(self["webpackChunk"] = self["webpackChunk"] || []).push([[39404],{ /***/ 7113: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.css ***! \*********************************************************************************************************/ /***/ (function() { "use strict"; // extracted by mini-css-extract-plugin /***/ }), /***/ 13833: /*!***********************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/list/list.css ***! \***********************************************************************************************/ /***/ (function() { "use strict"; // extracted by mini-css-extract-plugin /***/ }), /***/ 2550: /*!*****************************************************************************************************!*\ !*** include-loader!./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/editor.api.js ***! \*****************************************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { self["MonacoEnvironment"] = (function (paths) { function stripTrailingSlash(str) { return str.replace(/\/$/, ''); } return { globalAPI: false, getWorkerUrl: function (moduleId, label) { var pathPrefix = true ? __webpack_require__.p : 0; var result = (pathPrefix ? stripTrailingSlash(pathPrefix) + '/' : '') + paths[label]; if (/^((http:)|(https:)|(file:)|(\/\/))/.test(result)) { var currentUrl = String(window.location); var currentOrigin = currentUrl.substr(0, currentUrl.length - window.location.hash.length - window.location.search.length - window.location.pathname.length); if (result.substring(0, currentOrigin.length) !== currentOrigin) { if(/^(\/\/)/.test(result)) { result = window.location.protocol + result } var js = '/*' + label + '*/importScripts("' + result + '");'; var blob = new Blob([js], { type: 'application/javascript' }); return URL.createObjectURL(blob); } } return result; } }; })({ "editorWorkerService": "editor.worker.js", "css": "css.worker.js", "html": "html.worker.js", "json": "json.worker.js", "typescript": "ts.worker.js", "javascript": "ts.worker.js", "less": "css.worker.js", "scss": "css.worker.js", "handlebars": "html.worker.js", "razor": "html.worker.js" }); __webpack_require__(/*! ./standalone/browser/accessibilityHelp/accessibilityHelp.js */ 40029); __webpack_require__(/*! ./contrib/bracketMatching/bracketMatching.js */ 21154); __webpack_require__(/*! ./contrib/caretOperations/caretOperations.js */ 32838); __webpack_require__(/*! ./contrib/clipboard/clipboard.js */ 84826); __webpack_require__(/*! ./contrib/codeAction/codeActionContributions.js */ 60066); __webpack_require__(/*! ./contrib/codelens/codelensController.js */ 53983); __webpack_require__(/*! ./contrib/comment/comment.js */ 54807); __webpack_require__(/*! ./contrib/contextmenu/contextmenu.js */ 88297); __webpack_require__(/*! ./browser/controller/coreCommands.js */ 46343); __webpack_require__(/*! ./contrib/cursorUndo/cursorUndo.js */ 4105); __webpack_require__(/*! ./contrib/dnd/dnd.js */ 5032); __webpack_require__(/*! ./contrib/find/findController.js */ 38996); __webpack_require__(/*! ./contrib/folding/folding.js */ 9488); __webpack_require__(/*! ./contrib/fontZoom/fontZoom.js */ 34064); __webpack_require__(/*! ./contrib/format/formatActions.js */ 85628); __webpack_require__(/*! ./contrib/gotoError/gotoError.js */ 39519); __webpack_require__(/*! ./standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js */ 65586); __webpack_require__(/*! ./contrib/gotoSymbol/goToCommands.js */ 17645); __webpack_require__(/*! ./contrib/gotoSymbol/link/goToDefinitionAtPosition.js */ 50134); __webpack_require__(/*! ./contrib/hover/hover.js */ 4508); __webpack_require__(/*! ./standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js */ 6337); __webpack_require__(/*! ./contrib/inPlaceReplace/inPlaceReplace.js */ 63478); __webpack_require__(/*! ./standalone/browser/inspectTokens/inspectTokens.js */ 78038); __webpack_require__(/*! ./contrib/linesOperations/linesOperations.js */ 26313); __webpack_require__(/*! ./contrib/links/links.js */ 75789); __webpack_require__(/*! ./contrib/multicursor/multicursor.js */ 51518); __webpack_require__(/*! ./contrib/parameterHints/parameterHints.js */ 37921); __webpack_require__(/*! ./standalone/browser/quickAccess/standaloneCommandsQuickAccess.js */ 63435); __webpack_require__(/*! ./standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess.js */ 83861); __webpack_require__(/*! ./standalone/browser/referenceSearch/standaloneReferenceSearch.js */ 34835); __webpack_require__(/*! ./contrib/rename/rename.js */ 51110); __webpack_require__(/*! ./contrib/smartSelect/smartSelect.js */ 71925); __webpack_require__(/*! ./contrib/snippet/snippetController2.js */ 5588); __webpack_require__(/*! ./contrib/suggest/suggestController.js */ 82870); __webpack_require__(/*! ./standalone/browser/toggleHighContrast/toggleHighContrast.js */ 6181); __webpack_require__(/*! ./contrib/toggleTabFocusMode/toggleTabFocusMode.js */ 6410); __webpack_require__(/*! ./contrib/caretOperations/transpose.js */ 28630); __webpack_require__(/*! ./contrib/wordHighlighter/wordHighlighter.js */ 29111); __webpack_require__(/*! ./contrib/wordOperations/wordOperations.js */ 63618); __webpack_require__(/*! ./contrib/wordPartOperations/wordPartOperations.js */ 48608); module.exports = __webpack_require__(/*! !!./editor.api.js */ 36398); __webpack_require__(/*! ../basic-languages/abap/abap.contribution.js */ 92973); __webpack_require__(/*! ../basic-languages/apex/apex.contribution.js */ 72773); __webpack_require__(/*! ../basic-languages/azcli/azcli.contribution.js */ 30219); __webpack_require__(/*! ../basic-languages/bat/bat.contribution.js */ 10755); __webpack_require__(/*! ../basic-languages/cameligo/cameligo.contribution.js */ 74121); __webpack_require__(/*! ../basic-languages/clojure/clojure.contribution.js */ 77973); __webpack_require__(/*! ../basic-languages/coffee/coffee.contribution.js */ 27246); __webpack_require__(/*! ../basic-languages/cpp/cpp.contribution.js */ 82961); __webpack_require__(/*! ../basic-languages/csharp/csharp.contribution.js */ 19959); __webpack_require__(/*! ../basic-languages/csp/csp.contribution.js */ 23347); __webpack_require__(/*! ../basic-languages/css/css.contribution.js */ 17323); __webpack_require__(/*! ../language/css/monaco.contribution.js */ 24607); __webpack_require__(/*! ../basic-languages/dockerfile/dockerfile.contribution.js */ 90130); __webpack_require__(/*! ../basic-languages/fsharp/fsharp.contribution.js */ 72185); __webpack_require__(/*! ../basic-languages/go/go.contribution.js */ 40882); __webpack_require__(/*! ../basic-languages/graphql/graphql.contribution.js */ 14349); __webpack_require__(/*! ../basic-languages/handlebars/handlebars.contribution.js */ 10715); __webpack_require__(/*! ../basic-languages/html/html.contribution.js */ 88756); __webpack_require__(/*! ../language/html/monaco.contribution.js */ 67748); __webpack_require__(/*! ../basic-languages/ini/ini.contribution.js */ 30141); __webpack_require__(/*! ../basic-languages/java/java.contribution.js */ 44115); __webpack_require__(/*! ../basic-languages/javascript/javascript.contribution.js */ 65588); __webpack_require__(/*! ../language/json/monaco.contribution.js */ 42716); __webpack_require__(/*! ../basic-languages/kotlin/kotlin.contribution.js */ 83135); __webpack_require__(/*! ../basic-languages/less/less.contribution.js */ 91067); __webpack_require__(/*! ../basic-languages/lua/lua.contribution.js */ 63886); __webpack_require__(/*! ../basic-languages/markdown/markdown.contribution.js */ 44865); __webpack_require__(/*! ../basic-languages/mips/mips.contribution.js */ 41495); __webpack_require__(/*! ../basic-languages/msdax/msdax.contribution.js */ 12076); __webpack_require__(/*! ../basic-languages/mysql/mysql.contribution.js */ 38516); __webpack_require__(/*! ../basic-languages/objective-c/objective-c.contribution.js */ 18504); __webpack_require__(/*! ../basic-languages/pascal/pascal.contribution.js */ 28593); __webpack_require__(/*! ../basic-languages/pascaligo/pascaligo.contribution.js */ 43069); __webpack_require__(/*! ../basic-languages/perl/perl.contribution.js */ 50185); __webpack_require__(/*! ../basic-languages/pgsql/pgsql.contribution.js */ 11745); __webpack_require__(/*! ../basic-languages/php/php.contribution.js */ 96025); __webpack_require__(/*! ../basic-languages/postiats/postiats.contribution.js */ 85713); __webpack_require__(/*! ../basic-languages/powerquery/powerquery.contribution.js */ 98836); __webpack_require__(/*! ../basic-languages/powershell/powershell.contribution.js */ 18625); __webpack_require__(/*! ../basic-languages/pug/pug.contribution.js */ 25167); __webpack_require__(/*! ../basic-languages/python/python.contribution.js */ 5512); __webpack_require__(/*! ../basic-languages/r/r.contribution.js */ 59066); __webpack_require__(/*! ../basic-languages/razor/razor.contribution.js */ 73363); __webpack_require__(/*! ../basic-languages/redis/redis.contribution.js */ 5769); __webpack_require__(/*! ../basic-languages/redshift/redshift.contribution.js */ 95630); __webpack_require__(/*! ../basic-languages/restructuredtext/restructuredtext.contribution.js */ 12189); __webpack_require__(/*! ../basic-languages/ruby/ruby.contribution.js */ 78605); __webpack_require__(/*! ../basic-languages/rust/rust.contribution.js */ 17728); __webpack_require__(/*! ../basic-languages/sb/sb.contribution.js */ 94503); __webpack_require__(/*! ../basic-languages/scheme/scheme.contribution.js */ 66857); __webpack_require__(/*! ../basic-languages/scss/scss.contribution.js */ 38341); __webpack_require__(/*! ../basic-languages/shell/shell.contribution.js */ 61010); __webpack_require__(/*! ../basic-languages/solidity/solidity.contribution.js */ 1099); __webpack_require__(/*! ../basic-languages/sophia/sophia.contribution.js */ 46794); __webpack_require__(/*! ../basic-languages/sql/sql.contribution.js */ 32985); __webpack_require__(/*! ../basic-languages/st/st.contribution.js */ 72088); __webpack_require__(/*! ../basic-languages/swift/swift.contribution.js */ 69746); __webpack_require__(/*! ../basic-languages/tcl/tcl.contribution.js */ 94912); __webpack_require__(/*! ../basic-languages/twig/twig.contribution.js */ 60032); __webpack_require__(/*! ../basic-languages/typescript/typescript.contribution.js */ 24571); __webpack_require__(/*! ../language/typescript/monaco.contribution.js */ 55670); __webpack_require__(/*! ../basic-languages/vb/vb.contribution.js */ 77777); __webpack_require__(/*! ../basic-languages/xml/xml.contribution.js */ 39393); __webpack_require__(/*! ../basic-languages/yaml/yaml.contribution.js */ 81147); __webpack_require__(/*! ../basic-languages/scala/scala.contribution.js */ 35550); /***/ }), /***/ 87783: /*!*****************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/browser.js ***! \*****************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $W: function() { return /* binding */ isStandalone; }, /* harmony export */ Dt: function() { return /* binding */ isAndroid; }, /* harmony export */ G6: function() { return /* binding */ isSafari; }, /* harmony export */ MG: function() { return /* binding */ isWebkitWebView; }, /* harmony export */ Pf: function() { return /* binding */ isWebKit; }, /* harmony export */ WP: function() { return /* binding */ getTimeSinceLastZoomLevelChanged; }, /* harmony export */ fX: function() { return /* binding */ onDidChangeZoomLevel; }, /* harmony export */ i7: function() { return /* binding */ isChrome; }, /* harmony export */ ie: function() { return /* binding */ getZoomFactor; }, /* harmony export */ mX: function() { return /* binding */ getPixelRatio; }, /* harmony export */ px: function() { return /* binding */ getZoomLevel; }, /* harmony export */ vU: function() { return /* binding */ isFirefox; } /* harmony export */ }); /* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/event.js */ 4348); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class WindowManager { constructor() { // --- Zoom Level this._zoomLevel = 0; this._lastZoomLevelChangeTime = 0; this._onDidChangeZoomLevel = new _common_event_js__WEBPACK_IMPORTED_MODULE_0__/* .Emitter */ .Q5(); this.onDidChangeZoomLevel = this._onDidChangeZoomLevel.event; // --- Zoom Factor this._zoomFactor = 1; } getZoomLevel() { return this._zoomLevel; } getTimeSinceLastZoomLevelChanged() { return Date.now() - this._lastZoomLevelChangeTime; } getZoomFactor() { return this._zoomFactor; } // --- Pixel Ratio getPixelRatio() { let ctx = document.createElement('canvas').getContext('2d'); let dpr = window.devicePixelRatio || 1; let bsr = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1; return dpr / bsr; } } WindowManager.INSTANCE = new WindowManager(); function getZoomLevel() { return WindowManager.INSTANCE.getZoomLevel(); } /** Returns the time (in ms) since the zoom level was changed */ function getTimeSinceLastZoomLevelChanged() { return WindowManager.INSTANCE.getTimeSinceLastZoomLevelChanged(); } function onDidChangeZoomLevel(callback) { return WindowManager.INSTANCE.onDidChangeZoomLevel(callback); } /** The zoom scale for an index, e.g. 1, 1.2, 1.4 */ function getZoomFactor() { return WindowManager.INSTANCE.getZoomFactor(); } function getPixelRatio() { return WindowManager.INSTANCE.getPixelRatio(); } const userAgent = navigator.userAgent; const isFirefox = (userAgent.indexOf('Firefox') >= 0); const isWebKit = (userAgent.indexOf('AppleWebKit') >= 0); const isChrome = (userAgent.indexOf('Chrome') >= 0); const isSafari = (!isChrome && (userAgent.indexOf('Safari') >= 0)); const isWebkitWebView = (!isChrome && !isSafari && isWebKit); const isAndroid = (userAgent.indexOf('Android') >= 0); const isStandalone = (window.matchMedia && window.matchMedia('(display-mode: standalone)').matches); /***/ }), /***/ 23725: /*!*****************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/canIUse.js ***! \*****************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ D: function() { return /* binding */ BrowserFeatures; } /* harmony export */ }); /* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser.js */ 87783); /* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/platform.js */ 23345); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** * Browser feature we can support in current platform, browser and environment. */ const BrowserFeatures = { clipboard: { writeText: (_common_platform_js__WEBPACK_IMPORTED_MODULE_1__/* .isNative */ .tY || (document.queryCommandSupported && document.queryCommandSupported('copy')) || !!(navigator && navigator.clipboard && navigator.clipboard.writeText)), readText: (_common_platform_js__WEBPACK_IMPORTED_MODULE_1__/* .isNative */ .tY || !!(navigator && navigator.clipboard && navigator.clipboard.readText)) }, keyboard: (() => { if (_common_platform_js__WEBPACK_IMPORTED_MODULE_1__/* .isNative */ .tY || _browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isStandalone */ .$W) { return 0 /* Always */; } if (navigator.keyboard || _browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isSafari */ .G6) { return 1 /* FullScreen */; } return 2 /* None */; })(), // 'ontouchstart' in window always evaluates to true with typescript's modern typings. This causes `window` to be // `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast touch: 'ontouchstart' in window || navigator.maxTouchPoints > 0, pointerEvents: window.PointerEvent && ('ontouchstart' in window || window.navigator.maxTouchPoints > 0 || navigator.maxTouchPoints > 0) }; /***/ }), /***/ 84282: /*!*************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dnd.js ***! \*************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ P$: function() { return /* binding */ StaticDND; }, /* harmony export */ TN: function() { return /* binding */ DragAndDropData; }, /* harmony export */ go: function() { return /* binding */ DataTransfers; } /* harmony export */ }); /* harmony import */ var _common_mime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/mime.js */ 8473); // Common data transfers const DataTransfers = { /** * Application specific resource transfer type */ RESOURCES: 'ResourceURLs', /** * Browser specific transfer type to download */ DOWNLOAD_URL: 'DownloadURL', /** * Browser specific transfer type for files */ FILES: 'Files', /** * Typically transfer type for copy/paste transfers. */ TEXT: _common_mime_js__WEBPACK_IMPORTED_MODULE_0__/* .Mimes */ .vW.text, /** * Application specific terminal transfer type. */ TERMINALS: 'Terminals' }; class DragAndDropData { constructor(data) { this.data = data; } update() { // noop } getData() { return this.data; } } const StaticDND = { CurrentDragAndDropData: undefined }; /***/ }), /***/ 69454: /*!*************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dom.js ***! \*************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $: function() { return /* binding */ $; }, /* harmony export */ $Z: function() { return /* binding */ show; }, /* harmony export */ Ay: function() { return /* binding */ getShadowRoot; }, /* harmony export */ Ce: function() { return /* binding */ prepend; }, /* harmony export */ Cp: function() { return /* binding */ hide; }, /* harmony export */ D6: function() { return /* binding */ getClientArea; }, /* harmony export */ DI: function() { return /* binding */ StandardWindow; }, /* harmony export */ Dx: function() { return /* binding */ getComputedStyle; }, /* harmony export */ FK: function() { return /* binding */ getContentWidth; }, /* harmony export */ Fx: function() { return /* binding */ findParentWithClass; }, /* harmony export */ Gw: function() { return /* binding */ addStandardDisposableGenericMouseDownListner; }, /* harmony export */ H$: function() { return /* binding */ getElementsByTagName; }, /* harmony export */ If: function() { return /* binding */ getContentHeight; }, /* harmony export */ Lo: function() { return /* binding */ addDisposableGenericMouseDownListner; }, /* harmony export */ OO: function() { return /* binding */ isInShadowDOM; }, /* harmony export */ PO: function() { return /* binding */ clearNode; }, /* harmony export */ R3: function() { return /* binding */ append; }, /* harmony export */ RE: function() { return /* binding */ addDisposableNonBubblingPointerOutListener; }, /* harmony export */ Re: function() { return /* binding */ isHTMLElement; }, /* harmony export */ Ro: function() { return /* binding */ Dimension; }, /* harmony export */ Uh: function() { return /* binding */ computeScreenAwareSize; }, /* harmony export */ Uw: function() { return /* binding */ isInDOM; }, /* harmony export */ V3: function() { return /* binding */ windowOpenNoOpener; }, /* harmony export */ Y_: function() { return /* binding */ addDisposableThrottledListener; }, /* harmony export */ _0: function() { return /* binding */ restoreParentsScrollTop; }, /* harmony export */ _h: function() { return /* binding */ asCSSPropertyValue; }, /* harmony export */ _q: function() { return /* binding */ ModifierKeyEmitter; }, /* harmony export */ dS: function() { return /* binding */ createStyleSheet; }, /* harmony export */ dp: function() { return /* binding */ size; }, /* harmony export */ fk: function() { return /* binding */ createCSSRule; }, /* harmony export */ go: function() { return /* binding */ trackFocus; }, /* harmony export */ i: function() { return /* binding */ getDomNodePagePosition; }, /* harmony export */ jL: function() { return /* binding */ scheduleAtNextAnimationFrame; }, /* harmony export */ j_: function() { return /* binding */ addDisposableNonBubblingMouseOutListener; }, /* harmony export */ jg: function() { return /* binding */ isAncestor; }, /* harmony export */ jt: function() { return /* binding */ animate; }, /* harmony export */ lI: function() { return /* binding */ runAtThisOrScheduleAtNextAnimationFrame; }, /* harmony export */ mc: function() { return /* binding */ reset; }, /* harmony export */ mu: function() { return /* binding */ addStandardDisposableListener; }, /* harmony export */ nm: function() { return /* binding */ addDisposableListener; }, /* harmony export */ qV: function() { return /* binding */ addDisposableGenericMouseUpListner; }, /* harmony export */ tw: function() { return /* binding */ EventType; }, /* harmony export */ uB: function() { return /* binding */ addMatchMediaChangeListener; }, /* harmony export */ uN: function() { return /* binding */ removeCSSRulesContainingSelector; }, /* harmony export */ uU: function() { return /* binding */ hasParentWithClass; }, /* harmony export */ vL: function() { return /* binding */ saveParentsScrollTop; }, /* harmony export */ vY: function() { return /* binding */ getActiveElement; }, /* harmony export */ w: function() { return /* binding */ getTotalWidth; }, /* harmony export */ wY: function() { return /* binding */ asCSSUrl; }, /* harmony export */ wn: function() { return /* binding */ getTotalHeight; }, /* harmony export */ xQ: function() { return /* binding */ getTopLeftOffset; }, /* harmony export */ zB: function() { return /* binding */ EventHelper; } /* harmony export */ }); /* unused harmony exports isShadowRoot, Namespace */ /* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser.js */ 87783); /* harmony import */ var _canIUse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./canIUse.js */ 23725); /* harmony import */ var _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keyboardEvent.js */ 92813); /* harmony import */ var _mouseEvent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mouseEvent.js */ 52390); /* harmony import */ var _common_async_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/async.js */ 50431); /* harmony import */ var _common_errors_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/errors.js */ 79881); /* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/event.js */ 4348); /* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/lifecycle.js */ 69323); /* harmony import */ var _common_network_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/network.js */ 66657); /* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/platform.js */ 23345); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function clearNode(node) { while (node.firstChild) { node.firstChild.remove(); } } /** * @deprecated Use node.isConnected directly */ function isInDOM(node) { var _a; return (_a = node === null || node === void 0 ? void 0 : node.isConnected) !== null && _a !== void 0 ? _a : false; } class DomListener { constructor(node, type, handler, options) { this._node = node; this._type = type; this._handler = handler; this._options = (options || false); this._node.addEventListener(this._type, this._handler, this._options); } dispose() { if (!this._handler) { // Already disposed return; } this._node.removeEventListener(this._type, this._handler, this._options); // Prevent leakers from holding on to the dom or handler func this._node = null; this._handler = null; } } function addDisposableListener(node, type, handler, useCaptureOrOptions) { return new DomListener(node, type, handler, useCaptureOrOptions); } function _wrapAsStandardMouseEvent(handler) { return function (e) { return handler(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_3__/* .StandardMouseEvent */ .n(e)); }; } function _wrapAsStandardKeyboardEvent(handler) { return function (e) { return handler(new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_2__/* .StandardKeyboardEvent */ .y(e)); }; } let addStandardDisposableListener = function addStandardDisposableListener(node, type, handler, useCapture) { let wrapHandler = handler; if (type === 'click' || type === 'mousedown') { wrapHandler = _wrapAsStandardMouseEvent(handler); } else if (type === 'keydown' || type === 'keypress' || type === 'keyup') { wrapHandler = _wrapAsStandardKeyboardEvent(handler); } return addDisposableListener(node, type, wrapHandler, useCapture); }; let addStandardDisposableGenericMouseDownListner = function addStandardDisposableListener(node, handler, useCapture) { let wrapHandler = _wrapAsStandardMouseEvent(handler); return addDisposableGenericMouseDownListner(node, wrapHandler, useCapture); }; function addDisposableGenericMouseDownListner(node, handler, useCapture) { return addDisposableListener(node, _common_platform_js__WEBPACK_IMPORTED_MODULE_9__/* .isIOS */ .gn && _canIUse_js__WEBPACK_IMPORTED_MODULE_1__/* .BrowserFeatures */ .D.pointerEvents ? EventType.POINTER_DOWN : EventType.MOUSE_DOWN, handler, useCapture); } function addDisposableGenericMouseUpListner(node, handler, useCapture) { return addDisposableListener(node, _common_platform_js__WEBPACK_IMPORTED_MODULE_9__/* .isIOS */ .gn && _canIUse_js__WEBPACK_IMPORTED_MODULE_1__/* .BrowserFeatures */ .D.pointerEvents ? EventType.POINTER_UP : EventType.MOUSE_UP, handler, useCapture); } function addDisposableNonBubblingMouseOutListener(node, handler) { return addDisposableListener(node, 'mouseout', (e) => { // Mouse out bubbles, so this is an attempt to ignore faux mouse outs coming from children elements let toElement = (e.relatedTarget); while (toElement && toElement !== node) { toElement = toElement.parentNode; } if (toElement === node) { return; } handler(e); }); } function addDisposableNonBubblingPointerOutListener(node, handler) { return addDisposableListener(node, 'pointerout', (e) => { // Mouse out bubbles, so this is an attempt to ignore faux mouse outs coming from children elements let toElement = (e.relatedTarget); while (toElement && toElement !== node) { toElement = toElement.parentNode; } if (toElement === node) { return; } handler(e); }); } let _animationFrame = null; function doRequestAnimationFrame(callback) { if (!_animationFrame) { const emulatedRequestAnimationFrame = (callback) => { return setTimeout(() => callback(new Date().getTime()), 0); }; _animationFrame = (self.requestAnimationFrame || self.msRequestAnimationFrame || self.webkitRequestAnimationFrame || self.mozRequestAnimationFrame || self.oRequestAnimationFrame || emulatedRequestAnimationFrame); } return _animationFrame.call(self, callback); } /** * Schedule a callback to be run at the next animation frame. * This allows multiple parties to register callbacks that should run at the next animation frame. * If currently in an animation frame, `runner` will be executed immediately. * @return token that can be used to cancel the scheduled runner (only if `runner` was not executed immediately). */ let runAtThisOrScheduleAtNextAnimationFrame; /** * Schedule a callback to be run at the next animation frame. * This allows multiple parties to register callbacks that should run at the next animation frame. * If currently in an animation frame, `runner` will be executed at the next animation frame. * @return token that can be used to cancel the scheduled runner. */ let scheduleAtNextAnimationFrame; class AnimationFrameQueueItem { constructor(runner, priority = 0) { this._runner = runner; this.priority = priority; this._canceled = false; } dispose() { this._canceled = true; } execute() { if (this._canceled) { return; } try { this._runner(); } catch (e) { (0,_common_errors_js__WEBPACK_IMPORTED_MODULE_5__/* .onUnexpectedError */ .dL)(e); } } // Sort by priority (largest to lowest) static sort(a, b) { return b.priority - a.priority; } } (function () { /** * The runners scheduled at the next animation frame */ let NEXT_QUEUE = []; /** * The runners scheduled at the current animation frame */ let CURRENT_QUEUE = null; /** * A flag to keep track if the native requestAnimationFrame was already called */ let animFrameRequested = false; /** * A flag to indicate if currently handling a native requestAnimationFrame callback */ let inAnimationFrameRunner = false; let animationFrameRunner = () => { animFrameRequested = false; CURRENT_QUEUE = NEXT_QUEUE; NEXT_QUEUE = []; inAnimationFrameRunner = true; while (CURRENT_QUEUE.length > 0) { CURRENT_QUEUE.sort(AnimationFrameQueueItem.sort); let top = CURRENT_QUEUE.shift(); top.execute(); } inAnimationFrameRunner = false; }; scheduleAtNextAnimationFrame = (runner, priority = 0) => { let item = new AnimationFrameQueueItem(runner, priority); NEXT_QUEUE.push(item); if (!animFrameRequested) { animFrameRequested = true; doRequestAnimationFrame(animationFrameRunner); } return item; }; runAtThisOrScheduleAtNextAnimationFrame = (runner, priority) => { if (inAnimationFrameRunner) { let item = new AnimationFrameQueueItem(runner, priority); CURRENT_QUEUE.push(item); return item; } else { return scheduleAtNextAnimationFrame(runner, priority); } }; })(); const MINIMUM_TIME_MS = 8; const DEFAULT_EVENT_MERGER = function (lastEvent, currentEvent) { return currentEvent; }; class TimeoutThrottledDomListener extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__/* .Disposable */ .JT { constructor(node, type, handler, eventMerger = DEFAULT_EVENT_MERGER, minimumTimeMs = MINIMUM_TIME_MS) { super(); let lastEvent = null; let lastHandlerTime = 0; let timeout = this._register(new _common_async_js__WEBPACK_IMPORTED_MODULE_4__/* .TimeoutTimer */ ._F()); let invokeHandler = () => { lastHandlerTime = (new Date()).getTime(); handler(lastEvent); lastEvent = null; }; this._register(addDisposableListener(node, type, (e) => { lastEvent = eventMerger(lastEvent, e); let elapsedTime = (new Date()).getTime() - lastHandlerTime; if (elapsedTime >= minimumTimeMs) { timeout.cancel(); invokeHandler(); } else { timeout.setIfNotSet(invokeHandler, minimumTimeMs - elapsedTime); } })); } } function addDisposableThrottledListener(node, type, handler, eventMerger, minimumTimeMs) { return new TimeoutThrottledDomListener(node, type, handler, eventMerger, minimumTimeMs); } function getComputedStyle(el) { return document.defaultView.getComputedStyle(el, null); } function getClientArea(element) { // Try with DOM clientWidth / clientHeight if (element !== document.body) { return new Dimension(element.clientWidth, element.clientHeight); } // If visual view port exits and it's on mobile, it should be used instead of window innerWidth / innerHeight, or document.body.clientWidth / document.body.clientHeight if (_common_platform_js__WEBPACK_IMPORTED_MODULE_9__/* .isIOS */ .gn && window.visualViewport) { return new Dimension(window.visualViewport.width, window.visualViewport.height); } // Try innerWidth / innerHeight if (window.innerWidth && window.innerHeight) { return new Dimension(window.innerWidth, window.innerHeight); } // Try with document.body.clientWidth / document.body.clientHeight if (document.body && document.body.clientWidth && document.body.clientHeight) { return new Dimension(document.body.clientWidth, document.body.clientHeight); } // Try with document.documentElement.clientWidth / document.documentElement.clientHeight if (document.documentElement && document.documentElement.clientWidth && document.documentElement.clientHeight) { return new Dimension(document.documentElement.clientWidth, document.documentElement.clientHeight); } throw new Error('Unable to figure out browser width and height'); } class SizeUtils { // Adapted from WinJS // Converts a CSS positioning string for the specified element to pixels. static convertToPixels(element, value) { return parseFloat(value) || 0; } static getDimension(element, cssPropertyName, jsPropertyName) { let computedStyle = getComputedStyle(element); let value = '0'; if (computedStyle) { if (computedStyle.getPropertyValue) { value = computedStyle.getPropertyValue(cssPropertyName); } else { // IE8 value = computedStyle.getAttribute(jsPropertyName); } } return SizeUtils.convertToPixels(element, value); } static getBorderLeftWidth(element) { return SizeUtils.getDimension(element, 'border-left-width', 'borderLeftWidth'); } static getBorderRightWidth(element) { return SizeUtils.getDimension(element, 'border-right-width', 'borderRightWidth'); } static getBorderTopWidth(element) { return SizeUtils.getDimension(element, 'border-top-width', 'borderTopWidth'); } static getBorderBottomWidth(element) { return SizeUtils.getDimension(element, 'border-bottom-width', 'borderBottomWidth'); } static getPaddingLeft(element) { return SizeUtils.getDimension(element, 'padding-left', 'paddingLeft'); } static getPaddingRight(element) { return SizeUtils.getDimension(element, 'padding-right', 'paddingRight'); } static getPaddingTop(element) { return SizeUtils.getDimension(element, 'padding-top', 'paddingTop'); } static getPaddingBottom(element) { return SizeUtils.getDimension(element, 'padding-bottom', 'paddingBottom'); } static getMarginLeft(element) { return SizeUtils.getDimension(element, 'margin-left', 'marginLeft'); } static getMarginTop(element) { return SizeUtils.getDimension(element, 'margin-top', 'marginTop'); } static getMarginRight(element) { return SizeUtils.getDimension(element, 'margin-right', 'marginRight'); } static getMarginBottom(element) { return SizeUtils.getDimension(element, 'margin-bottom', 'marginBottom'); } } class Dimension { constructor(width, height) { this.width = width; this.height = height; } with(width = this.width, height = this.height) { if (width !== this.width || height !== this.height) { return new Dimension(width, height); } else { return this; } } static is(obj) { return typeof obj === 'object' && typeof obj.height === 'number' && typeof obj.width === 'number'; } static lift(obj) { if (obj instanceof Dimension) { return obj; } else { return new Dimension(obj.width, obj.height); } } static equals(a, b) { if (a === b) { return true; } if (!a || !b) { return false; } return a.width === b.width && a.height === b.height; } } function getTopLeftOffset(element) { // Adapted from WinJS.Utilities.getPosition // and added borders to the mix let offsetParent = element.offsetParent; let top = element.offsetTop; let left = element.offsetLeft; while ((element = element.parentNode) !== null && element !== document.body && element !== document.documentElement) { top -= element.scrollTop; const c = isShadowRoot(element) ? null : getComputedStyle(element); if (c) { left -= c.direction !== 'rtl' ? element.scrollLeft : -element.scrollLeft; } if (element === offsetParent) { left += SizeUtils.getBorderLeftWidth(element); top += SizeUtils.getBorderTopWidth(element); top += element.offsetTop; left += element.offsetLeft; offsetParent = element.offsetParent; } } return { left: left, top: top }; } function size(element, width, height) { if (typeof width === 'number') { element.style.width = `${width}px`; } if (typeof height === 'number') { element.style.height = `${height}px`; } } /** * Returns the position of a dom node relative to the entire page. */ function getDomNodePagePosition(domNode) { let bb = domNode.getBoundingClientRect(); return { left: bb.left + StandardWindow.scrollX, top: bb.top + StandardWindow.scrollY, width: bb.width, height: bb.height }; } const StandardWindow = new class { get scrollX() { if (typeof window.scrollX === 'number') { // modern browsers return window.scrollX; } else { return document.body.scrollLeft + document.documentElement.scrollLeft; } } get scrollY() { if (typeof window.scrollY === 'number') { // modern browsers return window.scrollY; } else { return document.body.scrollTop + document.documentElement.scrollTop; } } }; // Adapted from WinJS // Gets the width of the element, including margins. function getTotalWidth(element) { let margin = SizeUtils.getMarginLeft(element) + SizeUtils.getMarginRight(element); return element.offsetWidth + margin; } function getContentWidth(element) { let border = SizeUtils.getBorderLeftWidth(element) + SizeUtils.getBorderRightWidth(element); let padding = SizeUtils.getPaddingLeft(element) + SizeUtils.getPaddingRight(element); return element.offsetWidth - border - padding; } // Adapted from WinJS // Gets the height of the content of the specified element. The content height does not include borders or padding. function getContentHeight(element) { let border = SizeUtils.getBorderTopWidth(element) + SizeUtils.getBorderBottomWidth(element); let padding = SizeUtils.getPaddingTop(element) + SizeUtils.getPaddingBottom(element); return element.offsetHeight - border - padding; } // Adapted from WinJS // Gets the height of the element, including its margins. function getTotalHeight(element) { let margin = SizeUtils.getMarginTop(element) + SizeUtils.getMarginBottom(element); return element.offsetHeight + margin; } // ---------------------------------------------------------------------------------------- function isAncestor(testChild, testAncestor) { while (testChild) { if (testChild === testAncestor) { return true; } testChild = testChild.parentNode; } return false; } function findParentWithClass(node, clazz, stopAtClazzOrNode) { while (node && node.nodeType === node.ELEMENT_NODE) { if (node.classList.contains(clazz)) { return node; } if (stopAtClazzOrNode) { if (typeof stopAtClazzOrNode === 'string') { if (node.classList.contains(stopAtClazzOrNode)) { return null; } } else { if (node === stopAtClazzOrNode) { return null; } } } node = node.parentNode; } return null; } function hasParentWithClass(node, clazz, stopAtClazzOrNode) { return !!findParentWithClass(node, clazz, stopAtClazzOrNode); } function isShadowRoot(node) { return (node && !!node.host && !!node.mode); } function isInShadowDOM(domNode) { return !!getShadowRoot(domNode); } function getShadowRoot(domNode) { while (domNode.parentNode) { if (domNode === document.body) { // reached the body return null; } domNode = domNode.parentNode; } return isShadowRoot(domNode) ? domNode : null; } function getActiveElement() { let result = document.activeElement; while (result === null || result === void 0 ? void 0 : result.shadowRoot) { result = result.shadowRoot.activeElement; } return result; } function createStyleSheet(container = document.getElementsByTagName('head')[0]) { let style = document.createElement('style'); style.type = 'text/css'; style.media = 'screen'; container.appendChild(style); return style; } let _sharedStyleSheet = null; function getSharedStyleSheet() { if (!_sharedStyleSheet) { _sharedStyleSheet = createStyleSheet(); } return _sharedStyleSheet; } function getDynamicStyleSheetRules(style) { var _a, _b; if ((_a = style === null || style === void 0 ? void 0 : style.sheet) === null || _a === void 0 ? void 0 : _a.rules) { // Chrome, IE return style.sheet.rules; } if ((_b = style === null || style === void 0 ? void 0 : style.sheet) === null || _b === void 0 ? void 0 : _b.cssRules) { // FF return style.sheet.cssRules; } return []; } function createCSSRule(selector, cssText, style = getSharedStyleSheet()) { if (!style || !cssText) { return; } style.sheet.insertRule(selector + '{' + cssText + '}', 0); } function removeCSSRulesContainingSelector(ruleName, style = getSharedStyleSheet()) { if (!style) { return; } let rules = getDynamicStyleSheetRules(style); let toDelete = []; for (let i = 0; i < rules.length; i++) { let rule = rules[i]; if (rule.selectorText.indexOf(ruleName) !== -1) { toDelete.push(i); } } for (let i = toDelete.length - 1; i >= 0; i--) { style.sheet.deleteRule(toDelete[i]); } } function isHTMLElement(o) { if (typeof HTMLElement === 'object') { return o instanceof HTMLElement; } return o && typeof o === 'object' && o.nodeType === 1 && typeof o.nodeName === 'string'; } const EventType = { // Mouse 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', CONTEXT_MENU: 'contextmenu', WHEEL: 'wheel', // Keyboard KEY_DOWN: 'keydown', KEY_PRESS: 'keypress', KEY_UP: 'keyup', // HTML Document LOAD: 'load', BEFORE_UNLOAD: 'beforeunload', UNLOAD: 'unload', ABORT: 'abort', ERROR: 'error', RESIZE: 'resize', SCROLL: 'scroll', FULLSCREEN_CHANGE: 'fullscreenchange', WK_FULLSCREEN_CHANGE: 'webkitfullscreenchange', // Form SELECT: 'select', CHANGE: 'change', SUBMIT: 'submit', RESET: 'reset', FOCUS: 'focus', FOCUS_IN: 'focusin', FOCUS_OUT: 'focusout', BLUR: 'blur', INPUT: 'input', // Local Storage STORAGE: 'storage', // Drag DRAG_START: 'dragstart', DRAG: 'drag', DRAG_ENTER: 'dragenter', DRAG_LEAVE: 'dragleave', DRAG_OVER: 'dragover', DROP: 'drop', DRAG_END: 'dragend', // Animation ANIMATION_START: _browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isWebKit */ .Pf ? 'webkitAnimationStart' : 'animationstart', ANIMATION_END: _browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isWebKit */ .Pf ? 'webkitAnimationEnd' : 'animationend', ANIMATION_ITERATION: _browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isWebKit */ .Pf ? 'webkitAnimationIteration' : 'animationiteration' }; const EventHelper = { stop: function (e, cancelBubble) { if (e.preventDefault) { e.preventDefault(); } else { // IE8 e.returnValue = false; } if (cancelBubble) { if (e.stopPropagation) { e.stopPropagation(); } else { // IE8 e.cancelBubble = true; } } } }; function saveParentsScrollTop(node) { let r = []; for (let i = 0; node && node.nodeType === node.ELEMENT_NODE; i++) { r[i] = node.scrollTop; node = node.parentNode; } return r; } function restoreParentsScrollTop(node, state) { for (let i = 0; node && node.nodeType === node.ELEMENT_NODE; i++) { if (node.scrollTop !== state[i]) { node.scrollTop = state[i]; } node = node.parentNode; } } class FocusTracker extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__/* .Disposable */ .JT { constructor(element) { super(); this._onDidFocus = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__/* .Emitter */ .Q5()); this.onDidFocus = this._onDidFocus.event; this._onDidBlur = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_6__/* .Emitter */ .Q5()); this.onDidBlur = this._onDidBlur.event; let hasFocus = isAncestor(document.activeElement, element); let loosingFocus = false; const onFocus = () => { loosingFocus = false; if (!hasFocus) { hasFocus = true; this._onDidFocus.fire(); } }; const onBlur = () => { if (hasFocus) { loosingFocus = true; window.setTimeout(() => { if (loosingFocus) { loosingFocus = false; hasFocus = false; this._onDidBlur.fire(); } }, 0); } }; this._refreshStateHandler = () => { let currentNodeHasFocus = isAncestor(document.activeElement, element); if (currentNodeHasFocus !== hasFocus) { if (hasFocus) { onBlur(); } else { onFocus(); } } }; this._register(addDisposableListener(element, EventType.FOCUS, onFocus, true)); this._register(addDisposableListener(element, EventType.BLUR, onBlur, true)); } } function trackFocus(element) { return new FocusTracker(element); } function append(parent, ...children) { parent.append(...children); if (children.length === 1 && typeof children[0] !== 'string') { return children[0]; } } function prepend(parent, child) { parent.insertBefore(child, parent.firstChild); return child; } /** * Removes all children from `parent` and appends `children` */ function reset(parent, ...children) { parent.innerText = ''; append(parent, ...children); } const SELECTOR_REGEX = /([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/; var Namespace; (function (Namespace) { Namespace["HTML"] = "http://www.w3.org/1999/xhtml"; Namespace["SVG"] = "http://www.w3.org/2000/svg"; })(Namespace || (Namespace = {})); function _$(namespace, description, attrs, ...children) { let match = SELECTOR_REGEX.exec(description); if (!match) { throw new Error('Bad use of emmet'); } attrs = Object.assign({}, (attrs || {})); let tagName = match[1] || 'div'; let result; if (namespace !== Namespace.HTML) { result = document.createElementNS(namespace, tagName); } else { result = document.createElement(tagName); } if (match[3]) { result.id = match[3]; } if (match[4]) { result.className = match[4].replace(/\./g, ' ').trim(); } Object.keys(attrs).forEach(name => { const value = attrs[name]; if (typeof value === 'undefined') { return; } if (/^on\w+$/.test(name)) { result[name] = value; } else if (name === 'selected') { if (value) { result.setAttribute(name, 'true'); } } else { result.setAttribute(name, value); } }); result.append(...children); return result; } function $(description, attrs, ...children) { return _$(Namespace.HTML, description, attrs, ...children); } $.SVG = function (description, attrs, ...children) { return _$(Namespace.SVG, description, attrs, ...children); }; function show(...elements) { for (let element of elements) { element.style.display = ''; element.removeAttribute('aria-hidden'); } } function hide(...elements) { for (let element of elements) { element.style.display = 'none'; element.setAttribute('aria-hidden', 'true'); } } function getElementsByTagName(tag) { return Array.prototype.slice.call(document.getElementsByTagName(tag), 0); } /** * Find a value usable for a dom node size such that the likelihood that it would be * displayed with constant screen pixels size is as high as possible. * * e.g. We would desire for the cursors to be 2px (CSS px) wide. Under a devicePixelRatio * of 1.25, the cursor will be 2.5 screen pixels wide. Depending on how the dom node aligns/"snaps" * with the screen pixels, it will sometimes be rendered with 2 screen pixels, and sometimes with 3 screen pixels. */ function computeScreenAwareSize(cssPx) { const screenPx = window.devicePixelRatio * cssPx; return Math.max(1, Math.floor(screenPx)) / window.devicePixelRatio; } /** * Open safely a new window. This is the best way to do so, but you cannot tell * if the window was opened or if it was blocked by the browser's popup blocker. * If you want to tell if the browser blocked the new window, use `windowOpenNoOpenerWithSuccess`. * * See https://github.com/microsoft/monaco-editor/issues/601 * To protect against malicious code in the linked site, particularly phishing attempts, * the window.opener should be set to null to prevent the linked site from having access * to change the location of the current page. * See https://mathiasbynens.github.io/rel-noopener/ */ function windowOpenNoOpener(url) { // By using 'noopener' in the `windowFeatures` argument, the newly created window will // not be able to use `window.opener` to reach back to the current page. // See https://stackoverflow.com/a/46958731 // See https://developer.mozilla.org/en-US/docs/Web/API/Window/open#noopener // However, this also doesn't allow us to realize if the browser blocked // the creation of the window. window.open(url, '_blank', 'noopener'); } function animate(fn) { const step = () => { fn(); stepDisposable = scheduleAtNextAnimationFrame(step); }; let stepDisposable = scheduleAtNextAnimationFrame(step); return (0,_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__/* .toDisposable */ .OF)(() => stepDisposable.dispose()); } _common_network_js__WEBPACK_IMPORTED_MODULE_8__/* .RemoteAuthorities */ .WX.setPreferredWebSchema(/^https:/.test(window.location.href) ? 'https' : 'http'); /** * returns url('...') */ function asCSSUrl(uri) { if (!uri) { return `url('')`; } return `url('${_common_network_js__WEBPACK_IMPORTED_MODULE_8__/* .FileAccess */ .Gi.asBrowserUri(uri).toString(true).replace(/'/g, '%27')}')`; } function asCSSPropertyValue(value) { return `'${value.replace(/'/g, '%27')}'`; } class ModifierKeyEmitter extends _common_event_js__WEBPACK_IMPORTED_MODULE_6__/* .Emitter */ .Q5 { constructor() { super(); this._subscriptions = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_7__/* .DisposableStore */ .SL(); this._keyStatus = { altKey: false, shiftKey: false, ctrlKey: false, metaKey: false }; this._subscriptions.add(addDisposableListener(window, 'keydown', e => { if (e.defaultPrevented) { return; } const event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_2__/* .StandardKeyboardEvent */ .y(e); // If Alt-key keydown event is repeated, ignore it #112347 // Only known to be necessary for Alt-Key at the moment #115810 if (event.keyCode === 6 /* Alt */ && e.repeat) { return; } 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 (event.keyCode !== 6 /* Alt */) { this._keyStatus.lastKeyPressed = undefined; } else { return; } this._keyStatus.altKey = e.altKey; this._keyStatus.ctrlKey = e.ctrlKey; this._keyStatus.metaKey = e.metaKey; this._keyStatus.shiftKey = e.shiftKey; if (this._keyStatus.lastKeyPressed) { this._keyStatus.event = e; this.fire(this._keyStatus); } }, true)); this._subscriptions.add(addDisposableListener(window, 'keyup', e => { if (e.defaultPrevented) { return; } if (!e.altKey && this._keyStatus.altKey) { this._keyStatus.lastKeyReleased = 'alt'; } else if (!e.ctrlKey && this._keyStatus.ctrlKey) { this._keyStatus.lastKeyReleased = 'ctrl'; } else if (!e.metaKey && this._keyStatus.metaKey) { this._keyStatus.lastKeyReleased = 'meta'; } else if (!e.shiftKey && this._keyStatus.shiftKey) { this._keyStatus.lastKeyReleased = 'shift'; } else { this._keyStatus.lastKeyReleased = undefined; } if (this._keyStatus.lastKeyPressed !== this._keyStatus.lastKeyReleased) { this._keyStatus.lastKeyPressed = undefined; } this._keyStatus.altKey = e.altKey; this._keyStatus.ctrlKey = e.ctrlKey; this._keyStatus.metaKey = e.metaKey; this._keyStatus.shiftKey = e.shiftKey; if (this._keyStatus.lastKeyReleased) { this._keyStatus.event = e; this.fire(this._keyStatus); } }, true)); this._subscriptions.add(addDisposableListener(document.body, 'mousedown', () => { this._keyStatus.lastKeyPressed = undefined; }, true)); this._subscriptions.add(addDisposableListener(document.body, 'mouseup', () => { this._keyStatus.lastKeyPressed = undefined; }, true)); this._subscriptions.add(addDisposableListener(document.body, 'mousemove', e => { if (e.buttons) { this._keyStatus.lastKeyPressed = undefined; } }, true)); this._subscriptions.add(addDisposableListener(window, 'blur', () => { this.resetKeyStatus(); })); } get keyStatus() { return this._keyStatus; } /** * Allows to explicitly reset the key status based on more knowledge (#109062) */ resetKeyStatus() { this.doResetKeyStatus(); this.fire(this._keyStatus); } doResetKeyStatus() { this._keyStatus = { altKey: false, shiftKey: false, ctrlKey: false, metaKey: false }; } static getInstance() { if (!ModifierKeyEmitter.instance) { ModifierKeyEmitter.instance = new ModifierKeyEmitter(); } return ModifierKeyEmitter.instance; } dispose() { super.dispose(); this._subscriptions.dispose(); } } function addMatchMediaChangeListener(query, callback) { const mediaQueryList = window.matchMedia(query); if (typeof mediaQueryList.addEventListener === 'function') { mediaQueryList.addEventListener('change', callback); } else { // Safari 13.x mediaQueryList.addListener(callback); } } /***/ }), /***/ 8035: /*!***************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/event.js ***! \***************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Y: function() { return /* binding */ DomEmitter; }, /* harmony export */ p: function() { return /* binding */ stopEvent; } /* harmony export */ }); /* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/event.js */ 4348); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class DomEmitter { constructor(element, type, useCapture) { const fn = (e) => this.emitter.fire(e); this.emitter = new _common_event_js__WEBPACK_IMPORTED_MODULE_0__/* .Emitter */ .Q5({ onFirstListenerAdd: () => element.addEventListener(type, fn, useCapture), onLastListenerRemove: () => element.removeEventListener(type, fn, useCapture) }); } get event() { return this.emitter.event; } dispose() { this.emitter.dispose(); } } function stopEvent(event) { event.preventDefault(); event.stopPropagation(); return event; } /***/ }), /***/ 32635: /*!*********************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/fastDomNode.js ***! \*********************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ X: function() { return /* binding */ createFastDomNode; }, /* harmony export */ Z: function() { return /* binding */ FastDomNode; } /* harmony export */ }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class FastDomNode { constructor(domNode) { this.domNode = domNode; this._maxWidth = -1; this._width = -1; this._height = -1; this._top = -1; this._left = -1; this._bottom = -1; this._right = -1; this._fontFamily = ''; this._fontWeight = ''; this._fontSize = -1; this._fontFeatureSettings = ''; this._lineHeight = -1; this._letterSpacing = -100; this._className = ''; this._display = ''; this._position = ''; this._visibility = ''; this._backgroundColor = ''; this._layerHint = false; this._contain = 'none'; this._boxShadow = ''; } setMaxWidth(maxWidth) { if (this._maxWidth === maxWidth) { return; } this._maxWidth = maxWidth; this.domNode.style.maxWidth = this._maxWidth + 'px'; } setWidth(width) { if (this._width === width) { return; } this._width = width; this.domNode.style.width = this._width + 'px'; } setHeight(height) { if (this._height === height) { return; } this._height = height; this.domNode.style.height = this._height + 'px'; } setTop(top) { if (this._top === top) { return; } this._top = top; this.domNode.style.top = this._top + 'px'; } unsetTop() { if (this._top === -1) { return; } this._top = -1; this.domNode.style.top = ''; } setLeft(left) { if (this._left === left) { return; } this._left = left; this.domNode.style.left = this._left + 'px'; } setBottom(bottom) { if (this._bottom === bottom) { return; } this._bottom = bottom; this.domNode.style.bottom = this._bottom + 'px'; } setRight(right) { if (this._right === right) { return; } this._right = right; this.domNode.style.right = this._right + 'px'; } setFontFamily(fontFamily) { if (this._fontFamily === fontFamily) { return; } this._fontFamily = fontFamily; this.domNode.style.fontFamily = this._fontFamily; } setFontWeight(fontWeight) { if (this._fontWeight === fontWeight) { return; } this._fontWeight = fontWeight; this.domNode.style.fontWeight = this._fontWeight; } setFontSize(fontSize) { if (this._fontSize === fontSize) { return; } this._fontSize = fontSize; this.domNode.style.fontSize = this._fontSize + 'px'; } setFontFeatureSettings(fontFeatureSettings) { if (this._fontFeatureSettings === fontFeatureSettings) { return; } this._fontFeatureSettings = fontFeatureSettings; this.domNode.style.fontFeatureSettings = this._fontFeatureSettings; } setLineHeight(lineHeight) { if (this._lineHeight === lineHeight) { return; } this._lineHeight = lineHeight; this.domNode.style.lineHeight = this._lineHeight + 'px'; } setLetterSpacing(letterSpacing) { if (this._letterSpacing === letterSpacing) { return; } this._letterSpacing = letterSpacing; this.domNode.style.letterSpacing = this._letterSpacing + 'px'; } setClassName(className) { if (this._className === className) { return; } this._className = className; this.domNode.className = this._className; } toggleClassName(className, shouldHaveIt) { this.domNode.classList.toggle(className, shouldHaveIt); this._className = this.domNode.className; } setDisplay(display) { if (this._display === display) { return; } this._display = display; this.domNode.style.display = this._display; } setPosition(position) { if (this._position === position) { return; } this._position = position; this.domNode.style.position = this._position; } setVisibility(visibility) { if (this._visibility === visibility) { return; } this._visibility = visibility; this.domNode.style.visibility = this._visibility; } setBackgroundColor(backgroundColor) { if (this._backgroundColor === backgroundColor) { return; } this._backgroundColor = backgroundColor; this.domNode.style.backgroundColor = this._backgroundColor; } setLayerHinting(layerHint) { if (this._layerHint === layerHint) { return; } this._layerHint = layerHint; this.domNode.style.transform = this._layerHint ? 'translate3d(0px, 0px, 0px)' : ''; } setBoxShadow(boxShadow) { if (this._boxShadow === boxShadow) { return; } this._boxShadow = boxShadow; this.domNode.style.boxShadow = boxShadow; } setContain(contain) { if (this._contain === contain) { return; } this._contain = contain; this.domNode.style.contain = this._contain; } setAttribute(name, value) { this.domNode.setAttribute(name, value); } removeAttribute(name) { this.domNode.removeAttribute(name); } appendChild(child) { this.domNode.appendChild(child.domNode); } removeChild(child) { this.domNode.removeChild(child.domNode); } } function createFastDomNode(domNode) { return new FastDomNode(domNode); } /***/ }), /***/ 40575: /*!*******************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/formattedTextRenderer.js ***! \*******************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BO: function() { return /* binding */ renderFormattedText; }, /* harmony export */ IY: function() { return /* binding */ renderText; }, /* harmony export */ az: function() { return /* binding */ createElement; } /* harmony export */ }); /* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom.js */ 69454); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function renderText(text, options = {}) { const element = createElement(options); element.textContent = text; return element; } function renderFormattedText(formattedText, options = {}) { const element = createElement(options); _renderFormattedText(element, parseFormattedText(formattedText, !!options.renderCodeSegments), options.actionHandler, options.renderCodeSegments); return element; } function createElement(options) { const tagName = options.inline ? 'span' : 'div'; const element = document.createElement(tagName); if (options.className) { element.className = options.className; } return element; } class StringStream { constructor(source) { this.source = source; this.index = 0; } eos() { return this.index >= this.source.length; } next() { const next = this.peek(); this.advance(); return next; } peek() { return this.source[this.index]; } advance() { this.index++; } } function _renderFormattedText(element, treeNode, actionHandler, renderCodeSegments) { let child; if (treeNode.type === 2 /* Text */) { child = document.createTextNode(treeNode.content || ''); } else if (treeNode.type === 3 /* Bold */) { child = document.createElement('b'); } else if (treeNode.type === 4 /* Italics */) { child = document.createElement('i'); } else if (treeNode.type === 7 /* Code */ && renderCodeSegments) { child = document.createElement('code'); } else if (treeNode.type === 5 /* Action */ && actionHandler) { const a = document.createElement('a'); a.href = '#'; actionHandler.disposables.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addStandardDisposableListener */ .mu(a, 'click', (event) => { actionHandler.callback(String(treeNode.index), event); })); child = a; } else if (treeNode.type === 8 /* NewLine */) { child = document.createElement('br'); } else if (treeNode.type === 1 /* Root */) { child = element; } if (child && element !== child) { element.appendChild(child); } if (child && Array.isArray(treeNode.children)) { treeNode.children.forEach((nodeChild) => { _renderFormattedText(child, nodeChild, actionHandler, renderCodeSegments); }); } } function parseFormattedText(content, parseCodeSegments) { const root = { type: 1 /* Root */, children: [] }; let actionViewItemIndex = 0; let current = root; const stack = []; const stream = new StringStream(content); while (!stream.eos()) { let next = stream.next(); const isEscapedFormatType = (next === '\\' && formatTagType(stream.peek(), parseCodeSegments) !== 0 /* Invalid */); if (isEscapedFormatType) { next = stream.next(); // unread the backslash if it escapes a format tag type } if (!isEscapedFormatType && isFormatTag(next, parseCodeSegments) && next === stream.peek()) { stream.advance(); if (current.type === 2 /* Text */) { current = stack.pop(); } const type = formatTagType(next, parseCodeSegments); if (current.type === type || (current.type === 5 /* Action */ && type === 6 /* ActionClose */)) { current = stack.pop(); } else { const newCurrent = { type: type, children: [] }; if (type === 5 /* Action */) { newCurrent.index = actionViewItemIndex; actionViewItemIndex++; } current.children.push(newCurrent); stack.push(current); current = newCurrent; } } else if (next === '\n') { if (current.type === 2 /* Text */) { current = stack.pop(); } current.children.push({ type: 8 /* NewLine */ }); } else { if (current.type !== 2 /* Text */) { const textCurrent = { type: 2 /* Text */, content: next }; current.children.push(textCurrent); stack.push(current); current = textCurrent; } else { current.content += next; } } } if (current.type === 2 /* Text */) { current = stack.pop(); } if (stack.length) { // incorrectly formatted string literal } return root; } function isFormatTag(char, supportCodeSegments) { return formatTagType(char, supportCodeSegments) !== 0 /* Invalid */; } function formatTagType(char, supportCodeSegments) { switch (char) { case '*': return 3 /* Bold */; case '_': return 4 /* Italics */; case '[': return 5 /* Action */; case ']': return 6 /* ActionClose */; case '`': return supportCodeSegments ? 7 /* Code */ : 0 /* Invalid */; default: return 0 /* Invalid */; } } /***/ }), /***/ 2395: /*!********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/globalMouseMoveMonitor.js ***! \********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Z: function() { return /* binding */ GlobalMouseMoveMonitor; }, /* harmony export */ e: function() { return /* binding */ standardMouseMoveMerger; } /* harmony export */ }); /* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom.js */ 69454); /* harmony import */ var _iframe_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./iframe.js */ 7122); /* harmony import */ var _mouseEvent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mouseEvent.js */ 52390); /* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/lifecycle.js */ 69323); /* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/platform.js */ 23345); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function standardMouseMoveMerger(lastEvent, currentEvent) { let ev = new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .StandardMouseEvent */ .n(currentEvent); ev.preventDefault(); return { leftButton: ev.leftButton, buttons: ev.buttons, posx: ev.posx, posy: ev.posy }; } class GlobalMouseMoveMonitor { constructor() { this._hooks = new _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__/* .DisposableStore */ .SL(); this._mouseMoveEventMerger = null; this._mouseMoveCallback = null; this._onStopCallback = null; } dispose() { this.stopMonitoring(false); this._hooks.dispose(); } stopMonitoring(invokeStopCallback, browserEvent) { if (!this.isMonitoring()) { // Not monitoring return; } // Unhook this._hooks.clear(); this._mouseMoveEventMerger = null; this._mouseMoveCallback = null; const onStopCallback = this._onStopCallback; this._onStopCallback = null; if (invokeStopCallback && onStopCallback) { onStopCallback(browserEvent); } } isMonitoring() { return !!this._mouseMoveEventMerger; } startMonitoring(initialElement, initialButtons, mouseMoveEventMerger, mouseMoveCallback, onStopCallback) { if (this.isMonitoring()) { // I am already hooked return; } this._mouseMoveEventMerger = mouseMoveEventMerger; this._mouseMoveCallback = mouseMoveCallback; this._onStopCallback = onStopCallback; const windowChain = _iframe_js__WEBPACK_IMPORTED_MODULE_4__/* .IframeUtils */ .E.getSameOriginWindowChain(); const mouseMove = _common_platform_js__WEBPACK_IMPORTED_MODULE_3__/* .isIOS */ .gn ? 'pointermove' : 'mousemove'; // Safari sends wrong event, workaround for #122653 const mouseUp = 'mouseup'; const listenTo = windowChain.map(element => element.window.document); const shadowRoot = _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .getShadowRoot */ .Ay(initialElement); if (shadowRoot) { listenTo.unshift(shadowRoot); } for (const element of listenTo) { this._hooks.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableThrottledListener */ .Y_(element, mouseMove, (data) => { if (data.buttons !== initialButtons) { // Buttons state has changed in the meantime this.stopMonitoring(true); return; } this._mouseMoveCallback(data); }, (lastEvent, currentEvent) => this._mouseMoveEventMerger(lastEvent, currentEvent))); this._hooks.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(element, mouseUp, (e) => this.stopMonitoring(true))); } if (_iframe_js__WEBPACK_IMPORTED_MODULE_4__/* .IframeUtils */ .E.hasDifferentOriginAncestor()) { let lastSameOriginAncestor = windowChain[windowChain.length - 1]; // We might miss a mouse up if it happens outside the iframe // This one is for Chrome this._hooks.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(lastSameOriginAncestor.window.document, 'mouseout', (browserEvent) => { let e = new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .StandardMouseEvent */ .n(browserEvent); if (e.target.tagName.toLowerCase() === 'html') { this.stopMonitoring(true); } })); // This one is for FF this._hooks.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(lastSameOriginAncestor.window.document, 'mouseover', (browserEvent) => { let e = new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .StandardMouseEvent */ .n(browserEvent); if (e.target.tagName.toLowerCase() === 'html') { this.stopMonitoring(true); } })); // This one is for IE this._hooks.add(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(lastSameOriginAncestor.window.document.body, 'mouseleave', (browserEvent) => { this.stopMonitoring(true); })); } } } /***/ }), /***/ 7122: /*!****************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/iframe.js ***! \****************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: function() { return /* binding */ IframeUtils; } /* harmony export */ }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ let hasDifferentOriginAncestorFlag = false; let sameOriginWindowChainCache = null; function getParentWindowIfSameOrigin(w) { if (!w.parent || w.parent === w) { return null; } // Cannot really tell if we have access to the parent window unless we try to access something in it try { let location = w.location; let parentLocation = w.parent.location; if (location.origin !== 'null' && parentLocation.origin !== 'null' && location.origin !== parentLocation.origin) { hasDifferentOriginAncestorFlag = true; return null; } } catch (e) { hasDifferentOriginAncestorFlag = true; return null; } return w.parent; } class IframeUtils { /** * Returns a chain of embedded windows with the same origin (which can be accessed programmatically). * Having a chain of length 1 might mean that the current execution environment is running outside of an iframe or inside an iframe embedded in a window with a different origin. * To distinguish if at one point the current execution environment is running inside a window with a different origin, see hasDifferentOriginAncestor() */ static getSameOriginWindowChain() { if (!sameOriginWindowChainCache) { sameOriginWindowChainCache = []; let w = window; let parent; do { parent = getParentWindowIfSameOrigin(w); if (parent) { sameOriginWindowChainCache.push({ window: w, iframeElement: w.frameElement || null }); } else { sameOriginWindowChainCache.push({ window: w, iframeElement: null }); } w = parent; } while (w); } return sameOriginWindowChainCache.slice(0); } /** * Returns true if the current execution environment is chained in a list of iframes which at one point ends in a window with a different origin. * Returns false if the current execution environment is not running inside an iframe or if the entire chain of iframes have the same origin. */ static hasDifferentOriginAncestor() { if (!sameOriginWindowChainCache) { this.getSameOriginWindowChain(); } return hasDifferentOriginAncestorFlag; } /** * Returns the position of `childWindow` relative to `ancestorWindow` */ static getPositionOfChildWindowRelativeToAncestorWindow(childWindow, ancestorWindow) { if (!ancestorWindow || childWindow === ancestorWindow) { return { top: 0, left: 0 }; } let top = 0, left = 0; let windowChain = this.getSameOriginWindowChain(); for (const windowChainEl of windowChain) { top += windowChainEl.window.scrollY; left += windowChainEl.window.scrollX; if (windowChainEl.window === ancestorWindow) { break; } if (!windowChainEl.iframeElement) { break; } let boundingRect = windowChainEl.iframeElement.getBoundingClientRect(); top += boundingRect.top; left += boundingRect.left; } return { top: top, left: left }; } } /***/ }), /***/ 92813: /*!***********************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/keyboardEvent.js ***! \***********************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ y: function() { return /* binding */ StandardKeyboardEvent; } /* harmony export */ }); /* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser.js */ 87783); /* harmony import */ var _common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/keyCodes.js */ 52411); /* harmony import */ var _common_keybindings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/keybindings.js */ 86354); /* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/platform.js */ 23345); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function extractKeyCode(e) { if (e.charCode) { // "keypress" events mostly let char = String.fromCharCode(e.charCode).toUpperCase(); return _common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__/* .KeyCodeUtils */ .kL.fromString(char); } const keyCode = e.keyCode; // browser quirks if (keyCode === 3) { return 7 /* PauseBreak */; } else if (_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isFirefox */ .vU) { if (keyCode === 59) { return 80 /* Semicolon */; } else if (keyCode === 107) { return 81 /* Equal */; } else if (keyCode === 109) { return 83 /* Minus */; } else if (_common_platform_js__WEBPACK_IMPORTED_MODULE_3__/* .isMacintosh */ .dz && keyCode === 224) { return 57 /* Meta */; } } else if (_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isWebKit */ .Pf) { if (keyCode === 91) { return 57 /* Meta */; } else if (_common_platform_js__WEBPACK_IMPORTED_MODULE_3__/* .isMacintosh */ .dz && keyCode === 93) { // the two meta keys in the Mac have different key codes (91 and 93) return 57 /* Meta */; } else if (!_common_platform_js__WEBPACK_IMPORTED_MODULE_3__/* .isMacintosh */ .dz && keyCode === 92) { return 57 /* Meta */; } } // cross browser keycodes: return _common_keyCodes_js__WEBPACK_IMPORTED_MODULE_1__/* .EVENT_KEY_CODE_MAP */ .H_[keyCode] || 0 /* Unknown */; } const ctrlKeyMod = (_common_platform_js__WEBPACK_IMPORTED_MODULE_3__/* .isMacintosh */ .dz ? 256 /* WinCtrl */ : 2048 /* CtrlCmd */); const altKeyMod = 512 /* Alt */; const shiftKeyMod = 1024 /* Shift */; const metaKeyMod = (_common_platform_js__WEBPACK_IMPORTED_MODULE_3__/* .isMacintosh */ .dz ? 2048 /* CtrlCmd */ : 256 /* WinCtrl */); class StandardKeyboardEvent { constructor(source) { this._standardKeyboardEventBrand = true; let e = source; this.browserEvent = e; this.target = e.target; this.ctrlKey = e.ctrlKey; this.shiftKey = e.shiftKey; this.altKey = e.altKey; this.metaKey = e.metaKey; this.keyCode = extractKeyCode(e); this.code = e.code; // console.info(e.type + ": keyCode: " + e.keyCode + ", which: " + e.which + ", charCode: " + e.charCode + ", detail: " + e.detail + " ====> " + this.keyCode + ' -- ' + KeyCode[this.keyCode]); this.ctrlKey = this.ctrlKey || this.keyCode === 5 /* Ctrl */; this.altKey = this.altKey || this.keyCode === 6 /* Alt */; this.shiftKey = this.shiftKey || this.keyCode === 4 /* Shift */; this.metaKey = this.metaKey || this.keyCode === 57 /* Meta */; this._asKeybinding = this._computeKeybinding(); this._asRuntimeKeybinding = this._computeRuntimeKeybinding(); // console.log(`code: ${e.code}, keyCode: ${e.keyCode}, key: ${e.key}`); } preventDefault() { if (this.browserEvent && this.browserEvent.preventDefault) { this.browserEvent.preventDefault(); } } stopPropagation() { if (this.browserEvent && this.browserEvent.stopPropagation) { this.browserEvent.stopPropagation(); } } toKeybinding() { return this._asRuntimeKeybinding; } equals(other) { return this._asKeybinding === other; } _computeKeybinding() { let key = 0 /* Unknown */; if (this.keyCode !== 5 /* Ctrl */ && this.keyCode !== 4 /* Shift */ && this.keyCode !== 6 /* Alt */ && this.keyCode !== 57 /* Meta */) { key = this.keyCode; } let result = 0; if (this.ctrlKey) { result |= ctrlKeyMod; } if (this.altKey) { result |= altKeyMod; } if (this.shiftKey) { result |= shiftKeyMod; } if (this.metaKey) { result |= metaKeyMod; } result |= key; return result; } _computeRuntimeKeybinding() { let key = 0 /* Unknown */; if (this.keyCode !== 5 /* Ctrl */ && this.keyCode !== 4 /* Shift */ && this.keyCode !== 6 /* Alt */ && this.keyCode !== 57 /* Meta */) { key = this.keyCode; } return new _common_keybindings_js__WEBPACK_IMPORTED_MODULE_2__/* .SimpleKeybinding */ .QC(this.ctrlKey, this.shiftKey, this.altKey, this.metaKey, key); } } /***/ }), /***/ 52390: /*!********************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/mouseEvent.js ***! \********************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ n: function() { return /* binding */ StandardMouseEvent; }, /* harmony export */ q: function() { return /* binding */ StandardWheelEvent; } /* harmony export */ }); /* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser.js */ 87783); /* harmony import */ var _iframe_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./iframe.js */ 7122); /* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/platform.js */ 23345); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class StandardMouseEvent { constructor(e) { this.timestamp = Date.now(); this.browserEvent = e; this.leftButton = e.button === 0; this.middleButton = e.button === 1; this.rightButton = e.button === 2; this.buttons = e.buttons; this.target = e.target; this.detail = e.detail || 1; if (e.type === 'dblclick') { this.detail = 2; } this.ctrlKey = e.ctrlKey; this.shiftKey = e.shiftKey; this.altKey = e.altKey; this.metaKey = e.metaKey; if (typeof e.pageX === 'number') { this.posx = e.pageX; this.posy = e.pageY; } else { // Probably hit by MSGestureEvent this.posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; this.posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } // Find the position of the iframe this code is executing in relative to the iframe where the event was captured. let iframeOffsets = _iframe_js__WEBPACK_IMPORTED_MODULE_2__/* .IframeUtils */ .E.getPositionOfChildWindowRelativeToAncestorWindow(self, e.view); this.posx -= iframeOffsets.left; this.posy -= iframeOffsets.top; } preventDefault() { this.browserEvent.preventDefault(); } stopPropagation() { this.browserEvent.stopPropagation(); } } class StandardWheelEvent { constructor(e, deltaX = 0, deltaY = 0) { this.browserEvent = e || null; this.target = e ? (e.target || e.targetNode || e.srcElement) : null; this.deltaY = deltaY; this.deltaX = deltaX; if (e) { // Old (deprecated) wheel events let e1 = e; let e2 = e; // vertical delta scroll if (typeof e1.wheelDeltaY !== 'undefined') { this.deltaY = e1.wheelDeltaY / 120; } else if (typeof e2.VERTICAL_AXIS !== 'undefined' && e2.axis === e2.VERTICAL_AXIS) { this.deltaY = -e2.detail / 3; } else if (e.type === 'wheel') { // Modern wheel event // https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent const ev = e; if (ev.deltaMode === ev.DOM_DELTA_LINE) { // the deltas are expressed in lines if (_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isFirefox */ .vU && !_common_platform_js__WEBPACK_IMPORTED_MODULE_1__/* .isMacintosh */ .dz) { this.deltaY = -e.deltaY / 3; } else { this.deltaY = -e.deltaY; } } else { this.deltaY = -e.deltaY / 40; } } // horizontal delta scroll if (typeof e1.wheelDeltaX !== 'undefined') { if (_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isSafari */ .G6 && _common_platform_js__WEBPACK_IMPORTED_MODULE_1__/* .isWindows */ .ED) { this.deltaX = -(e1.wheelDeltaX / 120); } else { this.deltaX = e1.wheelDeltaX / 120; } } else if (typeof e2.HORIZONTAL_AXIS !== 'undefined' && e2.axis === e2.HORIZONTAL_AXIS) { this.deltaX = -e.detail / 3; } else if (e.type === 'wheel') { // Modern wheel event // https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent const ev = e; if (ev.deltaMode === ev.DOM_DELTA_LINE) { // the deltas are expressed in lines if (_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isFirefox */ .vU && !_common_platform_js__WEBPACK_IMPORTED_MODULE_1__/* .isMacintosh */ .dz) { this.deltaX = -e.deltaX / 3; } else { this.deltaX = -e.deltaX; } } else { this.deltaX = -e.deltaX / 40; } } // Assume a vertical scroll if nothing else worked if (this.deltaY === 0 && this.deltaX === 0 && e.wheelDelta) { this.deltaY = e.wheelDelta / 120; } } } preventDefault() { if (this.browserEvent) { this.browserEvent.preventDefault(); } } stopPropagation() { if (this.browserEvent) { this.browserEvent.stopPropagation(); } } } /***/ }), /***/ 60537: /*!***************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/touch.js ***! \***************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ o: function() { return /* binding */ Gesture; }, /* harmony export */ t: function() { return /* binding */ EventType; } /* harmony export */ }); /* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom.js */ 69454); /* harmony import */ var _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/arrays.js */ 43506); /* harmony import */ var _common_decorators_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/decorators.js */ 85402); /* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/lifecycle.js */ 69323); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var EventType; (function (EventType) { EventType.Tap = '-monaco-gesturetap'; EventType.Change = '-monaco-gesturechange'; EventType.Start = '-monaco-gesturestart'; EventType.End = '-monaco-gesturesend'; EventType.Contextmenu = '-monaco-gesturecontextmenu'; })(EventType || (EventType = {})); class Gesture extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__/* .Disposable */ .JT { constructor() { super(); this.dispatched = false; this.activeTouches = {}; this.handle = null; this.targets = []; this.ignoreTargets = []; this._lastSetTapCountTime = 0; this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(document, 'touchstart', (e) => this.onTouchStart(e), { passive: false })); this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(document, 'touchend', (e) => this.onTouchEnd(e))); this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(document, 'touchmove', (e) => this.onTouchMove(e), { passive: false })); } static addTarget(element) { if (!Gesture.isTouchDevice()) { return _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__/* .Disposable */ .JT.None; } if (!Gesture.INSTANCE) { Gesture.INSTANCE = new Gesture(); } Gesture.INSTANCE.targets.push(element); return { dispose: () => { Gesture.INSTANCE.targets = Gesture.INSTANCE.targets.filter(t => t !== element); } }; } static ignoreTarget(element) { if (!Gesture.isTouchDevice()) { return _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__/* .Disposable */ .JT.None; } if (!Gesture.INSTANCE) { Gesture.INSTANCE = new Gesture(); } Gesture.INSTANCE.ignoreTargets.push(element); return { dispose: () => { Gesture.INSTANCE.ignoreTargets = Gesture.INSTANCE.ignoreTargets.filter(t => t !== element); } }; } static isTouchDevice() { // `'ontouchstart' in window` always evaluates to true with typescript's modern typings. This causes `window` to be // `never` later in `window.navigator`. That's why we need the explicit `window as Window` cast return 'ontouchstart' in window || navigator.maxTouchPoints > 0; } dispose() { if (this.handle) { this.handle.dispose(); this.handle = null; } super.dispose(); } onTouchStart(e) { let timestamp = Date.now(); // use Date.now() because on FF e.timeStamp is not epoch based. if (this.handle) { this.handle.dispose(); this.handle = null; } for (let i = 0, len = e.targetTouches.length; i < len; i++) { let touch = e.targetTouches.item(i); this.activeTouches[touch.identifier] = { id: touch.identifier, initialTarget: touch.target, initialTimeStamp: timestamp, initialPageX: touch.pageX, initialPageY: touch.pageY, rollingTimestamps: [timestamp], rollingPageX: [touch.pageX], rollingPageY: [touch.pageY] }; let evt = this.newGestureEvent(EventType.Start, touch.target); evt.pageX = touch.pageX; evt.pageY = touch.pageY; this.dispatchEvent(evt); } if (this.dispatched) { e.preventDefault(); e.stopPropagation(); this.dispatched = false; } } onTouchEnd(e) { let timestamp = Date.now(); // use Date.now() because on FF e.timeStamp is not epoch based. let activeTouchCount = Object.keys(this.activeTouches).length; for (let i = 0, len = e.changedTouches.length; i < len; i++) { let touch = e.changedTouches.item(i); if (!this.activeTouches.hasOwnProperty(String(touch.identifier))) { console.warn('move of an UNKNOWN touch', touch); continue; } let data = this.activeTouches[touch.identifier], holdTime = Date.now() - data.initialTimeStamp; if (holdTime < Gesture.HOLD_DELAY && Math.abs(data.initialPageX - _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingPageX)) < 30 && Math.abs(data.initialPageY - _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingPageY)) < 30) { let evt = this.newGestureEvent(EventType.Tap, data.initialTarget); evt.pageX = _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingPageX); evt.pageY = _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingPageY); this.dispatchEvent(evt); } else if (holdTime >= Gesture.HOLD_DELAY && Math.abs(data.initialPageX - _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingPageX)) < 30 && Math.abs(data.initialPageY - _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingPageY)) < 30) { let evt = this.newGestureEvent(EventType.Contextmenu, data.initialTarget); evt.pageX = _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingPageX); evt.pageY = _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingPageY); this.dispatchEvent(evt); } else if (activeTouchCount === 1) { let finalX = _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingPageX); let finalY = _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingPageY); let deltaT = _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingTimestamps) - data.rollingTimestamps[0]; let deltaX = finalX - data.rollingPageX[0]; let deltaY = finalY - data.rollingPageY[0]; // We need to get all the dispatch targets on the start of the inertia event const dispatchTo = this.targets.filter(t => data.initialTarget instanceof Node && t.contains(data.initialTarget)); this.inertia(dispatchTo, timestamp, // time now Math.abs(deltaX) / deltaT, // speed deltaX > 0 ? 1 : -1, // x direction finalX, // x now Math.abs(deltaY) / deltaT, // y speed deltaY > 0 ? 1 : -1, // y direction finalY // y now ); } this.dispatchEvent(this.newGestureEvent(EventType.End, data.initialTarget)); // forget about this touch delete this.activeTouches[touch.identifier]; } if (this.dispatched) { e.preventDefault(); e.stopPropagation(); this.dispatched = false; } } newGestureEvent(type, initialTarget) { let event = document.createEvent('CustomEvent'); event.initEvent(type, false, true); event.initialTarget = initialTarget; event.tapCount = 0; return event; } dispatchEvent(event) { if (event.type === EventType.Tap) { const currentTime = (new Date()).getTime(); let setTapCount = 0; if (currentTime - this._lastSetTapCountTime > Gesture.CLEAR_TAP_COUNT_TIME) { setTapCount = 1; } else { setTapCount = 2; } this._lastSetTapCountTime = currentTime; event.tapCount = setTapCount; } else if (event.type === EventType.Change || event.type === EventType.Contextmenu) { // tap is canceled by scrolling or context menu this._lastSetTapCountTime = 0; } for (let i = 0; i < this.ignoreTargets.length; i++) { if (event.initialTarget instanceof Node && this.ignoreTargets[i].contains(event.initialTarget)) { return; } } this.targets.forEach(target => { if (event.initialTarget instanceof Node && target.contains(event.initialTarget)) { target.dispatchEvent(event); this.dispatched = true; } }); } inertia(dispatchTo, t1, vX, dirX, x, vY, dirY, y) { this.handle = _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .scheduleAtNextAnimationFrame */ .jL(() => { let now = Date.now(); // velocity: old speed + accel_over_time let deltaT = now - t1, delta_pos_x = 0, delta_pos_y = 0, stopped = true; vX += Gesture.SCROLL_FRICTION * deltaT; vY += Gesture.SCROLL_FRICTION * deltaT; if (vX > 0) { stopped = false; delta_pos_x = dirX * vX * deltaT; } if (vY > 0) { stopped = false; delta_pos_y = dirY * vY * deltaT; } // dispatch translation event let evt = this.newGestureEvent(EventType.Change); evt.translationX = delta_pos_x; evt.translationY = delta_pos_y; dispatchTo.forEach(d => d.dispatchEvent(evt)); if (!stopped) { this.inertia(dispatchTo, now, vX, dirX, x + delta_pos_x, vY, dirY, y + delta_pos_y); } }); } onTouchMove(e) { let timestamp = Date.now(); // use Date.now() because on FF e.timeStamp is not epoch based. for (let i = 0, len = e.changedTouches.length; i < len; i++) { let touch = e.changedTouches.item(i); if (!this.activeTouches.hasOwnProperty(String(touch.identifier))) { console.warn('end of an UNKNOWN touch', touch); continue; } let data = this.activeTouches[touch.identifier]; let evt = this.newGestureEvent(EventType.Change, data.initialTarget); evt.translationX = touch.pageX - _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingPageX); evt.translationY = touch.pageY - _common_arrays_js__WEBPACK_IMPORTED_MODULE_2__/* .tail */ .Gb(data.rollingPageY); evt.pageX = touch.pageX; evt.pageY = touch.pageY; this.dispatchEvent(evt); // only keep a few data points, to average the final speed if (data.rollingPageX.length > 3) { data.rollingPageX.shift(); data.rollingPageY.shift(); data.rollingTimestamps.shift(); } data.rollingPageX.push(touch.pageX); data.rollingPageY.push(touch.pageY); data.rollingTimestamps.push(timestamp); } if (this.dispatched) { e.preventDefault(); e.stopPropagation(); this.dispatched = false; } } } Gesture.SCROLL_FRICTION = -0.005; Gesture.HOLD_DELAY = 700; Gesture.CLEAR_TAP_COUNT_TIME = 400; // ms __decorate([ _common_decorators_js__WEBPACK_IMPORTED_MODULE_3__/* .memoize */ .H ], Gesture, "isTouchDevice", null); /***/ }), /***/ 10081: /*!**************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js ***! \**************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Y: function() { return /* binding */ BaseActionViewItem; }, /* harmony export */ g: function() { return /* binding */ ActionViewItem; } /* harmony export */ }); /* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../browser.js */ 87783); /* harmony import */ var _dnd_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../dnd.js */ 84282); /* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../dom.js */ 69454); /* harmony import */ var _touch_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../touch.js */ 60537); /* harmony import */ var _common_actions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/actions.js */ 75918); /* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/lifecycle.js */ 69323); /* harmony import */ var _common_platform_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../common/platform.js */ 23345); /* harmony import */ var _common_types_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/types.js */ 72999); /* harmony import */ var _actionbar_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./actionbar.css */ 7113); /* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../nls.js */ 13268); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class BaseActionViewItem extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__/* .Disposable */ .JT { constructor(context, action, options = {}) { super(); this.options = options; this._context = context || this; this._action = action; if (action instanceof _common_actions_js__WEBPACK_IMPORTED_MODULE_4__/* .Action */ .aU) { this._register(action.onDidChange(event => { if (!this.element) { // we have not been rendered yet, so there // is no point in updating the UI return; } this.handleActionChangeEvent(event); })); } } handleActionChangeEvent(event) { if (event.enabled !== undefined) { this.updateEnabled(); } if (event.checked !== undefined) { this.updateChecked(); } if (event.class !== undefined) { this.updateClass(); } if (event.label !== undefined) { this.updateLabel(); this.updateTooltip(); } if (event.tooltip !== undefined) { this.updateTooltip(); } } get actionRunner() { if (!this._actionRunner) { this._actionRunner = this._register(new _common_actions_js__WEBPACK_IMPORTED_MODULE_4__/* .ActionRunner */ .Wi()); } return this._actionRunner; } set actionRunner(actionRunner) { this._actionRunner = actionRunner; } getAction() { return this._action; } isEnabled() { return this._action.enabled; } setActionContext(newContext) { this._context = newContext; } render(container) { const element = this.element = container; this._register(_touch_js__WEBPACK_IMPORTED_MODULE_3__/* .Gesture */ .o.addTarget(container)); const enableDragging = this.options && this.options.draggable; if (enableDragging) { container.draggable = true; if (_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isFirefox */ .vU) { // Firefox: requires to set a text data transfer to get going this._register((0,_dom_js__WEBPACK_IMPORTED_MODULE_2__/* .addDisposableListener */ .nm)(container, _dom_js__WEBPACK_IMPORTED_MODULE_2__/* .EventType */ .tw.DRAG_START, e => { var _a; return (_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.setData(_dnd_js__WEBPACK_IMPORTED_MODULE_1__/* .DataTransfers */ .go.TEXT, this._action.label); })); } } this._register((0,_dom_js__WEBPACK_IMPORTED_MODULE_2__/* .addDisposableListener */ .nm)(element, _touch_js__WEBPACK_IMPORTED_MODULE_3__/* .EventType */ .t.Tap, e => this.onClick(e, true))); // Preserve focus on tap #125470 this._register((0,_dom_js__WEBPACK_IMPORTED_MODULE_2__/* .addDisposableListener */ .nm)(element, _dom_js__WEBPACK_IMPORTED_MODULE_2__/* .EventType */ .tw.MOUSE_DOWN, e => { if (!enableDragging) { _dom_js__WEBPACK_IMPORTED_MODULE_2__/* .EventHelper */ .zB.stop(e, true); // do not run when dragging is on because that would disable it } if (this._action.enabled && e.button === 0) { element.classList.add('active'); } })); if (_common_platform_js__WEBPACK_IMPORTED_MODULE_6__/* .isMacintosh */ .dz) { // macOS: allow to trigger the button when holding Ctrl+key and pressing the // main mouse button. This is for scenarios where e.g. some interaction forces // the Ctrl+key to be pressed and hold but the user still wants to interact // with the actions (for example quick access in quick navigation mode). this._register((0,_dom_js__WEBPACK_IMPORTED_MODULE_2__/* .addDisposableListener */ .nm)(element, _dom_js__WEBPACK_IMPORTED_MODULE_2__/* .EventType */ .tw.CONTEXT_MENU, e => { if (e.button === 0 && e.ctrlKey === true) { this.onClick(e); } })); } this._register((0,_dom_js__WEBPACK_IMPORTED_MODULE_2__/* .addDisposableListener */ .nm)(element, _dom_js__WEBPACK_IMPORTED_MODULE_2__/* .EventType */ .tw.CLICK, e => { _dom_js__WEBPACK_IMPORTED_MODULE_2__/* .EventHelper */ .zB.stop(e, true); // menus do not use the click event if (!(this.options && this.options.isMenu)) { this.onClick(e); } })); this._register((0,_dom_js__WEBPACK_IMPORTED_MODULE_2__/* .addDisposableListener */ .nm)(element, _dom_js__WEBPACK_IMPORTED_MODULE_2__/* .EventType */ .tw.DBLCLICK, e => { _dom_js__WEBPACK_IMPORTED_MODULE_2__/* .EventHelper */ .zB.stop(e, true); })); [_dom_js__WEBPACK_IMPORTED_MODULE_2__/* .EventType */ .tw.MOUSE_UP, _dom_js__WEBPACK_IMPORTED_MODULE_2__/* .EventType */ .tw.MOUSE_OUT].forEach(event => { this._register((0,_dom_js__WEBPACK_IMPORTED_MODULE_2__/* .addDisposableListener */ .nm)(element, event, e => { _dom_js__WEBPACK_IMPORTED_MODULE_2__/* .EventHelper */ .zB.stop(e); element.classList.remove('active'); })); }); } onClick(event, preserveFocus = false) { var _a; _dom_js__WEBPACK_IMPORTED_MODULE_2__/* .EventHelper */ .zB.stop(event, true); const context = _common_types_js__WEBPACK_IMPORTED_MODULE_8__/* .isUndefinedOrNull */ .Jp(this._context) ? ((_a = this.options) === null || _a === void 0 ? void 0 : _a.useEventAsContext) ? event : { preserveFocus } : this._context; this.actionRunner.run(this._action, context); } // Only set the tabIndex on the element once it is about to get focused // That way this element wont be a tab stop when it is not needed #106441 focus() { if (this.element) { this.element.tabIndex = 0; this.element.focus(); this.element.classList.add('focused'); } } blur() { if (this.element) { this.element.blur(); this.element.tabIndex = -1; this.element.classList.remove('focused'); } } setFocusable(focusable) { if (this.element) { this.element.tabIndex = focusable ? 0 : -1; } } get trapsArrowNavigation() { return false; } updateEnabled() { // implement in subclass } updateLabel() { // implement in subclass } updateTooltip() { // implement in subclass } updateClass() { // implement in subclass } updateChecked() { // implement in subclass } dispose() { if (this.element) { this.element.remove(); this.element = undefined; } super.dispose(); } } class ActionViewItem extends BaseActionViewItem { constructor(context, action, options = {}) { super(context, action, options); this.options = options; this.options.icon = options.icon !== undefined ? options.icon : false; this.options.label = options.label !== undefined ? options.label : true; this.cssClass = ''; } render(container) { super.render(container); if (this.element) { this.label = (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__/* .append */ .R3)(this.element, (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.$)('a.action-label')); } if (this.label) { if (this._action.id === _common_actions_js__WEBPACK_IMPORTED_MODULE_4__/* .Separator */ .Z0.ID) { this.label.setAttribute('role', 'presentation'); // A separator is a presentation item } else { if (this.options.isMenu) { this.label.setAttribute('role', 'menuitem'); } else { this.label.setAttribute('role', 'button'); } } } if (this.options.label && this.options.keybinding && this.element) { (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__/* .append */ .R3)(this.element, (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.$)('span.keybinding')).textContent = this.options.keybinding; } this.updateClass(); this.updateLabel(); this.updateTooltip(); this.updateEnabled(); this.updateChecked(); } // Only set the tabIndex on the element once it is about to get focused // That way this element wont be a tab stop when it is not needed #106441 focus() { if (this.label) { this.label.tabIndex = 0; this.label.focus(); } } blur() { if (this.label) { this.label.tabIndex = -1; } } setFocusable(focusable) { if (this.label) { this.label.tabIndex = focusable ? 0 : -1; } } updateLabel() { if (this.options.label && this.label) { this.label.textContent = this.getAction().label; } } updateTooltip() { let title = null; if (this.getAction().tooltip) { title = this.getAction().tooltip; } else if (!this.options.label && this.getAction().label && this.options.icon) { title = this.getAction().label; if (this.options.keybinding) { title = _nls_js__WEBPACK_IMPORTED_MODULE_9__/* .localize */ .N({ key: 'titleLabel', comment: ['action title', 'action keybinding'] }, "{0} ({1})", title, this.options.keybinding); } } if (title && this.label) { this.label.title = title; } } updateClass() { if (this.cssClass && this.label) { this.label.classList.remove(...this.cssClass.split(' ')); } if (this.options.icon) { this.cssClass = this.getAction().class; if (this.label) { this.label.classList.add('codicon'); if (this.cssClass) { this.label.classList.add(...this.cssClass.split(' ')); } } this.updateEnabled(); } else { if (this.label) { this.label.classList.remove('codicon'); } } } updateEnabled() { if (this.getAction().enabled) { if (this.label) { this.label.removeAttribute('aria-disabled'); this.label.classList.remove('disabled'); } if (this.element) { this.element.classList.remove('disabled'); } } else { if (this.label) { this.label.setAttribute('aria-disabled', 'true'); this.label.classList.add('disabled'); } if (this.element) { this.element.classList.add('disabled'); } } } updateChecked() { if (this.label) { if (this.getAction().checked) { this.label.classList.add('checked'); } else { this.label.classList.remove('checked'); } } } } /***/ }), /***/ 21784: /*!********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js ***! \********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ o: function() { return /* binding */ ActionBar; } /* harmony export */ }); /* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../dom.js */ 69454); /* harmony import */ var _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../keyboardEvent.js */ 92813); /* harmony import */ var _actionViewItems_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./actionViewItems.js */ 10081); /* harmony import */ var _common_actions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../common/actions.js */ 75918); /* harmony import */ var _common_event_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../common/event.js */ 4348); /* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../common/lifecycle.js */ 69323); /* harmony import */ var _common_types_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../common/types.js */ 72999); /* harmony import */ var _actionbar_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./actionbar.css */ 7113); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; class ActionBar extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__/* .Disposable */ .JT { constructor(container, options = {}) { var _a, _b, _c, _d, _e, _f; super(); // Trigger Key Tracking this.triggerKeyDown = false; this.focusable = true; this._onDidBlur = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_4__/* .Emitter */ .Q5()); this.onDidBlur = this._onDidBlur.event; this._onDidCancel = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_4__/* .Emitter */ .Q5({ onFirstListenerAdd: () => this.cancelHasListener = true })); this.onDidCancel = this._onDidCancel.event; this.cancelHasListener = false; this._onDidRun = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_4__/* .Emitter */ .Q5()); this.onDidRun = this._onDidRun.event; this._onBeforeRun = this._register(new _common_event_js__WEBPACK_IMPORTED_MODULE_4__/* .Emitter */ .Q5()); this.onBeforeRun = this._onBeforeRun.event; this.options = options; this._context = (_a = options.context) !== null && _a !== void 0 ? _a : null; this._orientation = (_b = this.options.orientation) !== null && _b !== void 0 ? _b : 0 /* HORIZONTAL */; this._triggerKeys = { keyDown: (_d = (_c = this.options.triggerKeys) === null || _c === void 0 ? void 0 : _c.keyDown) !== null && _d !== void 0 ? _d : false, keys: (_f = (_e = this.options.triggerKeys) === null || _e === void 0 ? void 0 : _e.keys) !== null && _f !== void 0 ? _f : [3 /* Enter */, 10 /* Space */] }; if (this.options.actionRunner) { this._actionRunner = this.options.actionRunner; } else { this._actionRunner = new _common_actions_js__WEBPACK_IMPORTED_MODULE_3__/* .ActionRunner */ .Wi(); this._register(this._actionRunner); } this._register(this._actionRunner.onDidRun(e => this._onDidRun.fire(e))); this._register(this._actionRunner.onBeforeRun(e => this._onBeforeRun.fire(e))); this._actionIds = []; this.viewItems = []; this.focusedItem = undefined; this.domNode = document.createElement('div'); this.domNode.className = 'monaco-action-bar'; if (options.animated !== false) { this.domNode.classList.add('animated'); } let previousKeys; let nextKeys; switch (this._orientation) { case 0 /* HORIZONTAL */: previousKeys = [15 /* LeftArrow */]; nextKeys = [17 /* RightArrow */]; break; case 1 /* VERTICAL */: previousKeys = [16 /* UpArrow */]; nextKeys = [18 /* DownArrow */]; this.domNode.className += ' vertical'; break; } this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(this.domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .EventType */ .tw.KEY_DOWN, e => { const event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .StandardKeyboardEvent */ .y(e); let eventHandled = true; const focusedItem = typeof this.focusedItem === 'number' ? this.viewItems[this.focusedItem] : undefined; if (previousKeys && (event.equals(previousKeys[0]) || event.equals(previousKeys[1]))) { eventHandled = this.focusPrevious(); } else if (nextKeys && (event.equals(nextKeys[0]) || event.equals(nextKeys[1]))) { eventHandled = this.focusNext(); } else if (event.equals(9 /* Escape */) && this.cancelHasListener) { this._onDidCancel.fire(); } else if (event.equals(14 /* Home */)) { eventHandled = this.focusFirst(); } else if (event.equals(13 /* End */)) { eventHandled = this.focusLast(); } else if (event.equals(2 /* Tab */) && focusedItem instanceof _actionViewItems_js__WEBPACK_IMPORTED_MODULE_2__/* .BaseActionViewItem */ .Y && focusedItem.trapsArrowNavigation) { eventHandled = this.focusNext(); } else if (this.isTriggerKeyEvent(event)) { // Staying out of the else branch even if not triggered if (this._triggerKeys.keyDown) { this.doTrigger(event); } else { this.triggerKeyDown = true; } } else { eventHandled = false; } if (eventHandled) { event.preventDefault(); event.stopPropagation(); } })); this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(this.domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .EventType */ .tw.KEY_UP, e => { const event = new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .StandardKeyboardEvent */ .y(e); // Run action on Enter/Space if (this.isTriggerKeyEvent(event)) { if (!this._triggerKeys.keyDown && this.triggerKeyDown) { this.triggerKeyDown = false; this.doTrigger(event); } event.preventDefault(); event.stopPropagation(); } // Recompute focused item else if (event.equals(2 /* Tab */) || event.equals(1024 /* Shift */ | 2 /* Tab */)) { this.updateFocusedItem(); } })); this.focusTracker = this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .trackFocus */ .go(this.domNode)); this._register(this.focusTracker.onDidBlur(() => { if (_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .getActiveElement */ .vY() === this.domNode || !_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .isAncestor */ .jg(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .getActiveElement */ .vY(), this.domNode)) { this._onDidBlur.fire(); this.focusedItem = undefined; this.triggerKeyDown = false; } })); this._register(this.focusTracker.onDidFocus(() => this.updateFocusedItem())); this.actionsList = document.createElement('ul'); this.actionsList.className = 'actions-container'; this.actionsList.setAttribute('role', 'toolbar'); if (this.options.ariaLabel) { this.actionsList.setAttribute('aria-label', this.options.ariaLabel); } this.domNode.appendChild(this.actionsList); container.appendChild(this.domNode); } isTriggerKeyEvent(event) { let ret = false; this._triggerKeys.keys.forEach(keyCode => { ret = ret || event.equals(keyCode); }); return ret; } updateFocusedItem() { for (let i = 0; i < this.actionsList.children.length; i++) { const elem = this.actionsList.children[i]; if (_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .isAncestor */ .jg(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .getActiveElement */ .vY(), elem)) { this.focusedItem = i; break; } } } get context() { return this._context; } set context(context) { this._context = context; this.viewItems.forEach(i => i.setActionContext(context)); } get actionRunner() { return this._actionRunner; } set actionRunner(actionRunner) { if (actionRunner) { this._actionRunner = actionRunner; this.viewItems.forEach(item => item.actionRunner = actionRunner); } } getContainer() { return this.domNode; } push(arg, options = {}) { const actions = Array.isArray(arg) ? arg : [arg]; let index = _common_types_js__WEBPACK_IMPORTED_MODULE_7__/* .isNumber */ .hj(options.index) ? options.index : null; actions.forEach((action) => { const actionViewItemElement = document.createElement('li'); actionViewItemElement.className = 'action-item'; actionViewItemElement.setAttribute('role', 'presentation'); // Prevent native context menu on actions if (!this.options.allowContextMenu) { this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(actionViewItemElement, _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .EventType */ .tw.CONTEXT_MENU, (e) => { _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .EventHelper */ .zB.stop(e, true); })); } let item; if (this.options.actionViewItemProvider) { item = this.options.actionViewItemProvider(action); } if (!item) { item = new _actionViewItems_js__WEBPACK_IMPORTED_MODULE_2__/* .ActionViewItem */ .g(this.context, action, options); } item.actionRunner = this._actionRunner; item.setActionContext(this.context); item.render(actionViewItemElement); if (this.focusable && item instanceof _actionViewItems_js__WEBPACK_IMPORTED_MODULE_2__/* .BaseActionViewItem */ .Y && this.viewItems.length === 0) { // We need to allow for the first enabled item to be focused on using tab navigation #106441 item.setFocusable(true); } if (index === null || index < 0 || index >= this.actionsList.children.length) { this.actionsList.appendChild(actionViewItemElement); this.viewItems.push(item); this._actionIds.push(action.id); } else { this.actionsList.insertBefore(actionViewItemElement, this.actionsList.children[index]); this.viewItems.splice(index, 0, item); this._actionIds.splice(index, 0, action.id); index++; } }); if (typeof this.focusedItem === 'number') { // After a clear actions might be re-added to simply toggle some actions. We should preserve focus #97128 this.focus(this.focusedItem); } } clear() { (0,_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__/* .dispose */ .B9)(this.viewItems); this.viewItems = []; this._actionIds = []; _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .clearNode */ .PO(this.actionsList); } length() { return this.viewItems.length; } focus(arg) { let selectFirst = false; let index = undefined; if (arg === undefined) { selectFirst = true; } else if (typeof arg === 'number') { index = arg; } else if (typeof arg === 'boolean') { selectFirst = arg; } if (selectFirst && typeof this.focusedItem === 'undefined') { const firstEnabled = this.viewItems.findIndex(item => item.isEnabled()); // Focus the first enabled item this.focusedItem = firstEnabled === -1 ? undefined : firstEnabled; this.updateFocus(); } else { if (index !== undefined) { this.focusedItem = index; } this.updateFocus(); } } focusFirst() { this.focusedItem = this.length() > 1 ? 1 : 0; return this.focusPrevious(); } focusLast() { this.focusedItem = this.length() < 2 ? 0 : this.length() - 2; return this.focusNext(); } focusNext() { if (typeof this.focusedItem === 'undefined') { this.focusedItem = this.viewItems.length - 1; } else if (this.viewItems.length <= 1) { return false; } const startIndex = this.focusedItem; let item; do { if (this.options.preventLoopNavigation && this.focusedItem + 1 >= this.viewItems.length) { this.focusedItem = startIndex; return false; } this.focusedItem = (this.focusedItem + 1) % this.viewItems.length; item = this.viewItems[this.focusedItem]; } while (this.focusedItem !== startIndex && this.options.focusOnlyEnabledItems && !item.isEnabled()); this.updateFocus(); return true; } focusPrevious() { if (typeof this.focusedItem === 'undefined') { this.focusedItem = 0; } else if (this.viewItems.length <= 1) { return false; } const startIndex = this.focusedItem; let item; do { this.focusedItem = this.focusedItem - 1; if (this.focusedItem < 0) { if (this.options.preventLoopNavigation) { this.focusedItem = startIndex; return false; } this.focusedItem = this.viewItems.length - 1; } item = this.viewItems[this.focusedItem]; } while (this.focusedItem !== startIndex && this.options.focusOnlyEnabledItems && !item.isEnabled()); this.updateFocus(true); return true; } updateFocus(fromRight, preventScroll) { if (typeof this.focusedItem === 'undefined') { this.actionsList.focus({ preventScroll }); } for (let i = 0; i < this.viewItems.length; i++) { const item = this.viewItems[i]; const actionViewItem = item; if (i === this.focusedItem) { let focusItem = true; if (!_common_types_js__WEBPACK_IMPORTED_MODULE_7__/* .isFunction */ .mf(actionViewItem.focus)) { focusItem = false; } if (this.options.focusOnlyEnabledItems && _common_types_js__WEBPACK_IMPORTED_MODULE_7__/* .isFunction */ .mf(item.isEnabled) && !item.isEnabled()) { focusItem = false; } if (focusItem) { actionViewItem.focus(fromRight); } else { this.actionsList.focus({ preventScroll }); } } else { if (_common_types_js__WEBPACK_IMPORTED_MODULE_7__/* .isFunction */ .mf(actionViewItem.blur)) { actionViewItem.blur(); } } } } doTrigger(event) { if (typeof this.focusedItem === 'undefined') { return; //nothing to focus } // trigger action const actionViewItem = this.viewItems[this.focusedItem]; if (actionViewItem instanceof _actionViewItems_js__WEBPACK_IMPORTED_MODULE_2__/* .BaseActionViewItem */ .Y) { const context = (actionViewItem._context === null || actionViewItem._context === undefined) ? event : actionViewItem._context; this.run(actionViewItem._action, context); } } run(action, context) { return __awaiter(this, void 0, void 0, function* () { yield this._actionRunner.run(action, context); }); } dispose() { (0,_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_5__/* .dispose */ .B9)(this.viewItems); this.viewItems = []; this._actionIds = []; this.getContainer().remove(); super.dispose(); } } /***/ }), /***/ 96297: /*!**********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/aria/aria.js + 1 modules ***! \**********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { Z9: function() { return /* binding */ aria_alert; }, wW: function() { return /* binding */ setARIAContainer; }, i7: function() { return /* binding */ aria_status; } }); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dom.js var dom = __webpack_require__(69454); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/platform.js var platform = __webpack_require__(23345); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/aria/aria.css // extracted by mini-css-extract-plugin ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/aria/aria.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Use a max length since we are inserting the whole msg in the DOM and that can cause browsers to freeze for long messages #94233 const MAX_MESSAGE_LENGTH = 20000; let ariaContainer; let alertContainer; let alertContainer2; let statusContainer; let statusContainer2; function setARIAContainer(parent) { ariaContainer = document.createElement('div'); ariaContainer.className = 'monaco-aria-container'; const createAlertContainer = () => { const element = document.createElement('div'); element.className = 'monaco-alert'; element.setAttribute('role', 'alert'); element.setAttribute('aria-atomic', 'true'); ariaContainer.appendChild(element); return element; }; alertContainer = createAlertContainer(); alertContainer2 = createAlertContainer(); const createStatusContainer = () => { const element = document.createElement('div'); element.className = 'monaco-status'; element.setAttribute('role', 'complementary'); element.setAttribute('aria-live', 'polite'); element.setAttribute('aria-atomic', 'true'); ariaContainer.appendChild(element); return element; }; statusContainer = createStatusContainer(); statusContainer2 = createStatusContainer(); parent.appendChild(ariaContainer); } /** * Given the provided message, will make sure that it is read as alert to screen readers. */ function aria_alert(msg) { if (!ariaContainer) { return; } // Use alternate containers such that duplicated messages get read out by screen readers #99466 if (alertContainer.textContent !== msg) { dom/* clearNode */.PO(alertContainer2); insertMessage(alertContainer, msg); } else { dom/* clearNode */.PO(alertContainer); insertMessage(alertContainer2, msg); } } /** * Given the provided message, will make sure that it is read as status to screen readers. */ function aria_status(msg) { if (!ariaContainer) { return; } if (platform/* isMacintosh */.dz) { aria_alert(msg); // VoiceOver does not seem to support status role } else { if (statusContainer.textContent !== msg) { dom/* clearNode */.PO(statusContainer2); insertMessage(statusContainer, msg); } else { dom/* clearNode */.PO(statusContainer); insertMessage(statusContainer2, msg); } } } function insertMessage(target, msg) { dom/* clearNode */.PO(target); if (msg.length > MAX_MESSAGE_LENGTH) { msg = msg.substr(0, MAX_MESSAGE_LENGTH); } target.textContent = msg; // See https://www.paciellogroup.com/blog/2012/06/html5-accessibility-chops-aria-rolealert-browser-support/ target.style.visibility = 'hidden'; target.style.visibility = 'visible'; } /***/ }), /***/ 83429: /*!***********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/codicons/codiconStyles.js + 2 modules ***! \***********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { a: function() { return /* binding */ formatRule; } }); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/codicons.js var codicons = __webpack_require__(52615); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon.css // extracted by mini-css-extract-plugin ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/codicons/codicon/codicon-modifiers.css // extracted by mini-css-extract-plugin ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/codicons/codiconStyles.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function formatRule(c) { let def = c.definition; while (def instanceof codicons/* Codicon */.lA) { def = def.definition; } return `.codicon-${c.id}:before { content: '${def.fontCharacter}'; }`; } /***/ }), /***/ 41221: /*!**********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.js + 1 modules ***! \**********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { Z: function() { return /* binding */ CountBadge; } }); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dom.js var dom = __webpack_require__(69454); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/color.js var color = __webpack_require__(51737); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/objects.js var objects = __webpack_require__(80470); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/strings.js var strings = __webpack_require__(82983); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.css // extracted by mini-css-extract-plugin ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/countBadge/countBadge.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const defaultOpts = { badgeBackground: color/* Color */.Il.fromHex('#4D4D4D'), badgeForeground: color/* Color */.Il.fromHex('#FFFFFF') }; class CountBadge { constructor(container, options) { this.count = 0; this.options = options || Object.create(null); (0,objects/* mixin */.jB)(this.options, defaultOpts, false); this.badgeBackground = this.options.badgeBackground; this.badgeForeground = this.options.badgeForeground; this.badgeBorder = this.options.badgeBorder; this.element = (0,dom/* append */.R3)(container, (0,dom.$)('.monaco-count-badge')); this.countFormat = this.options.countFormat || '{0}'; this.titleFormat = this.options.titleFormat || ''; this.setCount(this.options.count || 0); } setCount(count) { this.count = count; this.render(); } setTitleFormat(titleFormat) { this.titleFormat = titleFormat; this.render(); } render() { this.element.textContent = (0,strings/* format */.WU)(this.countFormat, this.count); this.element.title = (0,strings/* format */.WU)(this.titleFormat, this.count); this.applyStyles(); } style(styles) { this.badgeBackground = styles.badgeBackground; this.badgeForeground = styles.badgeForeground; this.badgeBorder = styles.badgeBorder; this.applyStyles(); } applyStyles() { if (this.element) { const background = this.badgeBackground ? this.badgeBackground.toString() : ''; const foreground = this.badgeForeground ? this.badgeForeground.toString() : ''; const border = this.badgeBorder ? this.badgeBorder.toString() : ''; this.element.style.backgroundColor = background; this.element.style.color = foreground; this.element.style.borderWidth = border ? '1px' : ''; this.element.style.borderStyle = border ? 'solid' : ''; this.element.style.borderColor = border; } } } /***/ }), /***/ 37357: /*!**********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/highlightedlabel/highlightedLabel.js ***! \**********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ q: function() { return /* binding */ HighlightedLabel; } /* harmony export */ }); /* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../dom.js */ 69454); /* harmony import */ var _iconLabel_iconLabels_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../iconLabel/iconLabels.js */ 67069); /* harmony import */ var _common_objects_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../common/objects.js */ 80470); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class HighlightedLabel { constructor(container, supportIcons) { this.supportIcons = supportIcons; this.text = ''; this.title = ''; this.highlights = []; this.didEverRender = false; this.domNode = document.createElement('span'); this.domNode.className = 'monaco-highlighted-label'; container.appendChild(this.domNode); } get element() { return this.domNode; } set(text, highlights = [], title = '', escapeNewLines) { if (!text) { text = ''; } if (escapeNewLines) { // adjusts highlights inplace text = HighlightedLabel.escapeNewLines(text, highlights); } if (this.didEverRender && this.text === text && this.title === title && _common_objects_js__WEBPACK_IMPORTED_MODULE_2__/* .equals */ .fS(this.highlights, highlights)) { return; } this.text = text; this.title = title; this.highlights = highlights; this.render(); } render() { const children = []; let pos = 0; for (const highlight of this.highlights) { if (highlight.end === highlight.start) { continue; } if (pos < highlight.start) { const substring = this.text.substring(pos, highlight.start); children.push(_dom_js__WEBPACK_IMPORTED_MODULE_0__.$('span', undefined, ...this.supportIcons ? (0,_iconLabel_iconLabels_js__WEBPACK_IMPORTED_MODULE_1__/* .renderLabelWithIcons */ .T)(substring) : [substring])); pos = highlight.end; } const substring = this.text.substring(highlight.start, highlight.end); const element = _dom_js__WEBPACK_IMPORTED_MODULE_0__.$('span.highlight', undefined, ...this.supportIcons ? (0,_iconLabel_iconLabels_js__WEBPACK_IMPORTED_MODULE_1__/* .renderLabelWithIcons */ .T)(substring) : [substring]); if (highlight.extraClasses) { element.classList.add(highlight.extraClasses); } children.push(element); pos = highlight.end; } if (pos < this.text.length) { const substring = this.text.substring(pos); children.push(_dom_js__WEBPACK_IMPORTED_MODULE_0__.$('span', undefined, ...this.supportIcons ? (0,_iconLabel_iconLabels_js__WEBPACK_IMPORTED_MODULE_1__/* .renderLabelWithIcons */ .T)(substring) : [substring])); } _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .reset */ .mc(this.domNode, ...children); if (this.title) { this.domNode.title = this.title; } else { this.domNode.removeAttribute('title'); } this.didEverRender = true; } static escapeNewLines(text, highlights) { let total = 0; let extra = 0; return text.replace(/\r\n|\r|\n/g, (match, offset) => { extra = match === '\r\n' ? -1 : 0; offset += total; for (const highlight of highlights) { if (highlight.end <= offset) { continue; } if (highlight.start >= offset) { highlight.start += extra; } if (highlight.end >= offset) { highlight.end += extra; } } total += extra; return '\u23CE'; }); } } /***/ }), /***/ 28442: /*!********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabel.js + 2 modules ***! \********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { g: function() { return /* binding */ IconLabel; } }); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dom.js var dom = __webpack_require__(69454); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/highlightedlabel/highlightedLabel.js var highlightedlabel_highlightedLabel = __webpack_require__(37357); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/async.js var common_async = __webpack_require__(50431); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/cancellation.js var cancellation = __webpack_require__(96283); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/htmlContent.js var htmlContent = __webpack_require__(94186); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/lifecycle.js var lifecycle = __webpack_require__(69323); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/types.js var types = __webpack_require__(72999); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/nls.js var nls = __webpack_require__(13268); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabelHover.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; function setupNativeHover(htmlElement, tooltip) { if ((0,types/* isString */.HD)(tooltip)) { htmlElement.title = tooltip; } else if (tooltip === null || tooltip === void 0 ? void 0 : tooltip.markdownNotSupportedFallback) { htmlElement.title = tooltip.markdownNotSupportedFallback; } else { htmlElement.removeAttribute('title'); } } class UpdatableHoverWidget { constructor(hoverDelegate, target, fadeInAnimation) { this.hoverDelegate = hoverDelegate; this.target = target; this.fadeInAnimation = fadeInAnimation; } update(markdownTooltip, focus) { var _a; return __awaiter(this, void 0, void 0, function* () { if (this._cancellationTokenSource) { // there's an computation ongoing, cancel it this._cancellationTokenSource.dispose(true); this._cancellationTokenSource = undefined; } if (this.isDisposed) { return; } let resolvedContent; if (markdownTooltip === undefined || (0,types/* isString */.HD)(markdownTooltip) || markdownTooltip instanceof HTMLElement) { resolvedContent = markdownTooltip; } else if (!(0,types/* isFunction */.mf)(markdownTooltip.markdown)) { resolvedContent = (_a = markdownTooltip.markdown) !== null && _a !== void 0 ? _a : markdownTooltip.markdownNotSupportedFallback; } else { // compute the content, potentially long-running // show 'Loading' if no hover is up yet if (!this._hoverWidget) { this.show((0,nls/* localize */.N)('iconLabel.loading', "Loading..."), focus); } // compute the content this._cancellationTokenSource = new cancellation/* CancellationTokenSource */.A(); const token = this._cancellationTokenSource.token; resolvedContent = yield markdownTooltip.markdown(token); if (this.isDisposed || token.isCancellationRequested) { // either the widget has been closed in the meantime // or there has been a new call to `update` return; } } this.show(resolvedContent, focus); }); } show(content, focus) { const oldHoverWidget = this._hoverWidget; if (this.hasContent(content)) { const hoverOptions = { content, target: this.target, showPointer: this.hoverDelegate.placement === 'element', hoverPosition: 2 /* BELOW */, skipFadeInAnimation: !this.fadeInAnimation || !!oldHoverWidget // do not fade in if the hover is already showing }; this._hoverWidget = this.hoverDelegate.showHover(hoverOptions, focus); } oldHoverWidget === null || oldHoverWidget === void 0 ? void 0 : oldHoverWidget.dispose(); } hasContent(content) { if (!content) { return false; } if ((0,htmlContent/* isMarkdownString */.Fr)(content)) { return !!content.value; } return true; } get isDisposed() { var _a; return (_a = this._hoverWidget) === null || _a === void 0 ? void 0 : _a.isDisposed; } dispose() { var _a, _b; (_a = this._hoverWidget) === null || _a === void 0 ? void 0 : _a.dispose(); (_b = this._cancellationTokenSource) === null || _b === void 0 ? void 0 : _b.dispose(true); this._cancellationTokenSource = undefined; } } function setupCustomHover(hoverDelegate, htmlElement, markdownTooltip) { let hoverPreparation; let hoverWidget; const hideHover = (disposeWidget, disposePreparation) => { var _a; if (disposeWidget) { hoverWidget === null || hoverWidget === void 0 ? void 0 : hoverWidget.dispose(); hoverWidget = undefined; } if (disposePreparation) { hoverPreparation === null || hoverPreparation === void 0 ? void 0 : hoverPreparation.dispose(); hoverPreparation = undefined; } (_a = hoverDelegate.onDidHideHover) === null || _a === void 0 ? void 0 : _a.call(hoverDelegate); }; const triggerShowHover = (delay, focus, target) => { return new common_async/* TimeoutTimer */._F(() => __awaiter(this, void 0, void 0, function* () { if (!hoverWidget || hoverWidget.isDisposed) { hoverWidget = new UpdatableHoverWidget(hoverDelegate, target || htmlElement, delay > 0); yield hoverWidget.update(markdownTooltip, focus); } }), delay); }; const onMouseOver = () => { if (hoverPreparation) { return; } const toDispose = new lifecycle/* DisposableStore */.SL(); const onMouseLeave = (e) => hideHover(false, e.fromElement === htmlElement); toDispose.add(dom/* addDisposableListener */.nm(htmlElement, dom/* EventType */.tw.MOUSE_LEAVE, onMouseLeave, true)); const onMouseDown = () => hideHover(true, true); toDispose.add(dom/* addDisposableListener */.nm(htmlElement, dom/* EventType */.tw.MOUSE_DOWN, onMouseDown, true)); const target = { targetElements: [htmlElement], dispose: () => { } }; if (hoverDelegate.placement === undefined || hoverDelegate.placement === 'mouse') { // track the mouse position const onMouseMove = (e) => target.x = e.x + 10; toDispose.add(dom/* addDisposableListener */.nm(htmlElement, dom/* EventType */.tw.MOUSE_MOVE, onMouseMove, true)); } toDispose.add(triggerShowHover(hoverDelegate.delay, false, target)); hoverPreparation = toDispose; }; const mouseOverDomEmitter = dom/* addDisposableListener */.nm(htmlElement, dom/* EventType */.tw.MOUSE_OVER, onMouseOver, true); const hover = { show: focus => { hideHover(false, true); // terminate a ongoing mouse over preparation triggerShowHover(0, focus); // show hover immediately }, hide: () => { hideHover(true, true); }, update: (newTooltip) => __awaiter(this, void 0, void 0, function* () { markdownTooltip = newTooltip; yield (hoverWidget === null || hoverWidget === void 0 ? void 0 : hoverWidget.update(markdownTooltip)); }), dispose: () => { mouseOverDomEmitter.dispose(); hideHover(true, true); } }; return hover; } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/objects.js var objects = __webpack_require__(80470); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/range.js var common_range = __webpack_require__(17981); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/iconLabel/iconlabel.css // extracted by mini-css-extract-plugin ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabel.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class FastLabelNode { constructor(_element) { this._element = _element; } get element() { return this._element; } set textContent(content) { if (this.disposed || content === this._textContent) { return; } this._textContent = content; this._element.textContent = content; } set className(className) { if (this.disposed || className === this._className) { return; } this._className = className; this._element.className = className; } set empty(empty) { if (this.disposed || empty === this._empty) { return; } this._empty = empty; this._element.style.marginLeft = empty ? '0' : ''; } dispose() { this.disposed = true; } } class IconLabel extends lifecycle/* Disposable */.JT { constructor(container, options) { super(); this.customHovers = new Map(); this.domNode = this._register(new FastLabelNode(dom/* append */.R3(container, dom.$('.monaco-icon-label')))); this.labelContainer = dom/* append */.R3(this.domNode.element, dom.$('.monaco-icon-label-container')); const nameContainer = dom/* append */.R3(this.labelContainer, dom.$('span.monaco-icon-name-container')); this.descriptionContainer = this._register(new FastLabelNode(dom/* append */.R3(this.labelContainer, dom.$('span.monaco-icon-description-container')))); if ((options === null || options === void 0 ? void 0 : options.supportHighlights) || (options === null || options === void 0 ? void 0 : options.supportIcons)) { this.nameNode = new LabelWithHighlights(nameContainer, !!options.supportIcons); } else { this.nameNode = new Label(nameContainer); } if (options === null || options === void 0 ? void 0 : options.supportDescriptionHighlights) { this.descriptionNodeFactory = () => new highlightedlabel_highlightedLabel/* HighlightedLabel */.q(dom/* append */.R3(this.descriptionContainer.element, dom.$('span.label-description')), !!options.supportIcons); } else { this.descriptionNodeFactory = () => this._register(new FastLabelNode(dom/* append */.R3(this.descriptionContainer.element, dom.$('span.label-description')))); } this.hoverDelegate = options === null || options === void 0 ? void 0 : options.hoverDelegate; } get element() { return this.domNode.element; } setLabel(label, description, options) { const classes = ['monaco-icon-label']; if (options) { if (options.extraClasses) { classes.push(...options.extraClasses); } if (options.italic) { classes.push('italic'); } if (options.strikethrough) { classes.push('strikethrough'); } } this.domNode.className = classes.join(' '); this.setupHover((options === null || options === void 0 ? void 0 : options.descriptionTitle) ? this.labelContainer : this.element, options === null || options === void 0 ? void 0 : options.title); this.nameNode.setLabel(label, options); if (description || this.descriptionNode) { if (!this.descriptionNode) { this.descriptionNode = this.descriptionNodeFactory(); // description node is created lazily on demand } if (this.descriptionNode instanceof highlightedlabel_highlightedLabel/* HighlightedLabel */.q) { this.descriptionNode.set(description || '', options ? options.descriptionMatches : undefined); this.setupHover(this.descriptionNode.element, options === null || options === void 0 ? void 0 : options.descriptionTitle); } else { this.descriptionNode.textContent = description || ''; this.setupHover(this.descriptionNode.element, (options === null || options === void 0 ? void 0 : options.descriptionTitle) || ''); this.descriptionNode.empty = !description; } } } setupHover(htmlElement, tooltip) { const previousCustomHover = this.customHovers.get(htmlElement); if (previousCustomHover) { previousCustomHover.dispose(); this.customHovers.delete(htmlElement); } if (!tooltip) { htmlElement.removeAttribute('title'); return; } if (!this.hoverDelegate) { setupNativeHover(htmlElement, tooltip); } else { const hoverDisposable = setupCustomHover(this.hoverDelegate, htmlElement, tooltip); if (hoverDisposable) { this.customHovers.set(htmlElement, hoverDisposable); } } } dispose() { super.dispose(); for (const disposable of this.customHovers.values()) { disposable.dispose(); } this.customHovers.clear(); } } class Label { constructor(container) { this.container = container; this.label = undefined; this.singleLabel = undefined; } setLabel(label, options) { if (this.label === label && (0,objects/* equals */.fS)(this.options, options)) { return; } this.label = label; this.options = options; if (typeof label === 'string') { if (!this.singleLabel) { this.container.innerText = ''; this.container.classList.remove('multiple'); this.singleLabel = dom/* append */.R3(this.container, dom.$('a.label-name', { id: options === null || options === void 0 ? void 0 : options.domId })); } this.singleLabel.textContent = label; } else { this.container.innerText = ''; this.container.classList.add('multiple'); this.singleLabel = undefined; for (let i = 0; i < label.length; i++) { const l = label[i]; const id = (options === null || options === void 0 ? void 0 : options.domId) && `${options === null || options === void 0 ? void 0 : options.domId}_${i}`; dom/* append */.R3(this.container, dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l)); if (i < label.length - 1) { dom/* append */.R3(this.container, dom.$('span.label-separator', undefined, (options === null || options === void 0 ? void 0 : options.separator) || '/')); } } } } } function splitMatches(labels, separator, matches) { if (!matches) { return undefined; } let labelStart = 0; return labels.map(label => { const labelRange = { start: labelStart, end: labelStart + label.length }; const result = matches .map(match => common_range/* Range */.e.intersect(labelRange, match)) .filter(range => !common_range/* Range */.e.isEmpty(range)) .map(({ start, end }) => ({ start: start - labelStart, end: end - labelStart })); labelStart = labelRange.end + separator.length; return result; }); } class LabelWithHighlights { constructor(container, supportIcons) { this.container = container; this.supportIcons = supportIcons; this.label = undefined; this.singleLabel = undefined; } setLabel(label, options) { if (this.label === label && (0,objects/* equals */.fS)(this.options, options)) { return; } this.label = label; this.options = options; if (typeof label === 'string') { if (!this.singleLabel) { this.container.innerText = ''; this.container.classList.remove('multiple'); this.singleLabel = new highlightedlabel_highlightedLabel/* HighlightedLabel */.q(dom/* append */.R3(this.container, dom.$('a.label-name', { id: options === null || options === void 0 ? void 0 : options.domId })), this.supportIcons); } this.singleLabel.set(label, options === null || options === void 0 ? void 0 : options.matches, undefined, options === null || options === void 0 ? void 0 : options.labelEscapeNewLines); } else { this.container.innerText = ''; this.container.classList.add('multiple'); this.singleLabel = undefined; const separator = (options === null || options === void 0 ? void 0 : options.separator) || '/'; const matches = splitMatches(label, separator, options === null || options === void 0 ? void 0 : options.matches); for (let i = 0; i < label.length; i++) { const l = label[i]; const m = matches ? matches[i] : undefined; const id = (options === null || options === void 0 ? void 0 : options.domId) && `${options === null || options === void 0 ? void 0 : options.domId}_${i}`; const name = dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }); const highlightedLabel = new highlightedlabel_highlightedLabel/* HighlightedLabel */.q(dom/* append */.R3(this.container, name), this.supportIcons); highlightedLabel.set(l, m, undefined, options === null || options === void 0 ? void 0 : options.labelEscapeNewLines); if (i < label.length - 1) { dom/* append */.R3(name, dom.$('span.label-separator', undefined, separator)); } } } } } /***/ }), /***/ 67069: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabels.js ***! \*********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ T: function() { return /* binding */ renderLabelWithIcons; } /* harmony export */ }); /* unused harmony export renderIcon */ /* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../dom.js */ 69454); /* harmony import */ var _common_codicons_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/codicons.js */ 52615); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const labelWithIconsRegex = new RegExp(`(\\\\)?\\$\\((${_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__/* .CSSIcon */ .dT.iconNameExpression}(?:${_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__/* .CSSIcon */ .dT.iconModifierExpression})?)\\)`, 'g'); function renderLabelWithIcons(text) { const elements = new Array(); let match; let textStart = 0, textStop = 0; while ((match = labelWithIconsRegex.exec(text)) !== null) { textStop = match.index || 0; elements.push(text.substring(textStart, textStop)); textStart = (match.index || 0) + match[0].length; const [, escaped, codicon] = match; elements.push(escaped ? `$(${codicon})` : renderIcon({ id: codicon })); } if (textStart < text.length) { elements.push(text.substring(textStart)); } return elements; } function renderIcon(icon) { const node = _dom_js__WEBPACK_IMPORTED_MODULE_0__.$(`span`); node.classList.add(..._common_codicons_js__WEBPACK_IMPORTED_MODULE_1__/* .CSSIcon */ .dT.asClassNameArray(icon)); return node; } /***/ }), /***/ 23280: /*!******************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.js + 3 modules ***! \******************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { p: function() { return /* binding */ HistoryInputBox; }, W: function() { return /* binding */ InputBox; } }); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dom.js var dom = __webpack_require__(69454); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/event.js var browser_event = __webpack_require__(8035); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/formattedTextRenderer.js var formattedTextRenderer = __webpack_require__(40575); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js var actionbar = __webpack_require__(21784); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/aria/aria.js + 1 modules var aria = __webpack_require__(96297); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js + 7 modules var scrollableElement = __webpack_require__(78265); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/widget.js var widget = __webpack_require__(62758); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/color.js var color = __webpack_require__(51737); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/event.js var common_event = __webpack_require__(4348); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/navigator.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class ArrayNavigator { constructor(items, start = 0, end = items.length, index = start - 1) { this.items = items; this.start = start; this.end = end; this.index = index; } current() { if (this.index === this.start - 1 || this.index === this.end) { return null; } return this.items[this.index]; } next() { this.index = Math.min(this.index + 1, this.end); return this.current(); } previous() { this.index = Math.max(this.index - 1, this.start - 1); return this.current(); } first() { this.index = this.start; return this.current(); } last() { this.index = this.end - 1; return this.current(); } } ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/history.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class HistoryNavigator { constructor(history = [], limit = 10) { this._initialize(history); this._limit = limit; this._onChange(); } getHistory() { return this._elements; } add(t) { this._history.delete(t); this._history.add(t); this._onChange(); } next() { if (this._currentPosition() !== this._elements.length - 1) { return this._navigator.next(); } return null; } previous() { if (this._currentPosition() !== 0) { return this._navigator.previous(); } return null; } current() { return this._navigator.current(); } first() { return this._navigator.first(); } last() { return this._navigator.last(); } has(t) { return this._history.has(t); } _onChange() { this._reduceToLimit(); const elements = this._elements; this._navigator = new ArrayNavigator(elements, 0, elements.length, elements.length); } _reduceToLimit() { const data = this._elements; if (data.length > this._limit) { this._initialize(data.slice(data.length - this._limit)); } } _currentPosition() { const currentElement = this._navigator.current(); if (!currentElement) { return -1; } return this._elements.indexOf(currentElement); } _initialize(history) { this._history = new Set(); for (const entry of history) { this._history.add(entry); } } get _elements() { const elements = []; this._history.forEach(e => elements.push(e)); return elements; } } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/objects.js var objects = __webpack_require__(80470); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.css // extracted by mini-css-extract-plugin // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/nls.js var nls = __webpack_require__(13268); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/inputbox/inputBox.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const $ = dom.$; const defaultOpts = { inputBackground: color/* Color */.Il.fromHex('#3C3C3C'), inputForeground: color/* Color */.Il.fromHex('#CCCCCC'), inputValidationInfoBorder: color/* Color */.Il.fromHex('#55AAFF'), inputValidationInfoBackground: color/* Color */.Il.fromHex('#063B49'), inputValidationWarningBorder: color/* Color */.Il.fromHex('#B89500'), inputValidationWarningBackground: color/* Color */.Il.fromHex('#352A05'), inputValidationErrorBorder: color/* Color */.Il.fromHex('#BE1100'), inputValidationErrorBackground: color/* Color */.Il.fromHex('#5A1D1D') }; class InputBox extends widget/* Widget */.$ { constructor(container, contextViewProvider, options) { var _a; super(); this.state = 'idle'; this.maxHeight = Number.POSITIVE_INFINITY; this._onDidChange = this._register(new common_event/* Emitter */.Q5()); this.onDidChange = this._onDidChange.event; this._onDidHeightChange = this._register(new common_event/* Emitter */.Q5()); this.onDidHeightChange = this._onDidHeightChange.event; this.contextViewProvider = contextViewProvider; this.options = options || Object.create(null); (0,objects/* mixin */.jB)(this.options, defaultOpts, false); this.message = null; this.placeholder = this.options.placeholder || ''; this.tooltip = (_a = this.options.tooltip) !== null && _a !== void 0 ? _a : (this.placeholder || ''); this.ariaLabel = this.options.ariaLabel || ''; this.inputBackground = this.options.inputBackground; this.inputForeground = this.options.inputForeground; this.inputBorder = this.options.inputBorder; this.inputValidationInfoBorder = this.options.inputValidationInfoBorder; this.inputValidationInfoBackground = this.options.inputValidationInfoBackground; this.inputValidationInfoForeground = this.options.inputValidationInfoForeground; this.inputValidationWarningBorder = this.options.inputValidationWarningBorder; this.inputValidationWarningBackground = this.options.inputValidationWarningBackground; this.inputValidationWarningForeground = this.options.inputValidationWarningForeground; this.inputValidationErrorBorder = this.options.inputValidationErrorBorder; this.inputValidationErrorBackground = this.options.inputValidationErrorBackground; this.inputValidationErrorForeground = this.options.inputValidationErrorForeground; if (this.options.validationOptions) { this.validation = this.options.validationOptions.validation; } this.element = dom/* append */.R3(container, $('.monaco-inputbox.idle')); let tagName = this.options.flexibleHeight ? 'textarea' : 'input'; let wrapper = dom/* append */.R3(this.element, $('.ibwrapper')); this.input = dom/* append */.R3(wrapper, $(tagName + '.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')); if (this.options.flexibleHeight) { this.maxHeight = typeof this.options.flexibleMaxHeight === 'number' ? this.options.flexibleMaxHeight : Number.POSITIVE_INFINITY; this.mirror = dom/* append */.R3(wrapper, $('div.mirror')); this.mirror.innerText = '\u00a0'; this.scrollableElement = new scrollableElement/* ScrollableElement */.NB(this.element, { vertical: 1 /* Auto */ }); if (this.options.flexibleWidth) { this.input.setAttribute('wrap', 'off'); this.mirror.style.whiteSpace = 'pre'; this.mirror.style.wordWrap = 'initial'; } dom/* append */.R3(container, this.scrollableElement.getDomNode()); this._register(this.scrollableElement); // from ScrollableElement to DOM this._register(this.scrollableElement.onScroll(e => this.input.scrollTop = e.scrollTop)); const onSelectionChange = this._register(new browser_event/* DomEmitter */.Y(document, 'selectionchange')); const onAnchoredSelectionChange = common_event/* Event */.ju.filter(onSelectionChange.event, () => { const selection = document.getSelection(); return (selection === null || selection === void 0 ? void 0 : selection.anchorNode) === wrapper; }); // from DOM to ScrollableElement this._register(onAnchoredSelectionChange(this.updateScrollDimensions, this)); this._register(this.onDidHeightChange(this.updateScrollDimensions, this)); } else { this.input.type = this.options.type || 'text'; this.input.setAttribute('wrap', 'off'); } if (this.ariaLabel) { this.input.setAttribute('aria-label', this.ariaLabel); } if (this.placeholder && !this.options.showPlaceholderOnFocus) { this.setPlaceHolder(this.placeholder); } if (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.ignoreGesture(this.input); setTimeout(() => this.updateMirror(), 0); // Support actions if (this.options.actions) { this.actionbar = this._register(new actionbar/* ActionBar */.o(this.element)); this.actionbar.push(this.options.actions, { icon: true, label: false }); } this.applyStyles(); } onBlur() { this._hideMessage(); if (this.options.showPlaceholderOnFocus) { this.input.setAttribute('placeholder', ''); } } onFocus() { this._showMessage(); if (this.options.showPlaceholderOnFocus) { this.input.setAttribute('placeholder', this.placeholder || ''); } } setPlaceHolder(placeHolder) { this.placeholder = placeHolder; this.input.setAttribute('placeholder', placeHolder); } setTooltip(tooltip) { this.tooltip = tooltip; this.input.title = tooltip; } setAriaLabel(label) { this.ariaLabel = label; if (label) { this.input.setAttribute('aria-label', this.ariaLabel); } else { this.input.removeAttribute('aria-label'); } } getAriaLabel() { return this.ariaLabel; } get inputElement() { return this.input; } get value() { return this.input.value; } set value(newValue) { if (this.input.value !== newValue) { this.input.value = newValue; this.onValueChange(); } } get height() { return typeof this.cachedHeight === 'number' ? this.cachedHeight : dom/* getTotalHeight */.wn(this.element); } focus() { this.input.focus(); } blur() { this.input.blur(); } hasFocus() { return document.activeElement === this.input; } select(range = null) { this.input.select(); if (range) { this.input.setSelectionRange(range.start, range.end); if (range.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 = true; this._hideMessage(); } get width() { return dom/* getTotalWidth */.w(this.input); } set width(width) { if (this.options.flexibleHeight && this.options.flexibleWidth) { // textarea with horizontal scrolling let horizontalPadding = 0; if (this.mirror) { const paddingLeft = parseFloat(this.mirror.style.paddingLeft || '') || 0; const paddingRight = parseFloat(this.mirror.style.paddingRight || '') || 0; horizontalPadding = paddingLeft + paddingRight; } this.input.style.width = (width - horizontalPadding) + 'px'; } else { this.input.style.width = width + 'px'; } if (this.mirror) { this.mirror.style.width = width + 'px'; } } set paddingRight(paddingRight) { if (this.options.flexibleHeight && this.options.flexibleWidth) { this.input.style.width = `calc(100% - ${paddingRight}px)`; } else { this.input.style.paddingRight = paddingRight + 'px'; } if (this.mirror) { this.mirror.style.paddingRight = paddingRight + 'px'; } } updateScrollDimensions() { if (typeof this.cachedContentHeight !== 'number' || typeof this.cachedHeight !== 'number' || !this.scrollableElement) { return; } const scrollHeight = this.cachedContentHeight; const height = this.cachedHeight; const scrollTop = this.input.scrollTop; this.scrollableElement.setScrollDimensions({ scrollHeight, height }); this.scrollableElement.setScrollPosition({ scrollTop }); } showMessage(message, force) { this.message = message; 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(message.type)); const styles = this.stylesForType(this.message.type); this.element.style.border = styles.border ? `1px solid ${styles.border}` : ''; if (this.hasFocus() || force) { 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 errorMsg = null; if (this.validation) { errorMsg = this.validation(this.value); if (errorMsg) { this.inputElement.setAttribute('aria-invalid', 'true'); this.showMessage(errorMsg); } else if (this.inputElement.hasAttribute('aria-invalid')) { this.inputElement.removeAttribute('aria-invalid'); this.hideMessage(); } } return errorMsg === null || errorMsg === void 0 ? void 0 : errorMsg.type; } stylesForType(type) { switch (type) { case 1 /* INFO */: return { border: this.inputValidationInfoBorder, background: this.inputValidationInfoBackground, foreground: this.inputValidationInfoForeground }; case 2 /* WARNING */: return { border: this.inputValidationWarningBorder, background: this.inputValidationWarningBackground, foreground: this.inputValidationWarningForeground }; default: return { border: this.inputValidationErrorBorder, background: this.inputValidationErrorBackground, foreground: this.inputValidationErrorForeground }; } } classForType(type) { switch (type) { case 1 /* INFO */: return 'info'; case 2 /* WARNING */: return 'warning'; default: return 'error'; } } _showMessage() { if (!this.contextViewProvider || !this.message) { return; } let div; let layout = () => div.style.width = dom/* getTotalWidth */.w(this.element) + 'px'; this.contextViewProvider.showContextView({ getAnchor: () => this.element, anchorAlignment: 1 /* RIGHT */, render: (container) => { if (!this.message) { return null; } div = dom/* append */.R3(container, $('.monaco-inputbox-container')); layout(); const renderOptions = { inline: true, className: 'monaco-inputbox-message' }; const spanElement = (this.message.formatContent ? (0,formattedTextRenderer/* renderFormattedText */.BO)(this.message.content, renderOptions) : (0,formattedTextRenderer/* renderText */.IY)(this.message.content, renderOptions)); spanElement.classList.add(this.classForType(this.message.type)); const styles = this.stylesForType(this.message.type); spanElement.style.backgroundColor = styles.background ? styles.background.toString() : ''; spanElement.style.color = styles.foreground ? styles.foreground.toString() : ''; spanElement.style.border = styles.border ? `1px solid ${styles.border}` : ''; dom/* append */.R3(div, spanElement); return null; }, onHide: () => { this.state = 'closed'; }, layout: layout }); // ARIA Support let alertText; if (this.message.type === 3 /* ERROR */) { alertText = nls/* localize */.N('alertErrorMessage', "Error: {0}", this.message.content); } else if (this.message.type === 2 /* WARNING */) { alertText = nls/* localize */.N('alertWarningMessage', "Warning: {0}", this.message.content); } else { alertText = nls/* localize */.N('alertInfoMessage', "Info: {0}", this.message.content); } aria/* alert */.Z9(alertText); this.state = 'open'; } _hideMessage() { if (!this.contextViewProvider) { return; } if (this.state === 'open') { this.contextViewProvider.hideContextView(); } this.state = 'idle'; } onValueChange() { this._onDidChange.fire(this.value); this.validate(); this.updateMirror(); this.input.classList.toggle('empty', !this.value); if (this.state === 'open' && this.contextViewProvider) { this.contextViewProvider.layout(); } } updateMirror() { if (!this.mirror) { return; } const value = this.value; const lastCharCode = value.charCodeAt(value.length - 1); const suffix = lastCharCode === 10 ? ' ' : ''; const mirrorTextContent = (value + suffix) .replace(/\u000c/g, ''); // Don't measure with the form feed character, which messes up sizing if (mirrorTextContent) { this.mirror.textContent = value + suffix; } else { this.mirror.innerText = '\u00a0'; } this.layout(); } style(styles) { this.inputBackground = styles.inputBackground; this.inputForeground = styles.inputForeground; this.inputBorder = styles.inputBorder; this.inputValidationInfoBackground = styles.inputValidationInfoBackground; this.inputValidationInfoForeground = styles.inputValidationInfoForeground; this.inputValidationInfoBorder = styles.inputValidationInfoBorder; this.inputValidationWarningBackground = styles.inputValidationWarningBackground; this.inputValidationWarningForeground = styles.inputValidationWarningForeground; this.inputValidationWarningBorder = styles.inputValidationWarningBorder; this.inputValidationErrorBackground = styles.inputValidationErrorBackground; this.inputValidationErrorForeground = styles.inputValidationErrorForeground; this.inputValidationErrorBorder = styles.inputValidationErrorBorder; this.applyStyles(); } applyStyles() { const background = this.inputBackground ? this.inputBackground.toString() : ''; const foreground = this.inputForeground ? this.inputForeground.toString() : ''; const border = this.inputBorder ? this.inputBorder.toString() : ''; this.element.style.backgroundColor = background; this.element.style.color = foreground; this.input.style.backgroundColor = 'inherit'; this.input.style.color = foreground; this.element.style.borderWidth = border ? '1px' : ''; this.element.style.borderStyle = border ? 'solid' : ''; this.element.style.borderColor = border; } layout() { if (!this.mirror) { return; } const previousHeight = this.cachedContentHeight; this.cachedContentHeight = dom/* getTotalHeight */.wn(this.mirror); if (previousHeight !== this.cachedContentHeight) { this.cachedHeight = Math.min(this.cachedContentHeight, this.maxHeight); this.input.style.height = this.cachedHeight + 'px'; this._onDidHeightChange.fire(this.cachedContentHeight); } } insertAtCursor(text) { const inputElement = this.inputElement; const start = inputElement.selectionStart; const end = inputElement.selectionEnd; const content = inputElement.value; if (start !== null && end !== null) { this.value = content.substr(0, start) + text + content.substr(end); inputElement.setSelectionRange(start + 1, start + 1); this.layout(); } } dispose() { this._hideMessage(); this.message = null; if (this.actionbar) { this.actionbar.dispose(); } super.dispose(); } } class HistoryInputBox extends InputBox { constructor(container, contextViewProvider, options) { const NLS_PLACEHOLDER_HISTORY_HINT = nls/* localize */.N({ key: 'history.inputbox.hint', comment: ['Text will be prefixed with \u21C5 plus a single space, then used as a hint where input field keeps history'] }, "for history"); const NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX = ` or \u21C5 ${NLS_PLACEHOLDER_HISTORY_HINT}`; const NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_IN_PARENS = ` (\u21C5 ${NLS_PLACEHOLDER_HISTORY_HINT})`; super(container, contextViewProvider, options); this.history = new HistoryNavigator(options.history, 100); // Function to append the history suffix to the placeholder if necessary const addSuffix = () => { if (options.showHistoryHint && options.showHistoryHint() && !this.placeholder.endsWith(NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX) && !this.placeholder.endsWith(NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_IN_PARENS) && this.history.getHistory().length) { const suffix = this.placeholder.endsWith(')') ? NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX : NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_IN_PARENS; const suffixedPlaceholder = this.placeholder + suffix; if (options.showPlaceholderOnFocus && document.activeElement !== this.input) { this.placeholder = suffixedPlaceholder; } else { this.setPlaceHolder(suffixedPlaceholder); } } }; // Spot the change to the textarea class attribute which occurs when it changes between non-empty and empty, // and add the history suffix to the placeholder if not yet present this.observer = new MutationObserver((mutationList, observer) => { mutationList.forEach((mutation) => { if (!mutation.target.textContent) { addSuffix(); } }); }); this.observer.observe(this.input, { attributeFilter: ['class'] }); this.onfocus(this.input, () => addSuffix()); this.onblur(this.input, () => { const resetPlaceholder = (historyHint) => { if (!this.placeholder.endsWith(historyHint)) { return false; } else { const revertedPlaceholder = this.placeholder.slice(0, this.placeholder.length - historyHint.length); if (options.showPlaceholderOnFocus) { this.placeholder = revertedPlaceholder; } else { this.setPlaceHolder(revertedPlaceholder); } return true; } }; if (!resetPlaceholder(NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX_IN_PARENS)) { resetPlaceholder(NLS_PLACEHOLDER_HISTORY_HINT_SUFFIX); } }); } dispose() { super.dispose(); if (this.observer) { this.observer.disconnect(); this.observer = undefined; } } addToHistory() { if (this.value && this.value !== this.getCurrentValue()) { this.history.add(this.value); } } showNextValue() { if (!this.history.has(this.value)) { this.addToHistory(); } let next = this.getNextValue(); if (next) { next = next === this.value ? this.getNextValue() : next; } if (next) { this.value = next; aria/* status */.i7(this.value); } } showPreviousValue() { if (!this.history.has(this.value)) { this.addToHistory(); } let previous = this.getPreviousValue(); if (previous) { previous = previous === this.value ? this.getPreviousValue() : previous; } if (previous) { this.value = previous; aria/* status */.i7(this.value); } } getCurrentValue() { let currentValue = this.history.current(); if (!currentValue) { currentValue = this.history.last(); this.history.next(); } return currentValue; } getPreviousValue() { return this.history.previous() || this.history.first(); } getNextValue() { return this.history.next() || this.history.last(); } } /***/ }), /***/ 15674: /*!**************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/list/listView.js + 2 modules ***! \**************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { kX: function() { return /* binding */ ElementsDragAndDropData; }, Bv: function() { return /* binding */ ListView; } }); // UNUSED EXPORTS: ExternalElementsDragAndDropData, NativeDragAndDropData // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/browser.js var browser = __webpack_require__(87783); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dnd.js var dnd = __webpack_require__(84282); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dom.js var dom = __webpack_require__(69454); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/event.js var browser_event = __webpack_require__(8035); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/touch.js var touch = __webpack_require__(60537); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js + 7 modules var scrollableElement = __webpack_require__(78265); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/arrays.js var arrays = __webpack_require__(43506); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/async.js var common_async = __webpack_require__(50431); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/decorators.js var decorators = __webpack_require__(85402); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/event.js var common_event = __webpack_require__(4348); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/lifecycle.js var lifecycle = __webpack_require__(69323); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/objects.js var objects = __webpack_require__(80470); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/range.js var common_range = __webpack_require__(17981); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/scrollable.js var scrollable = __webpack_require__(28962); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/list/rangeMap.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** * Returns the intersection between a ranged group and a range. * Returns `[]` if the intersection is empty. */ function groupIntersect(range, groups) { const result = []; for (let r of groups) { if (range.start >= r.range.end) { continue; } if (range.end < r.range.start) { break; } const intersection = common_range/* Range */.e.intersect(range, r.range); if (common_range/* Range */.e.isEmpty(intersection)) { continue; } result.push({ range: intersection, size: r.size }); } return result; } /** * Shifts a range by that `much`. */ function shift({ start, end }, much) { return { start: start + much, end: end + much }; } /** * Consolidates a collection of ranged groups. * * Consolidation is the process of merging consecutive ranged groups * that share the same `size`. */ function consolidate(groups) { const result = []; let previousGroup = null; for (let group of groups) { const start = group.range.start; const end = group.range.end; const size = group.size; if (previousGroup && size === previousGroup.size) { previousGroup.range.end = end; continue; } previousGroup = { range: { start, end }, size }; result.push(previousGroup); } return result; } /** * Concatenates several collections of ranged groups into a single * collection. */ function concat(...groups) { return consolidate(groups.reduce((r, g) => r.concat(g), [])); } class RangeMap { constructor() { this.groups = []; this._size = 0; } splice(index, deleteCount, items = []) { const diff = items.length - deleteCount; const before = groupIntersect({ start: 0, end: index }, this.groups); const after = groupIntersect({ start: index + deleteCount, end: Number.POSITIVE_INFINITY }, this.groups) .map(g => ({ range: shift(g.range, diff), size: g.size })); const middle = items.map((item, i) => ({ range: { start: index + i, end: index + i + 1 }, size: item.size })); this.groups = concat(before, middle, after); this._size = this.groups.reduce((t, g) => t + (g.size * (g.range.end - g.range.start)), 0); } /** * Returns the number of items in the range map. */ get count() { const len = this.groups.length; if (!len) { return 0; } return this.groups[len - 1].range.end; } /** * Returns the sum of the sizes of all items in the range map. */ get size() { return this._size; } /** * Returns the index of the item at the given position. */ indexAt(position) { if (position < 0) { return -1; } let index = 0; let size = 0; for (let group of this.groups) { const count = group.range.end - group.range.start; const newSize = size + (count * group.size); if (position < newSize) { return index + Math.floor((position - size) / group.size); } index += count; size = newSize; } return index; } /** * Returns the index of the item right after the item at the * index of the given position. */ indexAfter(position) { return Math.min(this.indexAt(position) + 1, this.count); } /** * Returns the start position of the item at the given index. */ positionAt(index) { if (index < 0) { return -1; } let position = 0; let count = 0; for (let group of this.groups) { const groupCount = group.range.end - group.range.start; const newCount = count + groupCount; if (index < newCount) { return position + ((index - count) * group.size); } position += groupCount * group.size; count = newCount; } return -1; } } ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/list/rowCache.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function removeFromParent(element) { try { if (element.parentElement) { element.parentElement.removeChild(element); } } catch (e) { // this will throw if this happens due to a blur event, nasty business } } class RowCache { constructor(renderers) { this.renderers = renderers; this.cache = new Map(); } /** * Returns a row either by creating a new one or reusing * a previously released row which shares the same templateId. */ alloc(templateId) { let result = this.getTemplateCache(templateId).pop(); if (!result) { const domNode = (0,dom.$)('.monaco-list-row'); const renderer = this.getRenderer(templateId); const templateData = renderer.renderTemplate(domNode); result = { domNode, templateId, templateData }; } return result; } /** * Releases the row for eventual reuse. */ release(row) { if (!row) { return; } this.releaseRow(row); } releaseRow(row) { const { domNode, templateId } = row; if (domNode) { domNode.classList.remove('scrolling'); removeFromParent(domNode); } const cache = this.getTemplateCache(templateId); cache.push(row); } getTemplateCache(templateId) { let result = this.cache.get(templateId); if (!result) { result = []; this.cache.set(templateId, result); } return result; } dispose() { this.cache.forEach((cachedRows, templateId) => { for (const cachedRow of cachedRows) { const renderer = this.getRenderer(templateId); renderer.disposeTemplate(cachedRow.templateData); cachedRow.templateData = null; } }); this.cache.clear(); } getRenderer(templateId) { const renderer = this.renderers.get(templateId); if (!renderer) { throw new Error(`No renderer found for ${templateId}`); } return renderer; } } ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/list/listView.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; const DefaultOptions = { useShadows: true, verticalScrollMode: 1 /* Auto */, setRowLineHeight: true, setRowHeight: true, supportDynamicHeights: false, dnd: { getDragElements(e) { return [e]; }, getDragURI() { return null; }, onDragStart() { }, onDragOver() { return false; }, drop() { } }, horizontalScrolling: false, transformOptimization: true, alwaysConsumeMouseWheel: true, }; class ElementsDragAndDropData { constructor(elements) { this.elements = elements; } update() { } getData() { return this.elements; } } class ExternalElementsDragAndDropData { constructor(elements) { this.elements = elements; } update() { } getData() { return this.elements; } } class NativeDragAndDropData { constructor() { this.types = []; this.files = []; } update(dataTransfer) { if (dataTransfer.types) { this.types.splice(0, this.types.length, ...dataTransfer.types); } if (dataTransfer.files) { this.files.splice(0, this.files.length); for (let i = 0; i < dataTransfer.files.length; i++) { const file = dataTransfer.files.item(i); if (file && (file.size || file.type)) { this.files.push(file); } } } } getData() { return { types: this.types, files: this.files }; } } function equalsDragFeedback(f1, f2) { if (Array.isArray(f1) && Array.isArray(f2)) { return (0,arrays/* equals */.fS)(f1, f2); } return f1 === f2; } class ListViewAccessibilityProvider { constructor(accessibilityProvider) { if (accessibilityProvider === null || accessibilityProvider === void 0 ? void 0 : accessibilityProvider.getSetSize) { this.getSetSize = accessibilityProvider.getSetSize.bind(accessibilityProvider); } else { this.getSetSize = (e, i, l) => l; } if (accessibilityProvider === null || accessibilityProvider === void 0 ? void 0 : accessibilityProvider.getPosInSet) { this.getPosInSet = accessibilityProvider.getPosInSet.bind(accessibilityProvider); } else { this.getPosInSet = (e, i) => i + 1; } if (accessibilityProvider === null || accessibilityProvider === void 0 ? void 0 : accessibilityProvider.getRole) { this.getRole = accessibilityProvider.getRole.bind(accessibilityProvider); } else { this.getRole = _ => 'listitem'; } if (accessibilityProvider === null || accessibilityProvider === void 0 ? void 0 : accessibilityProvider.isChecked) { this.isChecked = accessibilityProvider.isChecked.bind(accessibilityProvider); } else { this.isChecked = _ => undefined; } } } class ListView { constructor(container, virtualDelegate, renderers, options = DefaultOptions) { this.virtualDelegate = virtualDelegate; this.domId = `list_id_${++ListView.InstanceCount}`; this.renderers = new Map(); this.renderWidth = 0; this._scrollHeight = 0; this.scrollableElementUpdateDisposable = null; this.scrollableElementWidthDelayer = new common_async/* Delayer */.vp(50); this.splicing = false; this.dragOverAnimationStopDisposable = lifecycle/* Disposable */.JT.None; this.dragOverMouseY = 0; this.canDrop = false; this.currentDragFeedbackDisposable = lifecycle/* Disposable */.JT.None; this.onDragLeaveTimeout = lifecycle/* Disposable */.JT.None; this.disposables = new lifecycle/* DisposableStore */.SL(); this._onDidChangeContentHeight = new common_event/* Emitter */.Q5(); this._horizontalScrolling = false; if (options.horizontalScrolling && options.supportDynamicHeights) { throw new Error('Horizontal scrolling and dynamic heights not supported simultaneously'); } this.items = []; this.itemId = 0; this.rangeMap = new RangeMap(); for (const renderer of renderers) { this.renderers.set(renderer.templateId, renderer); } this.cache = this.disposables.add(new RowCache(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', typeof options.mouseSupport === 'boolean' ? options.mouseSupport : true); this._horizontalScrolling = (0,objects/* getOrDefault */.CJ)(options, o => o.horizontalScrolling, DefaultOptions.horizontalScrolling); this.domNode.classList.toggle('horizontal-scrolling', this._horizontalScrolling); this.additionalScrollHeight = typeof options.additionalScrollHeight === 'undefined' ? 0 : options.additionalScrollHeight; this.accessibilityProvider = new ListViewAccessibilityProvider(options.accessibilityProvider); this.rowsContainer = document.createElement('div'); this.rowsContainer.className = 'monaco-list-rows'; const transformOptimization = (0,objects/* getOrDefault */.CJ)(options, o => o.transformOptimization, DefaultOptions.transformOptimization); if (transformOptimization) { this.rowsContainer.style.transform = 'translate3d(0px, 0px, 0px)'; } this.disposables.add(touch/* Gesture */.o.addTarget(this.rowsContainer)); this.scrollable = new scrollable/* Scrollable */.Rm((0,objects/* getOrDefault */.CJ)(options, o => o.smoothScrolling, false) ? 125 : 0, cb => (0,dom/* scheduleAtNextAnimationFrame */.jL)(cb)); this.scrollableElement = this.disposables.add(new scrollableElement/* SmoothScrollableElement */.$Z(this.rowsContainer, { alwaysConsumeMouseWheel: (0,objects/* getOrDefault */.CJ)(options, o => o.alwaysConsumeMouseWheel, DefaultOptions.alwaysConsumeMouseWheel), horizontal: 1 /* Auto */, vertical: (0,objects/* getOrDefault */.CJ)(options, o => o.verticalScrollMode, DefaultOptions.verticalScrollMode), useShadows: (0,objects/* getOrDefault */.CJ)(options, o => o.useShadows, DefaultOptions.useShadows), mouseWheelScrollSensitivity: options.mouseWheelScrollSensitivity, fastScrollSensitivity: options.fastScrollSensitivity }, this.scrollable)); this.domNode.appendChild(this.scrollableElement.getDomNode()); container.appendChild(this.domNode); this.scrollableElement.onScroll(this.onScroll, this, this.disposables); this.disposables.add((0,dom/* addDisposableListener */.nm)(this.rowsContainer, touch/* EventType */.t.Change, e => this.onTouchChange(e))); // Prevent the monaco-scrollable-element from scrolling // https://github.com/microsoft/vscode/issues/44181 this.disposables.add((0,dom/* addDisposableListener */.nm)(this.scrollableElement.getDomNode(), 'scroll', e => e.target.scrollTop = 0)); this.disposables.add((0,dom/* addDisposableListener */.nm)(this.domNode, 'dragover', e => this.onDragOver(this.toDragEvent(e)))); this.disposables.add((0,dom/* addDisposableListener */.nm)(this.domNode, 'drop', e => this.onDrop(this.toDragEvent(e)))); this.disposables.add((0,dom/* addDisposableListener */.nm)(this.domNode, 'dragleave', e => this.onDragLeave(this.toDragEvent(e)))); this.disposables.add((0,dom/* addDisposableListener */.nm)(this.domNode, 'dragend', e => this.onDragEnd(e))); this.setRowLineHeight = (0,objects/* getOrDefault */.CJ)(options, o => o.setRowLineHeight, DefaultOptions.setRowLineHeight); this.setRowHeight = (0,objects/* getOrDefault */.CJ)(options, o => o.setRowHeight, DefaultOptions.setRowHeight); this.supportDynamicHeights = (0,objects/* getOrDefault */.CJ)(options, o => o.supportDynamicHeights, DefaultOptions.supportDynamicHeights); this.dnd = (0,objects/* getOrDefault */.CJ)(options, o => o.dnd, DefaultOptions.dnd); this.layout(); } get contentHeight() { return this.rangeMap.size; } get horizontalScrolling() { return this._horizontalScrolling; } set horizontalScrolling(value) { if (value === this._horizontalScrolling) { return; } if (value && this.supportDynamicHeights) { throw new Error('Horizontal scrolling and dynamic heights not supported simultaneously'); } this._horizontalScrolling = value; this.domNode.classList.toggle('horizontal-scrolling', this._horizontalScrolling); if (this._horizontalScrolling) { for (const item of this.items) { this.measureItemWidth(item); } this.updateScrollWidth(); this.scrollableElement.setScrollDimensions({ width: (0,dom/* getContentWidth */.FK)(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 = ''; } } updateOptions(options) { if (options.additionalScrollHeight !== undefined) { this.additionalScrollHeight = options.additionalScrollHeight; this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }); } if (options.smoothScrolling !== undefined) { this.scrollable.setSmoothScrollDuration(options.smoothScrolling ? 125 : 0); } if (options.horizontalScrolling !== undefined) { this.horizontalScrolling = options.horizontalScrolling; } if (options.mouseWheelScrollSensitivity !== undefined) { this.scrollableElement.updateOptions({ mouseWheelScrollSensitivity: options.mouseWheelScrollSensitivity }); } if (options.fastScrollSensitivity !== undefined) { this.scrollableElement.updateOptions({ fastScrollSensitivity: options.fastScrollSensitivity }); } } splice(start, deleteCount, elements = []) { if (this.splicing) { throw new Error('Can\'t run recursive splices.'); } this.splicing = true; try { return this._splice(start, deleteCount, elements); } finally { this.splicing = false; this._onDidChangeContentHeight.fire(this.contentHeight); } } _splice(start, deleteCount, elements = []) { const previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight); const deleteRange = { start, end: start + deleteCount }; const removeRange = common_range/* Range */.e.intersect(previousRenderRange, deleteRange); // try to reuse rows, avoid removing them from DOM const rowsToDispose = new Map(); for (let i = removeRange.start; i < removeRange.end; i++) { const item = this.items[i]; item.dragStartDisposable.dispose(); if (item.row) { let rows = rowsToDispose.get(item.templateId); if (!rows) { rows = []; rowsToDispose.set(item.templateId, rows); } const renderer = this.renderers.get(item.templateId); if (renderer && renderer.disposeElement) { renderer.disposeElement(item.element, i, item.row.templateData, item.size); } rows.push(item.row); } item.row = null; } const previousRestRange = { start: start + deleteCount, end: this.items.length }; const previousRenderedRestRange = common_range/* Range */.e.intersect(previousRestRange, previousRenderRange); const previousUnrenderedRestRanges = common_range/* Range */.e.relativeComplement(previousRestRange, previousRenderRange); const inserted = elements.map(element => ({ id: String(this.itemId++), element, templateId: this.virtualDelegate.getTemplateId(element), size: this.virtualDelegate.getHeight(element), width: undefined, hasDynamicHeight: !!this.virtualDelegate.hasDynamicHeight && this.virtualDelegate.hasDynamicHeight(element), lastDynamicHeightWidth: undefined, row: null, uri: undefined, dropTarget: false, dragStartDisposable: lifecycle/* Disposable */.JT.None })); let deleted; // TODO@joao: improve this optimization to catch even more cases if (start === 0 && deleteCount >= this.items.length) { this.rangeMap = new RangeMap(); this.rangeMap.splice(0, 0, inserted); deleted = this.items; this.items = inserted; } else { this.rangeMap.splice(start, deleteCount, inserted); deleted = this.items.splice(start, deleteCount, ...inserted); } const delta = elements.length - deleteCount; const renderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight); const renderedRestRange = shift(previousRenderedRestRange, delta); const updateRange = common_range/* Range */.e.intersect(renderRange, renderedRestRange); for (let i = updateRange.start; i < updateRange.end; i++) { this.updateItemInDOM(this.items[i], i); } const removeRanges = common_range/* Range */.e.relativeComplement(renderedRestRange, renderRange); for (const range of removeRanges) { for (let i = range.start; i < range.end; i++) { this.removeItemFromDOM(i); } } const unrenderedRestRanges = previousUnrenderedRestRanges.map(r => shift(r, delta)); const elementsRange = { start, end: start + elements.length }; const insertRanges = [elementsRange, ...unrenderedRestRanges].map(r => common_range/* Range */.e.intersect(renderRange, r)); const beforeElement = this.getNextToLastElement(insertRanges); for (const range of insertRanges) { for (let i = range.start; i < range.end; i++) { const item = this.items[i]; const rows = rowsToDispose.get(item.templateId); const row = rows === null || rows === void 0 ? void 0 : rows.pop(); this.insertItemInDOM(i, beforeElement, row); } } for (const rows of rowsToDispose.values()) { for (const row of rows) { this.cache.release(row); } } this.eventuallyUpdateScrollDimensions(); if (this.supportDynamicHeights) { this._rerender(this.scrollTop, this.renderHeight); } return deleted.map(i => i.element); } eventuallyUpdateScrollDimensions() { this._scrollHeight = this.contentHeight; this.rowsContainer.style.height = `${this._scrollHeight}px`; if (!this.scrollableElementUpdateDisposable) { this.scrollableElementUpdateDisposable = (0,dom/* scheduleAtNextAnimationFrame */.jL)(() => { this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }); this.updateScrollWidth(); this.scrollableElementUpdateDisposable = null; }); } } eventuallyUpdateScrollWidth() { if (!this.horizontalScrolling) { this.scrollableElementWidthDelayer.cancel(); return; } this.scrollableElementWidthDelayer.trigger(() => this.updateScrollWidth()); } updateScrollWidth() { if (!this.horizontalScrolling) { return; } let scrollWidth = 0; for (const item of this.items) { if (typeof item.width !== 'undefined') { scrollWidth = Math.max(scrollWidth, item.width); } } this.scrollWidth = scrollWidth; this.scrollableElement.setScrollDimensions({ scrollWidth: scrollWidth === 0 ? 0 : (scrollWidth + 10) }); } rerender() { if (!this.supportDynamicHeights) { return; } for (const item of this.items) { item.lastDynamicHeightWidth = undefined; } this._rerender(this.lastRenderTop, this.lastRenderHeight); } get length() { return this.items.length; } get renderHeight() { const scrollDimensions = this.scrollableElement.getScrollDimensions(); return scrollDimensions.height; } element(index) { return this.items[index].element; } domElement(index) { const row = this.items[index].row; return row && row.domNode; } elementHeight(index) { return this.items[index].size; } elementTop(index) { return this.rangeMap.positionAt(index); } indexAt(position) { return this.rangeMap.indexAt(position); } indexAfter(position) { return this.rangeMap.indexAfter(position); } layout(height, width) { let scrollDimensions = { height: typeof height === 'number' ? height : (0,dom/* getContentHeight */.If)(this.domNode) }; if (this.scrollableElementUpdateDisposable) { this.scrollableElementUpdateDisposable.dispose(); this.scrollableElementUpdateDisposable = null; scrollDimensions.scrollHeight = this.scrollHeight; } this.scrollableElement.setScrollDimensions(scrollDimensions); if (typeof width !== 'undefined') { this.renderWidth = width; if (this.supportDynamicHeights) { this._rerender(this.scrollTop, this.renderHeight); } } if (this.horizontalScrolling) { this.scrollableElement.setScrollDimensions({ width: typeof width === 'number' ? width : (0,dom/* getContentWidth */.FK)(this.domNode) }); } } // Render render(previousRenderRange, renderTop, renderHeight, renderLeft, scrollWidth, updateItemsInDOM = false) { const renderRange = this.getRenderRange(renderTop, renderHeight); const rangesToInsert = common_range/* Range */.e.relativeComplement(renderRange, previousRenderRange); const rangesToRemove = common_range/* Range */.e.relativeComplement(previousRenderRange, renderRange); const beforeElement = this.getNextToLastElement(rangesToInsert); if (updateItemsInDOM) { const rangesToUpdate = common_range/* Range */.e.intersect(previousRenderRange, renderRange); for (let i = rangesToUpdate.start; i < rangesToUpdate.end; i++) { this.updateItemInDOM(this.items[i], i); } } for (const range of rangesToInsert) { for (let i = range.start; i < range.end; i++) { this.insertItemInDOM(i, beforeElement); } } for (const range of rangesToRemove) { for (let i = range.start; i < range.end; i++) { this.removeItemFromDOM(i); } } if (renderLeft !== undefined) { this.rowsContainer.style.left = `-${renderLeft}px`; } this.rowsContainer.style.top = `-${renderTop}px`; if (this.horizontalScrolling && scrollWidth !== undefined) { this.rowsContainer.style.width = `${Math.max(scrollWidth, this.renderWidth)}px`; } this.lastRenderTop = renderTop; this.lastRenderHeight = renderHeight; } // DOM operations insertItemInDOM(index, beforeElement, row) { const item = this.items[index]; if (!item.row) { item.row = row !== null && row !== void 0 ? row : this.cache.alloc(item.templateId); } const role = this.accessibilityProvider.getRole(item.element) || 'listitem'; item.row.domNode.setAttribute('role', role); const checked = this.accessibilityProvider.isChecked(item.element); if (typeof checked !== 'undefined') { item.row.domNode.setAttribute('aria-checked', String(!!checked)); } if (!item.row.domNode.parentElement) { if (beforeElement) { this.rowsContainer.insertBefore(item.row.domNode, beforeElement); } else { this.rowsContainer.appendChild(item.row.domNode); } } this.updateItemInDOM(item, index); const renderer = this.renderers.get(item.templateId); if (!renderer) { throw new Error(`No renderer found for template id ${item.templateId}`); } if (renderer) { renderer.renderElement(item.element, index, item.row.templateData, item.size); } const uri = this.dnd.getDragURI(item.element); item.dragStartDisposable.dispose(); item.row.domNode.draggable = !!uri; if (uri) { item.dragStartDisposable = (0,dom/* addDisposableListener */.nm)(item.row.domNode, 'dragstart', event => this.onDragStart(item.element, uri, event)); } if (this.horizontalScrolling) { this.measureItemWidth(item); this.eventuallyUpdateScrollWidth(); } } measureItemWidth(item) { if (!item.row || !item.row.domNode) { return; } item.row.domNode.style.width = browser/* isFirefox */.vU ? '-moz-fit-content' : 'fit-content'; item.width = (0,dom/* getContentWidth */.FK)(item.row.domNode); const style = window.getComputedStyle(item.row.domNode); if (style.paddingLeft) { item.width += parseFloat(style.paddingLeft); } if (style.paddingRight) { item.width += parseFloat(style.paddingRight); } item.row.domNode.style.width = ''; } updateItemInDOM(item, index) { item.row.domNode.style.top = `${this.elementTop(index)}px`; if (this.setRowHeight) { item.row.domNode.style.height = `${item.size}px`; } if (this.setRowLineHeight) { item.row.domNode.style.lineHeight = `${item.size}px`; } item.row.domNode.setAttribute('data-index', `${index}`); item.row.domNode.setAttribute('data-last-element', index === this.length - 1 ? 'true' : 'false'); item.row.domNode.setAttribute('data-parity', index % 2 === 0 ? 'even' : 'odd'); item.row.domNode.setAttribute('aria-setsize', String(this.accessibilityProvider.getSetSize(item.element, index, this.length))); item.row.domNode.setAttribute('aria-posinset', String(this.accessibilityProvider.getPosInSet(item.element, index))); item.row.domNode.setAttribute('id', this.getElementDomId(index)); item.row.domNode.classList.toggle('drop-target', item.dropTarget); } removeItemFromDOM(index) { const item = this.items[index]; item.dragStartDisposable.dispose(); if (item.row) { const renderer = this.renderers.get(item.templateId); if (renderer && renderer.disposeElement) { renderer.disposeElement(item.element, index, item.row.templateData, item.size); } this.cache.release(item.row); item.row = null; } if (this.horizontalScrolling) { this.eventuallyUpdateScrollWidth(); } } getScrollTop() { const scrollPosition = this.scrollableElement.getScrollPosition(); return scrollPosition.scrollTop; } setScrollTop(scrollTop, reuseAnimation) { if (this.scrollableElementUpdateDisposable) { this.scrollableElementUpdateDisposable.dispose(); this.scrollableElementUpdateDisposable = null; this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }); } this.scrollableElement.setScrollPosition({ scrollTop, reuseAnimation }); } get scrollTop() { return this.getScrollTop(); } set scrollTop(scrollTop) { this.setScrollTop(scrollTop); } get scrollHeight() { return this._scrollHeight + (this.horizontalScrolling ? 10 : 0) + this.additionalScrollHeight; } // Events get onMouseClick() { return common_event/* Event */.ju.map(this.disposables.add(new browser_event/* DomEmitter */.Y(this.domNode, 'click')).event, e => this.toMouseEvent(e)); } get onMouseDblClick() { return common_event/* Event */.ju.map(this.disposables.add(new browser_event/* DomEmitter */.Y(this.domNode, 'dblclick')).event, e => this.toMouseEvent(e)); } get onMouseMiddleClick() { return common_event/* Event */.ju.filter(common_event/* Event */.ju.map(this.disposables.add(new browser_event/* DomEmitter */.Y(this.domNode, 'auxclick')).event, e => this.toMouseEvent(e)), e => e.browserEvent.button === 1); } get onMouseDown() { return common_event/* Event */.ju.map(this.disposables.add(new browser_event/* DomEmitter */.Y(this.domNode, 'mousedown')).event, e => this.toMouseEvent(e)); } get onContextMenu() { return common_event/* Event */.ju.any(common_event/* Event */.ju.map(this.disposables.add(new browser_event/* DomEmitter */.Y(this.domNode, 'contextmenu')).event, e => this.toMouseEvent(e)), common_event/* Event */.ju.map(this.disposables.add(new browser_event/* DomEmitter */.Y(this.domNode, touch/* EventType */.t.Contextmenu)).event, e => this.toGestureEvent(e))); } get onTouchStart() { return common_event/* Event */.ju.map(this.disposables.add(new browser_event/* DomEmitter */.Y(this.domNode, 'touchstart')).event, e => this.toTouchEvent(e)); } get onTap() { return common_event/* Event */.ju.map(this.disposables.add(new browser_event/* DomEmitter */.Y(this.rowsContainer, touch/* EventType */.t.Tap)).event, e => this.toGestureEvent(e)); } toMouseEvent(browserEvent) { const index = this.getItemIndexFromEventTarget(browserEvent.target || null); const item = typeof index === 'undefined' ? undefined : this.items[index]; const element = item && item.element; return { browserEvent, index, element }; } toTouchEvent(browserEvent) { const index = this.getItemIndexFromEventTarget(browserEvent.target || null); const item = typeof index === 'undefined' ? undefined : this.items[index]; const element = item && item.element; return { browserEvent, index, element }; } toGestureEvent(browserEvent) { const index = this.getItemIndexFromEventTarget(browserEvent.initialTarget || null); const item = typeof index === 'undefined' ? undefined : this.items[index]; const element = item && item.element; return { browserEvent, index, element }; } toDragEvent(browserEvent) { const index = this.getItemIndexFromEventTarget(browserEvent.target || null); const item = typeof index === 'undefined' ? undefined : this.items[index]; const element = item && item.element; return { browserEvent, index, element }; } onScroll(e) { try { const previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight); this.render(previousRenderRange, e.scrollTop, e.height, e.scrollLeft, e.scrollWidth); if (this.supportDynamicHeights) { this._rerender(e.scrollTop, e.height, e.inSmoothScrolling); } } catch (err) { console.error('Got bad scroll event:', e); throw err; } } onTouchChange(event) { event.preventDefault(); event.stopPropagation(); this.scrollTop -= event.translationY; } // DND onDragStart(element, uri, event) { if (!event.dataTransfer) { return; } const elements = this.dnd.getDragElements(element); event.dataTransfer.effectAllowed = 'copyMove'; event.dataTransfer.setData(dnd/* DataTransfers */.go.TEXT, uri); if (event.dataTransfer.setDragImage) { let label; if (this.dnd.getDragLabel) { label = this.dnd.getDragLabel(elements, event); } if (typeof label === 'undefined') { label = String(elements.length); } const dragImage = (0,dom.$)('.monaco-drag-image'); dragImage.textContent = label; document.body.appendChild(dragImage); event.dataTransfer.setDragImage(dragImage, -10, -10); setTimeout(() => document.body.removeChild(dragImage), 0); } this.currentDragData = new ElementsDragAndDropData(elements); dnd/* StaticDND */.P$.CurrentDragAndDropData = new ExternalElementsDragAndDropData(elements); if (this.dnd.onDragStart) { this.dnd.onDragStart(this.currentDragData, event); } } onDragOver(event) { event.browserEvent.preventDefault(); // needed so that the drop event fires (https://stackoverflow.com/questions/21339924/drop-event-not-firing-in-chrome) this.onDragLeaveTimeout.dispose(); if (dnd/* StaticDND */.P$.CurrentDragAndDropData && dnd/* StaticDND */.P$.CurrentDragAndDropData.getData() === 'vscode-ui') { return false; } this.setupDragAndDropScrollTopAnimation(event.browserEvent); if (!event.browserEvent.dataTransfer) { return false; } // Drag over from outside if (!this.currentDragData) { if (dnd/* StaticDND */.P$.CurrentDragAndDropData) { // Drag over from another list this.currentDragData = dnd/* StaticDND */.P$.CurrentDragAndDropData; } else { // Drag over from the desktop if (!event.browserEvent.dataTransfer.types) { return false; } this.currentDragData = new NativeDragAndDropData(); } } const result = this.dnd.onDragOver(this.currentDragData, event.element, event.index, event.browserEvent); this.canDrop = typeof result === 'boolean' ? result : result.accept; if (!this.canDrop) { this.currentDragFeedback = undefined; this.currentDragFeedbackDisposable.dispose(); return false; } event.browserEvent.dataTransfer.dropEffect = (typeof result !== 'boolean' && result.effect === 0 /* Copy */) ? 'copy' : 'move'; let feedback; if (typeof result !== 'boolean' && result.feedback) { feedback = result.feedback; } else { if (typeof event.index === 'undefined') { feedback = [-1]; } else { feedback = [event.index]; } } // sanitize feedback list feedback = (0,arrays/* distinct */.EB)(feedback).filter(i => i >= -1 && i < this.length).sort((a, b) => a - b); feedback = feedback[0] === -1 ? [-1] : feedback; if (equalsDragFeedback(this.currentDragFeedback, feedback)) { return true; } this.currentDragFeedback = feedback; this.currentDragFeedbackDisposable.dispose(); if (feedback[0] === -1) { // entire list feedback this.domNode.classList.add('drop-target'); this.rowsContainer.classList.add('drop-target'); this.currentDragFeedbackDisposable = (0,lifecycle/* toDisposable */.OF)(() => { this.domNode.classList.remove('drop-target'); this.rowsContainer.classList.remove('drop-target'); }); } else { for (const index of feedback) { const item = this.items[index]; item.dropTarget = true; if (item.row) { item.row.domNode.classList.add('drop-target'); } } this.currentDragFeedbackDisposable = (0,lifecycle/* toDisposable */.OF)(() => { for (const index of feedback) { const item = this.items[index]; item.dropTarget = false; if (item.row) { item.row.domNode.classList.remove('drop-target'); } } }); } return true; } onDragLeave(event) { var _a, _b; this.onDragLeaveTimeout.dispose(); this.onDragLeaveTimeout = (0,common_async/* disposableTimeout */.Vg)(() => this.clearDragOverFeedback(), 100); if (this.currentDragData) { (_b = (_a = this.dnd).onDragLeave) === null || _b === void 0 ? void 0 : _b.call(_a, this.currentDragData, event.element, event.index, event.browserEvent); } } onDrop(event) { if (!this.canDrop) { return; } const dragData = this.currentDragData; this.teardownDragAndDropScrollTopAnimation(); this.clearDragOverFeedback(); this.currentDragData = undefined; dnd/* StaticDND */.P$.CurrentDragAndDropData = undefined; if (!dragData || !event.browserEvent.dataTransfer) { return; } event.browserEvent.preventDefault(); dragData.update(event.browserEvent.dataTransfer); this.dnd.drop(dragData, event.element, event.index, event.browserEvent); } onDragEnd(event) { this.canDrop = false; this.teardownDragAndDropScrollTopAnimation(); this.clearDragOverFeedback(); this.currentDragData = undefined; dnd/* StaticDND */.P$.CurrentDragAndDropData = undefined; if (this.dnd.onDragEnd) { this.dnd.onDragEnd(event); } } clearDragOverFeedback() { this.currentDragFeedback = undefined; this.currentDragFeedbackDisposable.dispose(); this.currentDragFeedbackDisposable = lifecycle/* Disposable */.JT.None; } // DND scroll top animation setupDragAndDropScrollTopAnimation(event) { if (!this.dragOverAnimationDisposable) { const viewTop = (0,dom/* getTopLeftOffset */.xQ)(this.domNode).top; this.dragOverAnimationDisposable = (0,dom/* animate */.jt)(this.animateDragAndDropScrollTop.bind(this, viewTop)); } this.dragOverAnimationStopDisposable.dispose(); this.dragOverAnimationStopDisposable = (0,common_async/* disposableTimeout */.Vg)(() => { if (this.dragOverAnimationDisposable) { this.dragOverAnimationDisposable.dispose(); this.dragOverAnimationDisposable = undefined; } }, 1000); this.dragOverMouseY = event.pageY; } animateDragAndDropScrollTop(viewTop) { if (this.dragOverMouseY === undefined) { return; } const diff = this.dragOverMouseY - viewTop; const upperLimit = this.renderHeight - 35; if (diff < 35) { this.scrollTop += Math.max(-14, Math.floor(0.3 * (diff - 35))); } else if (diff > upperLimit) { this.scrollTop += Math.min(14, Math.floor(0.3 * (diff - upperLimit))); } } teardownDragAndDropScrollTopAnimation() { this.dragOverAnimationStopDisposable.dispose(); if (this.dragOverAnimationDisposable) { this.dragOverAnimationDisposable.dispose(); this.dragOverAnimationDisposable = undefined; } } // Util getItemIndexFromEventTarget(target) { const scrollableElement = this.scrollableElement.getDomNode(); let element = target; while (element instanceof HTMLElement && element !== this.rowsContainer && scrollableElement.contains(element)) { const rawIndex = element.getAttribute('data-index'); if (rawIndex) { const index = Number(rawIndex); if (!isNaN(index)) { return index; } } element = element.parentElement; } return undefined; } getRenderRange(renderTop, renderHeight) { return { start: this.rangeMap.indexAt(renderTop), end: this.rangeMap.indexAfter(renderTop + renderHeight - 1) }; } /** * Given a stable rendered state, checks every rendered element whether it needs * to be probed for dynamic height. Adjusts scroll height and top if necessary. */ _rerender(renderTop, renderHeight, inSmoothScrolling) { const previousRenderRange = this.getRenderRange(renderTop, renderHeight); // Let's remember the second element's position, this helps in scrolling up // and preserving a linear upwards scroll movement let anchorElementIndex; let anchorElementTopDelta; if (renderTop === this.elementTop(previousRenderRange.start)) { anchorElementIndex = previousRenderRange.start; anchorElementTopDelta = 0; } else if (previousRenderRange.end - previousRenderRange.start > 1) { anchorElementIndex = previousRenderRange.start + 1; anchorElementTopDelta = this.elementTop(anchorElementIndex) - renderTop; } let heightDiff = 0; while (true) { const renderRange = this.getRenderRange(renderTop, renderHeight); let didChange = false; for (let i = renderRange.start; i < renderRange.end; i++) { const diff = this.probeDynamicHeight(i); if (diff !== 0) { this.rangeMap.splice(i, 1, [this.items[i]]); } heightDiff += diff; didChange = didChange || diff !== 0; } if (!didChange) { if (heightDiff !== 0) { this.eventuallyUpdateScrollDimensions(); } const unrenderRanges = common_range/* Range */.e.relativeComplement(previousRenderRange, renderRange); for (const range of unrenderRanges) { for (let i = range.start; i < range.end; i++) { if (this.items[i].row) { this.removeItemFromDOM(i); } } } const renderRanges = common_range/* Range */.e.relativeComplement(renderRange, previousRenderRange); for (const range of renderRanges) { for (let i = range.start; i < range.end; i++) { const afterIndex = i + 1; const beforeRow = afterIndex < this.items.length ? this.items[afterIndex].row : null; const beforeElement = beforeRow ? beforeRow.domNode : null; this.insertItemInDOM(i, beforeElement); } } for (let i = renderRange.start; i < renderRange.end; i++) { if (this.items[i].row) { this.updateItemInDOM(this.items[i], i); } } if (typeof anchorElementIndex === 'number') { // To compute a destination scroll top, we need to take into account the current smooth scrolling // animation, and then reuse it with a new target (to avoid prolonging the scroll) // See https://github.com/microsoft/vscode/issues/104144 // See https://github.com/microsoft/vscode/pull/104284 // See https://github.com/microsoft/vscode/issues/107704 const deltaScrollTop = this.scrollable.getFutureScrollPosition().scrollTop - renderTop; const newScrollTop = this.elementTop(anchorElementIndex) - anchorElementTopDelta + deltaScrollTop; this.setScrollTop(newScrollTop, inSmoothScrolling); } this._onDidChangeContentHeight.fire(this.contentHeight); return; } } } probeDynamicHeight(index) { const item = this.items[index]; if (!!this.virtualDelegate.getDynamicHeight) { const newSize = this.virtualDelegate.getDynamicHeight(item.element); if (newSize !== null) { const size = item.size; item.size = newSize; item.lastDynamicHeightWidth = this.renderWidth; return newSize - size; } } if (!item.hasDynamicHeight || item.lastDynamicHeightWidth === this.renderWidth) { return 0; } if (!!this.virtualDelegate.hasDynamicHeight && !this.virtualDelegate.hasDynamicHeight(item.element)) { return 0; } const size = item.size; if (!this.setRowHeight && item.row) { let newSize = item.row.domNode.offsetHeight; item.size = newSize; item.lastDynamicHeightWidth = this.renderWidth; return newSize - size; } const row = this.cache.alloc(item.templateId); row.domNode.style.height = ''; this.rowsContainer.appendChild(row.domNode); const renderer = this.renderers.get(item.templateId); if (renderer) { renderer.renderElement(item.element, index, row.templateData, undefined); if (renderer.disposeElement) { renderer.disposeElement(item.element, index, row.templateData, undefined); } } item.size = row.domNode.offsetHeight; if (this.virtualDelegate.setDynamicHeight) { this.virtualDelegate.setDynamicHeight(item.element, item.size); } item.lastDynamicHeightWidth = this.renderWidth; this.rowsContainer.removeChild(row.domNode); this.cache.release(row); return item.size - size; } getNextToLastElement(ranges) { const lastRange = ranges[ranges.length - 1]; if (!lastRange) { return null; } const nextToLastItem = this.items[lastRange.end]; if (!nextToLastItem) { return null; } if (!nextToLastItem.row) { return null; } return nextToLastItem.row.domNode; } getElementDomId(index) { return `${this.domId}_${index}`; } // Dispose dispose() { if (this.items) { for (const item of this.items) { if (item.row) { const renderer = this.renderers.get(item.row.templateId); if (renderer) { if (renderer.disposeElement) { renderer.disposeElement(item.element, -1, item.row.templateData, undefined); } renderer.disposeTemplate(item.row.templateData); } } } this.items = []; } if (this.domNode && this.domNode.parentNode) { this.domNode.parentNode.removeChild(this.domNode); } (0,lifecycle/* dispose */.B9)(this.disposables); } } ListView.InstanceCount = 0; __decorate([ decorators/* memoize */.H ], ListView.prototype, "onMouseClick", null); __decorate([ decorators/* memoize */.H ], ListView.prototype, "onMouseDblClick", null); __decorate([ decorators/* memoize */.H ], ListView.prototype, "onMouseMiddleClick", null); __decorate([ decorators/* memoize */.H ], ListView.prototype, "onMouseDown", null); __decorate([ decorators/* memoize */.H ], ListView.prototype, "onContextMenu", null); __decorate([ decorators/* memoize */.H ], ListView.prototype, "onTouchStart", null); __decorate([ decorators/* memoize */.H ], ListView.prototype, "onTap", null); /***/ }), /***/ 62685: /*!****************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/list/listWidget.js + 2 modules ***! \****************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { WK: function() { return /* binding */ DefaultKeyboardNavigationDelegate; }, wD: function() { return /* binding */ DefaultStyleController; }, aV: function() { return /* binding */ List; }, sx: function() { return /* binding */ MouseController; }, cK: function() { return /* binding */ isInputElement; }, hD: function() { return /* binding */ isMonacoEditor; }, wn: function() { return /* binding */ isSelectionRangeChangeEvent; }, Zo: function() { return /* binding */ isSelectionSingleChangeEvent; } }); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dom.js var dom = __webpack_require__(69454); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/event.js var browser_event = __webpack_require__(8035); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/keyboardEvent.js var keyboardEvent = __webpack_require__(92813); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/touch.js var touch = __webpack_require__(60537); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/aria/aria.js + 1 modules var aria = __webpack_require__(96297); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/list/splice.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class CombinedSpliceable { constructor(spliceables) { this.spliceables = spliceables; } splice(start, deleteCount, elements) { this.spliceables.forEach(s => s.splice(start, deleteCount, elements)); } } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/arrays.js var arrays = __webpack_require__(43506); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/async.js var common_async = __webpack_require__(50431); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/color.js var color = __webpack_require__(51737); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/decorators.js var decorators = __webpack_require__(85402); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/event.js var common_event = __webpack_require__(4348); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/filters.js var filters = __webpack_require__(99599); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/lifecycle.js var lifecycle = __webpack_require__(69323); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/numbers.js var numbers = __webpack_require__(56722); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/objects.js var objects = __webpack_require__(80470); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/platform.js var platform = __webpack_require__(23345); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/types.js var types = __webpack_require__(72999); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/list/list.css var list = __webpack_require__(13833); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/list/list.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class ListError extends Error { constructor(user, message) { super(`ListError [${user}] ${message}`); } } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/list/listView.js + 2 modules var listView = __webpack_require__(15674); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/list/listWidget.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; class TraitRenderer { constructor(trait) { this.trait = trait; this.renderedElements = []; } get templateId() { return `template:${this.trait.trait}`; } renderTemplate(container) { return container; } renderElement(element, index, templateData) { const renderedElementIndex = this.renderedElements.findIndex(el => el.templateData === templateData); if (renderedElementIndex >= 0) { const rendered = this.renderedElements[renderedElementIndex]; this.trait.unrender(templateData); rendered.index = index; } else { const rendered = { index, templateData }; this.renderedElements.push(rendered); } this.trait.renderIndex(index, templateData); } splice(start, deleteCount, insertCount) { const rendered = []; for (const renderedElement of this.renderedElements) { if (renderedElement.index < start) { rendered.push(renderedElement); } else if (renderedElement.index >= start + deleteCount) { rendered.push({ index: renderedElement.index + insertCount - deleteCount, templateData: renderedElement.templateData }); } } this.renderedElements = rendered; } renderIndexes(indexes) { for (const { index, templateData } of this.renderedElements) { if (indexes.indexOf(index) > -1) { this.trait.renderIndex(index, templateData); } } } disposeTemplate(templateData) { const index = this.renderedElements.findIndex(el => el.templateData === templateData); if (index < 0) { return; } this.renderedElements.splice(index, 1); } } class Trait { constructor(_trait) { this._trait = _trait; this.length = 0; this.indexes = []; this.sortedIndexes = []; this._onChange = new common_event/* Emitter */.Q5(); this.onChange = this._onChange.event; } get trait() { return this._trait; } get renderer() { return new TraitRenderer(this); } splice(start, deleteCount, elements) { var _a; deleteCount = Math.max(0, Math.min(deleteCount, this.length - start)); const diff = elements.length - deleteCount; const end = start + deleteCount; const sortedIndexes = [ ...this.sortedIndexes.filter(i => i < start), ...elements.map((hasTrait, i) => hasTrait ? i + start : -1).filter(i => i !== -1), ...this.sortedIndexes.filter(i => i >= end).map(i => i + diff) ]; const length = this.length + diff; if (this.sortedIndexes.length > 0 && sortedIndexes.length === 0 && length > 0) { const first = (_a = this.sortedIndexes.find(index => index >= start)) !== null && _a !== void 0 ? _a : length - 1; sortedIndexes.push(Math.min(first, length - 1)); } this.renderer.splice(start, deleteCount, elements.length); this._set(sortedIndexes, sortedIndexes); this.length = length; } renderIndex(index, container) { container.classList.toggle(this._trait, this.contains(index)); } unrender(container) { container.classList.remove(this._trait); } /** * Sets the indexes which should have this trait. * * @param indexes Indexes which should have this trait. * @return The old indexes which had this trait. */ set(indexes, browserEvent) { return this._set(indexes, [...indexes].sort(numericSort), browserEvent); } _set(indexes, sortedIndexes, browserEvent) { const result = this.indexes; const sortedResult = this.sortedIndexes; this.indexes = indexes; this.sortedIndexes = sortedIndexes; const toRender = disjunction(sortedResult, indexes); this.renderer.renderIndexes(toRender); this._onChange.fire({ indexes, browserEvent }); return result; } get() { return this.indexes; } contains(index) { return (0,arrays/* binarySearch */.ry)(this.sortedIndexes, index, numericSort) >= 0; } dispose() { (0,lifecycle/* dispose */.B9)(this._onChange); } } __decorate([ decorators/* memoize */.H ], Trait.prototype, "renderer", null); class SelectionTrait extends Trait { constructor(setAriaSelected) { super('selected'); this.setAriaSelected = setAriaSelected; } renderIndex(index, container) { super.renderIndex(index, container); if (this.setAriaSelected) { if (this.contains(index)) { container.setAttribute('aria-selected', 'true'); } else { container.setAttribute('aria-selected', 'false'); } } } } /** * The TraitSpliceable is used as a util class to be able * to preserve traits across splice calls, given an identity * provider. */ class TraitSpliceable { constructor(trait, view, identityProvider) { this.trait = trait; this.view = view; this.identityProvider = identityProvider; } splice(start, deleteCount, elements) { if (!this.identityProvider) { return this.trait.splice(start, deleteCount, elements.map(() => false)); } const pastElementsWithTrait = this.trait.get().map(i => this.identityProvider.getId(this.view.element(i)).toString()); const elementsWithTrait = elements.map(e => pastElementsWithTrait.indexOf(this.identityProvider.getId(e).toString()) > -1); this.trait.splice(start, deleteCount, elementsWithTrait); } } function isInputElement(e) { return e.tagName === 'INPUT' || e.tagName === 'TEXTAREA'; } function isMonacoEditor(e) { if (e.classList.contains('monaco-editor')) { return true; } if (e.classList.contains('monaco-list')) { return false; } if (!e.parentElement) { return false; } return isMonacoEditor(e.parentElement); } class KeyboardController { constructor(list, view, options) { this.list = list; this.view = view; this.disposables = new lifecycle/* DisposableStore */.SL(); this.multipleSelectionDisposables = new lifecycle/* DisposableStore */.SL(); this.onKeyDown.filter(e => e.keyCode === 3 /* Enter */).on(this.onEnter, this, this.disposables); this.onKeyDown.filter(e => e.keyCode === 16 /* UpArrow */).on(this.onUpArrow, this, this.disposables); this.onKeyDown.filter(e => e.keyCode === 18 /* DownArrow */).on(this.onDownArrow, this, this.disposables); this.onKeyDown.filter(e => e.keyCode === 11 /* PageUp */).on(this.onPageUpArrow, this, this.disposables); this.onKeyDown.filter(e => e.keyCode === 12 /* PageDown */).on(this.onPageDownArrow, this, this.disposables); this.onKeyDown.filter(e => e.keyCode === 9 /* Escape */).on(this.onEscape, this, this.disposables); if (options.multipleSelectionSupport !== false) { this.onKeyDown.filter(e => (platform/* isMacintosh */.dz ? e.metaKey : e.ctrlKey) && e.keyCode === 31 /* KeyA */).on(this.onCtrlA, this, this.multipleSelectionDisposables); } } get onKeyDown() { return common_event/* Event */.ju.chain(this.disposables.add(new browser_event/* DomEmitter */.Y(this.view.domNode, 'keydown')).event) .filter(e => !isInputElement(e.target)) .map(e => new keyboardEvent/* StandardKeyboardEvent */.y(e)); } updateOptions(optionsUpdate) { if (optionsUpdate.multipleSelectionSupport !== undefined) { this.multipleSelectionDisposables.clear(); if (optionsUpdate.multipleSelectionSupport) { this.onKeyDown.filter(e => (platform/* isMacintosh */.dz ? e.metaKey : e.ctrlKey) && e.keyCode === 31 /* KeyA */).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, false, e.browserEvent); const el = this.list.getFocus()[0]; this.list.setAnchor(el); this.list.reveal(el); this.view.domNode.focus(); } onDownArrow(e) { e.preventDefault(); e.stopPropagation(); this.list.focusNext(1, false, e.browserEvent); const el = this.list.getFocus()[0]; this.list.setAnchor(el); this.list.reveal(el); this.view.domNode.focus(); } onPageUpArrow(e) { e.preventDefault(); e.stopPropagation(); this.list.focusPreviousPage(e.browserEvent); const el = this.list.getFocus()[0]; this.list.setAnchor(el); this.list.reveal(el); this.view.domNode.focus(); } onPageDownArrow(e) { e.preventDefault(); e.stopPropagation(); this.list.focusNextPage(e.browserEvent); const el = this.list.getFocus()[0]; this.list.setAnchor(el); this.list.reveal(el); this.view.domNode.focus(); } onCtrlA(e) { e.preventDefault(); e.stopPropagation(); this.list.setSelection((0,arrays/* range */.w6)(this.list.length), e.browserEvent); this.list.setAnchor(undefined); this.view.domNode.focus(); } onEscape(e) { if (this.list.getSelection().length) { e.preventDefault(); e.stopPropagation(); this.list.setSelection([], e.browserEvent); this.list.setAnchor(undefined); this.view.domNode.focus(); } } dispose() { this.disposables.dispose(); this.multipleSelectionDisposables.dispose(); } } __decorate([ decorators/* memoize */.H ], KeyboardController.prototype, "onKeyDown", null); var TypeLabelControllerState; (function (TypeLabelControllerState) { TypeLabelControllerState[TypeLabelControllerState["Idle"] = 0] = "Idle"; TypeLabelControllerState[TypeLabelControllerState["Typing"] = 1] = "Typing"; })(TypeLabelControllerState || (TypeLabelControllerState = {})); const DefaultKeyboardNavigationDelegate = new class { mightProducePrintableCharacter(event) { if (event.ctrlKey || event.metaKey || event.altKey) { return false; } return (event.keyCode >= 31 /* KeyA */ && event.keyCode <= 56 /* KeyZ */) || (event.keyCode >= 21 /* Digit0 */ && event.keyCode <= 30 /* Digit9 */) || (event.keyCode >= 93 /* Numpad0 */ && event.keyCode <= 102 /* Numpad9 */) || (event.keyCode >= 80 /* Semicolon */ && event.keyCode <= 90 /* Quote */); } }; class TypeLabelController { constructor(list, view, keyboardNavigationLabelProvider, delegate) { this.list = list; this.view = view; this.keyboardNavigationLabelProvider = keyboardNavigationLabelProvider; this.delegate = delegate; this.enabled = false; this.state = TypeLabelControllerState.Idle; this.automaticKeyboardNavigation = true; this.triggered = false; this.previouslyFocused = -1; this.enabledDisposables = new lifecycle/* DisposableStore */.SL(); this.disposables = new lifecycle/* DisposableStore */.SL(); this.updateOptions(list.options); } updateOptions(options) { const enableKeyboardNavigation = typeof options.enableKeyboardNavigation === 'undefined' ? true : !!options.enableKeyboardNavigation; if (enableKeyboardNavigation) { this.enable(); } else { this.disable(); } if (typeof options.automaticKeyboardNavigation !== 'undefined') { this.automaticKeyboardNavigation = options.automaticKeyboardNavigation; } } enable() { if (this.enabled) { return; } const onChar = common_event/* Event */.ju.chain(this.enabledDisposables.add(new browser_event/* DomEmitter */.Y(this.view.domNode, 'keydown')).event) .filter(e => !isInputElement(e.target)) .filter(() => this.automaticKeyboardNavigation || this.triggered) .map(event => new keyboardEvent/* StandardKeyboardEvent */.y(event)) .filter(e => this.delegate.mightProducePrintableCharacter(e)) .forEach(e => { e.stopPropagation(); e.preventDefault(); }) .map(event => event.browserEvent.key) .event; const onClear = common_event/* Event */.ju.debounce(onChar, () => null, 800); const onInput = common_event/* Event */.ju.reduce(common_event/* Event */.ju.any(onChar, onClear), (r, i) => i === null ? null : ((r || '') + i)); onInput(this.onInput, this, this.enabledDisposables); onClear(this.onClear, this, this.enabledDisposables); this.enabled = true; this.triggered = false; } disable() { if (!this.enabled) { return; } this.enabledDisposables.clear(); this.enabled = false; this.triggered = false; } onClear() { var _a; const focus = this.list.getFocus(); if (focus.length > 0 && focus[0] === this.previouslyFocused) { // List: re-announce element on typing end since typed keys will interrupt aria label of focused element // Do not announce if there was a focus change at the end to prevent duplication https://github.com/microsoft/vscode/issues/95961 const ariaLabel = (_a = this.list.options.accessibilityProvider) === null || _a === void 0 ? void 0 : _a.getAriaLabel(this.list.element(focus[0])); if (ariaLabel) { (0,aria/* alert */.Z9)(ariaLabel); } } this.previouslyFocused = -1; } onInput(word) { if (!word) { this.state = TypeLabelControllerState.Idle; this.triggered = false; return; } const focus = this.list.getFocus(); const start = focus.length > 0 ? focus[0] : 0; const delta = this.state === TypeLabelControllerState.Idle ? 1 : 0; this.state = TypeLabelControllerState.Typing; for (let i = 0; i < this.list.length; i++) { const index = (start + i + delta) % this.list.length; const label = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(index)); const labelStr = label && label.toString(); if (typeof labelStr === 'undefined' || (0,filters/* matchesPrefix */.Ji)(word, labelStr)) { this.previouslyFocused = start; this.list.setFocus([index]); this.list.reveal(index); return; } } } dispose() { this.disable(); this.enabledDisposables.dispose(); this.disposables.dispose(); } } class DOMFocusController { constructor(list, view) { this.list = list; this.view = view; this.disposables = new lifecycle/* DisposableStore */.SL(); const onKeyDown = common_event/* Event */.ju.chain(this.disposables.add(new browser_event/* DomEmitter */.Y(view.domNode, 'keydown')).event) .filter(e => !isInputElement(e.target)) .map(e => new keyboardEvent/* StandardKeyboardEvent */.y(e)); onKeyDown.filter(e => e.keyCode === 2 /* Tab */ && !e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey) .on(this.onTab, this, this.disposables); } onTab(e) { if (e.target !== this.view.domNode) { return; } const focus = this.list.getFocus(); if (focus.length === 0) { return; } const focusedDomElement = this.view.domElement(focus[0]); if (!focusedDomElement) { return; } const tabIndexElement = focusedDomElement.querySelector('[tabIndex]'); if (!tabIndexElement || !(tabIndexElement instanceof HTMLElement) || tabIndexElement.tabIndex === -1) { return; } const style = window.getComputedStyle(tabIndexElement); if (style.visibility === 'hidden' || style.display === 'none') { return; } e.preventDefault(); e.stopPropagation(); tabIndexElement.focus(); } dispose() { this.disposables.dispose(); } } function isSelectionSingleChangeEvent(event) { return platform/* isMacintosh */.dz ? event.browserEvent.metaKey : event.browserEvent.ctrlKey; } function isSelectionRangeChangeEvent(event) { return event.browserEvent.shiftKey; } function isMouseRightClick(event) { return event instanceof MouseEvent && event.button === 2; } const DefaultMultipleSelectionController = { isSelectionSingleChangeEvent, isSelectionRangeChangeEvent }; class MouseController { constructor(list) { this.list = list; this.disposables = new lifecycle/* DisposableStore */.SL(); this._onPointer = new common_event/* Emitter */.Q5(); this.onPointer = this._onPointer.event; if (list.options.multipleSelectionSupport !== false) { this.multipleSelectionController = this.list.options.multipleSelectionController || DefaultMultipleSelectionController; } this.mouseSupport = typeof list.options.mouseSupport === 'undefined' || !!list.options.mouseSupport; if (this.mouseSupport) { list.onMouseDown(this.onMouseDown, this, this.disposables); list.onContextMenu(this.onContextMenu, this, this.disposables); list.onMouseDblClick(this.onDoubleClick, this, this.disposables); list.onTouchStart(this.onMouseDown, this, this.disposables); this.disposables.add(touch/* Gesture */.o.addTarget(list.getHTMLElement())); } common_event/* Event */.ju.any(list.onMouseClick, list.onMouseMiddleClick, list.onTap)(this.onViewPointer, this, this.disposables); } updateOptions(optionsUpdate) { if (optionsUpdate.multipleSelectionSupport !== undefined) { this.multipleSelectionController = undefined; if (optionsUpdate.multipleSelectionSupport) { this.multipleSelectionController = this.list.options.multipleSelectionController || DefaultMultipleSelectionController; } } } isSelectionSingleChangeEvent(event) { if (!this.multipleSelectionController) { return false; } return this.multipleSelectionController.isSelectionSingleChangeEvent(event); } isSelectionRangeChangeEvent(event) { if (!this.multipleSelectionController) { return false; } return this.multipleSelectionController.isSelectionRangeChangeEvent(event); } isSelectionChangeEvent(event) { return this.isSelectionSingleChangeEvent(event) || this.isSelectionRangeChangeEvent(event); } onMouseDown(e) { if (isMonacoEditor(e.browserEvent.target)) { return; } if (document.activeElement !== e.browserEvent.target) { this.list.domFocus(); } } onContextMenu(e) { if (isMonacoEditor(e.browserEvent.target)) { return; } const focus = typeof e.index === 'undefined' ? [] : [e.index]; this.list.setFocus(focus, e.browserEvent); } onViewPointer(e) { if (!this.mouseSupport) { return; } if (isInputElement(e.browserEvent.target) || isMonacoEditor(e.browserEvent.target)) { return; } const focus = e.index; if (typeof focus === 'undefined') { this.list.setFocus([], e.browserEvent); this.list.setSelection([], e.browserEvent); this.list.setAnchor(undefined); return; } if (this.isSelectionRangeChangeEvent(e)) { return this.changeSelection(e); } if (this.isSelectionChangeEvent(e)) { return this.changeSelection(e); } this.list.setFocus([focus], e.browserEvent); this.list.setAnchor(focus); if (!isMouseRightClick(e.browserEvent)) { this.list.setSelection([focus], e.browserEvent); } this._onPointer.fire(e); } onDoubleClick(e) { if (isInputElement(e.browserEvent.target) || isMonacoEditor(e.browserEvent.target)) { return; } if (this.isSelectionChangeEvent(e)) { return; } const focus = this.list.getFocus(); this.list.setSelection(focus, e.browserEvent); } changeSelection(e) { const focus = e.index; let anchor = this.list.getAnchor(); if (this.isSelectionRangeChangeEvent(e)) { if (typeof anchor === 'undefined') { const currentFocus = this.list.getFocus()[0]; anchor = currentFocus !== null && currentFocus !== void 0 ? currentFocus : focus; this.list.setAnchor(anchor); } const min = Math.min(anchor, focus); const max = Math.max(anchor, focus); const rangeSelection = (0,arrays/* range */.w6)(min, max + 1); const selection = this.list.getSelection(); const contiguousRange = getContiguousRangeContaining(disjunction(selection, [anchor]), anchor); if (contiguousRange.length === 0) { return; } const newSelection = disjunction(rangeSelection, relativeComplement(selection, contiguousRange)); this.list.setSelection(newSelection, e.browserEvent); this.list.setFocus([focus], e.browserEvent); } else if (this.isSelectionSingleChangeEvent(e)) { const selection = this.list.getSelection(); const newSelection = selection.filter(i => i !== focus); this.list.setFocus([focus]); this.list.setAnchor(focus); if (selection.length === newSelection.length) { this.list.setSelection([...newSelection, focus], e.browserEvent); } else { this.list.setSelection(newSelection, e.browserEvent); } } } dispose() { this.disposables.dispose(); } } class DefaultStyleController { constructor(styleElement, selectorSuffix) { this.styleElement = styleElement; this.selectorSuffix = selectorSuffix; } style(styles) { const suffix = this.selectorSuffix && `.${this.selectorSuffix}`; const content = []; if (styles.listBackground) { if (styles.listBackground.isOpaque()) { content.push(`.monaco-list${suffix} .monaco-list-rows { background: ${styles.listBackground}; }`); } else if (!platform/* isMacintosh */.dz) { // subpixel AA doesn't exist in macOS console.warn(`List with id '${this.selectorSuffix}' was styled with a non-opaque background color. This will break sub-pixel antialiasing.`); } } if (styles.listFocusBackground) { content.push(`.monaco-list${suffix}:focus .monaco-list-row.focused { background-color: ${styles.listFocusBackground}; }`); content.push(`.monaco-list${suffix}:focus .monaco-list-row.focused:hover { background-color: ${styles.listFocusBackground}; }`); // overwrite :hover style in this case! } if (styles.listFocusForeground) { content.push(`.monaco-list${suffix}:focus .monaco-list-row.focused { color: ${styles.listFocusForeground}; }`); } if (styles.listActiveSelectionBackground) { content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected { background-color: ${styles.listActiveSelectionBackground}; }`); content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected:hover { background-color: ${styles.listActiveSelectionBackground}; }`); // overwrite :hover style in this case! } if (styles.listActiveSelectionForeground) { content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected { color: ${styles.listActiveSelectionForeground}; }`); } if (styles.listActiveSelectionIconForeground) { content.push(`.monaco-list${suffix}:focus .monaco-list-row.selected .codicon { color: ${styles.listActiveSelectionIconForeground}; }`); } if (styles.listFocusAndSelectionBackground) { content.push(` .monaco-drag-image, .monaco-list${suffix}:focus .monaco-list-row.selected.focused { background-color: ${styles.listFocusAndSelectionBackground}; } `); } if (styles.listFocusAndSelectionForeground) { content.push(` .monaco-drag-image, .monaco-list${suffix}:focus .monaco-list-row.selected.focused { color: ${styles.listFocusAndSelectionForeground}; } `); } if (styles.listInactiveFocusForeground) { content.push(`.monaco-list${suffix} .monaco-list-row.focused { color: ${styles.listInactiveFocusForeground}; }`); content.push(`.monaco-list${suffix} .monaco-list-row.focused:hover { color: ${styles.listInactiveFocusForeground}; }`); // overwrite :hover style in this case! } if (styles.listInactiveSelectionIconForeground) { content.push(`.monaco-list${suffix} .monaco-list-row.focused .codicon { color: ${styles.listInactiveSelectionIconForeground}; }`); } if (styles.listInactiveFocusBackground) { content.push(`.monaco-list${suffix} .monaco-list-row.focused { background-color: ${styles.listInactiveFocusBackground}; }`); content.push(`.monaco-list${suffix} .monaco-list-row.focused:hover { background-color: ${styles.listInactiveFocusBackground}; }`); // overwrite :hover style in this case! } if (styles.listInactiveSelectionBackground) { content.push(`.monaco-list${suffix} .monaco-list-row.selected { background-color: ${styles.listInactiveSelectionBackground}; }`); content.push(`.monaco-list${suffix} .monaco-list-row.selected:hover { background-color: ${styles.listInactiveSelectionBackground}; }`); // overwrite :hover style in this case! } if (styles.listInactiveSelectionForeground) { content.push(`.monaco-list${suffix} .monaco-list-row.selected { color: ${styles.listInactiveSelectionForeground}; }`); } if (styles.listHoverBackground) { content.push(`.monaco-list${suffix}:not(.drop-target) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${styles.listHoverBackground}; }`); } if (styles.listHoverForeground) { content.push(`.monaco-list${suffix} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${styles.listHoverForeground}; }`); } if (styles.listSelectionOutline) { content.push(`.monaco-list${suffix} .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; outline-offset: -1px; }`); } if (styles.listFocusOutline) { content.push(` .monaco-drag-image, .monaco-list${suffix}:focus .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; } `); } if (styles.listInactiveFocusOutline) { content.push(`.monaco-list${suffix} .monaco-list-row.focused { outline: 1px dotted ${styles.listInactiveFocusOutline}; outline-offset: -1px; }`); } if (styles.listHoverOutline) { content.push(`.monaco-list${suffix} .monaco-list-row:hover { outline: 1px dashed ${styles.listHoverOutline}; outline-offset: -1px; }`); } if (styles.listDropBackground) { content.push(` .monaco-list${suffix}.drop-target, .monaco-list${suffix} .monaco-list-rows.drop-target, .monaco-list${suffix} .monaco-list-row.drop-target { background-color: ${styles.listDropBackground} !important; color: inherit !important; } `); } if (styles.listFilterWidgetBackground) { content.push(`.monaco-list-type-filter { background-color: ${styles.listFilterWidgetBackground} }`); } if (styles.listFilterWidgetOutline) { content.push(`.monaco-list-type-filter { border: 1px solid ${styles.listFilterWidgetOutline}; }`); } if (styles.listFilterWidgetNoMatchesOutline) { content.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${styles.listFilterWidgetNoMatchesOutline}; }`); } if (styles.listMatchesShadow) { content.push(`.monaco-list-type-filter { box-shadow: 1px 1px 1px ${styles.listMatchesShadow}; }`); } if (styles.tableColumnsBorder) { content.push(` .monaco-table:hover > .monaco-split-view2, .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before { border-color: ${styles.tableColumnsBorder}; }`); } this.styleElement.textContent = content.join('\n'); } } const defaultStyles = { listFocusBackground: color/* Color */.Il.fromHex('#7FB0D0'), listActiveSelectionBackground: color/* Color */.Il.fromHex('#0E639C'), listActiveSelectionForeground: color/* Color */.Il.fromHex('#FFFFFF'), listActiveSelectionIconForeground: color/* Color */.Il.fromHex('#FFFFFF'), listFocusAndSelectionBackground: color/* Color */.Il.fromHex('#094771'), listFocusAndSelectionForeground: color/* Color */.Il.fromHex('#FFFFFF'), listInactiveSelectionBackground: color/* Color */.Il.fromHex('#3F3F46'), listInactiveSelectionIconForeground: color/* Color */.Il.fromHex('#FFFFFF'), listHoverBackground: color/* Color */.Il.fromHex('#2A2D2E'), listDropBackground: color/* Color */.Il.fromHex('#383B3D'), treeIndentGuidesStroke: color/* Color */.Il.fromHex('#a9a9a9'), tableColumnsBorder: color/* Color */.Il.fromHex('#cccccc').transparent(0.2) }; const DefaultOptions = { keyboardSupport: true, mouseSupport: true, multipleSelectionSupport: true, dnd: { getDragURI() { return null; }, onDragStart() { }, onDragOver() { return false; }, drop() { } } }; // TODO@Joao: move these utils into a SortedArray class function getContiguousRangeContaining(range, value) { const index = range.indexOf(value); if (index === -1) { return []; } const result = []; let i = index - 1; while (i >= 0 && range[i] === value - (index - i)) { result.push(range[i--]); } result.reverse(); i = index; while (i < range.length && range[i] === value + (i - index)) { result.push(range[i++]); } return result; } /** * Given two sorted collections of numbers, returns the intersection * between them (OR). */ function disjunction(one, other) { const result = []; let i = 0, j = 0; while (i < one.length || j < other.length) { if (i >= one.length) { result.push(other[j++]); } else if (j >= other.length) { result.push(one[i++]); } else if (one[i] === other[j]) { result.push(one[i]); i++; j++; continue; } else if (one[i] < other[j]) { result.push(one[i++]); } else { result.push(other[j++]); } } return result; } /** * Given two sorted collections of numbers, returns the relative * complement between them (XOR). */ function relativeComplement(one, other) { const result = []; let i = 0, j = 0; while (i < one.length || j < other.length) { if (i >= one.length) { result.push(other[j++]); } else if (j >= other.length) { result.push(one[i++]); } else if (one[i] === other[j]) { i++; j++; continue; } else if (one[i] < other[j]) { result.push(one[i++]); } else { j++; } } return result; } const numericSort = (a, b) => a - b; class PipelineRenderer { constructor(_templateId, renderers) { this._templateId = _templateId; this.renderers = renderers; } get templateId() { return this._templateId; } renderTemplate(container) { return this.renderers.map(r => r.renderTemplate(container)); } renderElement(element, index, templateData, height) { let i = 0; for (const renderer of this.renderers) { renderer.renderElement(element, index, templateData[i++], height); } } disposeElement(element, index, templateData, height) { let i = 0; for (const renderer of this.renderers) { if (renderer.disposeElement) { renderer.disposeElement(element, index, templateData[i], height); } i += 1; } } disposeTemplate(templateData) { let i = 0; for (const renderer of this.renderers) { renderer.disposeTemplate(templateData[i++]); } } } class AccessibiltyRenderer { constructor(accessibilityProvider) { this.accessibilityProvider = accessibilityProvider; this.templateId = 'a18n'; } renderTemplate(container) { return container; } renderElement(element, index, container) { const ariaLabel = this.accessibilityProvider.getAriaLabel(element); if (ariaLabel) { container.setAttribute('aria-label', ariaLabel); } else { container.removeAttribute('aria-label'); } const ariaLevel = this.accessibilityProvider.getAriaLevel && this.accessibilityProvider.getAriaLevel(element); if (typeof ariaLevel === 'number') { container.setAttribute('aria-level', `${ariaLevel}`); } else { container.removeAttribute('aria-level'); } } disposeTemplate(templateData) { // noop } } class ListViewDragAndDrop { constructor(list, dnd) { this.list = list; this.dnd = dnd; } getDragElements(element) { const selection = this.list.getSelectedElements(); const elements = selection.indexOf(element) > -1 ? selection : [element]; return elements; } getDragURI(element) { return this.dnd.getDragURI(element); } getDragLabel(elements, originalEvent) { if (this.dnd.getDragLabel) { return this.dnd.getDragLabel(elements, originalEvent); } return undefined; } onDragStart(data, originalEvent) { if (this.dnd.onDragStart) { this.dnd.onDragStart(data, originalEvent); } } onDragOver(data, targetElement, targetIndex, originalEvent) { return this.dnd.onDragOver(data, targetElement, targetIndex, originalEvent); } onDragLeave(data, targetElement, targetIndex, originalEvent) { var _a, _b; (_b = (_a = this.dnd).onDragLeave) === null || _b === void 0 ? void 0 : _b.call(_a, data, targetElement, targetIndex, originalEvent); } onDragEnd(originalEvent) { if (this.dnd.onDragEnd) { this.dnd.onDragEnd(originalEvent); } } drop(data, targetElement, targetIndex, originalEvent) { this.dnd.drop(data, targetElement, targetIndex, originalEvent); } } class List { constructor(user, container, virtualDelegate, renderers, _options = DefaultOptions) { var _a; this.user = user; this._options = _options; this.focus = new Trait('focused'); this.anchor = new Trait('anchor'); this.eventBufferer = new common_event/* EventBufferer */.E7(); this._ariaLabel = ''; this.disposables = new lifecycle/* DisposableStore */.SL(); this._onDidDispose = new common_event/* Emitter */.Q5(); this.onDidDispose = this._onDidDispose.event; const role = this._options.accessibilityProvider && this._options.accessibilityProvider.getWidgetRole ? (_a = this._options.accessibilityProvider) === null || _a === void 0 ? void 0 : _a.getWidgetRole() : 'list'; this.selection = new SelectionTrait(role !== 'listbox'); (0,objects/* mixin */.jB)(_options, defaultStyles, false); const baseRenderers = [this.focus.renderer, this.selection.renderer]; this.accessibilityProvider = _options.accessibilityProvider; if (this.accessibilityProvider) { baseRenderers.push(new AccessibiltyRenderer(this.accessibilityProvider)); if (this.accessibilityProvider.onDidChangeActiveDescendant) { this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant, this, this.disposables); } } renderers = renderers.map(r => new PipelineRenderer(r.templateId, [...baseRenderers, r])); const viewOptions = Object.assign(Object.assign({}, _options), { dnd: _options.dnd && new ListViewDragAndDrop(this, _options.dnd) }); this.view = new listView/* ListView */.Bv(container, virtualDelegate, renderers, viewOptions); this.view.domNode.setAttribute('role', role); if (_options.styleController) { this.styleController = _options.styleController(this.view.domId); } else { const styleElement = (0,dom/* createStyleSheet */.dS)(this.view.domNode); this.styleController = new DefaultStyleController(styleElement, this.view.domId); } this.spliceable = new CombinedSpliceable([ new TraitSpliceable(this.focus, this.view, _options.identityProvider), new TraitSpliceable(this.selection, this.view, _options.identityProvider), new TraitSpliceable(this.anchor, this.view, _options.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 DOMFocusController(this, this.view)); if (typeof _options.keyboardSupport !== 'boolean' || _options.keyboardSupport) { this.keyboardController = new KeyboardController(this, this.view, _options); this.disposables.add(this.keyboardController); } if (_options.keyboardNavigationLabelProvider) { const delegate = _options.keyboardNavigationDelegate || DefaultKeyboardNavigationDelegate; this.typeLabelController = new TypeLabelController(this, this.view, _options.keyboardNavigationLabelProvider, delegate); this.disposables.add(this.typeLabelController); } this.mouseController = this.createMouseController(_options); this.disposables.add(this.mouseController); this.onDidChangeFocus(this._onFocusChange, this, this.disposables); this.onDidChangeSelection(this._onSelectionChange, this, this.disposables); if (this.accessibilityProvider) { this.ariaLabel = this.accessibilityProvider.getWidgetAriaLabel(); } if (this._options.multipleSelectionSupport !== false) { this.view.domNode.setAttribute('aria-multiselectable', 'true'); } } get onDidChangeFocus() { return common_event/* Event */.ju.map(this.eventBufferer.wrapEvent(this.focus.onChange), e => this.toListEvent(e)); } get onDidChangeSelection() { return common_event/* Event */.ju.map(this.eventBufferer.wrapEvent(this.selection.onChange), e => this.toListEvent(e)); } 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 onTouchStart() { return this.view.onTouchStart; } get onTap() { return this.view.onTap; } /** * Possible context menu trigger events: * - ContextMenu key * - Shift F10 * - Ctrl Option Shift M (macOS with VoiceOver) * - Mouse right click */ get onContextMenu() { let didJustPressContextMenuKey = false; const fromKeyDown = common_event/* Event */.ju.chain(this.disposables.add(new browser_event/* DomEmitter */.Y(this.view.domNode, 'keydown')).event) .map(e => new keyboardEvent/* StandardKeyboardEvent */.y(e)) .filter(e => didJustPressContextMenuKey = e.keyCode === 58 /* ContextMenu */ || (e.shiftKey && e.keyCode === 68 /* F10 */)) .map(browser_event/* stopEvent */.p) .filter(() => false) .event; const fromKeyUp = common_event/* Event */.ju.chain(this.disposables.add(new browser_event/* DomEmitter */.Y(this.view.domNode, 'keyup')).event) .forEach(() => didJustPressContextMenuKey = false) .map(e => new keyboardEvent/* StandardKeyboardEvent */.y(e)) .filter(e => e.keyCode === 58 /* ContextMenu */ || (e.shiftKey && e.keyCode === 68 /* F10 */)) .map(browser_event/* stopEvent */.p) .map(({ browserEvent }) => { const focus = this.getFocus(); const index = focus.length ? focus[0] : undefined; const element = typeof index !== 'undefined' ? this.view.element(index) : undefined; const anchor = typeof index !== 'undefined' ? this.view.domElement(index) : this.view.domNode; return { index, element, anchor, browserEvent }; }) .event; const fromMouse = common_event/* Event */.ju.chain(this.view.onContextMenu) .filter(_ => !didJustPressContextMenuKey) .map(({ element, index, browserEvent }) => ({ element, index, anchor: { x: browserEvent.pageX + 1, y: browserEvent.pageY }, browserEvent })) .event; return common_event/* Event */.ju.any(fromKeyDown, fromKeyUp, fromMouse); } get onKeyDown() { return this.disposables.add(new browser_event/* DomEmitter */.Y(this.view.domNode, 'keydown')).event; } get onDidFocus() { return common_event/* Event */.ju.signal(this.disposables.add(new browser_event/* DomEmitter */.Y(this.view.domNode, 'focus', true)).event); } createMouseController(options) { return new MouseController(this); } updateOptions(optionsUpdate = {}) { var _a; this._options = Object.assign(Object.assign({}, this._options), optionsUpdate); if (this.typeLabelController) { this.typeLabelController.updateOptions(this._options); } if (this._options.multipleSelectionController !== undefined) { if (this._options.multipleSelectionSupport) { this.view.domNode.setAttribute('aria-multiselectable', 'true'); } else { this.view.domNode.removeAttribute('aria-multiselectable'); } } this.mouseController.updateOptions(optionsUpdate); (_a = this.keyboardController) === null || _a === void 0 ? void 0 : _a.updateOptions(optionsUpdate); this.view.updateOptions(optionsUpdate); } get options() { return this._options; } splice(start, deleteCount, elements = []) { if (start < 0 || start > this.view.length) { throw new ListError(this.user, `Invalid start index: ${start}`); } if (deleteCount < 0) { throw new ListError(this.user, `Invalid delete count: ${deleteCount}`); } if (deleteCount === 0 && elements.length === 0) { return; } this.eventBufferer.bufferEvents(() => this.spliceable.splice(start, deleteCount, elements)); } rerender() { this.view.rerender(); } element(index) { return this.view.element(index); } get length() { return this.view.length; } get contentHeight() { return this.view.contentHeight; } get scrollTop() { return this.view.getScrollTop(); } set scrollTop(scrollTop) { this.view.setScrollTop(scrollTop); } get ariaLabel() { return this._ariaLabel; } set ariaLabel(value) { this._ariaLabel = value; this.view.domNode.setAttribute('aria-label', value); } domFocus() { this.view.domNode.focus({ preventScroll: true }); } layout(height, width) { this.view.layout(height, width); } setSelection(indexes, browserEvent) { for (const index of indexes) { if (index < 0 || index >= this.length) { throw new ListError(this.user, `Invalid index ${index}`); } } this.selection.set(indexes, browserEvent); } getSelection() { return this.selection.get(); } getSelectedElements() { return this.getSelection().map(i => this.view.element(i)); } setAnchor(index) { if (typeof index === 'undefined') { this.anchor.set([]); return; } if (index < 0 || index >= this.length) { throw new ListError(this.user, `Invalid index ${index}`); } this.anchor.set([index]); } getAnchor() { return (0,arrays/* firstOrDefault */.Xh)(this.anchor.get(), undefined); } getAnchorElement() { const anchor = this.getAnchor(); return typeof anchor === 'undefined' ? undefined : this.element(anchor); } setFocus(indexes, browserEvent) { for (const index of indexes) { if (index < 0 || index >= this.length) { throw new ListError(this.user, `Invalid index ${index}`); } } this.focus.set(indexes, browserEvent); } focusNext(n = 1, loop = false, browserEvent, filter) { if (this.length === 0) { return; } const focus = this.focus.get(); const index = this.findNextIndex(focus.length > 0 ? focus[0] + n : 0, loop, filter); if (index > -1) { this.setFocus([index], browserEvent); } } focusPrevious(n = 1, loop = false, browserEvent, filter) { if (this.length === 0) { return; } const focus = this.focus.get(); const index = this.findPreviousIndex(focus.length > 0 ? focus[0] - n : 0, loop, filter); if (index > -1) { this.setFocus([index], browserEvent); } } focusNextPage(browserEvent, filter) { return __awaiter(this, void 0, void 0, function* () { let lastPageIndex = this.view.indexAt(this.view.getScrollTop() + this.view.renderHeight); lastPageIndex = lastPageIndex === 0 ? 0 : lastPageIndex - 1; const lastPageElement = this.view.element(lastPageIndex); const currentlyFocusedElement = this.getFocusedElements()[0]; if (currentlyFocusedElement !== lastPageElement) { const lastGoodPageIndex = this.findPreviousIndex(lastPageIndex, false, filter); if (lastGoodPageIndex > -1 && currentlyFocusedElement !== this.view.element(lastGoodPageIndex)) { this.setFocus([lastGoodPageIndex], browserEvent); } else { this.setFocus([lastPageIndex], browserEvent); } } else { const previousScrollTop = this.view.getScrollTop(); this.view.setScrollTop(previousScrollTop + this.view.renderHeight - this.view.elementHeight(lastPageIndex)); if (this.view.getScrollTop() !== previousScrollTop) { this.setFocus([]); // Let the scroll event listener run yield (0,common_async/* timeout */.Vs)(0); yield this.focusNextPage(browserEvent, filter); } } }); } focusPreviousPage(browserEvent, filter) { return __awaiter(this, void 0, void 0, function* () { let firstPageIndex; const scrollTop = this.view.getScrollTop(); if (scrollTop === 0) { firstPageIndex = this.view.indexAt(scrollTop); } else { firstPageIndex = this.view.indexAfter(scrollTop - 1); } const firstPageElement = this.view.element(firstPageIndex); const currentlyFocusedElement = this.getFocusedElements()[0]; if (currentlyFocusedElement !== firstPageElement) { const firstGoodPageIndex = this.findNextIndex(firstPageIndex, false, filter); if (firstGoodPageIndex > -1 && currentlyFocusedElement !== this.view.element(firstGoodPageIndex)) { this.setFocus([firstGoodPageIndex], browserEvent); } else { this.setFocus([firstPageIndex], browserEvent); } } else { const previousScrollTop = scrollTop; this.view.setScrollTop(scrollTop - this.view.renderHeight); if (this.view.getScrollTop() !== previousScrollTop) { this.setFocus([]); // Let the scroll event listener run yield (0,common_async/* timeout */.Vs)(0); yield this.focusPreviousPage(browserEvent, filter); } } }); } focusLast(browserEvent, filter) { if (this.length === 0) { return; } const index = this.findPreviousIndex(this.length - 1, false, filter); if (index > -1) { this.setFocus([index], browserEvent); } } focusFirst(browserEvent, filter) { this.focusNth(0, browserEvent, filter); } focusNth(n, browserEvent, filter) { if (this.length === 0) { return; } const index = this.findNextIndex(n, false, filter); if (index > -1) { this.setFocus([index], browserEvent); } } findNextIndex(index, loop = false, filter) { for (let i = 0; i < this.length; i++) { if (index >= this.length && !loop) { return -1; } index = index % this.length; if (!filter || filter(this.element(index))) { return index; } index++; } return -1; } findPreviousIndex(index, loop = false, filter) { for (let i = 0; i < this.length; i++) { if (index < 0 && !loop) { return -1; } index = (this.length + (index % this.length)) % this.length; if (!filter || filter(this.element(index))) { return index; } index--; } return -1; } getFocus() { return this.focus.get(); } getFocusedElements() { return this.getFocus().map(i => this.view.element(i)); } reveal(index, relativeTop) { if (index < 0 || index >= this.length) { throw new ListError(this.user, `Invalid index ${index}`); } const scrollTop = this.view.getScrollTop(); const elementTop = this.view.elementTop(index); const elementHeight = this.view.elementHeight(index); if ((0,types/* isNumber */.hj)(relativeTop)) { // y = mx + b const m = elementHeight - this.view.renderHeight; this.view.setScrollTop(m * (0,numbers/* clamp */.u)(relativeTop, 0, 1) + elementTop); } else { const viewItemBottom = elementTop + elementHeight; const scrollBottom = scrollTop + this.view.renderHeight; if (elementTop < scrollTop && viewItemBottom >= scrollBottom) { // The element is already overflowing the viewport, no-op } else if (elementTop < scrollTop || (viewItemBottom >= scrollBottom && elementHeight >= this.view.renderHeight)) { this.view.setScrollTop(elementTop); } else if (viewItemBottom >= scrollBottom) { this.view.setScrollTop(viewItemBottom - this.view.renderHeight); } } } /** * Returns the relative position of an element rendered in the list. * Returns `null` if the element isn't *entirely* in the visible viewport. */ getRelativeTop(index) { if (index < 0 || index >= this.length) { throw new ListError(this.user, `Invalid index ${index}`); } const scrollTop = this.view.getScrollTop(); const elementTop = this.view.elementTop(index); const elementHeight = this.view.elementHeight(index); if (elementTop < scrollTop || elementTop + elementHeight > scrollTop + this.view.renderHeight) { return null; } // y = mx + b const m = elementHeight - this.view.renderHeight; return Math.abs((scrollTop - elementTop) / m); } getHTMLElement() { return this.view.domNode; } style(styles) { this.styleController.style(styles); } toListEvent({ indexes, browserEvent }) { return { indexes, elements: indexes.map(i => this.view.element(i)), browserEvent }; } _onFocusChange() { const focus = this.focus.get(); this.view.domNode.classList.toggle('element-focused', focus.length > 0); this.onDidChangeActiveDescendant(); } onDidChangeActiveDescendant() { var _a; const focus = this.focus.get(); if (focus.length > 0) { let id; if ((_a = this.accessibilityProvider) === null || _a === void 0 ? void 0 : _a.getActiveDescendantId) { id = this.accessibilityProvider.getActiveDescendantId(this.view.element(focus[0])); } this.view.domNode.setAttribute('aria-activedescendant', id || this.view.getElementDomId(focus[0])); } else { this.view.domNode.removeAttribute('aria-activedescendant'); } } _onSelectionChange() { const selection = this.selection.get(); this.view.domNode.classList.toggle('selection-none', selection.length === 0); this.view.domNode.classList.toggle('selection-single', selection.length === 1); this.view.domNode.classList.toggle('selection-multiple', selection.length > 1); } dispose() { this._onDidDispose.fire(); this.disposables.dispose(); this._onDidDispose.dispose(); } } __decorate([ decorators/* memoize */.H ], List.prototype, "onDidChangeFocus", null); __decorate([ decorators/* memoize */.H ], List.prototype, "onDidChangeSelection", null); __decorate([ decorators/* memoize */.H ], List.prototype, "onContextMenu", null); __decorate([ decorators/* memoize */.H ], List.prototype, "onKeyDown", null); __decorate([ decorators/* memoize */.H ], List.prototype, "onDidFocus", null); /***/ }), /***/ 10418: /*!************************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.js + 1 modules ***! \************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { S: function() { return /* binding */ MOUSE_CURSOR_TEXT_CSS_CLASS_NAME; } }); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.css // extracted by mini-css-extract-plugin ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/mouseCursor/mouseCursor.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const MOUSE_CURSOR_TEXT_CSS_CLASS_NAME = `monaco-mouse-cursor-text`; /***/ }), /***/ 88048: /*!**********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/sash/sash.js + 1 modules ***! \**********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { l: function() { return /* binding */ OrthogonalEdge; }, g: function() { return /* binding */ Sash; } }); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dom.js var dom = __webpack_require__(69454); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/event.js var browser_event = __webpack_require__(8035); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/touch.js var touch = __webpack_require__(60537); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/async.js var common_async = __webpack_require__(50431); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/decorators.js var decorators = __webpack_require__(85402); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/event.js var common_event = __webpack_require__(4348); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/lifecycle.js var lifecycle = __webpack_require__(69323); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/platform.js var platform = __webpack_require__(23345); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/sash/sash.css // extracted by mini-css-extract-plugin ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/sash/sash.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; let DEBUG = false; var OrthogonalEdge; (function (OrthogonalEdge) { OrthogonalEdge["North"] = "north"; OrthogonalEdge["South"] = "south"; OrthogonalEdge["East"] = "east"; OrthogonalEdge["West"] = "west"; })(OrthogonalEdge || (OrthogonalEdge = {})); let globalSize = 4; const onDidChangeGlobalSize = new common_event/* Emitter */.Q5(); let globalHoverDelay = 300; const onDidChangeHoverDelay = new common_event/* Emitter */.Q5(); class MouseEventFactory { constructor() { this.disposables = new lifecycle/* DisposableStore */.SL(); } get onPointerMove() { return this.disposables.add(new browser_event/* DomEmitter */.Y(window, 'mousemove')).event; } get onPointerUp() { return this.disposables.add(new browser_event/* DomEmitter */.Y(window, 'mouseup')).event; } dispose() { this.disposables.dispose(); } } __decorate([ decorators/* memoize */.H ], MouseEventFactory.prototype, "onPointerMove", null); __decorate([ decorators/* memoize */.H ], MouseEventFactory.prototype, "onPointerUp", null); class GestureEventFactory { constructor(el) { this.el = el; this.disposables = new lifecycle/* DisposableStore */.SL(); } get onPointerMove() { return this.disposables.add(new browser_event/* DomEmitter */.Y(this.el, touch/* EventType */.t.Change)).event; } get onPointerUp() { return this.disposables.add(new browser_event/* DomEmitter */.Y(this.el, touch/* EventType */.t.End)).event; } dispose() { this.disposables.dispose(); } } __decorate([ decorators/* memoize */.H ], GestureEventFactory.prototype, "onPointerMove", null); __decorate([ decorators/* memoize */.H ], GestureEventFactory.prototype, "onPointerUp", null); class OrthogonalPointerEventFactory { constructor(factory) { this.factory = factory; } get onPointerMove() { return this.factory.onPointerMove; } get onPointerUp() { return this.factory.onPointerUp; } dispose() { // noop } } __decorate([ decorators/* memoize */.H ], OrthogonalPointerEventFactory.prototype, "onPointerMove", null); __decorate([ decorators/* memoize */.H ], OrthogonalPointerEventFactory.prototype, "onPointerUp", null); class Sash extends lifecycle/* Disposable */.JT { constructor(container, layoutProvider, options) { super(); this.hoverDelay = globalHoverDelay; this.hoverDelayer = this._register(new common_async/* Delayer */.vp(this.hoverDelay)); this._state = 3 /* Enabled */; this._onDidEnablementChange = this._register(new common_event/* Emitter */.Q5()); this.onDidEnablementChange = this._onDidEnablementChange.event; this._onDidStart = this._register(new common_event/* Emitter */.Q5()); this.onDidStart = this._onDidStart.event; this._onDidChange = this._register(new common_event/* Emitter */.Q5()); this.onDidChange = this._onDidChange.event; this._onDidReset = this._register(new common_event/* Emitter */.Q5()); this.onDidReset = this._onDidReset.event; this._onDidEnd = this._register(new common_event/* Emitter */.Q5()); this.onDidEnd = this._onDidEnd.event; this.linkedSash = undefined; this.orthogonalStartSashDisposables = this._register(new lifecycle/* DisposableStore */.SL()); this.orthogonalStartDragHandleDisposables = this._register(new lifecycle/* DisposableStore */.SL()); this.orthogonalEndSashDisposables = this._register(new lifecycle/* DisposableStore */.SL()); this.orthogonalEndDragHandleDisposables = this._register(new lifecycle/* DisposableStore */.SL()); this.el = (0,dom/* append */.R3)(container, (0,dom.$)('.monaco-sash')); if (options.orthogonalEdge) { this.el.classList.add(`orthogonal-edge-${options.orthogonalEdge}`); } if (platform/* isMacintosh */.dz) { this.el.classList.add('mac'); } const onMouseDown = this._register(new browser_event/* DomEmitter */.Y(this.el, 'mousedown')).event; this._register(onMouseDown(e => this.onPointerStart(e, new MouseEventFactory()), this)); const onMouseDoubleClick = this._register(new browser_event/* DomEmitter */.Y(this.el, 'dblclick')).event; this._register(onMouseDoubleClick(this.onPointerDoublePress, this)); const onMouseEnter = this._register(new browser_event/* DomEmitter */.Y(this.el, 'mouseenter')).event; this._register(onMouseEnter(() => Sash.onMouseEnter(this))); const onMouseLeave = this._register(new browser_event/* DomEmitter */.Y(this.el, 'mouseleave')).event; this._register(onMouseLeave(() => Sash.onMouseLeave(this))); this._register(touch/* Gesture */.o.addTarget(this.el)); const onTouchStart = common_event/* Event */.ju.map(this._register(new browser_event/* DomEmitter */.Y(this.el, touch/* EventType */.t.Start)).event, e => { var _a; return (Object.assign(Object.assign({}, e), { target: (_a = e.initialTarget) !== null && _a !== void 0 ? _a : null })); }); this._register(onTouchStart(e => this.onPointerStart(e, new GestureEventFactory(this.el)), this)); const onTap = this._register(new browser_event/* DomEmitter */.Y(this.el, touch/* EventType */.t.Tap)).event; const onDoubleTap = common_event/* Event */.ju.map(common_event/* Event */.ju.filter(common_event/* Event */.ju.debounce(onTap, (res, event) => { var _a; return ({ event, count: ((_a = res === null || res === void 0 ? void 0 : res.count) !== null && _a !== void 0 ? _a : 0) + 1 }); }, 250), ({ count }) => count === 2), ({ event }) => { var _a; return (Object.assign(Object.assign({}, event), { target: (_a = event.initialTarget) !== null && _a !== void 0 ? _a : null })); }); this._register(onDoubleTap(this.onPointerDoublePress, this)); if (typeof options.size === 'number') { this.size = options.size; if (options.orientation === 0 /* VERTICAL */) { this.el.style.width = `${this.size}px`; } else { this.el.style.height = `${this.size}px`; } } else { this.size = globalSize; this._register(onDidChangeGlobalSize.event(size => { this.size = size; this.layout(); })); } this._register(onDidChangeHoverDelay.event(delay => this.hoverDelay = delay)); this.hidden = false; this.layoutProvider = layoutProvider; this.orthogonalStartSash = options.orthogonalStartSash; this.orthogonalEndSash = options.orthogonalEndSash; this.orientation = options.orientation || 0 /* VERTICAL */; if (this.orientation === 1 /* HORIZONTAL */) { this.el.classList.add('horizontal'); this.el.classList.remove('vertical'); } else { this.el.classList.remove('horizontal'); this.el.classList.add('vertical'); } this.el.classList.toggle('debug', DEBUG); this.layout(); } get state() { return this._state; } set state(state) { if (this._state === state) { return; } this.el.classList.toggle('disabled', state === 0 /* Disabled */); this.el.classList.toggle('minimum', state === 1 /* Minimum */); this.el.classList.toggle('maximum', state === 2 /* Maximum */); this._state = state; this._onDidEnablementChange.fire(state); } get orthogonalStartSash() { return this._orthogonalStartSash; } set orthogonalStartSash(sash) { this.orthogonalStartDragHandleDisposables.clear(); this.orthogonalStartSashDisposables.clear(); if (sash) { const onChange = (state) => { this.orthogonalStartDragHandleDisposables.clear(); if (state !== 0 /* Disabled */) { this._orthogonalStartDragHandle = (0,dom/* append */.R3)(this.el, (0,dom.$)('.orthogonal-drag-handle.start')); this.orthogonalStartDragHandleDisposables.add((0,lifecycle/* toDisposable */.OF)(() => this._orthogonalStartDragHandle.remove())); this.orthogonalStartDragHandleDisposables.add(new browser_event/* DomEmitter */.Y(this._orthogonalStartDragHandle, 'mouseenter')).event(() => Sash.onMouseEnter(sash), undefined, this.orthogonalStartDragHandleDisposables); this.orthogonalStartDragHandleDisposables.add(new browser_event/* DomEmitter */.Y(this._orthogonalStartDragHandle, 'mouseleave')).event(() => Sash.onMouseLeave(sash), undefined, this.orthogonalStartDragHandleDisposables); } }; this.orthogonalStartSashDisposables.add(sash.onDidEnablementChange(onChange, this)); onChange(sash.state); } this._orthogonalStartSash = sash; } get orthogonalEndSash() { return this._orthogonalEndSash; } set orthogonalEndSash(sash) { this.orthogonalEndDragHandleDisposables.clear(); this.orthogonalEndSashDisposables.clear(); if (sash) { const onChange = (state) => { this.orthogonalEndDragHandleDisposables.clear(); if (state !== 0 /* Disabled */) { this._orthogonalEndDragHandle = (0,dom/* append */.R3)(this.el, (0,dom.$)('.orthogonal-drag-handle.end')); this.orthogonalEndDragHandleDisposables.add((0,lifecycle/* toDisposable */.OF)(() => this._orthogonalEndDragHandle.remove())); this.orthogonalEndDragHandleDisposables.add(new browser_event/* DomEmitter */.Y(this._orthogonalEndDragHandle, 'mouseenter')).event(() => Sash.onMouseEnter(sash), undefined, this.orthogonalEndDragHandleDisposables); this.orthogonalEndDragHandleDisposables.add(new browser_event/* DomEmitter */.Y(this._orthogonalEndDragHandle, 'mouseleave')).event(() => Sash.onMouseLeave(sash), undefined, this.orthogonalEndDragHandleDisposables); } }; this.orthogonalEndSashDisposables.add(sash.onDidEnablementChange(onChange, this)); onChange(sash.state); } this._orthogonalEndSash = sash; } onPointerStart(event, pointerEventFactory) { dom/* EventHelper */.zB.stop(event); let isMultisashResize = false; if (!event.__orthogonalSashEvent) { const orthogonalSash = this.getOrthogonalSash(event); if (orthogonalSash) { isMultisashResize = true; event.__orthogonalSashEvent = true; orthogonalSash.onPointerStart(event, new OrthogonalPointerEventFactory(pointerEventFactory)); } } if (this.linkedSash && !event.__linkedSashEvent) { event.__linkedSashEvent = true; this.linkedSash.onPointerStart(event, new OrthogonalPointerEventFactory(pointerEventFactory)); } if (!this.state) { return; } const iframes = (0,dom/* getElementsByTagName */.H$)('iframe'); for (const iframe of iframes) { iframe.style.pointerEvents = 'none'; // disable mouse events on iframes as long as we drag the sash } const startX = event.pageX; const startY = event.pageY; const altKey = event.altKey; const startEvent = { startX, currentX: startX, startY, currentY: startY, altKey }; this.el.classList.add('active'); this._onDidStart.fire(startEvent); // fix https://github.com/microsoft/vscode/issues/21675 const style = (0,dom/* createStyleSheet */.dS)(this.el); const updateStyle = () => { let cursor = ''; if (isMultisashResize) { cursor = 'all-scroll'; } else if (this.orientation === 1 /* HORIZONTAL */) { if (this.state === 1 /* Minimum */) { cursor = 's-resize'; } else if (this.state === 2 /* Maximum */) { cursor = 'n-resize'; } else { cursor = platform/* isMacintosh */.dz ? 'row-resize' : 'ns-resize'; } } else { if (this.state === 1 /* Minimum */) { cursor = 'e-resize'; } else if (this.state === 2 /* Maximum */) { cursor = 'w-resize'; } else { cursor = platform/* isMacintosh */.dz ? 'col-resize' : 'ew-resize'; } } style.textContent = `* { cursor: ${cursor} !important; }`; }; const disposables = new lifecycle/* DisposableStore */.SL(); updateStyle(); if (!isMultisashResize) { this.onDidEnablementChange(updateStyle, null, disposables); } const onPointerMove = (e) => { dom/* EventHelper */.zB.stop(e, false); const event = { startX, currentX: e.pageX, startY, currentY: e.pageY, altKey }; this._onDidChange.fire(event); }; const onPointerUp = (e) => { dom/* EventHelper */.zB.stop(e, false); this.el.removeChild(style); this.el.classList.remove('active'); this._onDidEnd.fire(); disposables.dispose(); for (const iframe of iframes) { iframe.style.pointerEvents = 'auto'; } }; pointerEventFactory.onPointerMove(onPointerMove, null, disposables); pointerEventFactory.onPointerUp(onPointerUp, null, disposables); disposables.add(pointerEventFactory); } onPointerDoublePress(e) { const orthogonalSash = this.getOrthogonalSash(e); if (orthogonalSash) { orthogonalSash._onDidReset.fire(); } if (this.linkedSash) { this.linkedSash._onDidReset.fire(); } this._onDidReset.fire(); } static onMouseEnter(sash, fromLinkedSash = false) { if (sash.el.classList.contains('active')) { sash.hoverDelayer.cancel(); sash.el.classList.add('hover'); } else { sash.hoverDelayer.trigger(() => sash.el.classList.add('hover'), sash.hoverDelay).then(undefined, () => { }); } if (!fromLinkedSash && sash.linkedSash) { Sash.onMouseEnter(sash.linkedSash, true); } } static onMouseLeave(sash, fromLinkedSash = false) { sash.hoverDelayer.cancel(); sash.el.classList.remove('hover'); if (!fromLinkedSash && sash.linkedSash) { Sash.onMouseLeave(sash.linkedSash, true); } } clearSashHoverState() { Sash.onMouseLeave(this); } layout() { if (this.orientation === 0 /* VERTICAL */) { const verticalProvider = this.layoutProvider; this.el.style.left = verticalProvider.getVerticalSashLeft(this) - (this.size / 2) + 'px'; if (verticalProvider.getVerticalSashTop) { this.el.style.top = verticalProvider.getVerticalSashTop(this) + 'px'; } if (verticalProvider.getVerticalSashHeight) { this.el.style.height = verticalProvider.getVerticalSashHeight(this) + 'px'; } } else { const horizontalProvider = this.layoutProvider; this.el.style.top = horizontalProvider.getHorizontalSashTop(this) - (this.size / 2) + 'px'; if (horizontalProvider.getHorizontalSashLeft) { this.el.style.left = horizontalProvider.getHorizontalSashLeft(this) + 'px'; } if (horizontalProvider.getHorizontalSashWidth) { this.el.style.width = horizontalProvider.getHorizontalSashWidth(this) + 'px'; } } } hide() { this.hidden = true; this.el.style.display = 'none'; this.el.setAttribute('aria-hidden', 'true'); } getOrthogonalSash(e) { if (!e.target || !(e.target instanceof HTMLElement)) { return undefined; } if (e.target.classList.contains('orthogonal-drag-handle')) { return e.target.classList.contains('start') ? this.orthogonalStartSash : this.orthogonalEndSash; } return undefined; } dispose() { super.dispose(); this.el.remove(); } } /***/ }), /***/ 78265: /*!****************************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js + 7 modules ***! \****************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { s$: function() { return /* binding */ DomScrollableElement; }, NB: function() { return /* binding */ ScrollableElement; }, $Z: function() { return /* binding */ SmoothScrollableElement; } }); // UNUSED EXPORTS: AbstractScrollableElement, MouseWheelClassifier // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/browser.js var browser = __webpack_require__(87783); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dom.js var dom = __webpack_require__(69454); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/fastDomNode.js var fastDomNode = __webpack_require__(32635); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/mouseEvent.js var mouseEvent = __webpack_require__(52390); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/globalMouseMoveMonitor.js var globalMouseMoveMonitor = __webpack_require__(2395); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/widget.js var widget = __webpack_require__(62758); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/async.js var common_async = __webpack_require__(50431); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarArrow.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** * The arrow image size. */ const ARROW_IMG_SIZE = 11; class ScrollbarArrow extends widget/* Widget */.$ { constructor(opts) { super(); this._onActivate = opts.onActivate; this.bgDomNode = document.createElement('div'); this.bgDomNode.className = 'arrow-background'; this.bgDomNode.style.position = 'absolute'; this.bgDomNode.style.width = opts.bgWidth + 'px'; this.bgDomNode.style.height = opts.bgHeight + 'px'; if (typeof opts.top !== 'undefined') { this.bgDomNode.style.top = '0px'; } if (typeof opts.left !== 'undefined') { this.bgDomNode.style.left = '0px'; } if (typeof opts.bottom !== 'undefined') { this.bgDomNode.style.bottom = '0px'; } if (typeof opts.right !== 'undefined') { this.bgDomNode.style.right = '0px'; } this.domNode = document.createElement('div'); this.domNode.className = opts.className; this.domNode.classList.add(...opts.icon.classNamesArray); this.domNode.style.position = 'absolute'; this.domNode.style.width = ARROW_IMG_SIZE + 'px'; this.domNode.style.height = ARROW_IMG_SIZE + 'px'; if (typeof opts.top !== 'undefined') { this.domNode.style.top = opts.top + 'px'; } if (typeof opts.left !== 'undefined') { this.domNode.style.left = opts.left + 'px'; } if (typeof opts.bottom !== 'undefined') { this.domNode.style.bottom = opts.bottom + 'px'; } if (typeof opts.right !== 'undefined') { this.domNode.style.right = opts.right + 'px'; } this._mouseMoveMonitor = this._register(new globalMouseMoveMonitor/* GlobalMouseMoveMonitor */.Z()); this.onmousedown(this.bgDomNode, (e) => this._arrowMouseDown(e)); this.onmousedown(this.domNode, (e) => this._arrowMouseDown(e)); this._mousedownRepeatTimer = this._register(new common_async/* IntervalTimer */.zh()); this._mousedownScheduleRepeatTimer = this._register(new common_async/* TimeoutTimer */._F()); } _arrowMouseDown(e) { const scheduleRepeater = () => { this._mousedownRepeatTimer.cancelAndSet(() => this._onActivate(), 1000 / 24); }; this._onActivate(); this._mousedownRepeatTimer.cancel(); this._mousedownScheduleRepeatTimer.cancelAndSet(scheduleRepeater, 200); this._mouseMoveMonitor.startMonitoring(e.target, e.buttons, globalMouseMoveMonitor/* standardMouseMoveMerger */.e, (mouseMoveData) => { /* Intentional empty */ }, () => { this._mousedownRepeatTimer.cancel(); this._mousedownScheduleRepeatTimer.cancel(); }); e.preventDefault(); } } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/lifecycle.js var lifecycle = __webpack_require__(69323); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class ScrollbarVisibilityController extends lifecycle/* Disposable */.JT { constructor(visibility, visibleClassName, invisibleClassName) { super(); this._visibility = visibility; this._visibleClassName = visibleClassName; this._invisibleClassName = invisibleClassName; this._domNode = null; this._isVisible = false; this._isNeeded = false; this._rawShouldBeVisible = false; this._shouldBeVisible = false; this._revealTimer = this._register(new common_async/* TimeoutTimer */._F()); } setVisibility(visibility) { if (this._visibility !== visibility) { this._visibility = visibility; this._updateShouldBeVisible(); } } // ----------------- Hide / Reveal setShouldBeVisible(rawShouldBeVisible) { this._rawShouldBeVisible = rawShouldBeVisible; this._updateShouldBeVisible(); } _applyVisibilitySetting() { if (this._visibility === 2 /* Hidden */) { return false; } if (this._visibility === 3 /* Visible */) { return true; } return this._rawShouldBeVisible; } _updateShouldBeVisible() { const shouldBeVisible = this._applyVisibilitySetting(); if (this._shouldBeVisible !== shouldBeVisible) { this._shouldBeVisible = shouldBeVisible; this.ensureVisibility(); } } setIsNeeded(isNeeded) { if (this._isNeeded !== isNeeded) { this._isNeeded = isNeeded; this.ensureVisibility(); } } setDomNode(domNode) { this._domNode = domNode; this._domNode.setClassName(this._invisibleClassName); // Now that the flags & the dom node are in a consistent state, ensure the Hidden/Visible configuration this.setShouldBeVisible(false); } ensureVisibility() { if (!this._isNeeded) { // Nothing to be rendered this._hide(false); return; } if (this._shouldBeVisible) { this._reveal(); } else { this._hide(true); } } _reveal() { if (this._isVisible) { return; } this._isVisible = true; // The CSS animation doesn't play otherwise this._revealTimer.setIfNotSet(() => { if (this._domNode) { this._domNode.setClassName(this._visibleClassName); } }, 0); } _hide(withFadeAway) { this._revealTimer.cancel(); if (!this._isVisible) { return; } this._isVisible = false; if (this._domNode) { this._domNode.setClassName(this._invisibleClassName + (withFadeAway ? ' fade' : '')); } } } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/platform.js var platform = __webpack_require__(23345); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/scrollbar/abstractScrollbar.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** * The orthogonal distance to the slider at which dragging "resets". This implements "snapping" */ const MOUSE_DRAG_RESET_DISTANCE = 140; class AbstractScrollbar extends widget/* Widget */.$ { constructor(opts) { super(); this._lazyRender = opts.lazyRender; this._host = opts.host; this._scrollable = opts.scrollable; this._scrollByPage = opts.scrollByPage; this._scrollbarState = opts.scrollbarState; this._visibilityController = this._register(new ScrollbarVisibilityController(opts.visibility, 'visible scrollbar ' + opts.extraScrollbarClassName, 'invisible scrollbar ' + opts.extraScrollbarClassName)); this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()); this._mouseMoveMonitor = this._register(new globalMouseMoveMonitor/* GlobalMouseMoveMonitor */.Z()); this._shouldRender = true; this.domNode = (0,fastDomNode/* createFastDomNode */.X)(document.createElement('div')); this.domNode.setAttribute('role', 'presentation'); this.domNode.setAttribute('aria-hidden', 'true'); this._visibilityController.setDomNode(this.domNode); this.domNode.setPosition('absolute'); this.onmousedown(this.domNode.domNode, (e) => this._domNodeMouseDown(e)); } // ----------------- creation /** * Creates the dom node for an arrow & adds it to the container */ _createArrow(opts) { const arrow = this._register(new ScrollbarArrow(opts)); this.domNode.domNode.appendChild(arrow.bgDomNode); this.domNode.domNode.appendChild(arrow.domNode); } /** * Creates the slider dom node, adds it to the container & hooks up the events */ _createSlider(top, left, width, height) { this.slider = (0,fastDomNode/* createFastDomNode */.X)(document.createElement('div')); this.slider.setClassName('slider'); this.slider.setPosition('absolute'); this.slider.setTop(top); this.slider.setLeft(left); if (typeof width === 'number') { this.slider.setWidth(width); } if (typeof height === 'number') { this.slider.setHeight(height); } this.slider.setLayerHinting(true); this.slider.setContain('strict'); this.domNode.domNode.appendChild(this.slider.domNode); this.onmousedown(this.slider.domNode, (e) => { if (e.leftButton) { e.preventDefault(); this._sliderMouseDown(e, () => { }); } }); this.onclick(this.slider.domNode, e => { if (e.leftButton) { e.stopPropagation(); } }); } // ----------------- Update state _onElementSize(visibleSize) { if (this._scrollbarState.setVisibleSize(visibleSize)) { this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()); this._shouldRender = true; if (!this._lazyRender) { this.render(); } } return this._shouldRender; } _onElementScrollSize(elementScrollSize) { if (this._scrollbarState.setScrollSize(elementScrollSize)) { this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()); this._shouldRender = true; if (!this._lazyRender) { this.render(); } } return this._shouldRender; } _onElementScrollPosition(elementScrollPosition) { if (this._scrollbarState.setScrollPosition(elementScrollPosition)) { this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()); this._shouldRender = true; if (!this._lazyRender) { this.render(); } } return this._shouldRender; } // ----------------- rendering beginReveal() { this._visibilityController.setShouldBeVisible(true); } beginHide() { this._visibilityController.setShouldBeVisible(false); } render() { if (!this._shouldRender) { return; } this._shouldRender = false; this._renderDomNode(this._scrollbarState.getRectangleLargeSize(), this._scrollbarState.getRectangleSmallSize()); this._updateSlider(this._scrollbarState.getSliderSize(), this._scrollbarState.getArrowSize() + this._scrollbarState.getSliderPosition()); } // ----------------- DOM events _domNodeMouseDown(e) { if (e.target !== this.domNode.domNode) { return; } this._onMouseDown(e); } delegateMouseDown(e) { const domTop = this.domNode.domNode.getClientRects()[0].top; const sliderStart = domTop + this._scrollbarState.getSliderPosition(); const sliderStop = domTop + this._scrollbarState.getSliderPosition() + this._scrollbarState.getSliderSize(); const mousePos = this._sliderMousePosition(e); if (sliderStart <= mousePos && mousePos <= sliderStop) { // Act as if it was a mouse down on the slider if (e.leftButton) { e.preventDefault(); this._sliderMouseDown(e, () => { }); } } else { // Act as if it was a mouse down on the scrollbar this._onMouseDown(e); } } _onMouseDown(e) { let offsetX; let offsetY; if (e.target === this.domNode.domNode && typeof e.browserEvent.offsetX === 'number' && typeof e.browserEvent.offsetY === 'number') { offsetX = e.browserEvent.offsetX; offsetY = e.browserEvent.offsetY; } else { const domNodePosition = dom/* getDomNodePagePosition */.i(this.domNode.domNode); offsetX = e.posx - domNodePosition.left; offsetY = e.posy - domNodePosition.top; } const offset = this._mouseDownRelativePosition(offsetX, offsetY); this._setDesiredScrollPositionNow(this._scrollByPage ? this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(offset) : this._scrollbarState.getDesiredScrollPositionFromOffset(offset)); if (e.leftButton) { e.preventDefault(); this._sliderMouseDown(e, () => { }); } } _sliderMouseDown(e, onDragFinished) { const initialMousePosition = this._sliderMousePosition(e); const initialMouseOrthogonalPosition = this._sliderOrthogonalMousePosition(e); const initialScrollbarState = this._scrollbarState.clone(); this.slider.toggleClassName('active', true); this._mouseMoveMonitor.startMonitoring(e.target, e.buttons, globalMouseMoveMonitor/* standardMouseMoveMerger */.e, (mouseMoveData) => { const mouseOrthogonalPosition = this._sliderOrthogonalMousePosition(mouseMoveData); const mouseOrthogonalDelta = Math.abs(mouseOrthogonalPosition - initialMouseOrthogonalPosition); if (platform/* isWindows */.ED && mouseOrthogonalDelta > MOUSE_DRAG_RESET_DISTANCE) { // The mouse has wondered away from the scrollbar => reset dragging this._setDesiredScrollPositionNow(initialScrollbarState.getScrollPosition()); return; } const mousePosition = this._sliderMousePosition(mouseMoveData); const mouseDelta = mousePosition - initialMousePosition; this._setDesiredScrollPositionNow(initialScrollbarState.getDesiredScrollPositionFromDelta(mouseDelta)); }, () => { this.slider.toggleClassName('active', false); this._host.onDragEnd(); onDragFinished(); }); this._host.onDragStart(); } _setDesiredScrollPositionNow(_desiredScrollPosition) { const desiredScrollPosition = {}; this.writeScrollPosition(desiredScrollPosition, _desiredScrollPosition); this._scrollable.setScrollPositionNow(desiredScrollPosition); } updateScrollbarSize(scrollbarSize) { this._updateScrollbarSize(scrollbarSize); this._scrollbarState.setScrollbarSize(scrollbarSize); this._shouldRender = true; if (!this._lazyRender) { this.render(); } } isNeeded() { return this._scrollbarState.isNeeded(); } } ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollbarState.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** * The minimal size of the slider (such that it can still be clickable) -- it is artificially enlarged. */ const MINIMUM_SLIDER_SIZE = 20; class ScrollbarState { constructor(arrowSize, scrollbarSize, oppositeScrollbarSize, visibleSize, scrollSize, scrollPosition) { this._scrollbarSize = Math.round(scrollbarSize); this._oppositeScrollbarSize = Math.round(oppositeScrollbarSize); this._arrowSize = Math.round(arrowSize); this._visibleSize = visibleSize; this._scrollSize = scrollSize; this._scrollPosition = scrollPosition; this._computedAvailableSize = 0; this._computedIsNeeded = false; this._computedSliderSize = 0; this._computedSliderRatio = 0; this._computedSliderPosition = 0; this._refreshComputedValues(); } clone() { return new ScrollbarState(this._arrowSize, this._scrollbarSize, this._oppositeScrollbarSize, this._visibleSize, this._scrollSize, this._scrollPosition); } setVisibleSize(visibleSize) { const iVisibleSize = Math.round(visibleSize); if (this._visibleSize !== iVisibleSize) { this._visibleSize = iVisibleSize; this._refreshComputedValues(); return true; } return false; } setScrollSize(scrollSize) { const iScrollSize = Math.round(scrollSize); if (this._scrollSize !== iScrollSize) { this._scrollSize = iScrollSize; this._refreshComputedValues(); return true; } return false; } setScrollPosition(scrollPosition) { const iScrollPosition = Math.round(scrollPosition); if (this._scrollPosition !== iScrollPosition) { this._scrollPosition = iScrollPosition; this._refreshComputedValues(); return true; } return false; } setScrollbarSize(scrollbarSize) { this._scrollbarSize = Math.round(scrollbarSize); } setOppositeScrollbarSize(oppositeScrollbarSize) { this._oppositeScrollbarSize = Math.round(oppositeScrollbarSize); } static _computeValues(oppositeScrollbarSize, arrowSize, visibleSize, scrollSize, scrollPosition) { const computedAvailableSize = Math.max(0, visibleSize - oppositeScrollbarSize); const computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * arrowSize); const computedIsNeeded = (scrollSize > 0 && scrollSize > visibleSize); if (!computedIsNeeded) { // There is no need for a slider return { computedAvailableSize: Math.round(computedAvailableSize), computedIsNeeded: computedIsNeeded, computedSliderSize: Math.round(computedRepresentableSize), computedSliderRatio: 0, computedSliderPosition: 0, }; } // We must artificially increase the size of the slider if needed, since the slider would be too small to grab with the mouse otherwise const computedSliderSize = Math.round(Math.max(MINIMUM_SLIDER_SIZE, Math.floor(visibleSize * computedRepresentableSize / scrollSize))); // The slider can move from 0 to `computedRepresentableSize` - `computedSliderSize` // in the same way `scrollPosition` can move from 0 to `scrollSize` - `visibleSize`. const computedSliderRatio = (computedRepresentableSize - computedSliderSize) / (scrollSize - visibleSize); const computedSliderPosition = (scrollPosition * computedSliderRatio); return { computedAvailableSize: Math.round(computedAvailableSize), computedIsNeeded: computedIsNeeded, computedSliderSize: Math.round(computedSliderSize), computedSliderRatio: computedSliderRatio, computedSliderPosition: Math.round(computedSliderPosition), }; } _refreshComputedValues() { const r = ScrollbarState._computeValues(this._oppositeScrollbarSize, this._arrowSize, this._visibleSize, this._scrollSize, this._scrollPosition); this._computedAvailableSize = r.computedAvailableSize; this._computedIsNeeded = r.computedIsNeeded; this._computedSliderSize = r.computedSliderSize; this._computedSliderRatio = r.computedSliderRatio; this._computedSliderPosition = r.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; } /** * Compute a desired `scrollPosition` such that `offset` ends up in the center of the slider. * `offset` is based on the same coordinate system as the `sliderPosition`. */ getDesiredScrollPositionFromOffset(offset) { if (!this._computedIsNeeded) { // no need for a slider return 0; } const desiredSliderPosition = offset - this._arrowSize - this._computedSliderSize / 2; return Math.round(desiredSliderPosition / this._computedSliderRatio); } /** * Compute a desired `scrollPosition` from if offset is before or after the slider position. * If offset is before slider, treat as a page up (or left). If after, page down (or right). * `offset` and `_computedSliderPosition` are based on the same coordinate system. * `_visibleSize` corresponds to a "page" of lines in the returned coordinate system. */ getDesiredScrollPositionFromOffsetPaged(offset) { if (!this._computedIsNeeded) { // no need for a slider return 0; } const correctedOffset = offset - this._arrowSize; // compensate if has arrows let desiredScrollPosition = this._scrollPosition; if (correctedOffset < this._computedSliderPosition) { desiredScrollPosition -= this._visibleSize; // page up/left } else { desiredScrollPosition += this._visibleSize; // page down/right } return desiredScrollPosition; } /** * Compute a desired `scrollPosition` such that the slider moves by `delta`. */ getDesiredScrollPositionFromDelta(delta) { if (!this._computedIsNeeded) { // no need for a slider return 0; } const desiredSliderPosition = this._computedSliderPosition + delta; return Math.round(desiredSliderPosition / this._computedSliderRatio); } } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/codicons.js var codicons = __webpack_require__(52615); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/scrollbar/horizontalScrollbar.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const scrollbarButtonLeftIcon = (0,codicons/* registerCodicon */.CM)('scrollbar-button-left', codicons/* Codicon */.lA.triangleLeft); const scrollbarButtonRightIcon = (0,codicons/* registerCodicon */.CM)('scrollbar-button-right', codicons/* Codicon */.lA.triangleRight); class HorizontalScrollbar extends AbstractScrollbar { constructor(scrollable, options, host) { const scrollDimensions = scrollable.getScrollDimensions(); const scrollPosition = scrollable.getCurrentScrollPosition(); super({ lazyRender: options.lazyRender, host: host, scrollbarState: new ScrollbarState((options.horizontalHasArrows ? options.arrowSize : 0), (options.horizontal === 2 /* Hidden */ ? 0 : options.horizontalScrollbarSize), (options.vertical === 2 /* Hidden */ ? 0 : options.verticalScrollbarSize), scrollDimensions.width, scrollDimensions.scrollWidth, scrollPosition.scrollLeft), visibility: options.horizontal, extraScrollbarClassName: 'horizontal', scrollable: scrollable, scrollByPage: options.scrollByPage }); if (options.horizontalHasArrows) { const arrowDelta = (options.arrowSize - ARROW_IMG_SIZE) / 2; const scrollbarDelta = (options.horizontalScrollbarSize - ARROW_IMG_SIZE) / 2; this._createArrow({ className: 'scra', icon: scrollbarButtonLeftIcon, top: scrollbarDelta, left: arrowDelta, bottom: undefined, right: undefined, bgWidth: options.arrowSize, bgHeight: options.horizontalScrollbarSize, onActivate: () => this._host.onMouseWheel(new mouseEvent/* StandardWheelEvent */.q(null, 1, 0)), }); this._createArrow({ className: 'scra', icon: scrollbarButtonRightIcon, top: scrollbarDelta, left: undefined, bottom: undefined, right: arrowDelta, bgWidth: options.arrowSize, bgHeight: options.horizontalScrollbarSize, onActivate: () => this._host.onMouseWheel(new mouseEvent/* StandardWheelEvent */.q(null, -1, 0)), }); } this._createSlider(Math.floor((options.horizontalScrollbarSize - options.horizontalSliderSize) / 2), 0, undefined, options.horizontalSliderSize); } _updateSlider(sliderSize, sliderPosition) { this.slider.setWidth(sliderSize); this.slider.setLeft(sliderPosition); } _renderDomNode(largeSize, smallSize) { this.domNode.setWidth(largeSize); this.domNode.setHeight(smallSize); this.domNode.setLeft(0); this.domNode.setBottom(0); } onDidScroll(e) { this._shouldRender = this._onElementScrollSize(e.scrollWidth) || this._shouldRender; this._shouldRender = this._onElementScrollPosition(e.scrollLeft) || this._shouldRender; this._shouldRender = this._onElementSize(e.width) || this._shouldRender; return this._shouldRender; } _mouseDownRelativePosition(offsetX, offsetY) { return offsetX; } _sliderMousePosition(e) { return e.posx; } _sliderOrthogonalMousePosition(e) { return e.posy; } _updateScrollbarSize(size) { this.slider.setHeight(size); } writeScrollPosition(target, scrollPosition) { target.scrollLeft = scrollPosition; } updateOptions(options) { this.updateScrollbarSize(options.horizontal === 2 /* Hidden */ ? 0 : options.horizontalScrollbarSize); this._scrollbarState.setOppositeScrollbarSize(options.vertical === 2 /* Hidden */ ? 0 : options.verticalScrollbarSize); this._visibilityController.setVisibility(options.horizontal); this._scrollByPage = options.scrollByPage; } } ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/scrollbar/verticalScrollbar.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const scrollbarButtonUpIcon = (0,codicons/* registerCodicon */.CM)('scrollbar-button-up', codicons/* Codicon */.lA.triangleUp); const scrollbarButtonDownIcon = (0,codicons/* registerCodicon */.CM)('scrollbar-button-down', codicons/* Codicon */.lA.triangleDown); class VerticalScrollbar extends AbstractScrollbar { constructor(scrollable, options, host) { const scrollDimensions = scrollable.getScrollDimensions(); const scrollPosition = scrollable.getCurrentScrollPosition(); super({ lazyRender: options.lazyRender, host: host, scrollbarState: new ScrollbarState((options.verticalHasArrows ? options.arrowSize : 0), (options.vertical === 2 /* Hidden */ ? 0 : options.verticalScrollbarSize), // give priority to vertical scroll bar over horizontal and let it scroll all the way to the bottom 0, scrollDimensions.height, scrollDimensions.scrollHeight, scrollPosition.scrollTop), visibility: options.vertical, extraScrollbarClassName: 'vertical', scrollable: scrollable, scrollByPage: options.scrollByPage }); if (options.verticalHasArrows) { const arrowDelta = (options.arrowSize - ARROW_IMG_SIZE) / 2; const scrollbarDelta = (options.verticalScrollbarSize - ARROW_IMG_SIZE) / 2; this._createArrow({ className: 'scra', icon: scrollbarButtonUpIcon, top: arrowDelta, left: scrollbarDelta, bottom: undefined, right: undefined, bgWidth: options.verticalScrollbarSize, bgHeight: options.arrowSize, onActivate: () => this._host.onMouseWheel(new mouseEvent/* StandardWheelEvent */.q(null, 0, 1)), }); this._createArrow({ className: 'scra', icon: scrollbarButtonDownIcon, top: undefined, left: scrollbarDelta, bottom: arrowDelta, right: undefined, bgWidth: options.verticalScrollbarSize, bgHeight: options.arrowSize, onActivate: () => this._host.onMouseWheel(new mouseEvent/* StandardWheelEvent */.q(null, 0, -1)), }); } this._createSlider(0, Math.floor((options.verticalScrollbarSize - options.verticalSliderSize) / 2), options.verticalSliderSize, undefined); } _updateSlider(sliderSize, sliderPosition) { this.slider.setHeight(sliderSize); this.slider.setTop(sliderPosition); } _renderDomNode(largeSize, smallSize) { this.domNode.setWidth(smallSize); this.domNode.setHeight(largeSize); this.domNode.setRight(0); this.domNode.setTop(0); } onDidScroll(e) { this._shouldRender = this._onElementScrollSize(e.scrollHeight) || this._shouldRender; this._shouldRender = this._onElementScrollPosition(e.scrollTop) || this._shouldRender; this._shouldRender = this._onElementSize(e.height) || this._shouldRender; return this._shouldRender; } _mouseDownRelativePosition(offsetX, offsetY) { return offsetY; } _sliderMousePosition(e) { return e.posy; } _sliderOrthogonalMousePosition(e) { return e.posx; } _updateScrollbarSize(size) { this.slider.setWidth(size); } writeScrollPosition(target, scrollPosition) { target.scrollTop = scrollPosition; } updateOptions(options) { this.updateScrollbarSize(options.vertical === 2 /* Hidden */ ? 0 : options.verticalScrollbarSize); // give priority to vertical scroll bar over horizontal and let it scroll all the way to the bottom this._scrollbarState.setOppositeScrollbarSize(0); this._visibilityController.setVisibility(options.vertical); this._scrollByPage = options.scrollByPage; } } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/event.js var common_event = __webpack_require__(4348); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/scrollable.js var common_scrollable = __webpack_require__(28962); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/scrollbar/media/scrollbars.css // extracted by mini-css-extract-plugin ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const HIDE_TIMEOUT = 500; const SCROLL_WHEEL_SENSITIVITY = 50; const SCROLL_WHEEL_SMOOTH_SCROLL_ENABLED = true; class MouseWheelClassifierItem { constructor(timestamp, deltaX, deltaY) { this.timestamp = timestamp; this.deltaX = deltaX; this.deltaY = deltaY; this.score = 0; } } class MouseWheelClassifier { constructor() { this._capacity = 5; this._memory = []; this._front = -1; this._rear = -1; } isPhysicalMouseWheel() { if (this._front === -1 && this._rear === -1) { // no elements return false; } // 0.5 * last + 0.25 * 2nd last + 0.125 * 3rd last + ... let remainingInfluence = 1; let score = 0; let iteration = 1; let index = this._rear; do { const influence = (index === this._front ? remainingInfluence : Math.pow(2, -iteration)); remainingInfluence -= influence; score += this._memory[index].score * influence; if (index === this._front) { break; } index = (this._capacity + index - 1) % this._capacity; iteration++; } while (true); return (score <= 0.5); } accept(timestamp, deltaX, deltaY) { const item = new MouseWheelClassifierItem(timestamp, deltaX, deltaY); item.score = this._computeScore(item); if (this._front === -1 && this._rear === -1) { this._memory[0] = item; this._front = 0; this._rear = 0; } else { this._rear = (this._rear + 1) % this._capacity; if (this._rear === this._front) { // Drop oldest this._front = (this._front + 1) % this._capacity; } this._memory[this._rear] = item; } } /** * A score between 0 and 1 for `item`. * - a score towards 0 indicates that the source appears to be a physical mouse wheel * - a score towards 1 indicates that the source appears to be a touchpad or magic mouse, etc. */ _computeScore(item) { if (Math.abs(item.deltaX) > 0 && Math.abs(item.deltaY) > 0) { // both axes exercised => definitely not a physical mouse wheel return 1; } let score = 0.5; const prev = (this._front === -1 && this._rear === -1 ? null : this._memory[this._rear]); if (prev) { // const deltaT = item.timestamp - prev.timestamp; // if (deltaT < 1000 / 30) { // // sooner than X times per second => indicator that this is not a physical mouse wheel // score += 0.25; // } // if (item.deltaX === prev.deltaX && item.deltaY === prev.deltaY) { // // equal amplitude => indicator that this is a physical mouse wheel // score -= 0.25; // } } if (!this._isAlmostInt(item.deltaX) || !this._isAlmostInt(item.deltaY)) { // non-integer deltas => indicator that this is not a physical mouse wheel score += 0.25; } return Math.min(Math.max(score, 0), 1); } _isAlmostInt(value) { const delta = Math.abs(Math.round(value) - value); return (delta < 0.01); } } MouseWheelClassifier.INSTANCE = new MouseWheelClassifier(); class AbstractScrollableElement extends widget/* Widget */.$ { constructor(element, options, scrollable) { super(); this._onScroll = this._register(new common_event/* Emitter */.Q5()); this.onScroll = this._onScroll.event; this._onWillScroll = this._register(new common_event/* Emitter */.Q5()); element.style.overflow = 'hidden'; this._options = resolveOptions(options); this._scrollable = scrollable; this._register(this._scrollable.onScroll((e) => { this._onWillScroll.fire(e); this._onDidScroll(e); this._onScroll.fire(e); })); const scrollbarHost = { onMouseWheel: (mouseWheelEvent) => this._onMouseWheel(mouseWheelEvent), onDragStart: () => this._onDragStart(), onDragEnd: () => this._onDragEnd(), }; this._verticalScrollbar = this._register(new VerticalScrollbar(this._scrollable, this._options, scrollbarHost)); this._horizontalScrollbar = this._register(new HorizontalScrollbar(this._scrollable, this._options, scrollbarHost)); 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(element); this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode); this._domNode.appendChild(this._verticalScrollbar.domNode.domNode); if (this._options.useShadows) { this._leftShadowDomNode = (0,fastDomNode/* createFastDomNode */.X)(document.createElement('div')); this._leftShadowDomNode.setClassName('shadow'); this._domNode.appendChild(this._leftShadowDomNode.domNode); this._topShadowDomNode = (0,fastDomNode/* createFastDomNode */.X)(document.createElement('div')); this._topShadowDomNode.setClassName('shadow'); this._domNode.appendChild(this._topShadowDomNode.domNode); this._topLeftShadowDomNode = (0,fastDomNode/* createFastDomNode */.X)(document.createElement('div')); this._topLeftShadowDomNode.setClassName('shadow'); this._domNode.appendChild(this._topLeftShadowDomNode.domNode); } else { 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.onnonbubblingmouseout(this._listenOnDomNode, (e) => this._onMouseOut(e)); this._hideTimeout = this._register(new common_async/* TimeoutTimer */._F()); this._isDragging = false; this._mouseIsOver = false; this._shouldRender = true; this._revealOnScroll = true; } dispose() { this._mouseWheelToDispose = (0,lifecycle/* dispose */.B9)(this._mouseWheelToDispose); super.dispose(); } /** * Get the generated 'scrollable' dom node */ getDomNode() { return this._domNode; } getOverviewRulerLayoutInfo() { return { parent: this._domNode, insertBefore: this._verticalScrollbar.domNode.domNode, }; } /** * Delegate a mouse down event to the vertical scrollbar. * This is to help with clicking somewhere else and having the scrollbar react. */ delegateVerticalScrollbarMouseDown(browserEvent) { this._verticalScrollbar.delegateMouseDown(browserEvent); } getScrollDimensions() { return this._scrollable.getScrollDimensions(); } setScrollDimensions(dimensions) { this._scrollable.setScrollDimensions(dimensions, false); } /** * Update the class name of the scrollable element. */ updateClassName(newClassName) { this._options.className = newClassName; // Defaults are different on Macs if (platform/* isMacintosh */.dz) { this._options.className += ' mac'; } this._domNode.className = 'monaco-scrollable-element ' + this._options.className; } /** * Update configuration options for the scrollbar. */ updateOptions(newOptions) { if (typeof newOptions.handleMouseWheel !== 'undefined') { this._options.handleMouseWheel = newOptions.handleMouseWheel; this._setListeningToMouseWheel(this._options.handleMouseWheel); } if (typeof newOptions.mouseWheelScrollSensitivity !== 'undefined') { this._options.mouseWheelScrollSensitivity = newOptions.mouseWheelScrollSensitivity; } if (typeof newOptions.fastScrollSensitivity !== 'undefined') { this._options.fastScrollSensitivity = newOptions.fastScrollSensitivity; } if (typeof newOptions.scrollPredominantAxis !== 'undefined') { this._options.scrollPredominantAxis = newOptions.scrollPredominantAxis; } if (typeof newOptions.horizontal !== 'undefined') { this._options.horizontal = newOptions.horizontal; } if (typeof newOptions.vertical !== 'undefined') { this._options.vertical = newOptions.vertical; } if (typeof newOptions.horizontalScrollbarSize !== 'undefined') { this._options.horizontalScrollbarSize = newOptions.horizontalScrollbarSize; } if (typeof newOptions.verticalScrollbarSize !== 'undefined') { this._options.verticalScrollbarSize = newOptions.verticalScrollbarSize; } if (typeof newOptions.scrollByPage !== 'undefined') { this._options.scrollByPage = newOptions.scrollByPage; } this._horizontalScrollbar.updateOptions(this._options); this._verticalScrollbar.updateOptions(this._options); if (!this._options.lazyRender) { this._render(); } } // -------------------- mouse wheel scrolling -------------------- _setListeningToMouseWheel(shouldListen) { const isListening = (this._mouseWheelToDispose.length > 0); if (isListening === shouldListen) { // No change return; } // Stop listening (if necessary) this._mouseWheelToDispose = (0,lifecycle/* dispose */.B9)(this._mouseWheelToDispose); // Start listening (if necessary) if (shouldListen) { const onMouseWheel = (browserEvent) => { this._onMouseWheel(new mouseEvent/* StandardWheelEvent */.q(browserEvent)); }; this._mouseWheelToDispose.push(dom/* addDisposableListener */.nm(this._listenOnDomNode, dom/* EventType */.tw.MOUSE_WHEEL, onMouseWheel, { passive: false })); } } _onMouseWheel(e) { const classifier = MouseWheelClassifier.INSTANCE; if (SCROLL_WHEEL_SMOOTH_SCROLL_ENABLED) { const osZoomFactor = window.devicePixelRatio / (0,browser/* getZoomFactor */.ie)(); if (platform/* isWindows */.ED || platform/* isLinux */.IJ) { // On Windows and Linux, the incoming delta events are multiplied with the OS zoom factor. // The OS zoom factor can be reverse engineered by using the device pixel ratio and the configured zoom factor into account. classifier.accept(Date.now(), e.deltaX / osZoomFactor, e.deltaY / osZoomFactor); } else { classifier.accept(Date.now(), e.deltaX, e.deltaY); } } // console.log(`${Date.now()}, ${e.deltaY}, ${e.deltaX}`); let didScroll = false; if (e.deltaY || e.deltaX) { let deltaY = e.deltaY * this._options.mouseWheelScrollSensitivity; let deltaX = e.deltaX * this._options.mouseWheelScrollSensitivity; if (this._options.scrollPredominantAxis) { if (Math.abs(deltaY) >= Math.abs(deltaX)) { deltaX = 0; } else { deltaY = 0; } } if (this._options.flipAxes) { [deltaY, deltaX] = [deltaX, deltaY]; } // Convert vertical scrolling to horizontal if shift is held, this // is handled at a higher level on Mac const shiftConvert = !platform/* isMacintosh */.dz && e.browserEvent && e.browserEvent.shiftKey; if ((this._options.scrollYToX || shiftConvert) && !deltaX) { deltaX = deltaY; deltaY = 0; } if (e.browserEvent && e.browserEvent.altKey) { // fastScrolling deltaX = deltaX * this._options.fastScrollSensitivity; deltaY = deltaY * this._options.fastScrollSensitivity; } const futureScrollPosition = this._scrollable.getFutureScrollPosition(); let desiredScrollPosition = {}; if (deltaY) { const deltaScrollTop = SCROLL_WHEEL_SENSITIVITY * deltaY; // Here we convert values such as -0.3 to -1 or 0.3 to 1, otherwise low speed scrolling will never scroll const desiredScrollTop = futureScrollPosition.scrollTop - (deltaScrollTop < 0 ? Math.floor(deltaScrollTop) : Math.ceil(deltaScrollTop)); this._verticalScrollbar.writeScrollPosition(desiredScrollPosition, desiredScrollTop); } if (deltaX) { const deltaScrollLeft = SCROLL_WHEEL_SENSITIVITY * deltaX; // Here we convert values such as -0.3 to -1 or 0.3 to 1, otherwise low speed scrolling will never scroll const desiredScrollLeft = futureScrollPosition.scrollLeft - (deltaScrollLeft < 0 ? Math.floor(deltaScrollLeft) : Math.ceil(deltaScrollLeft)); this._horizontalScrollbar.writeScrollPosition(desiredScrollPosition, desiredScrollLeft); } // Check that we are scrolling towards a location which is valid desiredScrollPosition = this._scrollable.validateScrollPosition(desiredScrollPosition); if (futureScrollPosition.scrollLeft !== desiredScrollPosition.scrollLeft || futureScrollPosition.scrollTop !== desiredScrollPosition.scrollTop) { const canPerformSmoothScroll = (SCROLL_WHEEL_SMOOTH_SCROLL_ENABLED && this._options.mouseWheelSmoothScroll && classifier.isPhysicalMouseWheel()); if (canPerformSmoothScroll) { this._scrollable.setScrollPositionSmooth(desiredScrollPosition); } else { this._scrollable.setScrollPositionNow(desiredScrollPosition); } didScroll = true; } } let consumeMouseWheel = didScroll; if (!consumeMouseWheel && this._options.alwaysConsumeMouseWheel) { consumeMouseWheel = true; } if (!consumeMouseWheel && this._options.consumeMouseWheelIfScrollbarIsNeeded && (this._verticalScrollbar.isNeeded() || this._horizontalScrollbar.isNeeded())) { consumeMouseWheel = true; } if (consumeMouseWheel) { e.preventDefault(); e.stopPropagation(); } } _onDidScroll(e) { this._shouldRender = this._horizontalScrollbar.onDidScroll(e) || this._shouldRender; this._shouldRender = this._verticalScrollbar.onDidScroll(e) || this._shouldRender; if (this._options.useShadows) { this._shouldRender = true; } if (this._revealOnScroll) { this._reveal(); } if (!this._options.lazyRender) { this._render(); } } /** * Render / mutate the DOM now. * Should be used together with the ctor option `lazyRender`. */ renderNow() { if (!this._options.lazyRender) { throw new Error('Please use `lazyRender` together with `renderNow`!'); } this._render(); } _render() { if (!this._shouldRender) { return; } this._shouldRender = false; this._horizontalScrollbar.render(); this._verticalScrollbar.render(); if (this._options.useShadows) { const scrollState = this._scrollable.getCurrentScrollPosition(); const enableTop = scrollState.scrollTop > 0; const enableLeft = scrollState.scrollLeft > 0; const leftClassName = (enableLeft ? ' left' : ''); const topClassName = (enableTop ? ' top' : ''); const topLeftClassName = (enableLeft || enableTop ? ' top-left-corner' : ''); this._leftShadowDomNode.setClassName(`shadow${leftClassName}`); this._topShadowDomNode.setClassName(`shadow${topClassName}`); this._topLeftShadowDomNode.setClassName(`shadow${topLeftClassName}${topClassName}${leftClassName}`); } } // -------------------- fade in / fade out -------------------- _onDragStart() { this._isDragging = true; this._reveal(); } _onDragEnd() { this._isDragging = false; this._hide(); } _onMouseOut(e) { this._mouseIsOver = false; this._hide(); } _onMouseOver(e) { this._mouseIsOver = true; this._reveal(); } _reveal() { this._verticalScrollbar.beginReveal(); this._horizontalScrollbar.beginReveal(); this._scheduleHide(); } _hide() { if (!this._mouseIsOver && !this._isDragging) { this._verticalScrollbar.beginHide(); this._horizontalScrollbar.beginHide(); } } _scheduleHide() { if (!this._mouseIsOver && !this._isDragging) { this._hideTimeout.cancelAndSet(() => this._hide(), HIDE_TIMEOUT); } } } class ScrollableElement extends AbstractScrollableElement { constructor(element, options) { options = options || {}; options.mouseWheelSmoothScroll = false; const scrollable = new common_scrollable/* Scrollable */.Rm(0, (callback) => dom/* scheduleAtNextAnimationFrame */.jL(callback)); super(element, options, scrollable); this._register(scrollable); } setScrollPosition(update) { this._scrollable.setScrollPositionNow(update); } getScrollPosition() { return this._scrollable.getCurrentScrollPosition(); } } class SmoothScrollableElement extends AbstractScrollableElement { constructor(element, options, scrollable) { super(element, options, scrollable); } setScrollPosition(update) { if (update.reuseAnimation) { this._scrollable.setScrollPositionSmooth(update, update.reuseAnimation); } else { this._scrollable.setScrollPositionNow(update); } } getScrollPosition() { return this._scrollable.getCurrentScrollPosition(); } } class DomScrollableElement extends ScrollableElement { constructor(element, options) { super(element, options); this._element = element; this.onScroll((e) => { if (e.scrollTopChanged) { this._element.scrollTop = e.scrollTop; } if (e.scrollLeftChanged) { this._element.scrollLeft = e.scrollLeft; } }); this.scanDomNode(); } scanDomNode() { // width, scrollLeft, scrollWidth, height, scrollTop, scrollHeight 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 resolveOptions(opts) { const result = { lazyRender: (typeof opts.lazyRender !== 'undefined' ? opts.lazyRender : false), className: (typeof opts.className !== 'undefined' ? opts.className : ''), useShadows: (typeof opts.useShadows !== 'undefined' ? opts.useShadows : true), handleMouseWheel: (typeof opts.handleMouseWheel !== 'undefined' ? opts.handleMouseWheel : true), flipAxes: (typeof opts.flipAxes !== 'undefined' ? opts.flipAxes : false), consumeMouseWheelIfScrollbarIsNeeded: (typeof opts.consumeMouseWheelIfScrollbarIsNeeded !== 'undefined' ? opts.consumeMouseWheelIfScrollbarIsNeeded : false), alwaysConsumeMouseWheel: (typeof opts.alwaysConsumeMouseWheel !== 'undefined' ? opts.alwaysConsumeMouseWheel : false), scrollYToX: (typeof opts.scrollYToX !== 'undefined' ? opts.scrollYToX : false), mouseWheelScrollSensitivity: (typeof opts.mouseWheelScrollSensitivity !== 'undefined' ? opts.mouseWheelScrollSensitivity : 1), fastScrollSensitivity: (typeof opts.fastScrollSensitivity !== 'undefined' ? opts.fastScrollSensitivity : 5), scrollPredominantAxis: (typeof opts.scrollPredominantAxis !== 'undefined' ? opts.scrollPredominantAxis : true), mouseWheelSmoothScroll: (typeof opts.mouseWheelSmoothScroll !== 'undefined' ? opts.mouseWheelSmoothScroll : true), arrowSize: (typeof opts.arrowSize !== 'undefined' ? opts.arrowSize : 11), listenOnDomNode: (typeof opts.listenOnDomNode !== 'undefined' ? opts.listenOnDomNode : null), horizontal: (typeof opts.horizontal !== 'undefined' ? opts.horizontal : 1 /* Auto */), horizontalScrollbarSize: (typeof opts.horizontalScrollbarSize !== 'undefined' ? opts.horizontalScrollbarSize : 10), horizontalSliderSize: (typeof opts.horizontalSliderSize !== 'undefined' ? opts.horizontalSliderSize : 0), horizontalHasArrows: (typeof opts.horizontalHasArrows !== 'undefined' ? opts.horizontalHasArrows : false), vertical: (typeof opts.vertical !== 'undefined' ? opts.vertical : 1 /* Auto */), verticalScrollbarSize: (typeof opts.verticalScrollbarSize !== 'undefined' ? opts.verticalScrollbarSize : 10), verticalHasArrows: (typeof opts.verticalHasArrows !== 'undefined' ? opts.verticalHasArrows : false), verticalSliderSize: (typeof opts.verticalSliderSize !== 'undefined' ? opts.verticalSliderSize : 0), scrollByPage: (typeof opts.scrollByPage !== 'undefined' ? opts.scrollByPage : false) }; result.horizontalSliderSize = (typeof opts.horizontalSliderSize !== 'undefined' ? opts.horizontalSliderSize : result.horizontalScrollbarSize); result.verticalSliderSize = (typeof opts.verticalSliderSize !== 'undefined' ? opts.verticalSliderSize : result.verticalScrollbarSize); // Defaults are different on Macs if (platform/* isMacintosh */.dz) { result.className += ' mac'; } return result; } /***/ }), /***/ 86916: /*!********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/splitview/splitview.js + 1 modules ***! \********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { M: function() { return /* binding */ Sizing; }, z: function() { return /* binding */ SplitView; } }); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dom.js var dom = __webpack_require__(69454); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/sash/sash.js + 1 modules var sash_sash = __webpack_require__(88048); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/scrollbar/scrollableElement.js + 7 modules var scrollableElement = __webpack_require__(78265); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/arrays.js var arrays = __webpack_require__(43506); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/color.js var color = __webpack_require__(51737); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/event.js var common_event = __webpack_require__(4348); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/lifecycle.js var lifecycle = __webpack_require__(69323); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/numbers.js var numbers = __webpack_require__(56722); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/scrollable.js var scrollable = __webpack_require__(28962); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/types.js var types = __webpack_require__(72999); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/splitview/splitview.css // extracted by mini-css-extract-plugin ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/splitview/splitview.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const defaultStyles = { separatorBorder: color/* Color */.Il.transparent }; class ViewItem { constructor(container, view, size, disposable) { this.container = container; this.view = view; this.disposable = disposable; this._cachedVisibleSize = undefined; if (typeof size === 'number') { this._size = size; this._cachedVisibleSize = undefined; container.classList.add('visible'); } else { this._size = 0; this._cachedVisibleSize = size.cachedVisibleSize; } } set size(size) { this._size = size; } get size() { return this._size; } get visible() { return typeof this._cachedVisibleSize === 'undefined'; } setVisible(visible, size) { if (visible === this.visible) { return; } if (visible) { this.size = (0,numbers/* clamp */.u)(this._cachedVisibleSize, this.viewMinimumSize, this.viewMaximumSize); this._cachedVisibleSize = undefined; } else { this._cachedVisibleSize = typeof size === 'number' ? size : this.size; this.size = 0; } this.container.classList.toggle('visible', visible); if (this.view.setVisible) { this.view.setVisible(visible); } } 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 snap() { return !!this.view.snap; } set enabled(enabled) { this.container.style.pointerEvents = enabled ? '' : 'none'; } layout(offset, layoutContext) { this.layoutContainer(offset); this.view.layout(this.size, offset, layoutContext); } dispose() { this.disposable.dispose(); return this.view; } } class VerticalViewItem extends ViewItem { layoutContainer(offset) { this.container.style.top = `${offset}px`; this.container.style.height = `${this.size}px`; } } class HorizontalViewItem extends ViewItem { layoutContainer(offset) { this.container.style.left = `${offset}px`; this.container.style.width = `${this.size}px`; } } var State; (function (State) { State[State["Idle"] = 0] = "Idle"; State[State["Busy"] = 1] = "Busy"; })(State || (State = {})); var Sizing; (function (Sizing) { Sizing.Distribute = { type: 'distribute' }; function Split(index) { return { type: 'split', index }; } Sizing.Split = Split; function Invisible(cachedVisibleSize) { return { type: 'invisible', cachedVisibleSize }; } Sizing.Invisible = Invisible; })(Sizing || (Sizing = {})); class SplitView extends lifecycle/* Disposable */.JT { constructor(container, options = {}) { var _a, _b; super(); this.size = 0; this.contentSize = 0; this.proportions = undefined; this.viewItems = []; this.sashItems = []; this.state = State.Idle; this._onDidSashChange = this._register(new common_event/* Emitter */.Q5()); this.onDidSashChange = this._onDidSashChange.event; this._onDidSashReset = this._register(new common_event/* Emitter */.Q5()); this._startSnappingEnabled = true; this._endSnappingEnabled = true; this.orientation = types/* isUndefined */.o8(options.orientation) ? 0 /* VERTICAL */ : options.orientation; this.inverseAltBehavior = !!options.inverseAltBehavior; this.proportionalLayout = types/* isUndefined */.o8(options.proportionalLayout) ? true : !!options.proportionalLayout; this.getSashOrthogonalSize = options.getSashOrthogonalSize; this.el = document.createElement('div'); this.el.classList.add('monaco-split-view2'); this.el.classList.add(this.orientation === 0 /* VERTICAL */ ? 'vertical' : 'horizontal'); container.appendChild(this.el); this.sashContainer = (0,dom/* append */.R3)(this.el, (0,dom.$)('.sash-container')); this.viewContainer = (0,dom.$)('.split-view-container'); this.scrollable = new scrollable/* Scrollable */.Rm(125, dom/* scheduleAtNextAnimationFrame */.jL); this.scrollableElement = this._register(new scrollableElement/* SmoothScrollableElement */.$Z(this.viewContainer, { vertical: this.orientation === 0 /* VERTICAL */ ? ((_a = options.scrollbarVisibility) !== null && _a !== void 0 ? _a : 1 /* Auto */) : 2 /* Hidden */, horizontal: this.orientation === 1 /* HORIZONTAL */ ? ((_b = options.scrollbarVisibility) !== null && _b !== void 0 ? _b : 1 /* Auto */) : 2 /* Hidden */ }, this.scrollable)); this.onDidScroll = this.scrollableElement.onScroll; this._register(this.onDidScroll(e => { this.viewContainer.scrollTop = e.scrollTop; this.viewContainer.scrollLeft = e.scrollLeft; })); (0,dom/* append */.R3)(this.el, this.scrollableElement.getDomNode()); this.style(options.styles || defaultStyles); // We have an existing set of view, add them now if (options.descriptor) { this.size = options.descriptor.size; options.descriptor.views.forEach((viewDescriptor, index) => { const sizing = types/* isUndefined */.o8(viewDescriptor.visible) || viewDescriptor.visible ? viewDescriptor.size : { type: 'invisible', cachedVisibleSize: viewDescriptor.size }; const view = viewDescriptor.view; this.doAddView(view, sizing, index, true); }); // Initialize content size and proportions for first layout this.contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); this.saveProportions(); } } get orthogonalStartSash() { return this._orthogonalStartSash; } set orthogonalStartSash(sash) { for (const sashItem of this.sashItems) { sashItem.sash.orthogonalStartSash = sash; } this._orthogonalStartSash = sash; } get orthogonalEndSash() { return this._orthogonalEndSash; } set orthogonalEndSash(sash) { for (const sashItem of this.sashItems) { sashItem.sash.orthogonalEndSash = sash; } this._orthogonalEndSash = sash; } get startSnappingEnabled() { return this._startSnappingEnabled; } set startSnappingEnabled(startSnappingEnabled) { if (this._startSnappingEnabled === startSnappingEnabled) { return; } this._startSnappingEnabled = startSnappingEnabled; this.updateSashEnablement(); } get endSnappingEnabled() { return this._endSnappingEnabled; } set endSnappingEnabled(endSnappingEnabled) { if (this._endSnappingEnabled === endSnappingEnabled) { return; } this._endSnappingEnabled = endSnappingEnabled; this.updateSashEnablement(); } style(styles) { if (styles.separatorBorder.isTransparent()) { this.el.classList.remove('separator-border'); this.el.style.removeProperty('--separator-border'); } else { this.el.classList.add('separator-border'); this.el.style.setProperty('--separator-border', styles.separatorBorder.toString()); } } addView(view, size, index = this.viewItems.length, skipLayout) { this.doAddView(view, size, index, skipLayout); } layout(size, layoutContext) { const previousSize = Math.max(this.size, this.contentSize); this.size = size; this.layoutContext = layoutContext; if (!this.proportions) { const indexes = (0,arrays/* range */.w6)(this.viewItems.length); const lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 1 /* Low */); const highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 2 /* High */); this.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes); } else { for (let i = 0; i < this.viewItems.length; i++) { const item = this.viewItems[i]; item.size = (0,numbers/* clamp */.u)(Math.round(this.proportions[i] * size), item.minimumSize, item.maximumSize); } } this.distributeEmptySpace(); this.layoutViews(); } saveProportions() { if (this.proportionalLayout && this.contentSize > 0) { this.proportions = this.viewItems.map(i => i.size / this.contentSize); } } onSashStart({ sash, start, alt }) { for (const item of this.viewItems) { item.enabled = false; } const index = this.sashItems.findIndex(item => item.sash === sash); // This way, we can press Alt while we resize a sash, macOS style! const disposable = (0,lifecycle/* combinedDisposable */.F8)((0,dom/* addDisposableListener */.nm)(document.body, 'keydown', e => resetSashDragState(this.sashDragState.current, e.altKey)), (0,dom/* addDisposableListener */.nm)(document.body, 'keyup', () => resetSashDragState(this.sashDragState.current, false))); const resetSashDragState = (start, alt) => { const sizes = this.viewItems.map(i => i.size); let minDelta = Number.NEGATIVE_INFINITY; let maxDelta = Number.POSITIVE_INFINITY; if (this.inverseAltBehavior) { alt = !alt; } if (alt) { // When we're using the last sash with Alt, we're resizing // the view to the left/up, instead of right/down as usual // Thus, we must do the inverse of the usual const isLastSash = index === this.sashItems.length - 1; if (isLastSash) { const viewItem = this.viewItems[index]; minDelta = (viewItem.minimumSize - viewItem.size) / 2; maxDelta = (viewItem.maximumSize - viewItem.size) / 2; } else { const viewItem = this.viewItems[index + 1]; minDelta = (viewItem.size - viewItem.maximumSize) / 2; maxDelta = (viewItem.size - viewItem.minimumSize) / 2; } } let snapBefore; let snapAfter; if (!alt) { const upIndexes = (0,arrays/* range */.w6)(index, -1); const downIndexes = (0,arrays/* range */.w6)(index + 1, this.viewItems.length); const minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0); const maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].viewMaximumSize - sizes[i]), 0); const maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0); const minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].viewMaximumSize), 0); const minDelta = Math.max(minDeltaUp, minDeltaDown); const maxDelta = Math.min(maxDeltaDown, maxDeltaUp); const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); const snapAfterIndex = this.findFirstSnapIndex(downIndexes); if (typeof snapBeforeIndex === 'number') { const viewItem = this.viewItems[snapBeforeIndex]; const halfSize = Math.floor(viewItem.viewMinimumSize / 2); snapBefore = { index: snapBeforeIndex, limitDelta: viewItem.visible ? minDelta - halfSize : minDelta + halfSize, size: viewItem.size }; } if (typeof snapAfterIndex === 'number') { const viewItem = this.viewItems[snapAfterIndex]; const halfSize = Math.floor(viewItem.viewMinimumSize / 2); snapAfter = { index: snapAfterIndex, limitDelta: viewItem.visible ? maxDelta + halfSize : maxDelta - halfSize, size: viewItem.size }; } } this.sashDragState = { start, current: start, index, sizes, minDelta, maxDelta, alt, snapBefore, snapAfter, disposable }; }; resetSashDragState(start, alt); } onSashChange({ current }) { const { index, start, sizes, alt, minDelta, maxDelta, snapBefore, snapAfter } = this.sashDragState; this.sashDragState.current = current; const delta = current - start; const newDelta = this.resize(index, delta, sizes, undefined, undefined, minDelta, maxDelta, snapBefore, snapAfter); if (alt) { const isLastSash = index === this.sashItems.length - 1; const newSizes = this.viewItems.map(i => i.size); const viewItemIndex = isLastSash ? index : index + 1; const viewItem = this.viewItems[viewItemIndex]; const newMinDelta = viewItem.size - viewItem.maximumSize; const newMaxDelta = viewItem.size - viewItem.minimumSize; const resizeIndex = isLastSash ? index - 1 : index + 1; this.resize(resizeIndex, -newDelta, newSizes, undefined, undefined, newMinDelta, newMaxDelta); } this.distributeEmptySpace(); this.layoutViews(); } onSashEnd(index) { this._onDidSashChange.fire(index); this.sashDragState.disposable.dispose(); this.saveProportions(); for (const item of this.viewItems) { item.enabled = true; } } onViewChange(item, size) { const index = this.viewItems.indexOf(item); if (index < 0 || index >= this.viewItems.length) { return; } size = typeof size === 'number' ? size : item.size; size = (0,numbers/* clamp */.u)(size, item.minimumSize, item.maximumSize); if (this.inverseAltBehavior && index > 0) { // In this case, we want the view to grow or shrink both sides equally // so we just resize the "left" side by half and let `resize` do the clamping magic this.resize(index - 1, Math.floor((item.size - size) / 2)); this.distributeEmptySpace(); this.layoutViews(); } else { item.size = size; this.relayout([index], undefined); } } resizeView(index, size) { if (this.state !== State.Idle) { throw new Error('Cant modify splitview'); } this.state = State.Busy; if (index < 0 || index >= this.viewItems.length) { return; } const indexes = (0,arrays/* range */.w6)(this.viewItems.length).filter(i => i !== index); const lowPriorityIndexes = [...indexes.filter(i => this.viewItems[i].priority === 1 /* Low */), index]; const highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 2 /* High */); const item = this.viewItems[index]; size = Math.round(size); size = (0,numbers/* clamp */.u)(size, item.minimumSize, Math.min(item.maximumSize, this.size)); item.size = size; this.relayout(lowPriorityIndexes, highPriorityIndexes); this.state = State.Idle; } distributeViewSizes() { const flexibleViewItems = []; let flexibleSize = 0; for (const item of this.viewItems) { if (item.maximumSize - item.minimumSize > 0) { flexibleViewItems.push(item); flexibleSize += item.size; } } const size = Math.floor(flexibleSize / flexibleViewItems.length); for (const item of flexibleViewItems) { item.size = (0,numbers/* clamp */.u)(size, item.minimumSize, item.maximumSize); } const indexes = (0,arrays/* range */.w6)(this.viewItems.length); const lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 1 /* Low */); const highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 2 /* High */); this.relayout(lowPriorityIndexes, highPriorityIndexes); } getViewSize(index) { if (index < 0 || index >= this.viewItems.length) { return -1; } return this.viewItems[index].size; } doAddView(view, size, index = this.viewItems.length, skipLayout) { if (this.state !== State.Idle) { throw new Error('Cant modify splitview'); } this.state = State.Busy; // Add view const container = (0,dom.$)('.split-view-view'); if (index === this.viewItems.length) { this.viewContainer.appendChild(container); } else { this.viewContainer.insertBefore(container, this.viewContainer.children.item(index)); } const onChangeDisposable = view.onDidChange(size => this.onViewChange(item, size)); const containerDisposable = (0,lifecycle/* toDisposable */.OF)(() => this.viewContainer.removeChild(container)); const disposable = (0,lifecycle/* combinedDisposable */.F8)(onChangeDisposable, containerDisposable); let viewSize; if (typeof size === 'number') { viewSize = size; } else if (size.type === 'split') { viewSize = this.getViewSize(size.index) / 2; } else if (size.type === 'invisible') { viewSize = { cachedVisibleSize: size.cachedVisibleSize }; } else { viewSize = view.minimumSize; } const item = this.orientation === 0 /* VERTICAL */ ? new VerticalViewItem(container, view, viewSize, disposable) : new HorizontalViewItem(container, view, viewSize, disposable); this.viewItems.splice(index, 0, item); // Add sash if (this.viewItems.length > 1) { let opts = { orthogonalStartSash: this.orthogonalStartSash, orthogonalEndSash: this.orthogonalEndSash }; const sash = this.orientation === 0 /* VERTICAL */ ? new sash_sash/* Sash */.g(this.sashContainer, { getHorizontalSashTop: s => this.getSashPosition(s), getHorizontalSashWidth: this.getSashOrthogonalSize }, Object.assign(Object.assign({}, opts), { orientation: 1 /* HORIZONTAL */ })) : new sash_sash/* Sash */.g(this.sashContainer, { getVerticalSashLeft: s => this.getSashPosition(s), getVerticalSashHeight: this.getSashOrthogonalSize }, Object.assign(Object.assign({}, opts), { orientation: 0 /* VERTICAL */ })); const sashEventMapper = this.orientation === 0 /* VERTICAL */ ? (e) => ({ sash, start: e.startY, current: e.currentY, alt: e.altKey }) : (e) => ({ sash, start: e.startX, current: e.currentX, alt: e.altKey }); const onStart = common_event/* Event */.ju.map(sash.onDidStart, sashEventMapper); const onStartDisposable = onStart(this.onSashStart, this); const onChange = common_event/* Event */.ju.map(sash.onDidChange, sashEventMapper); const onChangeDisposable = onChange(this.onSashChange, this); const onEnd = common_event/* Event */.ju.map(sash.onDidEnd, () => this.sashItems.findIndex(item => item.sash === sash)); const onEndDisposable = onEnd(this.onSashEnd, this); const onDidResetDisposable = sash.onDidReset(() => { const index = this.sashItems.findIndex(item => item.sash === sash); const upIndexes = (0,arrays/* range */.w6)(index, -1); const downIndexes = (0,arrays/* range */.w6)(index + 1, this.viewItems.length); const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); const snapAfterIndex = this.findFirstSnapIndex(downIndexes); if (typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible) { return; } if (typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible) { return; } this._onDidSashReset.fire(index); }); const disposable = (0,lifecycle/* combinedDisposable */.F8)(onStartDisposable, onChangeDisposable, onEndDisposable, onDidResetDisposable, sash); const sashItem = { sash, disposable }; this.sashItems.splice(index - 1, 0, sashItem); } container.appendChild(view.element); let highPriorityIndexes; if (typeof size !== 'number' && size.type === 'split') { highPriorityIndexes = [size.index]; } if (!skipLayout) { this.relayout([index], highPriorityIndexes); } this.state = State.Idle; if (!skipLayout && typeof size !== 'number' && size.type === 'distribute') { this.distributeViewSizes(); } } relayout(lowPriorityIndexes, highPriorityIndexes) { const contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); this.resize(this.viewItems.length - 1, this.size - contentSize, undefined, lowPriorityIndexes, highPriorityIndexes); this.distributeEmptySpace(); this.layoutViews(); this.saveProportions(); } resize(index, delta, sizes = this.viewItems.map(i => i.size), lowPriorityIndexes, highPriorityIndexes, overloadMinDelta = Number.NEGATIVE_INFINITY, overloadMaxDelta = Number.POSITIVE_INFINITY, snapBefore, snapAfter) { if (index < 0 || index >= this.viewItems.length) { return 0; } const upIndexes = (0,arrays/* range */.w6)(index, -1); const downIndexes = (0,arrays/* range */.w6)(index + 1, this.viewItems.length); if (highPriorityIndexes) { for (const index of highPriorityIndexes) { (0,arrays/* pushToStart */.zI)(upIndexes, index); (0,arrays/* pushToStart */.zI)(downIndexes, index); } } if (lowPriorityIndexes) { for (const index of lowPriorityIndexes) { (0,arrays/* pushToEnd */.al)(upIndexes, index); (0,arrays/* pushToEnd */.al)(downIndexes, index); } } const upItems = upIndexes.map(i => this.viewItems[i]); const upSizes = upIndexes.map(i => sizes[i]); const downItems = downIndexes.map(i => this.viewItems[i]); const downSizes = downIndexes.map(i => sizes[i]); const minDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].minimumSize - sizes[i]), 0); const maxDeltaUp = upIndexes.reduce((r, i) => r + (this.viewItems[i].maximumSize - sizes[i]), 0); const maxDeltaDown = downIndexes.length === 0 ? Number.POSITIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].minimumSize), 0); const minDeltaDown = downIndexes.length === 0 ? Number.NEGATIVE_INFINITY : downIndexes.reduce((r, i) => r + (sizes[i] - this.viewItems[i].maximumSize), 0); const minDelta = Math.max(minDeltaUp, minDeltaDown, overloadMinDelta); const maxDelta = Math.min(maxDeltaDown, maxDeltaUp, overloadMaxDelta); let snapped = false; if (snapBefore) { const snapView = this.viewItems[snapBefore.index]; const visible = delta >= snapBefore.limitDelta; snapped = visible !== snapView.visible; snapView.setVisible(visible, snapBefore.size); } if (!snapped && snapAfter) { const snapView = this.viewItems[snapAfter.index]; const visible = delta < snapAfter.limitDelta; snapped = visible !== snapView.visible; snapView.setVisible(visible, snapAfter.size); } if (snapped) { return this.resize(index, delta, sizes, lowPriorityIndexes, highPriorityIndexes, overloadMinDelta, overloadMaxDelta); } delta = (0,numbers/* clamp */.u)(delta, minDelta, maxDelta); for (let i = 0, deltaUp = delta; i < upItems.length; i++) { const item = upItems[i]; const size = (0,numbers/* clamp */.u)(upSizes[i] + deltaUp, item.minimumSize, item.maximumSize); const viewDelta = size - upSizes[i]; deltaUp -= viewDelta; item.size = size; } for (let i = 0, deltaDown = delta; i < downItems.length; i++) { const item = downItems[i]; const size = (0,numbers/* clamp */.u)(downSizes[i] - deltaDown, item.minimumSize, item.maximumSize); const viewDelta = size - downSizes[i]; deltaDown += viewDelta; item.size = size; } return delta; } distributeEmptySpace(lowPriorityIndex) { const contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); let emptyDelta = this.size - contentSize; const indexes = (0,arrays/* range */.w6)(this.viewItems.length - 1, -1); const lowPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 1 /* Low */); const highPriorityIndexes = indexes.filter(i => this.viewItems[i].priority === 2 /* High */); for (const index of highPriorityIndexes) { (0,arrays/* pushToStart */.zI)(indexes, index); } for (const index of lowPriorityIndexes) { (0,arrays/* pushToEnd */.al)(indexes, index); } if (typeof lowPriorityIndex === 'number') { (0,arrays/* pushToEnd */.al)(indexes, lowPriorityIndex); } for (let i = 0; emptyDelta !== 0 && i < indexes.length; i++) { const item = this.viewItems[indexes[i]]; const size = (0,numbers/* clamp */.u)(item.size + emptyDelta, item.minimumSize, item.maximumSize); const viewDelta = size - item.size; emptyDelta -= viewDelta; item.size = size; } } layoutViews() { // Save new content size this.contentSize = this.viewItems.reduce((r, i) => r + i.size, 0); // Layout views let offset = 0; for (const viewItem of this.viewItems) { viewItem.layout(offset, this.layoutContext); offset += viewItem.size; } // Layout sashes this.sashItems.forEach(item => item.sash.layout()); this.updateSashEnablement(); this.updateScrollableElement(); } updateScrollableElement() { if (this.orientation === 0 /* VERTICAL */) { this.scrollableElement.setScrollDimensions({ height: this.size, scrollHeight: this.contentSize }); } else { this.scrollableElement.setScrollDimensions({ width: this.size, scrollWidth: this.contentSize }); } } updateSashEnablement() { let previous = false; const collapsesDown = this.viewItems.map(i => previous = (i.size - i.minimumSize > 0) || previous); previous = false; const expandsDown = this.viewItems.map(i => previous = (i.maximumSize - i.size > 0) || previous); const reverseViews = [...this.viewItems].reverse(); previous = false; const collapsesUp = reverseViews.map(i => previous = (i.size - i.minimumSize > 0) || previous).reverse(); previous = false; const expandsUp = reverseViews.map(i => previous = (i.maximumSize - i.size > 0) || previous).reverse(); let position = 0; for (let index = 0; index < this.sashItems.length; index++) { const { sash } = this.sashItems[index]; const viewItem = this.viewItems[index]; position += viewItem.size; const min = !(collapsesDown[index] && expandsUp[index + 1]); const max = !(expandsDown[index] && collapsesUp[index + 1]); if (min && max) { const upIndexes = (0,arrays/* range */.w6)(index, -1); const downIndexes = (0,arrays/* range */.w6)(index + 1, this.viewItems.length); const snapBeforeIndex = this.findFirstSnapIndex(upIndexes); const snapAfterIndex = this.findFirstSnapIndex(downIndexes); const snappedBefore = typeof snapBeforeIndex === 'number' && !this.viewItems[snapBeforeIndex].visible; const snappedAfter = typeof snapAfterIndex === 'number' && !this.viewItems[snapAfterIndex].visible; if (snappedBefore && collapsesUp[index] && (position > 0 || this.startSnappingEnabled)) { sash.state = 1 /* Minimum */; } else if (snappedAfter && collapsesDown[index] && (position < this.contentSize || this.endSnappingEnabled)) { sash.state = 2 /* Maximum */; } else { sash.state = 0 /* Disabled */; } } else if (min && !max) { sash.state = 1 /* Minimum */; } else if (!min && max) { sash.state = 2 /* Maximum */; } else { sash.state = 3 /* Enabled */; } } } getSashPosition(sash) { let position = 0; for (let i = 0; i < this.sashItems.length; i++) { position += this.viewItems[i].size; if (this.sashItems[i].sash === sash) { return position; } } return 0; } findFirstSnapIndex(indexes) { // visible views first for (const index of indexes) { const viewItem = this.viewItems[index]; if (!viewItem.visible) { continue; } if (viewItem.snap) { return index; } } // then, hidden views for (const index of indexes) { const viewItem = this.viewItems[index]; if (viewItem.visible && viewItem.maximumSize - viewItem.minimumSize > 0) { return undefined; } if (!viewItem.visible && viewItem.snap) { return index; } } return undefined; } dispose() { super.dispose(); this.viewItems.forEach(i => i.dispose()); this.viewItems = []; this.sashItems.forEach(i => i.disposable.dispose()); this.sashItems = []; } } /***/ }), /***/ 62758: /*!*******************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/widget.js ***! \*******************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $: function() { return /* binding */ Widget; } /* harmony export */ }); /* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom.js */ 69454); /* harmony import */ var _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../keyboardEvent.js */ 92813); /* harmony import */ var _mouseEvent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../mouseEvent.js */ 52390); /* harmony import */ var _touch_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../touch.js */ 60537); /* harmony import */ var _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../common/lifecycle.js */ 69323); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class Widget extends _common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__/* .Disposable */ .JT { onclick(domNode, listener) { this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .EventType */ .tw.CLICK, (e) => listener(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_2__/* .StandardMouseEvent */ .n(e)))); } onmousedown(domNode, listener) { this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .EventType */ .tw.MOUSE_DOWN, (e) => listener(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_2__/* .StandardMouseEvent */ .n(e)))); } onmouseover(domNode, listener) { this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .EventType */ .tw.MOUSE_OVER, (e) => listener(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_2__/* .StandardMouseEvent */ .n(e)))); } onnonbubblingmouseout(domNode, listener) { this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableNonBubblingMouseOutListener */ .j_(domNode, (e) => listener(new _mouseEvent_js__WEBPACK_IMPORTED_MODULE_2__/* .StandardMouseEvent */ .n(e)))); } onkeydown(domNode, listener) { this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .EventType */ .tw.KEY_DOWN, (e) => listener(new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .StandardKeyboardEvent */ .y(e)))); } onkeyup(domNode, listener) { this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .EventType */ .tw.KEY_UP, (e) => listener(new _keyboardEvent_js__WEBPACK_IMPORTED_MODULE_1__/* .StandardKeyboardEvent */ .y(e)))); } oninput(domNode, listener) { this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .EventType */ .tw.INPUT, listener)); } onblur(domNode, listener) { this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .EventType */ .tw.BLUR, listener)); } onfocus(domNode, listener) { this._register(_dom_js__WEBPACK_IMPORTED_MODULE_0__/* .addDisposableListener */ .nm(domNode, _dom_js__WEBPACK_IMPORTED_MODULE_0__/* .EventType */ .tw.FOCUS, listener)); } ignoreGesture(domNode) { _touch_js__WEBPACK_IMPORTED_MODULE_3__/* .Gesture */ .o.ignoreTarget(domNode); } } /***/ }), /***/ 43506: /*!***************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/arrays.js ***! \***************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ EB: function() { return /* binding */ distinct; }, /* harmony export */ Gb: function() { return /* binding */ tail; }, /* harmony export */ H9: function() { return /* binding */ ArrayQueue; }, /* harmony export */ HW: function() { return /* binding */ quickSelect; }, /* harmony export */ JH: function() { return /* binding */ tail2; }, /* harmony export */ Of: function() { return /* binding */ isNonEmptyArray; }, /* harmony export */ XY: function() { return /* binding */ isFalsyOrEmpty; }, /* harmony export */ Xh: function() { return /* binding */ firstOrDefault; }, /* harmony export */ Zv: function() { return /* binding */ arrayInsert; }, /* harmony export */ _2: function() { return /* binding */ asArray; }, /* harmony export */ al: function() { return /* binding */ pushToEnd; }, /* harmony export */ dF: function() { return /* binding */ findLast; }, /* harmony export */ db: function() { return /* binding */ splice; }, /* harmony export */ fS: function() { return /* binding */ equals; }, /* harmony export */ kX: function() { return /* binding */ coalesce; }, /* harmony export */ lG: function() { return /* binding */ findFirstInSorted; }, /* harmony export */ ry: function() { return /* binding */ binarySearch; }, /* harmony export */ vM: function() { return /* binding */ groupBy; }, /* harmony export */ w6: function() { return /* binding */ range; }, /* harmony export */ xH: function() { return /* binding */ flatten; }, /* harmony export */ zI: function() { return /* binding */ pushToStart; } /* harmony export */ }); /* unused harmony exports lastIndex, insertInto */ /** * Returns the last element of an array. * @param array The array. * @param n Which element from the end (default is zero). */ function tail(array, n = 0) { return array[array.length - (1 + n)]; } function tail2(arr) { if (arr.length === 0) { throw new Error('Invalid tail call'); } return [arr.slice(0, arr.length - 1), arr[arr.length - 1]]; } function equals(one, other, itemEquals = (a, b) => a === b) { if (one === other) { return true; } if (!one || !other) { return false; } if (one.length !== other.length) { return false; } for (let i = 0, len = one.length; i < len; i++) { if (!itemEquals(one[i], other[i])) { return false; } } return true; } function binarySearch(array, key, comparator) { let low = 0, high = array.length - 1; while (low <= high) { const mid = ((low + high) / 2) | 0; const comp = comparator(array[mid], key); if (comp < 0) { low = mid + 1; } else if (comp > 0) { high = mid - 1; } else { return mid; } } return -(low + 1); } /** * Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false * are located before all elements where p(x) is true. * @returns the least x for which p(x) is true or array.length if no element fullfills the given function. */ function findFirstInSorted(array, p) { let low = 0, high = array.length; if (high === 0) { return 0; // no children } while (low < high) { const mid = Math.floor((low + high) / 2); if (p(array[mid])) { high = mid; } else { low = mid + 1; } } return low; } function quickSelect(nth, data, compare) { nth = nth | 0; if (nth >= data.length) { throw new TypeError('invalid index'); } let pivotValue = data[Math.floor(data.length * Math.random())]; let lower = []; let higher = []; let pivots = []; for (let value of data) { const val = compare(value, pivotValue); if (val < 0) { lower.push(value); } else if (val > 0) { higher.push(value); } else { pivots.push(value); } } if (nth < lower.length) { return quickSelect(nth, lower, compare); } else if (nth < lower.length + pivots.length) { return pivots[0]; } else { return quickSelect(nth - (lower.length + pivots.length), higher, compare); } } function groupBy(data, compare) { const result = []; let currentGroup = undefined; for (const element of data.slice(0).sort(compare)) { if (!currentGroup || compare(currentGroup[0], element) !== 0) { currentGroup = [element]; result.push(currentGroup); } else { currentGroup.push(element); } } return result; } /** * @returns New array with all falsy values removed. The original array IS NOT modified. */ function coalesce(array) { return array.filter(e => !!e); } /** * @returns false if the provided object is an array and not empty. */ function isFalsyOrEmpty(obj) { return !Array.isArray(obj) || obj.length === 0; } function isNonEmptyArray(obj) { return Array.isArray(obj) && obj.length > 0; } /** * Removes duplicates from the given array. The optional keyFn allows to specify * how elements are checked for equality by returning an alternate value for each. */ function distinct(array, keyFn = value => value) { const seen = new Set(); return array.filter(element => { const key = keyFn(element); if (seen.has(key)) { return false; } seen.add(key); return true; }); } function findLast(arr, predicate) { const idx = lastIndex(arr, predicate); if (idx === -1) { return undefined; } return arr[idx]; } function lastIndex(array, fn) { for (let i = array.length - 1; i >= 0; i--) { const element = array[i]; if (fn(element)) { return i; } } return -1; } function firstOrDefault(array, notFoundValue) { return array.length > 0 ? array[0] : notFoundValue; } function flatten(arr) { return [].concat(...arr); } function range(arg, to) { let from = typeof to === 'number' ? arg : 0; if (typeof to === 'number') { from = arg; } else { from = 0; to = arg; } const result = []; if (from <= to) { for (let i = from; i < to; i++) { result.push(i); } } else { for (let i = from; i > to; i--) { result.push(i); } } return result; } /** * Insert `insertArr` inside `target` at `insertIndex`. * Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array */ function arrayInsert(target, insertIndex, insertArr) { const before = target.slice(0, insertIndex); const after = target.slice(insertIndex); return before.concat(insertArr, after); } /** * Pushes an element to the start of the array, if found. */ function pushToStart(arr, value) { const index = arr.indexOf(value); if (index > -1) { arr.splice(index, 1); arr.unshift(value); } } /** * Pushes an element to the end of the array, if found. */ function pushToEnd(arr, value) { const index = arr.indexOf(value); if (index > -1) { arr.splice(index, 1); arr.push(value); } } function asArray(x) { return Array.isArray(x) ? x : [x]; } /** * Insert the new items in the array. * @param array The original array. * @param start The zero-based location in the array from which to start inserting elements. * @param newItems The items to be inserted */ function insertInto(array, start, newItems) { const startIdx = getActualStartIndex(array, start); const originalLength = array.length; const newItemsLength = newItems.length; array.length = originalLength + newItemsLength; // Move the items after the start index, start from the end so that we don't overwrite any value. for (let i = originalLength - 1; i >= startIdx; i--) { array[i + newItemsLength] = array[i]; } for (let i = 0; i < newItemsLength; i++) { array[i + startIdx] = newItems[i]; } } /** * Removes elements from an array and inserts new elements in their place, returning the deleted elements. Alternative to the native Array.splice method, it * can only support limited number of items due to the maximum call stack size limit. * @param array The original array. * @param start The zero-based location in the array from which to start removing elements. * @param deleteCount The number of elements to remove. * @returns An array containing the elements that were deleted. */ function splice(array, start, deleteCount, newItems) { const index = getActualStartIndex(array, start); const result = array.splice(index, deleteCount); insertInto(array, index, newItems); return result; } /** * Determine the actual start index (same logic as the native splice() or slice()) * If greater than the length of the array, start will be set to the length of the array. In this case, no element will be deleted but the method will behave as an adding function, adding as many element as item[n*] provided. * If negative, it will begin that many elements from the end of the array. (In this case, the origin -1, meaning -n is the index of the nth last element, and is therefore equivalent to the index of array.length - n.) If array.length + start is less than 0, it will begin from index 0. * @param array The target array. * @param start The operation index. */ function getActualStartIndex(array, start) { return start < 0 ? Math.max(start + array.length, 0) : Math.min(start, array.length); } class ArrayQueue { /** * Constructs a queue that is backed by the given array. Runtime is O(1). */ constructor(items) { this.items = items; this.firstIdx = 0; this.lastIdx = this.items.length - 1; } /** * Consumes elements from the beginning of the queue as long as the predicate returns true. * If no elements were consumed, `null` is returned. Has a runtime of O(result.length). */ takeWhile(predicate) { // P(k) := k <= this.lastIdx && predicate(this.items[k]) // Find s := min { k | k >= this.firstIdx && !P(k) } and return this.data[this.firstIdx...s) let startIdx = this.firstIdx; while (startIdx < this.items.length && predicate(this.items[startIdx])) { startIdx++; } const result = startIdx === this.firstIdx ? null : this.items.slice(this.firstIdx, startIdx); this.firstIdx = startIdx; return result; } /** * Consumes elements from the end of the queue as long as the predicate returns true. * If no elements were consumed, `null` is returned. * The result has the same order as the underlying array! */ takeFromEndWhile(predicate) { // P(k) := this.firstIdx >= k && predicate(this.items[k]) // Find s := max { k | k <= this.lastIdx && !P(k) } and return this.data(s...this.lastIdx] let endIdx = this.lastIdx; while (endIdx >= 0 && predicate(this.items[endIdx])) { endIdx--; } const result = endIdx === this.lastIdx ? null : this.items.slice(endIdx + 1, this.lastIdx + 1); this.lastIdx = endIdx; return result; } peek() { return this.items[this.firstIdx]; } } /***/ }), /***/ 50431: /*!**************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/async.js ***! \**************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ J8: function() { return /* binding */ isThenable; }, /* harmony export */ PG: function() { return /* binding */ createCancelablePromise; }, /* harmony export */ Ps: function() { return /* binding */ first; }, /* harmony export */ To: function() { return /* binding */ runWhenIdle; }, /* harmony export */ Ue: function() { return /* binding */ IdleValue; }, /* harmony export */ Vg: function() { return /* binding */ disposableTimeout; }, /* harmony export */ Vs: function() { return /* binding */ timeout; }, /* harmony export */ _F: function() { return /* binding */ TimeoutTimer; }, /* harmony export */ eP: function() { return /* binding */ raceCancellation; }, /* harmony export */ jT: function() { return /* binding */ Promises; }, /* harmony export */ pY: function() { return /* binding */ RunOnceScheduler; }, /* harmony export */ rH: function() { return /* binding */ ThrottledDelayer; }, /* harmony export */ vp: function() { return /* binding */ Delayer; }, /* harmony export */ zh: function() { return /* binding */ IntervalTimer; } /* harmony export */ }); /* unused harmony export Throttler */ /* harmony import */ var _cancellation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cancellation.js */ 96283); /* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./errors.js */ 79881); /* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lifecycle.js */ 69323); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; function isThenable(obj) { return !!obj && typeof obj.then === 'function'; } function createCancelablePromise(callback) { const source = new _cancellation_js__WEBPACK_IMPORTED_MODULE_0__/* .CancellationTokenSource */ .A(); const thenable = callback(source.token); const promise = new Promise((resolve, reject) => { const subscription = source.token.onCancellationRequested(() => { subscription.dispose(); source.dispose(); reject((0,_errors_js__WEBPACK_IMPORTED_MODULE_1__/* .canceled */ .F0)()); }); Promise.resolve(thenable).then(value => { subscription.dispose(); source.dispose(); resolve(value); }, err => { subscription.dispose(); source.dispose(); reject(err); }); }); return new class { cancel() { source.cancel(); } then(resolve, reject) { return promise.then(resolve, reject); } catch(reject) { return this.then(undefined, reject); } finally(onfinally) { return promise.finally(onfinally); } }; } function raceCancellation(promise, token, defaultValue) { return Promise.race([promise, new Promise(resolve => token.onCancellationRequested(() => resolve(defaultValue)))]); } /** * A helper to prevent accumulation of sequential async tasks. * * Imagine a mail man with the sole task of delivering letters. As soon as * a letter submitted for delivery, he drives to the destination, delivers it * and returns to his base. Imagine that during the trip, N more letters were submitted. * When the mail man returns, he picks those N letters and delivers them all in a * single trip. Even though N+1 submissions occurred, only 2 deliveries were made. * * The throttler implements this via the queue() method, by providing it a task * factory. Following the example: * * const throttler = new Throttler(); * const letters = []; * * function deliver() { * const lettersToDeliver = letters; * letters = []; * return makeTheTrip(lettersToDeliver); * } * * function onLetterReceived(l) { * letters.push(l); * throttler.queue(deliver); * } */ class Throttler { constructor() { this.activePromise = null; this.queuedPromise = null; this.queuedPromiseFactory = null; } queue(promiseFactory) { if (this.activePromise) { this.queuedPromiseFactory = promiseFactory; if (!this.queuedPromise) { const onComplete = () => { this.queuedPromise = null; const result = this.queue(this.queuedPromiseFactory); this.queuedPromiseFactory = null; return result; }; this.queuedPromise = new Promise(resolve => { this.activePromise.then(onComplete, onComplete).then(resolve); }); } return new Promise((resolve, reject) => { this.queuedPromise.then(resolve, reject); }); } this.activePromise = promiseFactory(); return new Promise((resolve, reject) => { this.activePromise.then((result) => { this.activePromise = null; resolve(result); }, (err) => { this.activePromise = null; reject(err); }); }); } } /** * A helper to delay (debounce) execution of a task that is being requested often. * * Following the throttler, now imagine the mail man wants to optimize the number of * trips proactively. The trip itself can be long, so he decides not to make the trip * as soon as a letter is submitted. Instead he waits a while, in case more * letters are submitted. After said waiting period, if no letters were submitted, he * decides to make the trip. Imagine that N more letters were submitted after the first * one, all within a short period of time between each other. Even though N+1 * submissions occurred, only 1 delivery was made. * * The delayer offers this behavior via the trigger() method, into which both the task * to be executed and the waiting period (delay) must be passed in as arguments. Following * the example: * * const delayer = new Delayer(WAITING_PERIOD); * const letters = []; * * function letterReceived(l) { * letters.push(l); * delayer.trigger(() => { return makeTheTrip(); }); * } */ class Delayer { constructor(defaultDelay) { this.defaultDelay = defaultDelay; this.timeout = null; this.completionPromise = null; this.doResolve = null; this.doReject = null; this.task = null; } trigger(task, delay = this.defaultDelay) { this.task = task; this.cancelTimeout(); if (!this.completionPromise) { this.completionPromise = new Promise((resolve, reject) => { this.doResolve = resolve; this.doReject = reject; }).then(() => { this.completionPromise = null; this.doResolve = null; if (this.task) { const task = this.task; this.task = null; return task(); } return undefined; }); } this.timeout = setTimeout(() => { this.timeout = null; if (this.doResolve) { this.doResolve(null); } }, delay); return this.completionPromise; } isTriggered() { return this.timeout !== null; } cancel() { this.cancelTimeout(); if (this.completionPromise) { if (this.doReject) { this.doReject((0,_errors_js__WEBPACK_IMPORTED_MODULE_1__/* .canceled */ .F0)()); } this.completionPromise = null; } } cancelTimeout() { if (this.timeout !== null) { clearTimeout(this.timeout); this.timeout = null; } } dispose() { this.cancel(); } } /** * A helper to delay execution of a task that is being requested often, while * preventing accumulation of consecutive executions, while the task runs. * * The mail man is clever and waits for a certain amount of time, before going * out to deliver letters. While the mail man is going out, more letters arrive * and can only be delivered once he is back. Once he is back the mail man will * do one more trip to deliver the letters that have accumulated while he was out. */ class ThrottledDelayer { constructor(defaultDelay) { this.delayer = new Delayer(defaultDelay); this.throttler = new Throttler(); } trigger(promiseFactory, delay) { return this.delayer.trigger(() => this.throttler.queue(promiseFactory), delay); } dispose() { this.delayer.dispose(); } } function timeout(millis, token) { if (!token) { return createCancelablePromise(token => timeout(millis, token)); } return new Promise((resolve, reject) => { const handle = setTimeout(() => { disposable.dispose(); resolve(); }, millis); const disposable = token.onCancellationRequested(() => { clearTimeout(handle); disposable.dispose(); reject((0,_errors_js__WEBPACK_IMPORTED_MODULE_1__/* .canceled */ .F0)()); }); }); } function disposableTimeout(handler, timeout = 0) { const timer = setTimeout(handler, timeout); return (0,_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__/* .toDisposable */ .OF)(() => clearTimeout(timer)); } function first(promiseFactories, shouldStop = t => !!t, defaultValue = null) { let index = 0; const len = promiseFactories.length; const loop = () => { if (index >= len) { return Promise.resolve(defaultValue); } const factory = promiseFactories[index++]; const promise = Promise.resolve(factory()); return promise.then(result => { if (shouldStop(result)) { return Promise.resolve(result); } return loop(); }); }; return loop(); } class TimeoutTimer { constructor(runner, timeout) { this._token = -1; if (typeof runner === 'function' && typeof timeout === 'number') { this.setIfNotSet(runner, timeout); } } dispose() { this.cancel(); } cancel() { if (this._token !== -1) { clearTimeout(this._token); this._token = -1; } } cancelAndSet(runner, timeout) { this.cancel(); this._token = setTimeout(() => { this._token = -1; runner(); }, timeout); } setIfNotSet(runner, timeout) { if (this._token !== -1) { // timer is already set return; } this._token = setTimeout(() => { this._token = -1; runner(); }, timeout); } } class IntervalTimer { constructor() { this._token = -1; } dispose() { this.cancel(); } cancel() { if (this._token !== -1) { clearInterval(this._token); this._token = -1; } } cancelAndSet(runner, interval) { this.cancel(); this._token = setInterval(() => { runner(); }, interval); } } class RunOnceScheduler { constructor(runner, delay) { this.timeoutToken = -1; this.runner = runner; this.timeout = delay; this.timeoutHandler = this.onTimeout.bind(this); } /** * Dispose RunOnceScheduler */ dispose() { this.cancel(); this.runner = null; } /** * Cancel current scheduled runner (if any). */ cancel() { if (this.isScheduled()) { clearTimeout(this.timeoutToken); this.timeoutToken = -1; } } /** * Cancel previous runner (if any) & schedule a new runner. */ schedule(delay = this.timeout) { this.cancel(); this.timeoutToken = setTimeout(this.timeoutHandler, delay); } get delay() { return this.timeout; } set delay(value) { this.timeout = value; } /** * Returns true if scheduled. */ isScheduled() { return this.timeoutToken !== -1; } onTimeout() { this.timeoutToken = -1; if (this.runner) { this.doRun(); } } doRun() { if (this.runner) { this.runner(); } } } /** * Execute the callback the next time the browser is idle */ let runWhenIdle; (function () { if (typeof requestIdleCallback !== 'function' || typeof cancelIdleCallback !== 'function') { runWhenIdle = (runner) => { const handle = setTimeout(() => { const end = Date.now() + 15; // one frame at 64fps runner(Object.freeze({ didTimeout: true, timeRemaining() { return Math.max(0, end - Date.now()); } })); }); let disposed = false; return { dispose() { if (disposed) { return; } disposed = true; clearTimeout(handle); } }; }; } else { runWhenIdle = (runner, timeout) => { const handle = requestIdleCallback(runner, typeof timeout === 'number' ? { timeout } : undefined); let disposed = false; return { dispose() { if (disposed) { return; } disposed = true; cancelIdleCallback(handle); } }; }; } })(); /** * An implementation of the "idle-until-urgent"-strategy as introduced * here: https://philipwalton.com/articles/idle-until-urgent/ */ class IdleValue { constructor(executor) { this._didRun = false; this._executor = () => { try { this._value = executor(); } catch (err) { this._error = err; } finally { this._didRun = true; } }; this._handle = runWhenIdle(() => this._executor()); } dispose() { this._handle.dispose(); } get value() { if (!this._didRun) { this._handle.dispose(); this._executor(); } if (this._error) { throw this._error; } return this._value; } get isInitialized() { return this._didRun; } } //#endregion //#region Promises var Promises; (function (Promises) { /** * A drop-in replacement for `Promise.all` with the only difference * that the method awaits every promise to either fulfill or reject. * * Similar to `Promise.all`, only the first error will be returned * if any. */ function settled(promises) { return __awaiter(this, void 0, void 0, function* () { let firstError = undefined; const result = yield Promise.all(promises.map(promise => promise.then(value => value, error => { if (!firstError) { firstError = error; } return undefined; // do not rethrow so that other promises can settle }))); if (typeof firstError !== 'undefined') { throw firstError; } return result; // cast is needed and protected by the `throw` above }); } Promises.settled = settled; /** * A helper to create a new `Promise` with a body that is a promise * itself. By default, an error that raises from the async body will * end up as a unhandled rejection, so this utility properly awaits the * body and rejects the promise as a normal promise does without async * body. * * This method should only be used in rare cases where otherwise `async` * cannot be used (e.g. when callbacks are involved that require this). */ function withAsyncBody(bodyFn) { // eslint-disable-next-line no-async-promise-executor return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { try { yield bodyFn(resolve, reject); } catch (error) { reject(error); } })); } Promises.withAsyncBody = withAsyncBody; })(Promises || (Promises = {})); //#endregion /***/ }), /***/ 90794: /*!***************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/buffer.js ***! \***************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ag: function() { return /* binding */ readUInt32BE; }, /* harmony export */ Cg: function() { return /* binding */ writeUInt8; }, /* harmony export */ KN: function() { return /* binding */ VSBuffer; }, /* harmony export */ Q$: function() { return /* binding */ readUInt8; }, /* harmony export */ T4: function() { return /* binding */ writeUInt32BE; }, /* harmony export */ mP: function() { return /* binding */ readUInt16LE; }, /* harmony export */ oq: function() { return /* binding */ writeUInt16LE; } /* harmony export */ }); /* provided dependency */ var Buffer = __webpack_require__(/*! buffer */ 19208)["lW"]; const hasBuffer = (typeof Buffer !== 'undefined'); let textDecoder; class VSBuffer { constructor(buffer) { this.buffer = buffer; this.byteLength = this.buffer.byteLength; } static wrap(actual) { if (hasBuffer && !(Buffer.isBuffer(actual))) { // https://nodejs.org/dist/latest-v10.x/docs/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length // Create a zero-copy Buffer wrapper around the ArrayBuffer pointed to by the Uint8Array actual = Buffer.from(actual.buffer, actual.byteOffset, actual.byteLength); } return new VSBuffer(actual); } toString() { if (hasBuffer) { return this.buffer.toString(); } else { if (!textDecoder) { textDecoder = new TextDecoder(); } return textDecoder.decode(this.buffer); } } } function readUInt16LE(source, offset) { return (((source[offset + 0] << 0) >>> 0) | ((source[offset + 1] << 8) >>> 0)); } function writeUInt16LE(destination, value, offset) { destination[offset + 0] = (value & 0b11111111); value = value >>> 8; destination[offset + 1] = (value & 0b11111111); } function readUInt32BE(source, offset) { return (source[offset] * Math.pow(2, 24) + source[offset + 1] * Math.pow(2, 16) + source[offset + 2] * Math.pow(2, 8) + source[offset + 3]); } function writeUInt32BE(destination, value, offset) { destination[offset + 3] = value; value = value >>> 8; destination[offset + 2] = value; value = value >>> 8; destination[offset + 1] = value; value = value >>> 8; destination[offset] = value; } function readUInt8(source, offset) { return source[offset]; } function writeUInt8(destination, value, offset) { destination[offset] = value; } /***/ }), /***/ 96283: /*!*********************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/cancellation.js ***! \*********************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ A: function() { return /* binding */ CancellationTokenSource; }, /* harmony export */ T: function() { return /* binding */ CancellationToken; } /* harmony export */ }); /* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ 4348); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const shortcutEvent = Object.freeze(function (callback, context) { const handle = setTimeout(callback.bind(context), 0); return { dispose() { clearTimeout(handle); } }; }); var CancellationToken; (function (CancellationToken) { function isCancellationToken(thing) { if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { return true; } if (thing instanceof MutableToken) { return true; } if (!thing || typeof thing !== 'object') { return false; } return typeof thing.isCancellationRequested === 'boolean' && typeof thing.onCancellationRequested === 'function'; } CancellationToken.isCancellationToken = isCancellationToken; CancellationToken.None = Object.freeze({ isCancellationRequested: false, onCancellationRequested: _event_js__WEBPACK_IMPORTED_MODULE_0__/* .Event */ .ju.None }); CancellationToken.Cancelled = Object.freeze({ isCancellationRequested: true, onCancellationRequested: shortcutEvent }); })(CancellationToken || (CancellationToken = {})); class MutableToken { constructor() { this._isCancelled = false; this._emitter = null; } cancel() { if (!this._isCancelled) { this._isCancelled = true; if (this._emitter) { this._emitter.fire(undefined); this.dispose(); } } } get isCancellationRequested() { return this._isCancelled; } get onCancellationRequested() { if (this._isCancelled) { return shortcutEvent; } if (!this._emitter) { this._emitter = new _event_js__WEBPACK_IMPORTED_MODULE_0__/* .Emitter */ .Q5(); } return this._emitter.event; } dispose() { if (this._emitter) { this._emitter.dispose(); this._emitter = null; } } } class CancellationTokenSource { constructor(parent) { this._token = undefined; this._parentListener = undefined; this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); } get token() { if (!this._token) { // be lazy and create the token only when // actually needed this._token = new MutableToken(); } return this._token; } cancel() { if (!this._token) { // save an object by returning the default // cancelled token when cancellation happens // before someone asks for the token this._token = CancellationToken.Cancelled; } else if (this._token instanceof MutableToken) { // actually cancel this._token.cancel(); } } dispose(cancel = false) { if (cancel) { this.cancel(); } if (this._parentListener) { this._parentListener.dispose(); } if (!this._token) { // ensure to initialize with an empty token if we had none this._token = CancellationToken.None; } else if (this._token instanceof MutableToken) { // actually dispose this._token.dispose(); } } } /***/ }), /***/ 55237: /*!********************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/collections.js ***! \********************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: function() { return /* binding */ forEach; }, /* harmony export */ r: function() { return /* binding */ SetMap; } /* harmony export */ }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const hasOwnProperty = Object.prototype.hasOwnProperty; /** * Iterates over each entry in the provided dictionary. The iterator allows * to remove elements and will stop when the callback returns {{false}}. */ function forEach(from, callback) { for (let key in from) { if (hasOwnProperty.call(from, key)) { const result = callback({ key: key, value: from[key] }, function () { delete from[key]; }); if (result === false) { return; } } } } class SetMap { constructor() { this.map = new Map(); } add(key, value) { let values = this.map.get(key); if (!values) { values = new Set(); this.map.set(key, values); } values.add(value); } delete(key, value) { const values = this.map.get(key); if (!values) { return; } values.delete(value); if (values.size === 0) { this.map.delete(key); } } forEach(key, fn) { const values = this.map.get(key); if (!values) { return; } values.forEach(fn); } } /***/ }), /***/ 51737: /*!**************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/color.js ***! \**************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Il: function() { return /* binding */ Color; }, /* harmony export */ VS: function() { return /* binding */ RGBA; }, /* harmony export */ tx: function() { return /* binding */ HSVA; } /* harmony export */ }); /* unused harmony export HSLA */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function roundFloat(number, decimalPoints) { const decimal = Math.pow(10, decimalPoints); return Math.round(number * decimal) / decimal; } class RGBA { constructor(r, g, b, a = 1) { this._rgbaBrand = undefined; this.r = Math.min(255, Math.max(0, r)) | 0; this.g = Math.min(255, Math.max(0, g)) | 0; this.b = Math.min(255, Math.max(0, b)) | 0; this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); } static equals(a, b) { return a.r === b.r && a.g === b.g && a.b === b.b && a.a === b.a; } } class HSLA { constructor(h, s, l, a) { this._hslaBrand = undefined; this.h = Math.max(Math.min(360, h), 0) | 0; this.s = roundFloat(Math.max(Math.min(1, s), 0), 3); this.l = roundFloat(Math.max(Math.min(1, l), 0), 3); this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); } static equals(a, b) { return a.h === b.h && a.s === b.s && a.l === b.l && a.a === b.a; } /** * Converts an RGB color value to HSL. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSL_color_space. * Assumes r, g, and b are contained in the set [0, 255] and * returns h in the set [0, 360], s, and l in the set [0, 1]. */ static fromRGBA(rgba) { const r = rgba.r / 255; const g = rgba.g / 255; const b = rgba.b / 255; const a = rgba.a; const max = Math.max(r, g, b); const min = Math.min(r, g, b); let h = 0; let s = 0; const l = (min + max) / 2; const chroma = max - min; if (chroma > 0) { s = Math.min((l <= 0.5 ? chroma / (2 * l) : chroma / (2 - (2 * l))), 1); switch (max) { case r: h = (g - b) / chroma + (g < b ? 6 : 0); break; case g: h = (b - r) / chroma + 2; break; case b: h = (r - g) / chroma + 4; break; } h *= 60; h = Math.round(h); } return new HSLA(h, s, l, a); } static _hue2rgb(p, q, t) { if (t < 0) { t += 1; } if (t > 1) { t -= 1; } if (t < 1 / 6) { return p + (q - p) * 6 * t; } if (t < 1 / 2) { return q; } if (t < 2 / 3) { return p + (q - p) * (2 / 3 - t) * 6; } return p; } /** * Converts an HSL color value to RGB. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSL_color_space. * Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and * returns r, g, and b in the set [0, 255]. */ static toRGBA(hsla) { const h = hsla.h / 360; const { s, l, a } = hsla; let r, g, b; if (s === 0) { r = g = b = l; // achromatic } else { const q = l < 0.5 ? l * (1 + s) : l + s - l * s; const p = 2 * l - q; r = HSLA._hue2rgb(p, q, h + 1 / 3); g = HSLA._hue2rgb(p, q, h); b = HSLA._hue2rgb(p, q, h - 1 / 3); } return new RGBA(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a); } } class HSVA { constructor(h, s, v, a) { this._hsvaBrand = undefined; this.h = Math.max(Math.min(360, h), 0) | 0; this.s = roundFloat(Math.max(Math.min(1, s), 0), 3); this.v = roundFloat(Math.max(Math.min(1, v), 0), 3); this.a = roundFloat(Math.max(Math.min(1, a), 0), 3); } static equals(a, b) { return a.h === b.h && a.s === b.s && a.v === b.v && a.a === b.a; } // from http://www.rapidtables.com/convert/color/rgb-to-hsv.htm static fromRGBA(rgba) { const r = rgba.r / 255; const g = rgba.g / 255; const b = rgba.b / 255; const cmax = Math.max(r, g, b); const cmin = Math.min(r, g, b); const delta = cmax - cmin; const s = cmax === 0 ? 0 : (delta / cmax); let m; if (delta === 0) { m = 0; } else if (cmax === r) { m = ((((g - b) / delta) % 6) + 6) % 6; } else if (cmax === g) { m = ((b - r) / delta) + 2; } else { m = ((r - g) / delta) + 4; } return new HSVA(Math.round(m * 60), s, cmax, rgba.a); } // from http://www.rapidtables.com/convert/color/hsv-to-rgb.htm static toRGBA(hsva) { const { h, s, v, a } = hsva; const c = v * s; const x = c * (1 - Math.abs((h / 60) % 2 - 1)); const m = v - c; let [r, g, b] = [0, 0, 0]; if (h < 60) { r = c; g = x; } else if (h < 120) { r = x; g = c; } else if (h < 180) { g = c; b = x; } else if (h < 240) { g = x; b = c; } else if (h < 300) { r = x; b = c; } else if (h <= 360) { r = c; b = x; } r = Math.round((r + m) * 255); g = Math.round((g + m) * 255); b = Math.round((b + m) * 255); return new RGBA(r, g, b, a); } } class Color { constructor(arg) { if (!arg) { throw new Error('Color needs a value'); } else if (arg instanceof RGBA) { this.rgba = arg; } else if (arg instanceof HSLA) { this._hsla = arg; this.rgba = HSLA.toRGBA(arg); } else if (arg instanceof HSVA) { this._hsva = arg; this.rgba = HSVA.toRGBA(arg); } else { throw new Error('Invalid color ctor argument'); } } static fromHex(hex) { return Color.Format.CSS.parseHex(hex) || Color.red; } get hsla() { if (this._hsla) { return this._hsla; } else { return HSLA.fromRGBA(this.rgba); } } get hsva() { if (this._hsva) { return this._hsva; } return HSVA.fromRGBA(this.rgba); } equals(other) { return !!other && RGBA.equals(this.rgba, other.rgba) && HSLA.equals(this.hsla, other.hsla) && HSVA.equals(this.hsva, other.hsva); } /** * http://www.w3.org/TR/WCAG20/#relativeluminancedef * Returns the number in the set [0, 1]. O => Darkest Black. 1 => Lightest white. */ getRelativeLuminance() { const R = Color._relativeLuminanceForComponent(this.rgba.r); const G = Color._relativeLuminanceForComponent(this.rgba.g); const B = Color._relativeLuminanceForComponent(this.rgba.b); const luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B; return roundFloat(luminance, 4); } static _relativeLuminanceForComponent(color) { const c = color / 255; return (c <= 0.03928) ? c / 12.92 : Math.pow(((c + 0.055) / 1.055), 2.4); } /** * http://24ways.org/2010/calculating-color-contrast * Return 'true' if lighter color otherwise 'false' */ isLighter() { const yiq = (this.rgba.r * 299 + this.rgba.g * 587 + this.rgba.b * 114) / 1000; return yiq >= 128; } isLighterThan(another) { const lum1 = this.getRelativeLuminance(); const lum2 = another.getRelativeLuminance(); return lum1 > lum2; } isDarkerThan(another) { const lum1 = this.getRelativeLuminance(); const lum2 = another.getRelativeLuminance(); return lum1 < lum2; } lighten(factor) { return new Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * factor, this.hsla.a)); } darken(factor) { return new Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * factor, this.hsla.a)); } transparent(factor) { const { r, g, b, a } = this.rgba; return new Color(new RGBA(r, g, b, a * factor)); } isTransparent() { return this.rgba.a === 0; } isOpaque() { return this.rgba.a === 1; } opposite() { return new Color(new RGBA(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a)); } toString() { if (!this._toString) { this._toString = Color.Format.CSS.format(this); } return this._toString; } static getLighterColor(of, relative, factor) { if (of.isLighterThan(relative)) { return of; } factor = factor ? factor : 0.5; const lum1 = of.getRelativeLuminance(); const lum2 = relative.getRelativeLuminance(); factor = factor * (lum2 - lum1) / lum2; return of.lighten(factor); } static getDarkerColor(of, relative, factor) { if (of.isDarkerThan(relative)) { return of; } factor = factor ? factor : 0.5; const lum1 = of.getRelativeLuminance(); const lum2 = relative.getRelativeLuminance(); factor = factor * (lum1 - lum2) / lum1; return of.darken(factor); } } Color.white = new Color(new RGBA(255, 255, 255, 1)); Color.black = new Color(new RGBA(0, 0, 0, 1)); Color.red = new Color(new RGBA(255, 0, 0, 1)); Color.blue = new Color(new RGBA(0, 0, 255, 1)); Color.cyan = new Color(new RGBA(0, 255, 255, 1)); Color.lightgrey = new Color(new RGBA(211, 211, 211, 1)); Color.transparent = new Color(new RGBA(0, 0, 0, 0)); (function (Color) { let Format; (function (Format) { let CSS; (function (CSS) { function formatRGB(color) { if (color.rgba.a === 1) { return `rgb(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b})`; } return Color.Format.CSS.formatRGBA(color); } CSS.formatRGB = formatRGB; function formatRGBA(color) { return `rgba(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b}, ${+(color.rgba.a).toFixed(2)})`; } CSS.formatRGBA = formatRGBA; function formatHSL(color) { if (color.hsla.a === 1) { return `hsl(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%)`; } return Color.Format.CSS.formatHSLA(color); } CSS.formatHSL = formatHSL; function formatHSLA(color) { return `hsla(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%, ${color.hsla.a.toFixed(2)})`; } CSS.formatHSLA = formatHSLA; function _toTwoDigitHex(n) { const r = n.toString(16); return r.length !== 2 ? '0' + r : r; } /** * Formats the color as #RRGGBB */ function formatHex(color) { return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}`; } CSS.formatHex = formatHex; /** * Formats the color as #RRGGBBAA * If 'compact' is set, colors without transparancy will be printed as #RRGGBB */ function formatHexA(color, compact = false) { if (compact && color.rgba.a === 1) { return Color.Format.CSS.formatHex(color); } return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}${_toTwoDigitHex(Math.round(color.rgba.a * 255))}`; } CSS.formatHexA = formatHexA; /** * The default format will use HEX if opaque and RGBA otherwise. */ function format(color) { if (color.isOpaque()) { return Color.Format.CSS.formatHex(color); } return Color.Format.CSS.formatRGBA(color); } CSS.format = format; /** * Converts an Hex color value to a Color. * returns r, g, and b are contained in the set [0, 255] * @param hex string (#RGB, #RGBA, #RRGGBB or #RRGGBBAA). */ function parseHex(hex) { const length = hex.length; if (length === 0) { // Invalid color return null; } if (hex.charCodeAt(0) !== 35 /* Hash */) { // Does not begin with a # return null; } if (length === 7) { // #RRGGBB format const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2)); const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4)); const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6)); return new Color(new RGBA(r, g, b, 1)); } if (length === 9) { // #RRGGBBAA format const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2)); const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4)); const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6)); const a = 16 * _parseHexDigit(hex.charCodeAt(7)) + _parseHexDigit(hex.charCodeAt(8)); return new Color(new RGBA(r, g, b, a / 255)); } if (length === 4) { // #RGB format const r = _parseHexDigit(hex.charCodeAt(1)); const g = _parseHexDigit(hex.charCodeAt(2)); const b = _parseHexDigit(hex.charCodeAt(3)); return new Color(new RGBA(16 * r + r, 16 * g + g, 16 * b + b)); } if (length === 5) { // #RGBA format const r = _parseHexDigit(hex.charCodeAt(1)); const g = _parseHexDigit(hex.charCodeAt(2)); const b = _parseHexDigit(hex.charCodeAt(3)); const a = _parseHexDigit(hex.charCodeAt(4)); return new Color(new RGBA(16 * r + r, 16 * g + g, 16 * b + b, (16 * a + a) / 255)); } // Invalid color return null; } CSS.parseHex = parseHex; function _parseHexDigit(charCode) { switch (charCode) { case 48 /* Digit0 */: return 0; case 49 /* Digit1 */: return 1; case 50 /* Digit2 */: return 2; case 51 /* Digit3 */: return 3; case 52 /* Digit4 */: return 4; case 53 /* Digit5 */: return 5; case 54 /* Digit6 */: return 6; case 55 /* Digit7 */: return 7; case 56 /* Digit8 */: return 8; case 57 /* Digit9 */: return 9; case 97 /* a */: return 10; case 65 /* A */: return 10; case 98 /* b */: return 11; case 66 /* B */: return 11; case 99 /* c */: return 12; case 67 /* C */: return 12; case 100 /* d */: return 13; case 68 /* D */: return 13; case 101 /* e */: return 14; case 69 /* E */: return 14; case 102 /* f */: return 15; case 70 /* F */: return 15; } return 0; } })(CSS = Format.CSS || (Format.CSS = {})); })(Format = Color.Format || (Color.Format = {})); })(Color || (Color = {})); /***/ }), /***/ 85402: /*!*******************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/decorators.js ***! \*******************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ H: function() { return /* binding */ memoize; } /* harmony export */ }); function memoize(_target, key, descriptor) { let fnKey = null; let fn = null; if (typeof descriptor.value === 'function') { fnKey = 'value'; fn = descriptor.value; if (fn.length !== 0) { console.warn('Memoize should only be used in functions with zero parameters'); } } else if (typeof descriptor.get === 'function') { fnKey = 'get'; fn = descriptor.get; } if (!fn) { throw new Error('not supported'); } const memoizeKey = `$memoize$${key}`; descriptor[fnKey] = function (...args) { if (!this.hasOwnProperty(memoizeKey)) { Object.defineProperty(this, memoizeKey, { configurable: false, enumerable: false, writable: false, value: fn.apply(this, args) }); } return this[memoizeKey]; }; } /***/ }), /***/ 23068: /*!******************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/diff/diff.js + 1 modules ***! \******************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { Hs: function() { return /* binding */ LcsDiff; }, a$: function() { return /* binding */ stringDiff; } }); // UNUSED EXPORTS: Debug, MyArray, StringDiffSequence ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/diff/diffChange.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** * Represents information about a specific difference between two sequences. */ class DiffChange { /** * Constructs a new DiffChange with the given sequence information * and content. */ constructor(originalStart, originalLength, modifiedStart, modifiedLength) { //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); this.originalStart = originalStart; this.originalLength = originalLength; this.modifiedStart = modifiedStart; this.modifiedLength = modifiedLength; } /** * The end point (exclusive) of the change in the original sequence. */ getOriginalEnd() { return this.originalStart + this.originalLength; } /** * The end point (exclusive) of the change in the modified sequence. */ getModifiedEnd() { return this.modifiedStart + this.modifiedLength; } } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/hash.js var hash = __webpack_require__(44619); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/diff/diff.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class StringDiffSequence { constructor(source) { this.source = source; } getElements() { const source = this.source; const characters = new Int32Array(source.length); for (let i = 0, len = source.length; i < len; i++) { characters[i] = source.charCodeAt(i); } return characters; } } function stringDiff(original, modified, pretty) { return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes; } // // The code below has been ported from a C# implementation in VS // class Debug { static Assert(condition, message) { if (!condition) { throw new Error(message); } } } class MyArray { /** * Copies a range of elements from an Array starting at the specified source index and pastes * them to another Array starting at the specified destination index. The length and the indexes * are specified as 64-bit integers. * sourceArray: * The Array that contains the data to copy. * sourceIndex: * A 64-bit integer that represents the index in the sourceArray at which copying begins. * destinationArray: * The Array that receives the data. * destinationIndex: * A 64-bit integer that represents the index in the destinationArray at which storing begins. * length: * A 64-bit integer that represents the number of elements to copy. */ static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) { for (let i = 0; i < length; i++) { destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; } } static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) { for (let i = 0; i < length; i++) { destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; } } } /** * A utility class which helps to create the set of DiffChanges from * a difference operation. This class accepts original DiffElements and * modified DiffElements that are involved in a particular change. The * MarkNextChange() method can be called to mark the separation between * distinct changes. At the end, the Changes property can be called to retrieve * the constructed changes. */ class DiffChangeHelper { /** * Constructs a new DiffChangeHelper for the given DiffSequences. */ constructor() { this.m_changes = []; this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; this.m_originalCount = 0; this.m_modifiedCount = 0; } /** * Marks the beginning of the next change in the set of differences. */ MarkNextChange() { // Only add to the list if there is something to add if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { // Add the new change to our list this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); } // Reset for the next change this.m_originalCount = 0; this.m_modifiedCount = 0; this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; } /** * Adds the original element at the given position to the elements * affected by the current change. The modified index gives context * to the change position with respect to the original sequence. * @param originalIndex The index of the original element to add. * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence. */ AddOriginalElement(originalIndex, modifiedIndex) { // The 'true' start index is the smallest of the ones we've seen this.m_originalStart = Math.min(this.m_originalStart, originalIndex); this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex); this.m_originalCount++; } /** * Adds the modified element at the given position to the elements * affected by the current change. The original index gives context * to the change position with respect to the modified sequence. * @param originalIndex The index of the original element that provides corresponding position in the original sequence. * @param modifiedIndex The index of the modified element to add. */ AddModifiedElement(originalIndex, modifiedIndex) { // The 'true' start index is the smallest of the ones we've seen this.m_originalStart = Math.min(this.m_originalStart, originalIndex); this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex); this.m_modifiedCount++; } /** * Retrieves all of the changes marked by the class. */ getChanges() { if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { // Finish up on whatever is left this.MarkNextChange(); } return this.m_changes; } /** * Retrieves all of the changes marked by the class in the reverse order */ getReverseChanges() { if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { // Finish up on whatever is left this.MarkNextChange(); } this.m_changes.reverse(); return this.m_changes; } } /** * An implementation of the difference algorithm described in * "An O(ND) Difference Algorithm and its variations" by Eugene W. Myers */ class LcsDiff { /** * Constructs the DiffFinder */ constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) { this.ContinueProcessingPredicate = continueProcessingPredicate; this._originalSequence = originalSequence; this._modifiedSequence = modifiedSequence; const [originalStringElements, originalElementsOrHash, originalHasStrings] = LcsDiff._getElements(originalSequence); const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = LcsDiff._getElements(modifiedSequence); this._hasStrings = (originalHasStrings && modifiedHasStrings); this._originalStringElements = originalStringElements; this._originalElementsOrHash = originalElementsOrHash; this._modifiedStringElements = modifiedStringElements; this._modifiedElementsOrHash = modifiedElementsOrHash; this.m_forwardHistory = []; this.m_reverseHistory = []; } static _isStringArray(arr) { return (arr.length > 0 && typeof arr[0] === 'string'); } static _getElements(sequence) { const elements = sequence.getElements(); if (LcsDiff._isStringArray(elements)) { const hashes = new Int32Array(elements.length); for (let i = 0, len = elements.length; i < len; i++) { hashes[i] = (0,hash/* stringHash */.Cv)(elements[i], 0); } return [elements, hashes, true]; } if (elements instanceof Int32Array) { return [[], elements, false]; } return [[], new Int32Array(elements), false]; } ElementsAreEqual(originalIndex, newIndex) { if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) { return false; } return (this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true); } ElementsAreStrictEqual(originalIndex, newIndex) { if (!this.ElementsAreEqual(originalIndex, newIndex)) { return false; } const originalElement = LcsDiff._getStrictElement(this._originalSequence, originalIndex); const modifiedElement = LcsDiff._getStrictElement(this._modifiedSequence, newIndex); return (originalElement === modifiedElement); } static _getStrictElement(sequence, index) { if (typeof sequence.getStrictElement === 'function') { return sequence.getStrictElement(index); } return null; } OriginalElementsAreEqual(index1, index2) { if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) { return false; } return (this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true); } ModifiedElementsAreEqual(index1, index2) { if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) { return false; } return (this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true); } ComputeDiff(pretty) { return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty); } /** * Computes the differences between the original and modified input * sequences on the bounded range. * @returns An array of the differences between the two input sequences. */ _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) { const quitEarlyArr = [false]; let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr); if (pretty) { // We have to clean up the computed diff to be more intuitive // but it turns out this cannot be done correctly until the entire set // of diffs have been computed changes = this.PrettifyChanges(changes); } return { quitEarly: quitEarlyArr[0], changes: changes }; } /** * Private helper method which computes the differences on the bounded range * recursively. * @returns An array of the differences between the two input sequences. */ ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) { quitEarlyArr[0] = false; // Find the start of the differences while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) { originalStart++; modifiedStart++; } // Find the end of the differences while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) { originalEnd--; modifiedEnd--; } // In the special case where we either have all insertions or all deletions or the sequences are identical if (originalStart > originalEnd || modifiedStart > modifiedEnd) { let changes; if (modifiedStart <= modifiedEnd) { Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); // All insertions changes = [ new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } else if (originalStart <= originalEnd) { Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); // All deletions changes = [ new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0) ]; } else { Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); // Identical sequences - No differences changes = []; } return changes; } // This problem can be solved using the Divide-And-Conquer technique. const midOriginalArr = [0]; const midModifiedArr = [0]; const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr); const midOriginal = midOriginalArr[0]; const midModified = midModifiedArr[0]; if (result !== null) { // Result is not-null when there was enough memory to compute the changes while // searching for the recursion point return result; } else if (!quitEarlyArr[0]) { // We can break the problem down recursively by finding the changes in the // First Half: (originalStart, modifiedStart) to (midOriginal, midModified) // Second Half: (midOriginal + 1, minModified + 1) to (originalEnd, modifiedEnd) // NOTE: ComputeDiff() is inclusive, therefore the second range starts on the next point const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr); let rightChanges = []; if (!quitEarlyArr[0]) { rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr); } else { // We didn't have time to finish the first half, so we don't have time to compute this half. // Consider the entire rest of the sequence different. rightChanges = [ new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) ]; } return this.ConcatenateChanges(leftChanges, rightChanges); } // If we hit here, we quit early, and so can't return anything meaningful return [ new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) { let forwardChanges = null; let reverseChanges = null; // First, walk backward through the forward diagonals history let changeHelper = new DiffChangeHelper(); let diagonalMin = diagonalForwardStart; let diagonalMax = diagonalForwardEnd; let diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset; let lastOriginalIndex = -1073741824 /* MIN_SAFE_SMALL_INTEGER */; let historyIndex = this.m_forwardHistory.length - 1; do { // Get the diagonal index from the relative diagonal number const diagonal = diagonalRelative + diagonalForwardBase; // Figure out where we came from if (diagonal === diagonalMin || (diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) { // Vertical line (the element is an insert) originalIndex = forwardPoints[diagonal + 1]; modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset; if (originalIndex < lastOriginalIndex) { changeHelper.MarkNextChange(); } lastOriginalIndex = originalIndex; changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex); diagonalRelative = (diagonal + 1) - diagonalForwardBase; //Setup for the next iteration } else { // Horizontal line (the element is a deletion) originalIndex = forwardPoints[diagonal - 1] + 1; modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset; if (originalIndex < lastOriginalIndex) { changeHelper.MarkNextChange(); } lastOriginalIndex = originalIndex - 1; changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1); diagonalRelative = (diagonal - 1) - diagonalForwardBase; //Setup for the next iteration } if (historyIndex >= 0) { forwardPoints = this.m_forwardHistory[historyIndex]; diagonalForwardBase = forwardPoints[0]; //We stored this in the first spot diagonalMin = 1; diagonalMax = forwardPoints.length - 1; } } while (--historyIndex >= -1); // Ironically, we get the forward changes as the reverse of the // order we added them since we technically added them backwards forwardChanges = changeHelper.getReverseChanges(); if (quitEarlyArr[0]) { // TODO: Calculate a partial from the reverse diagonals. // For now, just assume everything after the midOriginal/midModified point is a diff let originalStartPoint = midOriginalArr[0] + 1; let modifiedStartPoint = midModifiedArr[0] + 1; if (forwardChanges !== null && forwardChanges.length > 0) { const lastForwardChange = forwardChanges[forwardChanges.length - 1]; originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd()); modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd()); } reverseChanges = [ new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) ]; } else { // Now walk backward through the reverse diagonals history changeHelper = new DiffChangeHelper(); diagonalMin = diagonalReverseStart; diagonalMax = diagonalReverseEnd; diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset; lastOriginalIndex = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; historyIndex = (deltaIsEven) ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2; do { // Get the diagonal index from the relative diagonal number const diagonal = diagonalRelative + diagonalReverseBase; // Figure out where we came from if (diagonal === diagonalMin || (diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) { // Horizontal line (the element is a deletion)) originalIndex = reversePoints[diagonal + 1] - 1; modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset; if (originalIndex > lastOriginalIndex) { changeHelper.MarkNextChange(); } lastOriginalIndex = originalIndex + 1; changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1); diagonalRelative = (diagonal + 1) - diagonalReverseBase; //Setup for the next iteration } else { // Vertical line (the element is an insertion) originalIndex = reversePoints[diagonal - 1]; modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset; if (originalIndex > lastOriginalIndex) { changeHelper.MarkNextChange(); } lastOriginalIndex = originalIndex; changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1); diagonalRelative = (diagonal - 1) - diagonalReverseBase; //Setup for the next iteration } if (historyIndex >= 0) { reversePoints = this.m_reverseHistory[historyIndex]; diagonalReverseBase = reversePoints[0]; //We stored this in the first spot diagonalMin = 1; diagonalMax = reversePoints.length - 1; } } while (--historyIndex >= -1); // There are cases where the reverse history will find diffs that // are correct, but not intuitive, so we need shift them. reverseChanges = changeHelper.getChanges(); } return this.ConcatenateChanges(forwardChanges, reverseChanges); } /** * Given the range to compute the diff on, this method finds the point: * (midOriginal, midModified) * that exists in the middle of the LCS of the two sequences and * is the point at which the LCS problem may be broken down recursively. * This method will try to keep the LCS trace in memory. If the LCS recursion * point is calculated and the full trace is available in memory, then this method * will return the change list. * @param originalStart The start bound of the original sequence range * @param originalEnd The end bound of the original sequence range * @param modifiedStart The start bound of the modified sequence range * @param modifiedEnd The end bound of the modified sequence range * @param midOriginal The middle point of the original sequence range * @param midModified The middle point of the modified sequence range * @returns The diff changes, if available, otherwise null */ ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) { let originalIndex = 0, modifiedIndex = 0; let diagonalForwardStart = 0, diagonalForwardEnd = 0; let diagonalReverseStart = 0, diagonalReverseEnd = 0; // To traverse the edit graph and produce the proper LCS, our actual // start position is just outside the given boundary originalStart--; modifiedStart--; // We set these up to make the compiler happy, but they will // be replaced before we return with the actual recursion point midOriginalArr[0] = 0; midModifiedArr[0] = 0; // Clear out the history this.m_forwardHistory = []; this.m_reverseHistory = []; // Each cell in the two arrays corresponds to a diagonal in the edit graph. // The integer value in the cell represents the originalIndex of the furthest // reaching point found so far that ends in that diagonal. // The modifiedIndex can be computed mathematically from the originalIndex and the diagonal number. const maxDifferences = (originalEnd - originalStart) + (modifiedEnd - modifiedStart); const numDiagonals = maxDifferences + 1; const forwardPoints = new Int32Array(numDiagonals); const reversePoints = new Int32Array(numDiagonals); // diagonalForwardBase: Index into forwardPoints of the diagonal which passes through (originalStart, modifiedStart) // diagonalReverseBase: Index into reversePoints of the diagonal which passes through (originalEnd, modifiedEnd) const diagonalForwardBase = (modifiedEnd - modifiedStart); const diagonalReverseBase = (originalEnd - originalStart); // diagonalForwardOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the // diagonal number (relative to diagonalForwardBase) // diagonalReverseOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the // diagonal number (relative to diagonalReverseBase) const diagonalForwardOffset = (originalStart - modifiedStart); const diagonalReverseOffset = (originalEnd - modifiedEnd); // delta: The difference between the end diagonal and the start diagonal. This is used to relate diagonal numbers // relative to the start diagonal with diagonal numbers relative to the end diagonal. // The Even/Oddn-ness of this delta is important for determining when we should check for overlap const delta = diagonalReverseBase - diagonalForwardBase; const deltaIsEven = (delta % 2 === 0); // Here we set up the start and end points as the furthest points found so far // in both the forward and reverse directions, respectively forwardPoints[diagonalForwardBase] = originalStart; reversePoints[diagonalReverseBase] = originalEnd; // Remember if we quit early, and thus need to do a best-effort result instead of a real result. quitEarlyArr[0] = false; // A couple of points: // --With this method, we iterate on the number of differences between the two sequences. // The more differences there actually are, the longer this will take. // --Also, as the number of differences increases, we have to search on diagonals further // away from the reference diagonal (which is diagonalForwardBase for forward, diagonalReverseBase for reverse). // --We extend on even diagonals (relative to the reference diagonal) only when numDifferences // is even and odd diagonals only when numDifferences is odd. for (let numDifferences = 1; numDifferences <= (maxDifferences / 2) + 1; numDifferences++) { let furthestOriginalIndex = 0; let furthestModifiedIndex = 0; // Run the algorithm in the forward direction diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals); diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals); for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) { // STEP 1: We extend the furthest reaching point in the present diagonal // by looking at the diagonals above and below and picking the one whose point // is further away from the start point (originalStart, modifiedStart) if (diagonal === diagonalForwardStart || (diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) { originalIndex = forwardPoints[diagonal + 1]; } else { originalIndex = forwardPoints[diagonal - 1] + 1; } modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset; // Save the current originalIndex so we can test for false overlap in step 3 const tempOriginalIndex = originalIndex; // STEP 2: We can continue to extend the furthest reaching point in the present diagonal // so long as the elements are equal. while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) { originalIndex++; modifiedIndex++; } forwardPoints[diagonal] = originalIndex; if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) { furthestOriginalIndex = originalIndex; furthestModifiedIndex = modifiedIndex; } // STEP 3: If delta is odd (overlap first happens on forward when delta is odd) // and diagonal is in the range of reverse diagonals computed for numDifferences-1 // (the previous iteration; we haven't computed reverse diagonals for numDifferences yet) // then check for overlap. if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= (numDifferences - 1)) { if (originalIndex >= reversePoints[diagonal]) { midOriginalArr[0] = originalIndex; midModifiedArr[0] = modifiedIndex; if (tempOriginalIndex <= reversePoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) { // BINGO! We overlapped, and we have the full trace in memory! return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); } else { // Either false overlap, or we didn't have enough memory for the full trace // Just return the recursion point return null; } } } } // Check to see if we should be quitting early, before moving on to the next iteration. const matchLengthOfLongest = ((furthestOriginalIndex - originalStart) + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2; if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) { // We can't finish, so skip ahead to generating a result from what we have. quitEarlyArr[0] = true; // Use the furthest distance we got in the forward direction. midOriginalArr[0] = furthestOriginalIndex; midModifiedArr[0] = furthestModifiedIndex; if (matchLengthOfLongest > 0 && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) { // Enough of the history is in memory to walk it backwards return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); } else { // We didn't actually remember enough of the history. //Since we are quitting the diff early, we need to shift back the originalStart and modified start //back into the boundary limits since we decremented their value above beyond the boundary limit. originalStart++; modifiedStart++; return [ new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } } // Run the algorithm in the reverse direction diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals); diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals); for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) { // STEP 1: We extend the furthest reaching point in the present diagonal // by looking at the diagonals above and below and picking the one whose point // is further away from the start point (originalEnd, modifiedEnd) if (diagonal === diagonalReverseStart || (diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) { originalIndex = reversePoints[diagonal + 1] - 1; } else { originalIndex = reversePoints[diagonal - 1]; } modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset; // Save the current originalIndex so we can test for false overlap const tempOriginalIndex = originalIndex; // STEP 2: We can continue to extend the furthest reaching point in the present diagonal // as long as the elements are equal. while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) { originalIndex--; modifiedIndex--; } reversePoints[diagonal] = originalIndex; // STEP 4: If delta is even (overlap first happens on reverse when delta is even) // and diagonal is in the range of forward diagonals computed for numDifferences // then check for overlap. if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) { if (originalIndex <= forwardPoints[diagonal]) { midOriginalArr[0] = originalIndex; midModifiedArr[0] = modifiedIndex; if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) { // BINGO! We overlapped, and we have the full trace in memory! return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); } else { // Either false overlap, or we didn't have enough memory for the full trace // Just return the recursion point return null; } } } } // Save current vectors to history before the next iteration if (numDifferences <= 1447 /* MaxDifferencesHistory */) { // We are allocating space for one extra int, which we fill with // the index of the diagonal base index let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2); temp[0] = diagonalForwardBase - diagonalForwardStart + 1; MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1); this.m_forwardHistory.push(temp); temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2); temp[0] = diagonalReverseBase - diagonalReverseStart + 1; MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1); this.m_reverseHistory.push(temp); } } // If we got here, then we have the full trace in history. We just have to convert it to a change list // NOTE: This part is a bit messy return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr); } /** * Shifts the given changes to provide a more intuitive diff. * While the first element in a diff matches the first element after the diff, * we shift the diff down. * * @param changes The list of changes to shift * @returns The shifted changes */ PrettifyChanges(changes) { // Shift all the changes down first for (let i = 0; i < changes.length; i++) { const change = changes[i]; const originalStop = (i < changes.length - 1) ? changes[i + 1].originalStart : this._originalElementsOrHash.length; const modifiedStop = (i < changes.length - 1) ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length; const checkOriginal = change.originalLength > 0; const checkModified = change.modifiedLength > 0; while (change.originalStart + change.originalLength < originalStop && change.modifiedStart + change.modifiedLength < modifiedStop && (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) && (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) { const startStrictEqual = this.ElementsAreStrictEqual(change.originalStart, change.modifiedStart); const endStrictEqual = this.ElementsAreStrictEqual(change.originalStart + change.originalLength, change.modifiedStart + change.modifiedLength); if (endStrictEqual && !startStrictEqual) { // moving the change down would create an equal change, but the elements are not strict equal break; } change.originalStart++; change.modifiedStart++; } let mergedChangeArr = [null]; if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) { changes[i] = mergedChangeArr[0]; changes.splice(i + 1, 1); i--; continue; } } // Shift changes back up until we hit empty or whitespace-only lines for (let i = changes.length - 1; i >= 0; i--) { const change = changes[i]; let originalStop = 0; let modifiedStop = 0; if (i > 0) { const prevChange = changes[i - 1]; originalStop = prevChange.originalStart + prevChange.originalLength; modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength; } const checkOriginal = change.originalLength > 0; const checkModified = change.modifiedLength > 0; let bestDelta = 0; let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength); for (let delta = 1;; delta++) { const originalStart = change.originalStart - delta; const modifiedStart = change.modifiedStart - delta; if (originalStart < originalStop || modifiedStart < modifiedStop) { break; } if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) { break; } if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) { break; } const touchingPreviousChange = (originalStart === originalStop && modifiedStart === modifiedStop); const score = ((touchingPreviousChange ? 5 : 0) + this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength)); if (score > bestScore) { bestScore = score; bestDelta = delta; } } change.originalStart -= bestDelta; change.modifiedStart -= bestDelta; const mergedChangeArr = [null]; if (i > 0 && this.ChangesOverlap(changes[i - 1], changes[i], mergedChangeArr)) { changes[i - 1] = mergedChangeArr[0]; changes.splice(i, 1); i++; continue; } } // There could be multiple longest common substrings. // Give preference to the ones containing longer lines if (this._hasStrings) { for (let i = 1, len = changes.length; i < len; i++) { const aChange = changes[i - 1]; const bChange = changes[i]; const matchedLength = bChange.originalStart - aChange.originalStart - aChange.originalLength; const aOriginalStart = aChange.originalStart; const bOriginalEnd = bChange.originalStart + bChange.originalLength; const abOriginalLength = bOriginalEnd - aOriginalStart; const aModifiedStart = aChange.modifiedStart; const bModifiedEnd = bChange.modifiedStart + bChange.modifiedLength; const abModifiedLength = bModifiedEnd - aModifiedStart; // Avoid wasting a lot of time with these searches if (matchedLength < 5 && abOriginalLength < 20 && abModifiedLength < 20) { const t = this._findBetterContiguousSequence(aOriginalStart, abOriginalLength, aModifiedStart, abModifiedLength, matchedLength); if (t) { const [originalMatchStart, modifiedMatchStart] = t; if (originalMatchStart !== aChange.originalStart + aChange.originalLength || modifiedMatchStart !== aChange.modifiedStart + aChange.modifiedLength) { // switch to another sequence that has a better score aChange.originalLength = originalMatchStart - aChange.originalStart; aChange.modifiedLength = modifiedMatchStart - aChange.modifiedStart; bChange.originalStart = originalMatchStart + matchedLength; bChange.modifiedStart = modifiedMatchStart + matchedLength; bChange.originalLength = bOriginalEnd - bChange.originalStart; bChange.modifiedLength = bModifiedEnd - bChange.modifiedStart; } } } } } return changes; } _findBetterContiguousSequence(originalStart, originalLength, modifiedStart, modifiedLength, desiredLength) { if (originalLength < desiredLength || modifiedLength < desiredLength) { return null; } const originalMax = originalStart + originalLength - desiredLength + 1; const modifiedMax = modifiedStart + modifiedLength - desiredLength + 1; let bestScore = 0; let bestOriginalStart = 0; let bestModifiedStart = 0; for (let i = originalStart; i < originalMax; i++) { for (let j = modifiedStart; j < modifiedMax; j++) { const score = this._contiguousSequenceScore(i, j, desiredLength); if (score > 0 && score > bestScore) { bestScore = score; bestOriginalStart = i; bestModifiedStart = j; } } } if (bestScore > 0) { return [bestOriginalStart, bestModifiedStart]; } return null; } _contiguousSequenceScore(originalStart, modifiedStart, length) { let score = 0; for (let l = 0; l < length; l++) { if (!this.ElementsAreEqual(originalStart + l, modifiedStart + l)) { return 0; } score += this._originalStringElements[originalStart + l].length; } return score; } _OriginalIsBoundary(index) { if (index <= 0 || index >= this._originalElementsOrHash.length - 1) { return true; } return (this._hasStrings && /^\s*$/.test(this._originalStringElements[index])); } _OriginalRegionIsBoundary(originalStart, originalLength) { if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) { return true; } if (originalLength > 0) { const originalEnd = originalStart + originalLength; if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) { return true; } } return false; } _ModifiedIsBoundary(index) { if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) { return true; } return (this._hasStrings && /^\s*$/.test(this._modifiedStringElements[index])); } _ModifiedRegionIsBoundary(modifiedStart, modifiedLength) { if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) { return true; } if (modifiedLength > 0) { const modifiedEnd = modifiedStart + modifiedLength; if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) { return true; } } return false; } _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) { const originalScore = (this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0); const modifiedScore = (this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0); return (originalScore + modifiedScore); } /** * Concatenates the two input DiffChange lists and returns the resulting * list. * @param The left changes * @param The right changes * @returns The concatenated list */ ConcatenateChanges(left, right) { let mergedChangeArr = []; if (left.length === 0 || right.length === 0) { return (right.length > 0) ? right : left; } else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) { // Since we break the problem down recursively, it is possible that we // might recurse in the middle of a change thereby splitting it into // two changes. Here in the combining stage, we detect and fuse those // changes back together const result = new Array(left.length + right.length - 1); MyArray.Copy(left, 0, result, 0, left.length - 1); result[left.length - 1] = mergedChangeArr[0]; MyArray.Copy(right, 1, result, left.length, right.length - 1); return result; } else { const result = new Array(left.length + right.length); MyArray.Copy(left, 0, result, 0, left.length); MyArray.Copy(right, 0, result, left.length, right.length); return result; } } /** * Returns true if the two changes overlap and can be merged into a single * change * @param left The left change * @param right The right change * @param mergedChange The merged change if the two overlap, null otherwise * @returns True if the two changes overlap */ ChangesOverlap(left, right, mergedChangeArr) { Debug.Assert(left.originalStart <= right.originalStart, 'Left change is not less than or equal to right change'); Debug.Assert(left.modifiedStart <= right.modifiedStart, 'Left change is not less than or equal to right change'); if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) { const originalStart = left.originalStart; let originalLength = left.originalLength; const modifiedStart = left.modifiedStart; let modifiedLength = left.modifiedLength; if (left.originalStart + left.originalLength >= right.originalStart) { originalLength = right.originalStart + right.originalLength - left.originalStart; } if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) { modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart; } mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength); return true; } else { mergedChangeArr[0] = null; return false; } } /** * Helper method used to clip a diagonal index to the range of valid * diagonals. This also decides whether or not the diagonal index, * if it exceeds the boundary, should be clipped to the boundary or clipped * one inside the boundary depending on the Even/Odd status of the boundary * and numDifferences. * @param diagonal The index of the diagonal to clip. * @param numDifferences The current number of differences being iterated upon. * @param diagonalBaseIndex The base reference diagonal. * @param numDiagonals The total number of diagonals. * @returns The clipped diagonal index. */ ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) { if (diagonal >= 0 && diagonal < numDiagonals) { // Nothing to clip, its in range return diagonal; } // diagonalsBelow: The number of diagonals below the reference diagonal // diagonalsAbove: The number of diagonals above the reference diagonal const diagonalsBelow = diagonalBaseIndex; const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1; const diffEven = (numDifferences % 2 === 0); if (diagonal < 0) { const lowerBoundEven = (diagonalsBelow % 2 === 0); return (diffEven === lowerBoundEven) ? 0 : 1; } else { const upperBoundEven = (diagonalsAbove % 2 === 0); return (diffEven === upperBoundEven) ? numDiagonals - 1 : numDiagonals - 2; } } } /***/ }), /***/ 57637: /*!****************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/extpath.js ***! \****************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ KM: function() { return /* binding */ isEqualOrParent; }, /* harmony export */ fn: function() { return /* binding */ toPosixPath; }, /* harmony export */ oP: function() { return /* binding */ hasDriveLetter; }, /* harmony export */ vY: function() { return /* binding */ isRootOrDriveLetter; } /* harmony export */ }); /* unused harmony exports toSlashes, isWindowsDriveLetter */ /* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./path.js */ 86408); /* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./platform.js */ 23345); /* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./strings.js */ 82983); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** * Takes a Windows OS path and changes backward slashes to forward slashes. * This should only be done for OS paths from Windows (or user provided paths potentially from Windows). * Using it on a Linux or MaxOS path might change it. */ function toSlashes(osPath) { return osPath.replace(/[\\/]/g, _path_js__WEBPACK_IMPORTED_MODULE_0__/* .posix */ .KR.sep); } /** * Takes a Windows OS path (using backward or forward slashes) and turns it into a posix path: * - turns backward slashes into forward slashes * - makes it absolute if it starts with a drive letter * This should only be done for OS paths from Windows (or user provided paths potentially from Windows). * Using it on a Linux or MaxOS path might change it. */ function toPosixPath(osPath) { if (osPath.indexOf('/') === -1) { osPath = toSlashes(osPath); } if (/^[a-zA-Z]:(\/|$)/.test(osPath)) { // starts with a drive letter osPath = '/' + osPath; } return osPath; } function isEqualOrParent(base, parentCandidate, ignoreCase, separator = _path_js__WEBPACK_IMPORTED_MODULE_0__/* .sep */ .ir) { if (base === parentCandidate) { return true; } if (!base || !parentCandidate) { return false; } if (parentCandidate.length > base.length) { return false; } if (ignoreCase) { const beginsWith = (0,_strings_js__WEBPACK_IMPORTED_MODULE_2__/* .startsWithIgnoreCase */ .ok)(base, parentCandidate); if (!beginsWith) { return false; } if (parentCandidate.length === base.length) { return true; // same path, different casing } let sepOffset = parentCandidate.length; if (parentCandidate.charAt(parentCandidate.length - 1) === separator) { sepOffset--; // adjust the expected sep offset in case our candidate already ends in separator character } return base.charAt(sepOffset) === separator; } if (parentCandidate.charAt(parentCandidate.length - 1) !== separator) { parentCandidate += separator; } return base.indexOf(parentCandidate) === 0; } function isWindowsDriveLetter(char0) { return char0 >= 65 /* A */ && char0 <= 90 /* Z */ || char0 >= 97 /* a */ && char0 <= 122 /* z */; } function isRootOrDriveLetter(path) { const pathNormalized = (0,_path_js__WEBPACK_IMPORTED_MODULE_0__/* .normalize */ .Fv)(path); if (_platform_js__WEBPACK_IMPORTED_MODULE_1__/* .isWindows */ .ED) { if (path.length > 3) { return false; } return hasDriveLetter(pathNormalized) && (path.length === 2 || pathNormalized.charCodeAt(2) === 92 /* Backslash */); } return pathNormalized === _path_js__WEBPACK_IMPORTED_MODULE_0__/* .posix */ .KR.sep; } function hasDriveLetter(path) { if (_platform_js__WEBPACK_IMPORTED_MODULE_1__/* .isWindows */ .ED) { return isWindowsDriveLetter(path.charCodeAt(0)) && path.charCodeAt(1) === 58 /* Colon */; } return false; } /***/ }), /***/ 99599: /*!****************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/filters.js ***! \****************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CL: function() { return /* binding */ FuzzyScore; }, /* harmony export */ EW: function() { return /* binding */ fuzzyScore; }, /* harmony export */ Ji: function() { return /* binding */ matchesPrefix; }, /* harmony export */ KZ: function() { return /* binding */ matchesWords; }, /* harmony export */ Oh: function() { return /* binding */ matchesFuzzy; }, /* harmony export */ ir: function() { return /* binding */ matchesContiguousSubString; }, /* harmony export */ jB: function() { return /* binding */ anyScore; }, /* harmony export */ l7: function() { return /* binding */ fuzzyScoreGracefulAggressive; }, /* harmony export */ mB: function() { return /* binding */ createMatches; }, /* harmony export */ or: function() { return /* binding */ or; } /* harmony export */ }); /* unused harmony exports matchesSubString, isUpper, matchesCamelCase, isPatternInWord */ /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./map.js */ 78421); /* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strings.js */ 82983); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Combined filters /** * @returns A filter which combines the provided set * of filters with an or. The *first* filters that * matches defined the return value of the returned * filter. */ function or(...filter) { return function (word, wordToMatchAgainst) { for (let i = 0, len = filter.length; i < len; i++) { const match = filter[i](word, wordToMatchAgainst); if (match) { return match; } } return null; }; } const matchesPrefix = _matchesPrefix.bind(undefined, true); function _matchesPrefix(ignoreCase, word, wordToMatchAgainst) { if (!wordToMatchAgainst || wordToMatchAgainst.length < word.length) { return null; } let matches; if (ignoreCase) { matches = _strings_js__WEBPACK_IMPORTED_MODULE_1__/* .startsWithIgnoreCase */ .ok(wordToMatchAgainst, word); } else { matches = wordToMatchAgainst.indexOf(word) === 0; } if (!matches) { return null; } return word.length > 0 ? [{ start: 0, end: word.length }] : []; } // Contiguous Substring function matchesContiguousSubString(word, wordToMatchAgainst) { const index = wordToMatchAgainst.toLowerCase().indexOf(word.toLowerCase()); if (index === -1) { return null; } return [{ start: index, end: index + word.length }]; } // Substring function matchesSubString(word, wordToMatchAgainst) { return _matchesSubString(word.toLowerCase(), wordToMatchAgainst.toLowerCase(), 0, 0); } function _matchesSubString(word, wordToMatchAgainst, i, j) { if (i === word.length) { return []; } else if (j === wordToMatchAgainst.length) { return null; } else { if (word[i] === wordToMatchAgainst[j]) { let result = null; if (result = _matchesSubString(word, wordToMatchAgainst, i + 1, j + 1)) { return join({ start: j, end: j + 1 }, result); } return null; } return _matchesSubString(word, wordToMatchAgainst, i, j + 1); } } // CamelCase function isLower(code) { return 97 /* a */ <= code && code <= 122 /* z */; } function isUpper(code) { return 65 /* A */ <= code && code <= 90 /* Z */; } function isNumber(code) { return 48 /* Digit0 */ <= code && code <= 57 /* Digit9 */; } function isWhitespace(code) { return (code === 32 /* Space */ || code === 9 /* Tab */ || code === 10 /* LineFeed */ || code === 13 /* CarriageReturn */); } const wordSeparators = new Set(); '`~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?' .split('') .forEach(s => wordSeparators.add(s.charCodeAt(0))); function isWordSeparator(code) { return isWhitespace(code) || wordSeparators.has(code); } function charactersMatch(codeA, codeB) { return (codeA === codeB) || (isWordSeparator(codeA) && isWordSeparator(codeB)); } function isAlphanumeric(code) { return isLower(code) || isUpper(code) || isNumber(code); } function join(head, tail) { if (tail.length === 0) { tail = [head]; } else if (head.end === tail[0].start) { tail[0].start = head.start; } else { tail.unshift(head); } return tail; } function nextAnchor(camelCaseWord, start) { for (let i = start; i < camelCaseWord.length; i++) { const c = camelCaseWord.charCodeAt(i); if (isUpper(c) || isNumber(c) || (i > 0 && !isAlphanumeric(camelCaseWord.charCodeAt(i - 1)))) { return i; } } return camelCaseWord.length; } function _matchesCamelCase(word, camelCaseWord, i, j) { if (i === word.length) { return []; } else if (j === camelCaseWord.length) { return null; } else if (word[i] !== camelCaseWord[j].toLowerCase()) { return null; } else { let result = null; let nextUpperIndex = j + 1; result = _matchesCamelCase(word, camelCaseWord, i + 1, j + 1); while (!result && (nextUpperIndex = nextAnchor(camelCaseWord, nextUpperIndex)) < camelCaseWord.length) { result = _matchesCamelCase(word, camelCaseWord, i + 1, nextUpperIndex); nextUpperIndex++; } return result === null ? null : join({ start: j, end: j + 1 }, result); } } // Heuristic to avoid computing camel case matcher for words that don't // look like camelCaseWords. function analyzeCamelCaseWord(word) { let upper = 0, lower = 0, alpha = 0, numeric = 0, code = 0; for (let i = 0; i < word.length; i++) { code = word.charCodeAt(i); if (isUpper(code)) { upper++; } if (isLower(code)) { lower++; } if (isAlphanumeric(code)) { alpha++; } if (isNumber(code)) { numeric++; } } const upperPercent = upper / word.length; const lowerPercent = lower / word.length; const alphaPercent = alpha / word.length; const numericPercent = numeric / word.length; return { upperPercent, lowerPercent, alphaPercent, numericPercent }; } function isUpperCaseWord(analysis) { const { upperPercent, lowerPercent } = analysis; return lowerPercent === 0 && upperPercent > 0.6; } function isCamelCaseWord(analysis) { const { upperPercent, lowerPercent, alphaPercent, numericPercent } = analysis; return lowerPercent > 0.2 && upperPercent < 0.8 && alphaPercent > 0.6 && numericPercent < 0.2; } // Heuristic to avoid computing camel case matcher for words that don't // look like camel case patterns. function isCamelCasePattern(word) { let upper = 0, lower = 0, code = 0, whitespace = 0; for (let i = 0; i < word.length; i++) { code = word.charCodeAt(i); if (isUpper(code)) { upper++; } if (isLower(code)) { lower++; } if (isWhitespace(code)) { whitespace++; } } if ((upper === 0 || lower === 0) && whitespace === 0) { return word.length <= 30; } else { return upper <= 5; } } function matchesCamelCase(word, camelCaseWord) { if (!camelCaseWord) { return null; } camelCaseWord = camelCaseWord.trim(); if (camelCaseWord.length === 0) { return null; } if (!isCamelCasePattern(word)) { return null; } if (camelCaseWord.length > 60) { return null; } const analysis = analyzeCamelCaseWord(camelCaseWord); if (!isCamelCaseWord(analysis)) { if (!isUpperCaseWord(analysis)) { return null; } camelCaseWord = camelCaseWord.toLowerCase(); } let result = null; let i = 0; word = word.toLowerCase(); while (i < camelCaseWord.length && (result = _matchesCamelCase(word, camelCaseWord, 0, i)) === null) { i = nextAnchor(camelCaseWord, i + 1); } return result; } // Matches beginning of words supporting non-ASCII languages // If `contiguous` is true then matches word with beginnings of the words in the target. E.g. "pul" will match "Git: Pull" // Otherwise also matches sub string of the word with beginnings of the words in the target. E.g. "gp" or "g p" will match "Git: Pull" // Useful in cases where the target is words (e.g. command labels) function matchesWords(word, target, contiguous = false) { if (!target || target.length === 0) { return null; } let result = null; let i = 0; word = word.toLowerCase(); target = target.toLowerCase(); while (i < target.length && (result = _matchesWords(word, target, 0, i, contiguous)) === null) { i = nextWord(target, i + 1); } return result; } function _matchesWords(word, target, i, j, contiguous) { if (i === word.length) { return []; } else if (j === target.length) { return null; } else if (!charactersMatch(word.charCodeAt(i), target.charCodeAt(j))) { return null; } else { let result = null; let nextWordIndex = j + 1; result = _matchesWords(word, target, i + 1, j + 1, contiguous); if (!contiguous) { while (!result && (nextWordIndex = nextWord(target, nextWordIndex)) < target.length) { result = _matchesWords(word, target, i + 1, nextWordIndex, contiguous); nextWordIndex++; } } return result === null ? null : join({ start: j, end: j + 1 }, result); } } function nextWord(word, start) { for (let i = start; i < word.length; i++) { if (isWordSeparator(word.charCodeAt(i)) || (i > 0 && isWordSeparator(word.charCodeAt(i - 1)))) { return i; } } return word.length; } // Fuzzy const fuzzyContiguousFilter = or(matchesPrefix, matchesCamelCase, matchesContiguousSubString); const fuzzySeparateFilter = or(matchesPrefix, matchesCamelCase, matchesSubString); const fuzzyRegExpCache = new _map_js__WEBPACK_IMPORTED_MODULE_0__/* .LRUCache */ .z6(10000); // bounded to 10000 elements function matchesFuzzy(word, wordToMatchAgainst, enableSeparateSubstringMatching = false) { if (typeof word !== 'string' || typeof wordToMatchAgainst !== 'string') { return null; // return early for invalid input } // Form RegExp for wildcard matches let regexp = fuzzyRegExpCache.get(word); if (!regexp) { regexp = new RegExp(_strings_js__WEBPACK_IMPORTED_MODULE_1__/* .convertSimple2RegExpPattern */ .un(word), 'i'); fuzzyRegExpCache.set(word, regexp); } // RegExp Filter const match = regexp.exec(wordToMatchAgainst); if (match) { return [{ start: match.index, end: match.index + match[0].length }]; } // Default Filter return enableSeparateSubstringMatching ? fuzzySeparateFilter(word, wordToMatchAgainst) : fuzzyContiguousFilter(word, wordToMatchAgainst); } function anyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos) { const max = Math.min(13, pattern.length); for (; patternPos < max; patternPos++) { const result = fuzzyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos, false); if (result) { return result; } } return [0, wordPos]; } //#region --- fuzzyScore --- function createMatches(score) { if (typeof score === 'undefined') { return []; } const res = []; const wordPos = score[1]; for (let i = score.length - 1; i > 1; i--) { const pos = score[i] + wordPos; const last = res[res.length - 1]; if (last && last.end === pos) { last.end = pos + 1; } else { res.push({ start: pos, end: pos + 1 }); } } return res; } const _maxLen = 128; function initTable() { const table = []; const row = []; for (let i = 0; i <= _maxLen; i++) { row[i] = 0; } for (let i = 0; i <= _maxLen; i++) { table.push(row.slice(0)); } return table; } function initArr(maxLen) { const row = []; for (let i = 0; i <= maxLen; i++) { row[i] = 0; } return row; } const _minWordMatchPos = initArr(2 * _maxLen); // min word position for a certain pattern position const _maxWordMatchPos = initArr(2 * _maxLen); // max word position for a certain pattern position const _diag = initTable(); // the length of a contiguous diagonal match const _table = initTable(); const _arrows = initTable(); const _debug = false; function printTable(table, pattern, patternLen, word, wordLen) { function pad(s, n, pad = ' ') { while (s.length < n) { s = pad + s; } return s; } let ret = ` | |${word.split('').map(c => pad(c, 3)).join('|')}\n`; for (let i = 0; i <= patternLen; i++) { if (i === 0) { ret += ' |'; } else { ret += `${pattern[i - 1]}|`; } ret += table[i].slice(0, wordLen + 1).map(n => pad(n.toString(), 3)).join('|') + '\n'; } return ret; } function printTables(pattern, patternStart, word, wordStart) { pattern = pattern.substr(patternStart); word = word.substr(wordStart); console.log(printTable(_table, pattern, pattern.length, word, word.length)); console.log(printTable(_arrows, pattern, pattern.length, word, word.length)); console.log(printTable(_diag, pattern, pattern.length, word, word.length)); } function isSeparatorAtPos(value, index) { if (index < 0 || index >= value.length) { return false; } const code = value.codePointAt(index); switch (code) { case 95 /* Underline */: case 45 /* Dash */: case 46 /* Period */: case 32 /* Space */: case 47 /* Slash */: case 92 /* Backslash */: case 39 /* SingleQuote */: case 34 /* DoubleQuote */: case 58 /* Colon */: case 36 /* DollarSign */: case 60 /* LessThan */: case 40 /* OpenParen */: case 91 /* OpenSquareBracket */: return true; case undefined: return false; default: if (_strings_js__WEBPACK_IMPORTED_MODULE_1__/* .isEmojiImprecise */ .C8(code)) { return true; } return false; } } function isWhitespaceAtPos(value, index) { if (index < 0 || index >= value.length) { return false; } const code = value.charCodeAt(index); switch (code) { case 32 /* Space */: case 9 /* Tab */: return true; default: return false; } } function isUpperCaseAtPos(pos, word, wordLow) { return word[pos] !== wordLow[pos]; } function isPatternInWord(patternLow, patternPos, patternLen, wordLow, wordPos, wordLen, fillMinWordPosArr = false) { while (patternPos < patternLen && wordPos < wordLen) { if (patternLow[patternPos] === wordLow[wordPos]) { if (fillMinWordPosArr) { // Remember the min word position for each pattern position _minWordMatchPos[patternPos] = wordPos; } patternPos += 1; } wordPos += 1; } return patternPos === patternLen; // pattern must be exhausted } var FuzzyScore; (function (FuzzyScore) { /** * No matches and value `-100` */ FuzzyScore.Default = ([-100, 0]); function isDefault(score) { return !score || (score.length === 2 && score[0] === -100 && score[1] === 0); } FuzzyScore.isDefault = isDefault; })(FuzzyScore || (FuzzyScore = {})); function fuzzyScore(pattern, patternLow, patternStart, word, wordLow, wordStart, firstMatchCanBeWeak) { const patternLen = pattern.length > _maxLen ? _maxLen : pattern.length; const wordLen = word.length > _maxLen ? _maxLen : word.length; if (patternStart >= patternLen || wordStart >= wordLen || (patternLen - patternStart) > (wordLen - wordStart)) { return undefined; } // Run a simple check if the characters of pattern occur // (in order) at all in word. If that isn't the case we // stop because no match will be possible if (!isPatternInWord(patternLow, patternStart, patternLen, wordLow, wordStart, wordLen, true)) { return undefined; } // Find the max matching word position for each pattern position // NOTE: the min matching word position was filled in above, in the `isPatternInWord` call _fillInMaxWordMatchPos(patternLen, wordLen, patternStart, wordStart, patternLow, wordLow); let row = 1; let column = 1; let patternPos = patternStart; let wordPos = wordStart; const hasStrongFirstMatch = [false]; // There will be a match, fill in tables for (row = 1, patternPos = patternStart; patternPos < patternLen; row++, patternPos++) { // Reduce search space to possible matching word positions and to possible access from next row const minWordMatchPos = _minWordMatchPos[patternPos]; const maxWordMatchPos = _maxWordMatchPos[patternPos]; const nextMaxWordMatchPos = (patternPos + 1 < patternLen ? _maxWordMatchPos[patternPos + 1] : wordLen); for (column = minWordMatchPos - wordStart + 1, wordPos = minWordMatchPos; wordPos < nextMaxWordMatchPos; column++, wordPos++) { let score = Number.MIN_SAFE_INTEGER; let canComeDiag = false; if (wordPos <= maxWordMatchPos) { score = _doScore(pattern, patternLow, patternPos, patternStart, word, wordLow, wordPos, wordLen, wordStart, _diag[row - 1][column - 1] === 0, hasStrongFirstMatch); } let diagScore = 0; if (score !== Number.MAX_SAFE_INTEGER) { canComeDiag = true; diagScore = score + _table[row - 1][column - 1]; } const canComeLeft = wordPos > minWordMatchPos; const leftScore = canComeLeft ? _table[row][column - 1] + (_diag[row][column - 1] > 0 ? -5 : 0) : 0; // penalty for a gap start const canComeLeftLeft = wordPos > minWordMatchPos + 1 && _diag[row][column - 1] > 0; const leftLeftScore = canComeLeftLeft ? _table[row][column - 2] + (_diag[row][column - 2] > 0 ? -5 : 0) : 0; // penalty for a gap start if (canComeLeftLeft && (!canComeLeft || leftLeftScore >= leftScore) && (!canComeDiag || leftLeftScore >= diagScore)) { // always prefer choosing left left to jump over a diagonal because that means a match is earlier in the word _table[row][column] = leftLeftScore; _arrows[row][column] = 3 /* LeftLeft */; _diag[row][column] = 0; } else if (canComeLeft && (!canComeDiag || leftScore >= diagScore)) { // always prefer choosing left since that means a match is earlier in the word _table[row][column] = leftScore; _arrows[row][column] = 2 /* Left */; _diag[row][column] = 0; } else if (canComeDiag) { _table[row][column] = diagScore; _arrows[row][column] = 1 /* Diag */; _diag[row][column] = _diag[row - 1][column - 1] + 1; } else { throw new Error(`not possible`); } } } if (_debug) { printTables(pattern, patternStart, word, wordStart); } if (!hasStrongFirstMatch[0] && !firstMatchCanBeWeak) { return undefined; } row--; column--; const result = [_table[row][column], wordStart]; let backwardsDiagLength = 0; let maxMatchColumn = 0; while (row >= 1) { // Find the column where we go diagonally up let diagColumn = column; do { const arrow = _arrows[row][diagColumn]; if (arrow === 3 /* LeftLeft */) { diagColumn = diagColumn - 2; } else if (arrow === 2 /* Left */) { diagColumn = diagColumn - 1; } else { // found the diagonal break; } } while (diagColumn >= 1); // Overturn the "forwards" decision if keeping the "backwards" diagonal would give a better match if (backwardsDiagLength > 1 // only if we would have a contiguous match of 3 characters && patternLow[patternStart + row - 1] === wordLow[wordStart + column - 1] // only if we can do a contiguous match diagonally && !isUpperCaseAtPos(diagColumn + wordStart - 1, word, wordLow) // only if the forwards chose diagonal is not an uppercase && backwardsDiagLength + 1 > _diag[row][diagColumn] // only if our contiguous match would be longer than the "forwards" contiguous match ) { diagColumn = column; } if (diagColumn === column) { // this is a contiguous match backwardsDiagLength++; } else { backwardsDiagLength = 1; } if (!maxMatchColumn) { // remember the last matched column maxMatchColumn = diagColumn; } row--; column = diagColumn - 1; result.push(column); } if (wordLen === patternLen) { // the word matches the pattern with all characters! // giving the score a total match boost (to come up ahead other words) result[0] += 2; } // Add 1 penalty for each skipped character in the word const skippedCharsCount = maxMatchColumn - patternLen; result[0] -= skippedCharsCount; return result; } function _fillInMaxWordMatchPos(patternLen, wordLen, patternStart, wordStart, patternLow, wordLow) { let patternPos = patternLen - 1; let wordPos = wordLen - 1; while (patternPos >= patternStart && wordPos >= wordStart) { if (patternLow[patternPos] === wordLow[wordPos]) { _maxWordMatchPos[patternPos] = wordPos; patternPos--; } wordPos--; } } function _doScore(pattern, patternLow, patternPos, patternStart, word, wordLow, wordPos, wordLen, wordStart, newMatchStart, outFirstMatchStrong) { if (patternLow[patternPos] !== wordLow[wordPos]) { return Number.MIN_SAFE_INTEGER; } let score = 1; let isGapLocation = false; if (wordPos === (patternPos - patternStart)) { // common prefix: `foobar <-> foobaz` // ^^^^^ score = pattern[patternPos] === word[wordPos] ? 7 : 5; } else if (isUpperCaseAtPos(wordPos, word, wordLow) && (wordPos === 0 || !isUpperCaseAtPos(wordPos - 1, word, wordLow))) { // hitting upper-case: `foo <-> forOthers` // ^^ ^ score = pattern[patternPos] === word[wordPos] ? 7 : 5; isGapLocation = true; } else if (isSeparatorAtPos(wordLow, wordPos) && (wordPos === 0 || !isSeparatorAtPos(wordLow, wordPos - 1))) { // hitting a separator: `. <-> foo.bar` // ^ score = 5; } else if (isSeparatorAtPos(wordLow, wordPos - 1) || isWhitespaceAtPos(wordLow, wordPos - 1)) { // post separator: `foo <-> bar_foo` // ^^^ score = 5; isGapLocation = true; } if (score > 1 && patternPos === patternStart) { outFirstMatchStrong[0] = true; } if (!isGapLocation) { isGapLocation = isUpperCaseAtPos(wordPos, word, wordLow) || isSeparatorAtPos(wordLow, wordPos - 1) || isWhitespaceAtPos(wordLow, wordPos - 1); } // if (patternPos === patternStart) { // first character in pattern if (wordPos > wordStart) { // the first pattern character would match a word character that is not at the word start // so introduce a penalty to account for the gap preceding this match score -= isGapLocation ? 3 : 5; } } else { if (newMatchStart) { // this would be the beginning of a new match (i.e. there would be a gap before this location) score += isGapLocation ? 2 : 0; } else { // this is part of a contiguous match, so give it a slight bonus, but do so only if it would not be a preferred gap location score += isGapLocation ? 0 : 1; } } if (wordPos + 1 === wordLen) { // we always penalize gaps, but this gives unfair advantages to a match that would match the last character in the word // so pretend there is a gap after the last character in the word to normalize things score -= isGapLocation ? 3 : 5; } return score; } //#endregion //#region --- graceful --- function fuzzyScoreGracefulAggressive(pattern, lowPattern, patternPos, word, lowWord, wordPos, firstMatchCanBeWeak) { return fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, true, firstMatchCanBeWeak); } function fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, aggressive, firstMatchCanBeWeak) { let top = fuzzyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos, firstMatchCanBeWeak); if (top && !aggressive) { // when using the original pattern yield a result we` // return it unless we are aggressive and try to find // a better alignment, e.g. `cno` -> `^co^ns^ole` or `^c^o^nsole`. return top; } if (pattern.length >= 3) { // When the pattern is long enough then try a few (max 7) // permutations of the pattern to find a better match. The // permutations only swap neighbouring characters, e.g // `cnoso` becomes `conso`, `cnsoo`, `cnoos`. const tries = Math.min(7, pattern.length - 1); for (let movingPatternPos = patternPos + 1; movingPatternPos < tries; movingPatternPos++) { const newPattern = nextTypoPermutation(pattern, movingPatternPos); if (newPattern) { const candidate = fuzzyScore(newPattern, newPattern.toLowerCase(), patternPos, word, lowWord, wordPos, firstMatchCanBeWeak); if (candidate) { candidate[0] -= 3; // permutation penalty if (!top || candidate[0] > top[0]) { top = candidate; } } } } } return top; } function nextTypoPermutation(pattern, patternPos) { if (patternPos + 1 >= pattern.length) { return undefined; } const swap1 = pattern[patternPos]; const swap2 = pattern[patternPos + 1]; if (swap1 === swap2) { return undefined; } return pattern.slice(0, patternPos) + swap2 + swap1 + pattern.slice(patternPos + 2); } //#endregion /***/ }), /***/ 63224: /*!*************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/glob.js ***! \*************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ EQ: function() { return /* binding */ match; }, /* harmony export */ Qc: function() { return /* binding */ parse; } /* harmony export */ }); /* unused harmony exports splitGlobAware, isRelativePattern */ /* harmony import */ var _async_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./async.js */ 50431); /* harmony import */ var _extpath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extpath.js */ 57637); /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./map.js */ 78421); /* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./path.js */ 86408); /* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./strings.js */ 82983); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const GLOBSTAR = '**'; const GLOB_SPLIT = '/'; const PATH_REGEX = '[/\\\\]'; // any slash or backslash const NO_PATH_REGEX = '[^/\\\\]'; // any non-slash and non-backslash const ALL_FORWARD_SLASHES = /\//g; function starsToRegExp(starCount) { switch (starCount) { case 0: return ''; case 1: return `${NO_PATH_REGEX}*?`; // 1 star matches any number of characters except path separator (/ and \) - non greedy (?) default: // Matches: (Path Sep OR Path Val followed by Path Sep OR Path Sep followed by Path Val) 0-many times // Group is non capturing because we don't need to capture at all (?:...) // Overall we use non-greedy matching because it could be that we match too much return `(?:${PATH_REGEX}|${NO_PATH_REGEX}+${PATH_REGEX}|${PATH_REGEX}${NO_PATH_REGEX}+)*?`; } } function splitGlobAware(pattern, splitChar) { if (!pattern) { return []; } const segments = []; let inBraces = false; let inBrackets = false; let curVal = ''; for (const char of pattern) { switch (char) { case splitChar: if (!inBraces && !inBrackets) { segments.push(curVal); curVal = ''; continue; } break; case '{': inBraces = true; break; case '}': inBraces = false; break; case '[': inBrackets = true; break; case ']': inBrackets = false; break; } curVal += char; } // Tail if (curVal) { segments.push(curVal); } return segments; } function parseRegExp(pattern) { if (!pattern) { return ''; } let regEx = ''; // Split up into segments for each slash found const segments = splitGlobAware(pattern, GLOB_SPLIT); // Special case where we only have globstars if (segments.every(s => s === GLOBSTAR)) { regEx = '.*'; } // Build regex over segments else { let previousSegmentWasGlobStar = false; segments.forEach((segment, index) => { // Globstar is special if (segment === GLOBSTAR) { // if we have more than one globstar after another, just ignore it if (!previousSegmentWasGlobStar) { regEx += starsToRegExp(2); previousSegmentWasGlobStar = true; } return; } // States let inBraces = false; let braceVal = ''; let inBrackets = false; let bracketVal = ''; for (const char of segment) { // Support brace expansion if (char !== '}' && inBraces) { braceVal += char; continue; } // Support brackets if (inBrackets && (char !== ']' || !bracketVal) /* ] is literally only allowed as first character in brackets to match it */) { let res; // range operator if (char === '-') { res = char; } // negation operator (only valid on first index in bracket) else if ((char === '^' || char === '!') && !bracketVal) { res = '^'; } // glob split matching is not allowed within character ranges // see http://man7.org/linux/man-pages/man7/glob.7.html else if (char === GLOB_SPLIT) { res = ''; } // anything else gets escaped else { res = _strings_js__WEBPACK_IMPORTED_MODULE_4__/* .escapeRegExpCharacters */ .ec(char); } bracketVal += res; continue; } switch (char) { case '{': inBraces = true; continue; case '[': inBrackets = true; continue; case '}': const choices = splitGlobAware(braceVal, ','); // Converts {foo,bar} => [foo|bar] const braceRegExp = `(?:${choices.map(c => parseRegExp(c)).join('|')})`; regEx += braceRegExp; inBraces = false; braceVal = ''; break; case ']': regEx += ('[' + bracketVal + ']'); inBrackets = false; bracketVal = ''; break; case '?': regEx += NO_PATH_REGEX; // 1 ? matches any single character except path separator (/ and \) continue; case '*': regEx += starsToRegExp(1); continue; default: regEx += _strings_js__WEBPACK_IMPORTED_MODULE_4__/* .escapeRegExpCharacters */ .ec(char); } } // Tail: Add the slash we had split on if there is more to come and the remaining pattern is not a globstar // For example if pattern: some/**/*.js we want the "/" after some to be included in the RegEx to prevent // a folder called "something" to match as well. // However, if pattern: some/**, we tolerate that we also match on "something" because our globstar behaviour // is to match 0-N segments. if (index < segments.length - 1 && (segments[index + 1] !== GLOBSTAR || index + 2 < segments.length)) { regEx += PATH_REGEX; } // reset state previousSegmentWasGlobStar = false; }); } return regEx; } // regexes to check for trivial glob patterns that just check for String#endsWith const T1 = /^\*\*\/\*\.[\w\.-]+$/; // **/*.something const T2 = /^\*\*\/([\w\.-]+)\/?$/; // **/something const T3 = /^{\*\*\/[\*\.]?[\w\.-]+\/?(,\*\*\/[\*\.]?[\w\.-]+\/?)*}$/; // {**/*.something,**/*.else} or {**/package.json,**/project.json} const T3_2 = /^{\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?(,\*\*\/[\*\.]?[\w\.-]+(\/(\*\*)?)?)*}$/; // Like T3, with optional trailing /** const T4 = /^\*\*((\/[\w\.-]+)+)\/?$/; // **/something/else const T5 = /^([\w\.-]+(\/[\w\.-]+)*)\/?$/; // something/else const CACHE = new _map_js__WEBPACK_IMPORTED_MODULE_2__/* .LRUCache */ .z6(10000); // bounded to 10000 elements const FALSE = function () { return false; }; const NULL = function () { return null; }; function parsePattern(arg1, options) { if (!arg1) { return NULL; } // Handle IRelativePattern let pattern; if (typeof arg1 !== 'string') { pattern = arg1.pattern; } else { pattern = arg1; } // Whitespace trimming pattern = pattern.trim(); // Check cache const patternKey = `${pattern}_${!!options.trimForExclusions}`; let parsedPattern = CACHE.get(patternKey); if (parsedPattern) { return wrapRelativePattern(parsedPattern, arg1); } // Check for Trivials let match; if (T1.test(pattern)) { // common pattern: **/*.txt just need endsWith check const base = pattern.substr(4); // '**/*'.length === 4 parsedPattern = function (path, basename) { return typeof path === 'string' && path.endsWith(base) ? pattern : null; }; } else if (match = T2.exec(trimForExclusions(pattern, options))) { // common pattern: **/some.txt just need basename check parsedPattern = trivia2(match[1], pattern); } else if ((options.trimForExclusions ? T3_2 : T3).test(pattern)) { // repetition of common patterns (see above) {**/*.txt,**/*.png} parsedPattern = trivia3(pattern, options); } else if (match = T4.exec(trimForExclusions(pattern, options))) { // common pattern: **/something/else just need endsWith check parsedPattern = trivia4and5(match[1].substr(1), pattern, true); } else if (match = T5.exec(trimForExclusions(pattern, options))) { // common pattern: something/else just need equals check parsedPattern = trivia4and5(match[1], pattern, false); } // Otherwise convert to pattern else { parsedPattern = toRegExp(pattern); } // Cache CACHE.set(patternKey, parsedPattern); return wrapRelativePattern(parsedPattern, arg1); } function wrapRelativePattern(parsedPattern, arg2) { if (typeof arg2 === 'string') { return parsedPattern; } return function (path, basename) { if (!_extpath_js__WEBPACK_IMPORTED_MODULE_1__/* .isEqualOrParent */ .KM(path, arg2.base)) { return null; } return parsedPattern(_path_js__WEBPACK_IMPORTED_MODULE_3__/* .relative */ .Gf(arg2.base, path), basename); }; } function trimForExclusions(pattern, options) { return options.trimForExclusions && pattern.endsWith('/**') ? pattern.substr(0, pattern.length - 2) : pattern; // dropping **, tailing / is dropped later } // common pattern: **/some.txt just need basename check function trivia2(base, originalPattern) { const slashBase = `/${base}`; const backslashBase = `\\${base}`; const parsedPattern = function (path, basename) { if (typeof path !== 'string') { return null; } if (basename) { return basename === base ? originalPattern : null; } return path === base || path.endsWith(slashBase) || path.endsWith(backslashBase) ? originalPattern : null; }; const basenames = [base]; parsedPattern.basenames = basenames; parsedPattern.patterns = [originalPattern]; parsedPattern.allBasenames = basenames; return parsedPattern; } // repetition of common patterns (see above) {**/*.txt,**/*.png} function trivia3(pattern, options) { const parsedPatterns = aggregateBasenameMatches(pattern.slice(1, -1).split(',') .map(pattern => parsePattern(pattern, options)) .filter(pattern => pattern !== NULL), pattern); const n = parsedPatterns.length; if (!n) { return NULL; } if (n === 1) { return parsedPatterns[0]; } const parsedPattern = function (path, basename) { for (let i = 0, n = parsedPatterns.length; i < n; i++) { if (parsedPatterns[i](path, basename)) { return pattern; } } return null; }; const withBasenames = parsedPatterns.find(pattern => !!pattern.allBasenames); if (withBasenames) { parsedPattern.allBasenames = withBasenames.allBasenames; } const allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, []); if (allPaths.length) { parsedPattern.allPaths = allPaths; } return parsedPattern; } // common patterns: **/something/else just need endsWith check, something/else just needs and equals check function trivia4and5(targetPath, pattern, matchPathEnds) { const usingPosixSep = _path_js__WEBPACK_IMPORTED_MODULE_3__/* .sep */ .ir === _path_js__WEBPACK_IMPORTED_MODULE_3__/* .posix */ .KR.sep; const nativePath = usingPosixSep ? targetPath : targetPath.replace(ALL_FORWARD_SLASHES, _path_js__WEBPACK_IMPORTED_MODULE_3__/* .sep */ .ir); const nativePathEnd = _path_js__WEBPACK_IMPORTED_MODULE_3__/* .sep */ .ir + nativePath; const targetPathEnd = _path_js__WEBPACK_IMPORTED_MODULE_3__/* .posix */ .KR.sep + targetPath; const parsedPattern = matchPathEnds ? function (testPath, basename) { return typeof testPath === 'string' && ((testPath === nativePath || testPath.endsWith(nativePathEnd)) || !usingPosixSep && (testPath === targetPath || testPath.endsWith(targetPathEnd))) ? pattern : null; } : function (testPath, basename) { return typeof testPath === 'string' && (testPath === nativePath || (!usingPosixSep && testPath === targetPath)) ? pattern : null; }; parsedPattern.allPaths = [(matchPathEnds ? '*/' : './') + targetPath]; return parsedPattern; } function toRegExp(pattern) { try { const regExp = new RegExp(`^${parseRegExp(pattern)}$`); return function (path) { regExp.lastIndex = 0; // reset RegExp to its initial state to reuse it! return typeof path === 'string' && regExp.test(path) ? pattern : null; }; } catch (error) { return NULL; } } function match(arg1, path, hasSibling) { if (!arg1 || typeof path !== 'string') { return false; } return parse(arg1)(path, undefined, hasSibling); } function parse(arg1, options = {}) { if (!arg1) { return FALSE; } // Glob with String if (typeof arg1 === 'string' || isRelativePattern(arg1)) { const parsedPattern = parsePattern(arg1, options); if (parsedPattern === NULL) { return FALSE; } const resultPattern = function (path, basename) { return !!parsedPattern(path, basename); }; if (parsedPattern.allBasenames) { resultPattern.allBasenames = parsedPattern.allBasenames; } if (parsedPattern.allPaths) { resultPattern.allPaths = parsedPattern.allPaths; } return resultPattern; } // Glob with Expression return parsedExpression(arg1, options); } function isRelativePattern(obj) { const rp = obj; return rp && typeof rp.base === 'string' && typeof rp.pattern === 'string'; } function parsedExpression(expression, options) { const parsedPatterns = aggregateBasenameMatches(Object.getOwnPropertyNames(expression) .map(pattern => parseExpressionPattern(pattern, expression[pattern], options)) .filter(pattern => pattern !== NULL)); const n = parsedPatterns.length; if (!n) { return NULL; } if (!parsedPatterns.some(parsedPattern => !!parsedPattern.requiresSiblings)) { if (n === 1) { return parsedPatterns[0]; } const resultExpression = function (path, basename) { for (let i = 0, n = parsedPatterns.length; i < n; i++) { // Pattern matches path const result = parsedPatterns[i](path, basename); if (result) { return result; } } return null; }; const withBasenames = parsedPatterns.find(pattern => !!pattern.allBasenames); if (withBasenames) { resultExpression.allBasenames = withBasenames.allBasenames; } const allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, []); if (allPaths.length) { resultExpression.allPaths = allPaths; } return resultExpression; } const resultExpression = function (path, basename, hasSibling) { let name = undefined; for (let i = 0, n = parsedPatterns.length; i < n; i++) { // Pattern matches path const parsedPattern = parsedPatterns[i]; if (parsedPattern.requiresSiblings && hasSibling) { if (!basename) { basename = _path_js__WEBPACK_IMPORTED_MODULE_3__/* .basename */ .EZ(path); } if (!name) { name = basename.substr(0, basename.length - _path_js__WEBPACK_IMPORTED_MODULE_3__/* .extname */ .DZ(path).length); } } const result = parsedPattern(path, basename, name, hasSibling); if (result) { return result; } } return null; }; const withBasenames = parsedPatterns.find(pattern => !!pattern.allBasenames); if (withBasenames) { resultExpression.allBasenames = withBasenames.allBasenames; } const allPaths = parsedPatterns.reduce((all, current) => current.allPaths ? all.concat(current.allPaths) : all, []); if (allPaths.length) { resultExpression.allPaths = allPaths; } return resultExpression; } function parseExpressionPattern(pattern, value, options) { if (value === false) { return NULL; // pattern is disabled } const parsedPattern = parsePattern(pattern, options); if (parsedPattern === NULL) { return NULL; } // Expression Pattern is if (typeof value === 'boolean') { return parsedPattern; } // Expression Pattern is if (value) { const when = value.when; if (typeof when === 'string') { const result = (path, basename, name, hasSibling) => { if (!hasSibling || !parsedPattern(path, basename)) { return null; } const clausePattern = when.replace('$(basename)', name); const matched = hasSibling(clausePattern); return (0,_async_js__WEBPACK_IMPORTED_MODULE_0__/* .isThenable */ .J8)(matched) ? matched.then(m => m ? pattern : null) : matched ? pattern : null; }; result.requiresSiblings = true; return result; } } // Expression is Anything return parsedPattern; } function aggregateBasenameMatches(parsedPatterns, result) { const basenamePatterns = parsedPatterns.filter(parsedPattern => !!parsedPattern.basenames); if (basenamePatterns.length < 2) { return parsedPatterns; } const basenames = basenamePatterns.reduce((all, current) => { const basenames = current.basenames; return basenames ? all.concat(basenames) : all; }, []); let patterns; if (result) { patterns = []; for (let i = 0, n = basenames.length; i < n; i++) { patterns.push(result); } } else { patterns = basenamePatterns.reduce((all, current) => { const patterns = current.patterns; return patterns ? all.concat(patterns) : all; }, []); } const aggregate = function (path, basename) { if (typeof path !== 'string') { return null; } if (!basename) { let i; for (i = path.length; i > 0; i--) { const ch = path.charCodeAt(i - 1); if (ch === 47 /* Slash */ || ch === 92 /* Backslash */) { break; } } basename = path.substr(i); } const index = basenames.indexOf(basename); return index !== -1 ? patterns[index] : null; }; aggregate.basenames = basenames; aggregate.patterns = patterns; aggregate.allBasenames = basenames; const aggregatedPatterns = parsedPatterns.filter(parsedPattern => !parsedPattern.basenames); aggregatedPatterns.push(aggregate); return aggregatedPatterns; } /***/ }), /***/ 44619: /*!*************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/hash.js ***! \*************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Cv: function() { return /* binding */ stringHash; }, /* harmony export */ SP: function() { return /* binding */ doHash; }, /* harmony export */ vp: function() { return /* binding */ hash; }, /* harmony export */ yP: function() { return /* binding */ StringSHA1; } /* harmony export */ }); /* unused harmony exports numberHash, toHexString */ /* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./strings.js */ 82983); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** * Return a hash value for an object. */ function hash(obj) { return doHash(obj, 0); } function doHash(obj, hashVal) { switch (typeof obj) { case 'object': if (obj === null) { return numberHash(349, hashVal); } else if (Array.isArray(obj)) { return arrayHash(obj, hashVal); } return objectHash(obj, hashVal); case 'string': return stringHash(obj, hashVal); case 'boolean': return booleanHash(obj, hashVal); case 'number': return numberHash(obj, hashVal); case 'undefined': return numberHash(937, hashVal); default: return numberHash(617, hashVal); } } function numberHash(val, initialHashVal) { return (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32 } function booleanHash(b, initialHashVal) { return numberHash(b ? 433 : 863, initialHashVal); } function stringHash(s, hashVal) { hashVal = numberHash(149417, hashVal); for (let i = 0, length = s.length; i < length; i++) { hashVal = numberHash(s.charCodeAt(i), hashVal); } return hashVal; } function arrayHash(arr, initialHashVal) { initialHashVal = numberHash(104579, initialHashVal); return arr.reduce((hashVal, item) => doHash(item, hashVal), initialHashVal); } function objectHash(obj, initialHashVal) { initialHashVal = numberHash(181387, initialHashVal); return Object.keys(obj).sort().reduce((hashVal, key) => { hashVal = stringHash(key, hashVal); return doHash(obj[key], hashVal); }, initialHashVal); } function leftRotate(value, bits, totalBits = 32) { // delta + bits = totalBits const delta = totalBits - bits; // All ones, expect `delta` zeros aligned to the right const mask = ~((1 << delta) - 1); // Join (value left-shifted `bits` bits) with (masked value right-shifted `delta` bits) return ((value << bits) | ((mask & value) >>> delta)) >>> 0; } function fill(dest, index = 0, count = dest.byteLength, value = 0) { for (let i = 0; i < count; i++) { dest[index + i] = value; } } function leftPad(value, length, char = '0') { while (value.length < length) { value = char + value; } return value; } function toHexString(bufferOrValue, bitsize = 32) { if (bufferOrValue instanceof ArrayBuffer) { return Array.from(new Uint8Array(bufferOrValue)).map(b => b.toString(16).padStart(2, '0')).join(''); } return leftPad((bufferOrValue >>> 0).toString(16), bitsize / 4); } /** * A SHA1 implementation that works with strings and does not allocate. */ class StringSHA1 { constructor() { this._h0 = 0x67452301; this._h1 = 0xEFCDAB89; this._h2 = 0x98BADCFE; this._h3 = 0x10325476; this._h4 = 0xC3D2E1F0; this._buff = new Uint8Array(64 /* BLOCK_SIZE */ + 3 /* to fit any utf-8 */); this._buffDV = new DataView(this._buff.buffer); this._buffLen = 0; this._totalLen = 0; this._leftoverHighSurrogate = 0; this._finished = false; } update(str) { const strLen = str.length; if (strLen === 0) { return; } const buff = this._buff; let buffLen = this._buffLen; let leftoverHighSurrogate = this._leftoverHighSurrogate; let charCode; let offset; if (leftoverHighSurrogate !== 0) { charCode = leftoverHighSurrogate; offset = -1; leftoverHighSurrogate = 0; } else { charCode = str.charCodeAt(0); offset = 0; } while (true) { let codePoint = charCode; if (_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .isHighSurrogate */ .ZG(charCode)) { if (offset + 1 < strLen) { const nextCharCode = str.charCodeAt(offset + 1); if (_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .isLowSurrogate */ .YK(nextCharCode)) { offset++; codePoint = _strings_js__WEBPACK_IMPORTED_MODULE_0__/* .computeCodePoint */ .rL(charCode, nextCharCode); } else { // illegal => unicode replacement character codePoint = 65533 /* UNICODE_REPLACEMENT */; } } else { // last character is a surrogate pair leftoverHighSurrogate = charCode; break; } } else if (_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .isLowSurrogate */ .YK(charCode)) { // illegal => unicode replacement character codePoint = 65533 /* UNICODE_REPLACEMENT */; } buffLen = this._push(buff, buffLen, codePoint); offset++; if (offset < strLen) { charCode = str.charCodeAt(offset); } else { break; } } this._buffLen = buffLen; this._leftoverHighSurrogate = leftoverHighSurrogate; } _push(buff, buffLen, codePoint) { if (codePoint < 0x0080) { buff[buffLen++] = codePoint; } else if (codePoint < 0x0800) { buff[buffLen++] = 0b11000000 | ((codePoint & 0b00000000000000000000011111000000) >>> 6); buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0); } else if (codePoint < 0x10000) { buff[buffLen++] = 0b11100000 | ((codePoint & 0b00000000000000001111000000000000) >>> 12); buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6); buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0); } else { buff[buffLen++] = 0b11110000 | ((codePoint & 0b00000000000111000000000000000000) >>> 18); buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000111111000000000000) >>> 12); buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000111111000000) >>> 6); buff[buffLen++] = 0b10000000 | ((codePoint & 0b00000000000000000000000000111111) >>> 0); } if (buffLen >= 64 /* BLOCK_SIZE */) { this._step(); buffLen -= 64 /* BLOCK_SIZE */; this._totalLen += 64 /* BLOCK_SIZE */; // take last 3 in case of UTF8 overflow buff[0] = buff[64 /* BLOCK_SIZE */ + 0]; buff[1] = buff[64 /* BLOCK_SIZE */ + 1]; buff[2] = buff[64 /* BLOCK_SIZE */ + 2]; } return buffLen; } digest() { if (!this._finished) { this._finished = true; if (this._leftoverHighSurrogate) { // illegal => unicode replacement character this._leftoverHighSurrogate = 0; this._buffLen = this._push(this._buff, this._buffLen, 65533 /* UNICODE_REPLACEMENT */); } this._totalLen += this._buffLen; this._wrapUp(); } return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4); } _wrapUp() { this._buff[this._buffLen++] = 0x80; fill(this._buff, this._buffLen); if (this._buffLen > 56) { this._step(); fill(this._buff); } // this will fit because the mantissa can cover up to 52 bits const ml = 8 * this._totalLen; this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false); this._buffDV.setUint32(60, ml % 4294967296, false); this._step(); } _step() { const bigBlock32 = StringSHA1._bigBlock32; const data = this._buffDV; for (let j = 0; j < 64 /* 16*4 */; j += 4) { bigBlock32.setUint32(j, data.getUint32(j, false), false); } for (let j = 64; j < 320 /* 80*4 */; j += 4) { bigBlock32.setUint32(j, leftRotate((bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false)), 1), false); } let a = this._h0; let b = this._h1; let c = this._h2; let d = this._h3; let e = this._h4; let f, k; let temp; for (let j = 0; j < 80; j++) { if (j < 20) { f = (b & c) | ((~b) & d); k = 0x5A827999; } else if (j < 40) { f = b ^ c ^ d; k = 0x6ED9EBA1; } else if (j < 60) { f = (b & c) | (b & d) | (c & d); k = 0x8F1BBCDC; } else { f = b ^ c ^ d; k = 0xCA62C1D6; } temp = (leftRotate(a, 5) + f + e + k + bigBlock32.getUint32(j * 4, false)) & 0xffffffff; e = d; d = c; c = leftRotate(b, 30); b = a; a = temp; } this._h0 = (this._h0 + a) & 0xffffffff; this._h1 = (this._h1 + b) & 0xffffffff; this._h2 = (this._h2 + c) & 0xffffffff; this._h3 = (this._h3 + d) & 0xffffffff; this._h4 = (this._h4 + e) & 0xffffffff; } } StringSHA1._bigBlock32 = new DataView(new ArrayBuffer(320)); // 80 * 4 = 320 /***/ }), /***/ 94186: /*!********************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/htmlContent.js ***! \********************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CP: function() { return /* binding */ isEmptyMarkdownString; }, /* harmony export */ Fr: function() { return /* binding */ isMarkdownString; }, /* harmony export */ W5: function() { return /* binding */ MarkdownString; }, /* harmony export */ oR: function() { return /* binding */ removeMarkdownEscapes; }, /* harmony export */ v1: function() { return /* binding */ parseHrefAndDimensions; } /* harmony export */ }); /* unused harmony export escapeMarkdownSyntaxTokens */ /* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ 79881); /* harmony import */ var _iconLabels_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iconLabels.js */ 38940); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class MarkdownString { constructor(value = '', isTrustedOrOptions = false) { var _a, _b, _c; this.value = value; if (typeof this.value !== 'string') { throw (0,_errors_js__WEBPACK_IMPORTED_MODULE_0__/* .illegalArgument */ .b1)('value'); } if (typeof isTrustedOrOptions === 'boolean') { this.isTrusted = isTrustedOrOptions; this.supportThemeIcons = false; this.supportHtml = false; } else { this.isTrusted = (_a = isTrustedOrOptions.isTrusted) !== null && _a !== void 0 ? _a : undefined; this.supportThemeIcons = (_b = isTrustedOrOptions.supportThemeIcons) !== null && _b !== void 0 ? _b : false; this.supportHtml = (_c = isTrustedOrOptions.supportHtml) !== null && _c !== void 0 ? _c : false; } } appendText(value, newlineStyle = 0 /* Paragraph */) { this.value += escapeMarkdownSyntaxTokens(this.supportThemeIcons ? (0,_iconLabels_js__WEBPACK_IMPORTED_MODULE_1__/* .escapeIcons */ .Qo)(value) : value) .replace(/([ \t]+)/g, (_match, g1) => ' '.repeat(g1.length)) .replace(/\>/gm, '\\>') .replace(/\n/g, newlineStyle === 1 /* Break */ ? '\\\n' : '\n\n'); return this; } appendMarkdown(value) { this.value += value; return this; } appendCodeblock(langId, code) { this.value += '\n```'; this.value += langId; this.value += '\n'; this.value += code; this.value += '\n```\n'; return this; } } function isEmptyMarkdownString(oneOrMany) { if (isMarkdownString(oneOrMany)) { return !oneOrMany.value; } else if (Array.isArray(oneOrMany)) { return oneOrMany.every(isEmptyMarkdownString); } else { return true; } } function isMarkdownString(thing) { if (thing instanceof MarkdownString) { return true; } else if (thing && typeof thing === 'object') { return typeof thing.value === 'string' && (typeof thing.isTrusted === 'boolean' || thing.isTrusted === undefined) && (typeof thing.supportThemeIcons === 'boolean' || thing.supportThemeIcons === undefined); } return false; } function escapeMarkdownSyntaxTokens(text) { // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash return text.replace(/[\\`*_{}[\]()#+\-!]/g, '\\$&'); } function removeMarkdownEscapes(text) { if (!text) { return text; } return text.replace(/\\([\\`*_{}[\]()#+\-.!])/g, '$1'); } function parseHrefAndDimensions(href) { const dimensions = []; const splitted = href.split('|').map(s => s.trim()); href = splitted[0]; const parameters = splitted[1]; if (parameters) { const heightFromParams = /height=(\d+)/.exec(parameters); const widthFromParams = /width=(\d+)/.exec(parameters); const height = heightFromParams ? heightFromParams[1] : ''; const width = widthFromParams ? widthFromParams[1] : ''; const widthIsFinite = isFinite(parseInt(width)); const heightIsFinite = isFinite(parseInt(height)); if (widthIsFinite) { dimensions.push(`width="${width}"`); } if (heightIsFinite) { dimensions.push(`height="${height}"`); } } return { href, dimensions }; } /***/ }), /***/ 38940: /*!*******************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/iconLabels.js ***! \*******************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Gt: function() { return /* binding */ matchesFuzzyIconAware; }, /* harmony export */ Ho: function() { return /* binding */ parseLabelWithIcons; }, /* harmony export */ Qo: function() { return /* binding */ escapeIcons; }, /* harmony export */ f$: function() { return /* binding */ markdownEscapeEscapedIcons; }, /* harmony export */ x$: function() { return /* binding */ stripIcons; } /* harmony export */ }); /* unused harmony export iconStartMarker */ /* harmony import */ var _codicons_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./codicons.js */ 52615); /* harmony import */ var _filters_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filters.js */ 99599); /* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./strings.js */ 82983); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const iconStartMarker = '$('; const iconsRegex = new RegExp(`\\$\\(${_codicons_js__WEBPACK_IMPORTED_MODULE_0__/* .CSSIcon */ .dT.iconNameExpression}(?:${_codicons_js__WEBPACK_IMPORTED_MODULE_0__/* .CSSIcon */ .dT.iconModifierExpression})?\\)`, 'g'); // no capturing groups const escapeIconsRegex = new RegExp(`(\\\\)?${iconsRegex.source}`, 'g'); function escapeIcons(text) { return text.replace(escapeIconsRegex, (match, escaped) => escaped ? match : `\\${match}`); } const markdownEscapedIconsRegex = new RegExp(`\\\\${iconsRegex.source}`, 'g'); function markdownEscapeEscapedIcons(text) { // Need to add an extra \ for escaping in markdown return text.replace(markdownEscapedIconsRegex, match => `\\${match}`); } const stripIconsRegex = new RegExp(`(\\s)?(\\\\)?${iconsRegex.source}(\\s)?`, 'g'); function stripIcons(text) { if (text.indexOf(iconStartMarker) === -1) { return text; } return text.replace(stripIconsRegex, (match, preWhitespace, escaped, postWhitespace) => escaped ? match : preWhitespace || postWhitespace || ''); } function parseLabelWithIcons(text) { const firstIconIndex = text.indexOf(iconStartMarker); if (firstIconIndex === -1) { return { text }; // return early if the word does not include an icon } return doParseLabelWithIcons(text, firstIconIndex); } function doParseLabelWithIcons(text, firstIconIndex) { const iconOffsets = []; let textWithoutIcons = ''; function appendChars(chars) { if (chars) { textWithoutIcons += chars; for (const _ of chars) { iconOffsets.push(iconsOffset); // make sure to fill in icon offsets } } } let currentIconStart = -1; let currentIconValue = ''; let iconsOffset = 0; let char; let nextChar; let offset = firstIconIndex; const length = text.length; // Append all characters until the first icon appendChars(text.substr(0, firstIconIndex)); // example: $(file-symlink-file) my cool $(other-icon) entry while (offset < length) { char = text[offset]; nextChar = text[offset + 1]; // beginning of icon: some value $( <-- if (char === iconStartMarker[0] && nextChar === iconStartMarker[1]) { currentIconStart = offset; // if we had a previous potential icon value without // the closing ')', it was actually not an icon and // so we have to add it to the actual value appendChars(currentIconValue); currentIconValue = iconStartMarker; offset++; // jump over '(' } // end of icon: some value $(some-icon) <-- else if (char === ')' && currentIconStart !== -1) { const currentIconLength = offset - currentIconStart + 1; // +1 to include the closing ')' iconsOffset += currentIconLength; currentIconStart = -1; currentIconValue = ''; } // within icon else if (currentIconStart !== -1) { // Make sure this is a real icon name if (/^[a-z0-9\-]$/i.test(char)) { currentIconValue += char; } else { // This is not a real icon, treat it as text appendChars(currentIconValue); currentIconStart = -1; currentIconValue = ''; } } // any value outside of icon else { appendChars(char); } offset++; } // if we had a previous potential icon value without // the closing ')', it was actually not an icon and // so we have to add it to the actual value appendChars(currentIconValue); return { text: textWithoutIcons, iconOffsets }; } function matchesFuzzyIconAware(query, target, enableSeparateSubstringMatching = false) { const { text, iconOffsets } = target; // Return early if there are no icon markers in the word to match against if (!iconOffsets || iconOffsets.length === 0) { return (0,_filters_js__WEBPACK_IMPORTED_MODULE_1__/* .matchesFuzzy */ .Oh)(query, text, enableSeparateSubstringMatching); } // Trim the word to match against because it could have leading // whitespace now if the word started with an icon const wordToMatchAgainstWithoutIconsTrimmed = (0,_strings_js__WEBPACK_IMPORTED_MODULE_2__/* .ltrim */ .j3)(text, ' '); const leadingWhitespaceOffset = text.length - wordToMatchAgainstWithoutIconsTrimmed.length; // match on value without icon const matches = (0,_filters_js__WEBPACK_IMPORTED_MODULE_1__/* .matchesFuzzy */ .Oh)(query, wordToMatchAgainstWithoutIconsTrimmed, enableSeparateSubstringMatching); // Map matches back to offsets with icon and trimming if (matches) { for (const match of matches) { const iconOffset = iconOffsets[match.start + leadingWhitespaceOffset] /* icon offsets at index */ + leadingWhitespaceOffset /* overall leading whitespace offset */; match.start += iconOffset; match.end += iconOffset; } } return matches; } /***/ }), /***/ 85035: /*!********************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/idGenerator.js ***! \********************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ R: function() { return /* binding */ IdGenerator; }, /* harmony export */ a: function() { return /* binding */ defaultGenerator; } /* harmony export */ }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class IdGenerator { constructor(prefix) { this._prefix = prefix; this._lastId = 0; } nextId() { return this._prefix + (++this._lastId); } } const defaultGenerator = new IdGenerator('id#'); /***/ }), /***/ 52411: /*!*****************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/keyCodes.js ***! \*****************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ H_: function() { return /* binding */ EVENT_KEY_CODE_MAP; }, /* harmony export */ Vd: function() { return /* binding */ IMMUTABLE_CODE_TO_KEY_CODE; }, /* harmony export */ gx: function() { return /* binding */ KeyChord; }, /* harmony export */ kL: function() { return /* binding */ KeyCodeUtils; } /* harmony export */ }); /* unused harmony exports NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE, IMMUTABLE_KEY_CODE_TO_CODE */ /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class KeyCodeStrMap { constructor() { this._keyCodeToStr = []; this._strToKeyCode = Object.create(null); } define(keyCode, str) { this._keyCodeToStr[keyCode] = str; this._strToKeyCode[str.toLowerCase()] = keyCode; } keyCodeToStr(keyCode) { return this._keyCodeToStr[keyCode]; } strToKeyCode(str) { return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; } } const uiMap = new KeyCodeStrMap(); const userSettingsUSMap = new KeyCodeStrMap(); const userSettingsGeneralMap = new KeyCodeStrMap(); const EVENT_KEY_CODE_MAP = new Array(230); const NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE = {}; const scanCodeIntToStr = []; const scanCodeStrToInt = Object.create(null); const scanCodeLowerCaseStrToInt = Object.create(null); /** * -1 if a ScanCode => KeyCode mapping depends on kb layout. */ const IMMUTABLE_CODE_TO_KEY_CODE = []; /** * -1 if a KeyCode => ScanCode mapping depends on kb layout. */ const IMMUTABLE_KEY_CODE_TO_CODE = []; for (let i = 0; i <= 193 /* MAX_VALUE */; i++) { IMMUTABLE_CODE_TO_KEY_CODE[i] = -1 /* DependsOnKbLayout */; } for (let i = 0; i <= 126 /* MAX_VALUE */; i++) { IMMUTABLE_KEY_CODE_TO_CODE[i] = -1 /* DependsOnKbLayout */; } (function () { // See https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx // See https://github.com/microsoft/node-native-keymap/blob/master/deps/chromium/keyboard_codes_win.h const empty = ''; const mappings = [ // keyCodeOrd, immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel [0, 1, 0 /* None */, 'None', 0 /* Unknown */, 'unknown', 0, 'VK_UNKNOWN', empty, empty], [0, 1, 1 /* Hyper */, 'Hyper', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 2 /* Super */, 'Super', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 3 /* Fn */, 'Fn', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 4 /* FnLock */, 'FnLock', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 5 /* Suspend */, 'Suspend', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 6 /* Resume */, 'Resume', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 7 /* Turbo */, 'Turbo', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 8 /* Sleep */, 'Sleep', 0 /* Unknown */, empty, 0, 'VK_SLEEP', empty, empty], [0, 1, 9 /* WakeUp */, 'WakeUp', 0 /* Unknown */, empty, 0, empty, empty, empty], [31, 0, 10 /* KeyA */, 'KeyA', 31 /* KeyA */, 'A', 65, 'VK_A', empty, empty], [32, 0, 11 /* KeyB */, 'KeyB', 32 /* KeyB */, 'B', 66, 'VK_B', empty, empty], [33, 0, 12 /* KeyC */, 'KeyC', 33 /* KeyC */, 'C', 67, 'VK_C', empty, empty], [34, 0, 13 /* KeyD */, 'KeyD', 34 /* KeyD */, 'D', 68, 'VK_D', empty, empty], [35, 0, 14 /* KeyE */, 'KeyE', 35 /* KeyE */, 'E', 69, 'VK_E', empty, empty], [36, 0, 15 /* KeyF */, 'KeyF', 36 /* KeyF */, 'F', 70, 'VK_F', empty, empty], [37, 0, 16 /* KeyG */, 'KeyG', 37 /* KeyG */, 'G', 71, 'VK_G', empty, empty], [38, 0, 17 /* KeyH */, 'KeyH', 38 /* KeyH */, 'H', 72, 'VK_H', empty, empty], [39, 0, 18 /* KeyI */, 'KeyI', 39 /* KeyI */, 'I', 73, 'VK_I', empty, empty], [40, 0, 19 /* KeyJ */, 'KeyJ', 40 /* KeyJ */, 'J', 74, 'VK_J', empty, empty], [41, 0, 20 /* KeyK */, 'KeyK', 41 /* KeyK */, 'K', 75, 'VK_K', empty, empty], [42, 0, 21 /* KeyL */, 'KeyL', 42 /* KeyL */, 'L', 76, 'VK_L', empty, empty], [43, 0, 22 /* KeyM */, 'KeyM', 43 /* KeyM */, 'M', 77, 'VK_M', empty, empty], [44, 0, 23 /* KeyN */, 'KeyN', 44 /* KeyN */, 'N', 78, 'VK_N', empty, empty], [45, 0, 24 /* KeyO */, 'KeyO', 45 /* KeyO */, 'O', 79, 'VK_O', empty, empty], [46, 0, 25 /* KeyP */, 'KeyP', 46 /* KeyP */, 'P', 80, 'VK_P', empty, empty], [47, 0, 26 /* KeyQ */, 'KeyQ', 47 /* KeyQ */, 'Q', 81, 'VK_Q', empty, empty], [48, 0, 27 /* KeyR */, 'KeyR', 48 /* KeyR */, 'R', 82, 'VK_R', empty, empty], [49, 0, 28 /* KeyS */, 'KeyS', 49 /* KeyS */, 'S', 83, 'VK_S', empty, empty], [50, 0, 29 /* KeyT */, 'KeyT', 50 /* KeyT */, 'T', 84, 'VK_T', empty, empty], [51, 0, 30 /* KeyU */, 'KeyU', 51 /* KeyU */, 'U', 85, 'VK_U', empty, empty], [52, 0, 31 /* KeyV */, 'KeyV', 52 /* KeyV */, 'V', 86, 'VK_V', empty, empty], [53, 0, 32 /* KeyW */, 'KeyW', 53 /* KeyW */, 'W', 87, 'VK_W', empty, empty], [54, 0, 33 /* KeyX */, 'KeyX', 54 /* KeyX */, 'X', 88, 'VK_X', empty, empty], [55, 0, 34 /* KeyY */, 'KeyY', 55 /* KeyY */, 'Y', 89, 'VK_Y', empty, empty], [56, 0, 35 /* KeyZ */, 'KeyZ', 56 /* KeyZ */, 'Z', 90, 'VK_Z', empty, empty], [22, 0, 36 /* Digit1 */, 'Digit1', 22 /* Digit1 */, '1', 49, 'VK_1', empty, empty], [23, 0, 37 /* Digit2 */, 'Digit2', 23 /* Digit2 */, '2', 50, 'VK_2', empty, empty], [24, 0, 38 /* Digit3 */, 'Digit3', 24 /* Digit3 */, '3', 51, 'VK_3', empty, empty], [25, 0, 39 /* Digit4 */, 'Digit4', 25 /* Digit4 */, '4', 52, 'VK_4', empty, empty], [26, 0, 40 /* Digit5 */, 'Digit5', 26 /* Digit5 */, '5', 53, 'VK_5', empty, empty], [27, 0, 41 /* Digit6 */, 'Digit6', 27 /* Digit6 */, '6', 54, 'VK_6', empty, empty], [28, 0, 42 /* Digit7 */, 'Digit7', 28 /* Digit7 */, '7', 55, 'VK_7', empty, empty], [29, 0, 43 /* Digit8 */, 'Digit8', 29 /* Digit8 */, '8', 56, 'VK_8', empty, empty], [30, 0, 44 /* Digit9 */, 'Digit9', 30 /* Digit9 */, '9', 57, 'VK_9', empty, empty], [21, 0, 45 /* Digit0 */, 'Digit0', 21 /* Digit0 */, '0', 48, 'VK_0', empty, empty], [3, 1, 46 /* Enter */, 'Enter', 3 /* Enter */, 'Enter', 13, 'VK_RETURN', empty, empty], [9, 1, 47 /* Escape */, 'Escape', 9 /* Escape */, 'Escape', 27, 'VK_ESCAPE', empty, empty], [1, 1, 48 /* Backspace */, 'Backspace', 1 /* Backspace */, 'Backspace', 8, 'VK_BACK', empty, empty], [2, 1, 49 /* Tab */, 'Tab', 2 /* Tab */, 'Tab', 9, 'VK_TAB', empty, empty], [10, 1, 50 /* Space */, 'Space', 10 /* Space */, 'Space', 32, 'VK_SPACE', empty, empty], [83, 0, 51 /* Minus */, 'Minus', 83 /* Minus */, '-', 189, 'VK_OEM_MINUS', '-', 'OEM_MINUS'], [81, 0, 52 /* Equal */, 'Equal', 81 /* Equal */, '=', 187, 'VK_OEM_PLUS', '=', 'OEM_PLUS'], [87, 0, 53 /* BracketLeft */, 'BracketLeft', 87 /* BracketLeft */, '[', 219, 'VK_OEM_4', '[', 'OEM_4'], [89, 0, 54 /* BracketRight */, 'BracketRight', 89 /* BracketRight */, ']', 221, 'VK_OEM_6', ']', 'OEM_6'], [88, 0, 55 /* Backslash */, 'Backslash', 88 /* Backslash */, '\\', 220, 'VK_OEM_5', '\\', 'OEM_5'], [0, 0, 56 /* IntlHash */, 'IntlHash', 0 /* Unknown */, empty, 0, empty, empty, empty], [80, 0, 57 /* Semicolon */, 'Semicolon', 80 /* Semicolon */, ';', 186, 'VK_OEM_1', ';', 'OEM_1'], [90, 0, 58 /* Quote */, 'Quote', 90 /* Quote */, '\'', 222, 'VK_OEM_7', '\'', 'OEM_7'], [86, 0, 59 /* Backquote */, 'Backquote', 86 /* Backquote */, '`', 192, 'VK_OEM_3', '`', 'OEM_3'], [82, 0, 60 /* Comma */, 'Comma', 82 /* Comma */, ',', 188, 'VK_OEM_COMMA', ',', 'OEM_COMMA'], [84, 0, 61 /* Period */, 'Period', 84 /* Period */, '.', 190, 'VK_OEM_PERIOD', '.', 'OEM_PERIOD'], [85, 0, 62 /* Slash */, 'Slash', 85 /* Slash */, '/', 191, 'VK_OEM_2', '/', 'OEM_2'], [8, 1, 63 /* CapsLock */, 'CapsLock', 8 /* CapsLock */, 'CapsLock', 20, 'VK_CAPITAL', empty, empty], [59, 1, 64 /* F1 */, 'F1', 59 /* F1 */, 'F1', 112, 'VK_F1', empty, empty], [60, 1, 65 /* F2 */, 'F2', 60 /* F2 */, 'F2', 113, 'VK_F2', empty, empty], [61, 1, 66 /* F3 */, 'F3', 61 /* F3 */, 'F3', 114, 'VK_F3', empty, empty], [62, 1, 67 /* F4 */, 'F4', 62 /* F4 */, 'F4', 115, 'VK_F4', empty, empty], [63, 1, 68 /* F5 */, 'F5', 63 /* F5 */, 'F5', 116, 'VK_F5', empty, empty], [64, 1, 69 /* F6 */, 'F6', 64 /* F6 */, 'F6', 117, 'VK_F6', empty, empty], [65, 1, 70 /* F7 */, 'F7', 65 /* F7 */, 'F7', 118, 'VK_F7', empty, empty], [66, 1, 71 /* F8 */, 'F8', 66 /* F8 */, 'F8', 119, 'VK_F8', empty, empty], [67, 1, 72 /* F9 */, 'F9', 67 /* F9 */, 'F9', 120, 'VK_F9', empty, empty], [68, 1, 73 /* F10 */, 'F10', 68 /* F10 */, 'F10', 121, 'VK_F10', empty, empty], [69, 1, 74 /* F11 */, 'F11', 69 /* F11 */, 'F11', 122, 'VK_F11', empty, empty], [70, 1, 75 /* F12 */, 'F12', 70 /* F12 */, 'F12', 123, 'VK_F12', empty, empty], [0, 1, 76 /* PrintScreen */, 'PrintScreen', 0 /* Unknown */, empty, 0, empty, empty, empty], [79, 1, 77 /* ScrollLock */, 'ScrollLock', 79 /* ScrollLock */, 'ScrollLock', 145, 'VK_SCROLL', empty, empty], [7, 1, 78 /* Pause */, 'Pause', 7 /* PauseBreak */, 'PauseBreak', 19, 'VK_PAUSE', empty, empty], [19, 1, 79 /* Insert */, 'Insert', 19 /* Insert */, 'Insert', 45, 'VK_INSERT', empty, empty], [14, 1, 80 /* Home */, 'Home', 14 /* Home */, 'Home', 36, 'VK_HOME', empty, empty], [11, 1, 81 /* PageUp */, 'PageUp', 11 /* PageUp */, 'PageUp', 33, 'VK_PRIOR', empty, empty], [20, 1, 82 /* Delete */, 'Delete', 20 /* Delete */, 'Delete', 46, 'VK_DELETE', empty, empty], [13, 1, 83 /* End */, 'End', 13 /* End */, 'End', 35, 'VK_END', empty, empty], [12, 1, 84 /* PageDown */, 'PageDown', 12 /* PageDown */, 'PageDown', 34, 'VK_NEXT', empty, empty], [17, 1, 85 /* ArrowRight */, 'ArrowRight', 17 /* RightArrow */, 'RightArrow', 39, 'VK_RIGHT', 'Right', empty], [15, 1, 86 /* ArrowLeft */, 'ArrowLeft', 15 /* LeftArrow */, 'LeftArrow', 37, 'VK_LEFT', 'Left', empty], [18, 1, 87 /* ArrowDown */, 'ArrowDown', 18 /* DownArrow */, 'DownArrow', 40, 'VK_DOWN', 'Down', empty], [16, 1, 88 /* ArrowUp */, 'ArrowUp', 16 /* UpArrow */, 'UpArrow', 38, 'VK_UP', 'Up', empty], [78, 1, 89 /* NumLock */, 'NumLock', 78 /* NumLock */, 'NumLock', 144, 'VK_NUMLOCK', empty, empty], [108, 1, 90 /* NumpadDivide */, 'NumpadDivide', 108 /* NumpadDivide */, 'NumPad_Divide', 111, 'VK_DIVIDE', empty, empty], [103, 1, 91 /* NumpadMultiply */, 'NumpadMultiply', 103 /* NumpadMultiply */, 'NumPad_Multiply', 106, 'VK_MULTIPLY', empty, empty], [106, 1, 92 /* NumpadSubtract */, 'NumpadSubtract', 106 /* NumpadSubtract */, 'NumPad_Subtract', 109, 'VK_SUBTRACT', empty, empty], [104, 1, 93 /* NumpadAdd */, 'NumpadAdd', 104 /* NumpadAdd */, 'NumPad_Add', 107, 'VK_ADD', empty, empty], [3, 1, 94 /* NumpadEnter */, 'NumpadEnter', 3 /* Enter */, empty, 0, empty, empty, empty], [94, 1, 95 /* Numpad1 */, 'Numpad1', 94 /* Numpad1 */, 'NumPad1', 97, 'VK_NUMPAD1', empty, empty], [95, 1, 96 /* Numpad2 */, 'Numpad2', 95 /* Numpad2 */, 'NumPad2', 98, 'VK_NUMPAD2', empty, empty], [96, 1, 97 /* Numpad3 */, 'Numpad3', 96 /* Numpad3 */, 'NumPad3', 99, 'VK_NUMPAD3', empty, empty], [97, 1, 98 /* Numpad4 */, 'Numpad4', 97 /* Numpad4 */, 'NumPad4', 100, 'VK_NUMPAD4', empty, empty], [98, 1, 99 /* Numpad5 */, 'Numpad5', 98 /* Numpad5 */, 'NumPad5', 101, 'VK_NUMPAD5', empty, empty], [99, 1, 100 /* Numpad6 */, 'Numpad6', 99 /* Numpad6 */, 'NumPad6', 102, 'VK_NUMPAD6', empty, empty], [100, 1, 101 /* Numpad7 */, 'Numpad7', 100 /* Numpad7 */, 'NumPad7', 103, 'VK_NUMPAD7', empty, empty], [101, 1, 102 /* Numpad8 */, 'Numpad8', 101 /* Numpad8 */, 'NumPad8', 104, 'VK_NUMPAD8', empty, empty], [102, 1, 103 /* Numpad9 */, 'Numpad9', 102 /* Numpad9 */, 'NumPad9', 105, 'VK_NUMPAD9', empty, empty], [93, 1, 104 /* Numpad0 */, 'Numpad0', 93 /* Numpad0 */, 'NumPad0', 96, 'VK_NUMPAD0', empty, empty], [107, 1, 105 /* NumpadDecimal */, 'NumpadDecimal', 107 /* NumpadDecimal */, 'NumPad_Decimal', 110, 'VK_DECIMAL', empty, empty], [92, 0, 106 /* IntlBackslash */, 'IntlBackslash', 92 /* IntlBackslash */, 'OEM_102', 226, 'VK_OEM_102', empty, empty], [58, 1, 107 /* ContextMenu */, 'ContextMenu', 58 /* ContextMenu */, 'ContextMenu', 93, empty, empty, empty], [0, 1, 108 /* Power */, 'Power', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 109 /* NumpadEqual */, 'NumpadEqual', 0 /* Unknown */, empty, 0, empty, empty, empty], [71, 1, 110 /* F13 */, 'F13', 71 /* F13 */, 'F13', 124, 'VK_F13', empty, empty], [72, 1, 111 /* F14 */, 'F14', 72 /* F14 */, 'F14', 125, 'VK_F14', empty, empty], [73, 1, 112 /* F15 */, 'F15', 73 /* F15 */, 'F15', 126, 'VK_F15', empty, empty], [74, 1, 113 /* F16 */, 'F16', 74 /* F16 */, 'F16', 127, 'VK_F16', empty, empty], [75, 1, 114 /* F17 */, 'F17', 75 /* F17 */, 'F17', 128, 'VK_F17', empty, empty], [76, 1, 115 /* F18 */, 'F18', 76 /* F18 */, 'F18', 129, 'VK_F18', empty, empty], [77, 1, 116 /* F19 */, 'F19', 77 /* F19 */, 'F19', 130, 'VK_F19', empty, empty], [0, 1, 117 /* F20 */, 'F20', 0 /* Unknown */, empty, 0, 'VK_F20', empty, empty], [0, 1, 118 /* F21 */, 'F21', 0 /* Unknown */, empty, 0, 'VK_F21', empty, empty], [0, 1, 119 /* F22 */, 'F22', 0 /* Unknown */, empty, 0, 'VK_F22', empty, empty], [0, 1, 120 /* F23 */, 'F23', 0 /* Unknown */, empty, 0, 'VK_F23', empty, empty], [0, 1, 121 /* F24 */, 'F24', 0 /* Unknown */, empty, 0, 'VK_F24', empty, empty], [0, 1, 122 /* Open */, 'Open', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 123 /* Help */, 'Help', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 124 /* Select */, 'Select', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 125 /* Again */, 'Again', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 126 /* Undo */, 'Undo', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 127 /* Cut */, 'Cut', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 128 /* Copy */, 'Copy', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 129 /* Paste */, 'Paste', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 130 /* Find */, 'Find', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 131 /* AudioVolumeMute */, 'AudioVolumeMute', 112 /* AudioVolumeMute */, 'AudioVolumeMute', 173, 'VK_VOLUME_MUTE', empty, empty], [0, 1, 132 /* AudioVolumeUp */, 'AudioVolumeUp', 113 /* AudioVolumeUp */, 'AudioVolumeUp', 175, 'VK_VOLUME_UP', empty, empty], [0, 1, 133 /* AudioVolumeDown */, 'AudioVolumeDown', 114 /* AudioVolumeDown */, 'AudioVolumeDown', 174, 'VK_VOLUME_DOWN', empty, empty], [105, 1, 134 /* NumpadComma */, 'NumpadComma', 105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator', 108, 'VK_SEPARATOR', empty, empty], [110, 0, 135 /* IntlRo */, 'IntlRo', 110 /* ABNT_C1 */, 'ABNT_C1', 193, 'VK_ABNT_C1', empty, empty], [0, 1, 136 /* KanaMode */, 'KanaMode', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 0, 137 /* IntlYen */, 'IntlYen', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 138 /* Convert */, 'Convert', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 139 /* NonConvert */, 'NonConvert', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 140 /* Lang1 */, 'Lang1', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 141 /* Lang2 */, 'Lang2', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 142 /* Lang3 */, 'Lang3', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 143 /* Lang4 */, 'Lang4', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 144 /* Lang5 */, 'Lang5', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 145 /* Abort */, 'Abort', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 146 /* Props */, 'Props', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 147 /* NumpadParenLeft */, 'NumpadParenLeft', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 148 /* NumpadParenRight */, 'NumpadParenRight', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 149 /* NumpadBackspace */, 'NumpadBackspace', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 150 /* NumpadMemoryStore */, 'NumpadMemoryStore', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 151 /* NumpadMemoryRecall */, 'NumpadMemoryRecall', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 152 /* NumpadMemoryClear */, 'NumpadMemoryClear', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 153 /* NumpadMemoryAdd */, 'NumpadMemoryAdd', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 154 /* NumpadMemorySubtract */, 'NumpadMemorySubtract', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 155 /* NumpadClear */, 'NumpadClear', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 156 /* NumpadClearEntry */, 'NumpadClearEntry', 0 /* Unknown */, empty, 0, empty, empty, empty], [5, 1, 0 /* None */, empty, 5 /* Ctrl */, 'Ctrl', 17, 'VK_CONTROL', empty, empty], [4, 1, 0 /* None */, empty, 4 /* Shift */, 'Shift', 16, 'VK_SHIFT', empty, empty], [6, 1, 0 /* None */, empty, 6 /* Alt */, 'Alt', 18, 'VK_MENU', empty, empty], [57, 1, 0 /* None */, empty, 57 /* Meta */, 'Meta', 0, 'VK_COMMAND', empty, empty], [5, 1, 157 /* ControlLeft */, 'ControlLeft', 5 /* Ctrl */, empty, 0, 'VK_LCONTROL', empty, empty], [4, 1, 158 /* ShiftLeft */, 'ShiftLeft', 4 /* Shift */, empty, 0, 'VK_LSHIFT', empty, empty], [6, 1, 159 /* AltLeft */, 'AltLeft', 6 /* Alt */, empty, 0, 'VK_LMENU', empty, empty], [57, 1, 160 /* MetaLeft */, 'MetaLeft', 57 /* Meta */, empty, 0, 'VK_LWIN', empty, empty], [5, 1, 161 /* ControlRight */, 'ControlRight', 5 /* Ctrl */, empty, 0, 'VK_RCONTROL', empty, empty], [4, 1, 162 /* ShiftRight */, 'ShiftRight', 4 /* Shift */, empty, 0, 'VK_RSHIFT', empty, empty], [6, 1, 163 /* AltRight */, 'AltRight', 6 /* Alt */, empty, 0, 'VK_RMENU', empty, empty], [57, 1, 164 /* MetaRight */, 'MetaRight', 57 /* Meta */, empty, 0, 'VK_RWIN', empty, empty], [0, 1, 165 /* BrightnessUp */, 'BrightnessUp', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 166 /* BrightnessDown */, 'BrightnessDown', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 167 /* MediaPlay */, 'MediaPlay', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 168 /* MediaRecord */, 'MediaRecord', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 169 /* MediaFastForward */, 'MediaFastForward', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 170 /* MediaRewind */, 'MediaRewind', 0 /* Unknown */, empty, 0, empty, empty, empty], [114, 1, 171 /* MediaTrackNext */, 'MediaTrackNext', 119 /* MediaTrackNext */, 'MediaTrackNext', 176, 'VK_MEDIA_NEXT_TRACK', empty, empty], [115, 1, 172 /* MediaTrackPrevious */, 'MediaTrackPrevious', 120 /* MediaTrackPrevious */, 'MediaTrackPrevious', 177, 'VK_MEDIA_PREV_TRACK', empty, empty], [116, 1, 173 /* MediaStop */, 'MediaStop', 121 /* MediaStop */, 'MediaStop', 178, 'VK_MEDIA_STOP', empty, empty], [0, 1, 174 /* Eject */, 'Eject', 0 /* Unknown */, empty, 0, empty, empty, empty], [117, 1, 175 /* MediaPlayPause */, 'MediaPlayPause', 122 /* MediaPlayPause */, 'MediaPlayPause', 179, 'VK_MEDIA_PLAY_PAUSE', empty, empty], [0, 1, 176 /* MediaSelect */, 'MediaSelect', 123 /* LaunchMediaPlayer */, 'LaunchMediaPlayer', 181, 'VK_MEDIA_LAUNCH_MEDIA_SELECT', empty, empty], [0, 1, 177 /* LaunchMail */, 'LaunchMail', 124 /* LaunchMail */, 'LaunchMail', 180, 'VK_MEDIA_LAUNCH_MAIL', empty, empty], [0, 1, 178 /* LaunchApp2 */, 'LaunchApp2', 125 /* LaunchApp2 */, 'LaunchApp2', 183, 'VK_MEDIA_LAUNCH_APP2', empty, empty], [0, 1, 179 /* LaunchApp1 */, 'LaunchApp1', 0 /* Unknown */, empty, 0, 'VK_MEDIA_LAUNCH_APP1', empty, empty], [0, 1, 180 /* SelectTask */, 'SelectTask', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 181 /* LaunchScreenSaver */, 'LaunchScreenSaver', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 182 /* BrowserSearch */, 'BrowserSearch', 115 /* BrowserSearch */, 'BrowserSearch', 170, 'VK_BROWSER_SEARCH', empty, empty], [0, 1, 183 /* BrowserHome */, 'BrowserHome', 116 /* BrowserHome */, 'BrowserHome', 172, 'VK_BROWSER_HOME', empty, empty], [112, 1, 184 /* BrowserBack */, 'BrowserBack', 117 /* BrowserBack */, 'BrowserBack', 166, 'VK_BROWSER_BACK', empty, empty], [113, 1, 185 /* BrowserForward */, 'BrowserForward', 118 /* BrowserForward */, 'BrowserForward', 167, 'VK_BROWSER_FORWARD', empty, empty], [0, 1, 186 /* BrowserStop */, 'BrowserStop', 0 /* Unknown */, empty, 0, 'VK_BROWSER_STOP', empty, empty], [0, 1, 187 /* BrowserRefresh */, 'BrowserRefresh', 0 /* Unknown */, empty, 0, 'VK_BROWSER_REFRESH', empty, empty], [0, 1, 188 /* BrowserFavorites */, 'BrowserFavorites', 0 /* Unknown */, empty, 0, 'VK_BROWSER_FAVORITES', empty, empty], [0, 1, 189 /* ZoomToggle */, 'ZoomToggle', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 190 /* MailReply */, 'MailReply', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 191 /* MailForward */, 'MailForward', 0 /* Unknown */, empty, 0, empty, empty, empty], [0, 1, 192 /* MailSend */, 'MailSend', 0 /* Unknown */, empty, 0, empty, empty, empty], // See https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html // If an Input Method Editor is processing key input and the event is keydown, return 229. [109, 1, 0 /* None */, empty, 109 /* KEY_IN_COMPOSITION */, 'KeyInComposition', 229, empty, empty, empty], [111, 1, 0 /* None */, empty, 111 /* ABNT_C2 */, 'ABNT_C2', 194, 'VK_ABNT_C2', empty, empty], [91, 1, 0 /* None */, empty, 91 /* OEM_8 */, 'OEM_8', 223, 'VK_OEM_8', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_CLEAR', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_KANA', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_HANGUL', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_JUNJA', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_FINAL', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_HANJA', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_KANJI', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_CONVERT', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_NONCONVERT', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_ACCEPT', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_MODECHANGE', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_SELECT', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_PRINT', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_EXECUTE', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_SNAPSHOT', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_HELP', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_APPS', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_PROCESSKEY', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_PACKET', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_DBE_SBCSCHAR', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_DBE_DBCSCHAR', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_ATTN', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_CRSEL', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_EXSEL', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_EREOF', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_PLAY', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_ZOOM', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_NONAME', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_PA1', empty, empty], [0, 1, 0 /* None */, empty, 0 /* Unknown */, empty, 0, 'VK_OEM_CLEAR', empty, empty], ]; let seenKeyCode = []; let seenScanCode = []; for (const mapping of mappings) { const [_keyCodeOrd, immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel] = mapping; if (!seenScanCode[scanCode]) { seenScanCode[scanCode] = true; scanCodeIntToStr[scanCode] = scanCodeStr; scanCodeStrToInt[scanCodeStr] = scanCode; scanCodeLowerCaseStrToInt[scanCodeStr.toLowerCase()] = scanCode; if (immutable) { IMMUTABLE_CODE_TO_KEY_CODE[scanCode] = keyCode; if ((keyCode !== 0 /* Unknown */) && (keyCode !== 3 /* Enter */) && (keyCode !== 5 /* Ctrl */) && (keyCode !== 4 /* Shift */) && (keyCode !== 6 /* Alt */) && (keyCode !== 57 /* Meta */)) { IMMUTABLE_KEY_CODE_TO_CODE[keyCode] = scanCode; } } } if (!seenKeyCode[keyCode]) { seenKeyCode[keyCode] = true; if (!keyCodeStr) { throw new Error(`String representation missing for key code ${keyCode} around scan code ${scanCodeStr}`); } uiMap.define(keyCode, keyCodeStr); userSettingsUSMap.define(keyCode, usUserSettingsLabel || keyCodeStr); userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel || usUserSettingsLabel || keyCodeStr); } if (eventKeyCode) { EVENT_KEY_CODE_MAP[eventKeyCode] = keyCode; } if (vkey) { NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE[vkey] = keyCode; } } // Manually added due to the exclusion above (due to duplication with NumpadEnter) IMMUTABLE_KEY_CODE_TO_CODE[3 /* Enter */] = 46 /* Enter */; })(); var KeyCodeUtils; (function (KeyCodeUtils) { function toString(keyCode) { return uiMap.keyCodeToStr(keyCode); } KeyCodeUtils.toString = toString; function fromString(key) { return uiMap.strToKeyCode(key); } KeyCodeUtils.fromString = fromString; function toUserSettingsUS(keyCode) { return userSettingsUSMap.keyCodeToStr(keyCode); } KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; function toUserSettingsGeneral(keyCode) { return userSettingsGeneralMap.keyCodeToStr(keyCode); } KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; function fromUserSettings(key) { return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); } KeyCodeUtils.fromUserSettings = fromUserSettings; function toElectronAccelerator(keyCode) { if (keyCode >= 93 /* Numpad0 */ && keyCode <= 108 /* NumpadDivide */) { // [Electron Accelerators] Electron is able to parse numpad keys, but unfortunately it // renders them just as regular keys in menus. For example, num0 is rendered as "0", // numdiv is rendered as "/", numsub is rendered as "-". // // This can lead to incredible confusion, as it makes numpad based keybindings indistinguishable // from keybindings based on regular keys. // // We therefore need to fall back to custom rendering for numpad keys. return null; } switch (keyCode) { case 16 /* UpArrow */: return 'Up'; case 18 /* DownArrow */: return 'Down'; case 15 /* LeftArrow */: return 'Left'; case 17 /* RightArrow */: return 'Right'; } return uiMap.keyCodeToStr(keyCode); } KeyCodeUtils.toElectronAccelerator = toElectronAccelerator; })(KeyCodeUtils || (KeyCodeUtils = {})); function KeyChord(firstPart, secondPart) { const chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; return (firstPart | chordPart) >>> 0; } /***/ }), /***/ 66872: /*!*************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/keybindingLabels.js ***! \*************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ X4: function() { return /* binding */ AriaLabelProvider; }, /* harmony export */ jC: function() { return /* binding */ ElectronAcceleratorLabelProvider; }, /* harmony export */ xo: function() { return /* binding */ UILabelProvider; } /* harmony export */ }); /* unused harmony export ModifierLabelProvider */ /* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../nls.js */ 13268); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class ModifierLabelProvider { constructor(mac, windows, linux = windows) { this.modifierLabels = [null]; // index 0 will never me accessed. this.modifierLabels[2 /* Macintosh */] = mac; this.modifierLabels[1 /* Windows */] = windows; this.modifierLabels[3 /* Linux */] = linux; } toLabel(OS, parts, keyLabelProvider) { if (parts.length === 0) { return null; } const result = []; for (let i = 0, len = parts.length; i < len; i++) { const part = parts[i]; const keyLabel = keyLabelProvider(part); if (keyLabel === null) { // this keybinding cannot be expressed... return null; } result[i] = _simpleAsString(part, keyLabel, this.modifierLabels[OS]); } return result.join(' '); } } /** * A label provider that prints modifiers in a suitable format for displaying in the UI. */ const UILabelProvider = new ModifierLabelProvider({ ctrlKey: '⌃', shiftKey: '⇧', altKey: '⌥', metaKey: '⌘', separator: '', }, { ctrlKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'ctrlKey', comment: ['This is the short form for the Control key on the keyboard'] }, "Ctrl"), shiftKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'shiftKey', comment: ['This is the short form for the Shift key on the keyboard'] }, "Shift"), altKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'altKey', comment: ['This is the short form for the Alt key on the keyboard'] }, "Alt"), metaKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'windowsKey', comment: ['This is the short form for the Windows key on the keyboard'] }, "Windows"), separator: '+', }, { ctrlKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'ctrlKey', comment: ['This is the short form for the Control key on the keyboard'] }, "Ctrl"), shiftKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'shiftKey', comment: ['This is the short form for the Shift key on the keyboard'] }, "Shift"), altKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'altKey', comment: ['This is the short form for the Alt key on the keyboard'] }, "Alt"), metaKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'superKey', comment: ['This is the short form for the Super key on the keyboard'] }, "Super"), separator: '+', }); /** * A label provider that prints modifiers in a suitable format for ARIA. */ const AriaLabelProvider = new ModifierLabelProvider({ ctrlKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'ctrlKey.long', comment: ['This is the long form for the Control key on the keyboard'] }, "Control"), shiftKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'shiftKey.long', comment: ['This is the long form for the Shift key on the keyboard'] }, "Shift"), altKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'altKey.long', comment: ['This is the long form for the Alt key on the keyboard'] }, "Alt"), metaKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'cmdKey.long', comment: ['This is the long form for the Command key on the keyboard'] }, "Command"), separator: '+', }, { ctrlKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'ctrlKey.long', comment: ['This is the long form for the Control key on the keyboard'] }, "Control"), shiftKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'shiftKey.long', comment: ['This is the long form for the Shift key on the keyboard'] }, "Shift"), altKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'altKey.long', comment: ['This is the long form for the Alt key on the keyboard'] }, "Alt"), metaKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'windowsKey.long', comment: ['This is the long form for the Windows key on the keyboard'] }, "Windows"), separator: '+', }, { ctrlKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'ctrlKey.long', comment: ['This is the long form for the Control key on the keyboard'] }, "Control"), shiftKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'shiftKey.long', comment: ['This is the long form for the Shift key on the keyboard'] }, "Shift"), altKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'altKey.long', comment: ['This is the long form for the Alt key on the keyboard'] }, "Alt"), metaKey: _nls_js__WEBPACK_IMPORTED_MODULE_0__/* .localize */ .N({ key: 'superKey.long', comment: ['This is the long form for the Super key on the keyboard'] }, "Super"), separator: '+', }); /** * A label provider that prints modifiers in a suitable format for Electron Accelerators. * See https://github.com/electron/electron/blob/master/docs/api/accelerator.md */ const ElectronAcceleratorLabelProvider = new ModifierLabelProvider({ ctrlKey: 'Ctrl', shiftKey: 'Shift', altKey: 'Alt', metaKey: 'Cmd', separator: '+', }, { ctrlKey: 'Ctrl', shiftKey: 'Shift', altKey: 'Alt', metaKey: 'Super', separator: '+', }); function _simpleAsString(modifiers, key, labels) { if (key === null) { return ''; } const result = []; // translate modifier keys: Ctrl-Shift-Alt-Meta if (modifiers.ctrlKey) { result.push(labels.ctrlKey); } if (modifiers.shiftKey) { result.push(labels.shiftKey); } if (modifiers.altKey) { result.push(labels.altKey); } if (modifiers.metaKey) { result.push(labels.metaKey); } // the actual key if (key !== '') { result.push(key); } return result.join(labels.separator); } /***/ }), /***/ 86354: /*!********************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/keybindings.js ***! \********************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BQ: function() { return /* binding */ ResolvedKeybindingPart; }, /* harmony export */ QC: function() { return /* binding */ SimpleKeybinding; }, /* harmony export */ X_: function() { return /* binding */ ChordKeybinding; }, /* harmony export */ f1: function() { return /* binding */ ResolvedKeybinding; }, /* harmony export */ gm: function() { return /* binding */ createKeybinding; } /* harmony export */ }); /* unused harmony exports createSimpleKeybinding, ScanCodeBinding */ /* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ 79881); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function createKeybinding(keybinding, OS) { if (keybinding === 0) { return null; } const firstPart = (keybinding & 0x0000FFFF) >>> 0; const chordPart = (keybinding & 0xFFFF0000) >>> 16; if (chordPart !== 0) { return new ChordKeybinding([ createSimpleKeybinding(firstPart, OS), createSimpleKeybinding(chordPart, OS) ]); } return new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); } function createSimpleKeybinding(keybinding, OS) { const ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); const winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); const ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); const shiftKey = (keybinding & 1024 /* Shift */ ? true : false); const altKey = (keybinding & 512 /* Alt */ ? true : false); const metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); const keyCode = (keybinding & 255 /* KeyCode */); return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); } class SimpleKeybinding { constructor(ctrlKey, shiftKey, altKey, metaKey, keyCode) { this.ctrlKey = ctrlKey; this.shiftKey = shiftKey; this.altKey = altKey; this.metaKey = metaKey; this.keyCode = keyCode; } equals(other) { return (this.ctrlKey === other.ctrlKey && this.shiftKey === other.shiftKey && this.altKey === other.altKey && this.metaKey === other.metaKey && this.keyCode === other.keyCode); } isModifierKey() { return (this.keyCode === 0 /* Unknown */ || this.keyCode === 5 /* Ctrl */ || this.keyCode === 57 /* Meta */ || this.keyCode === 6 /* Alt */ || this.keyCode === 4 /* Shift */); } toChord() { return new ChordKeybinding([this]); } /** * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? */ isDuplicateModifierCase() { return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) || (this.shiftKey && this.keyCode === 4 /* Shift */) || (this.altKey && this.keyCode === 6 /* Alt */) || (this.metaKey && this.keyCode === 57 /* Meta */)); } } class ChordKeybinding { constructor(parts) { if (parts.length === 0) { throw (0,_errors_js__WEBPACK_IMPORTED_MODULE_0__/* .illegalArgument */ .b1)(`parts`); } this.parts = parts; } } class ScanCodeBinding { constructor(ctrlKey, shiftKey, altKey, metaKey, scanCode) { this.ctrlKey = ctrlKey; this.shiftKey = shiftKey; this.altKey = altKey; this.metaKey = metaKey; this.scanCode = scanCode; } /** * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? */ isDuplicateModifierCase() { return ((this.ctrlKey && (this.scanCode === 157 /* ControlLeft */ || this.scanCode === 161 /* ControlRight */)) || (this.shiftKey && (this.scanCode === 158 /* ShiftLeft */ || this.scanCode === 162 /* ShiftRight */)) || (this.altKey && (this.scanCode === 159 /* AltLeft */ || this.scanCode === 163 /* AltRight */)) || (this.metaKey && (this.scanCode === 160 /* MetaLeft */ || this.scanCode === 164 /* MetaRight */))); } } class ResolvedKeybindingPart { constructor(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { this.ctrlKey = ctrlKey; this.shiftKey = shiftKey; this.altKey = altKey; this.metaKey = metaKey; this.keyLabel = kbLabel; this.keyAriaLabel = kbAriaLabel; } } /** * A resolved keybinding. Can be a simple keybinding or a chord keybinding. */ class ResolvedKeybinding { } /***/ }), /***/ 51983: /*!***************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/labels.js ***! \***************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ D: function() { return /* binding */ normalizeDriveLetter; }, /* harmony export */ p: function() { return /* binding */ getBaseLabel; } /* harmony export */ }); /* harmony import */ var _extpath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extpath.js */ 57637); /* harmony import */ var _network_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./network.js */ 66657); /* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./platform.js */ 23345); /* harmony import */ var _resources_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./resources.js */ 9365); /* harmony import */ var _uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./uri.js */ 5472); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function getBaseLabel(resource) { if (!resource) { return undefined; } if (typeof resource === 'string') { resource = _uri_js__WEBPACK_IMPORTED_MODULE_4__/* .URI */ .o.file(resource); } const base = (0,_resources_js__WEBPACK_IMPORTED_MODULE_3__/* .basename */ .EZ)(resource) || (resource.scheme === _network_js__WEBPACK_IMPORTED_MODULE_1__/* .Schemas */ .lg.file ? resource.fsPath : resource.path) /* can be empty string if '/' is passed in */; // convert c: => C: if (_platform_js__WEBPACK_IMPORTED_MODULE_2__/* .isWindows */ .ED && (0,_extpath_js__WEBPACK_IMPORTED_MODULE_0__/* .isRootOrDriveLetter */ .vY)(base)) { return normalizeDriveLetter(base); } return base; } function normalizeDriveLetter(path) { if ((0,_extpath_js__WEBPACK_IMPORTED_MODULE_0__/* .hasDriveLetter */ .oP)(path)) { return path.charAt(0).toUpperCase() + path.slice(1); } return path; } /***/ }), /***/ 78421: /*!************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/map.js ***! \************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Id: function() { return /* binding */ TernarySearchTree; }, /* harmony export */ Y9: function() { return /* binding */ ResourceMap; }, /* harmony export */ z6: function() { return /* binding */ LRUCache; } /* harmony export */ }); /* unused harmony exports StringIterator, ConfigKeysIterator, PathIterator, UriIterator, LinkedMap */ /* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./strings.js */ 82983); var _a, _b; class StringIterator { constructor() { this._value = ''; this._pos = 0; } reset(key) { this._value = key; this._pos = 0; return this; } next() { this._pos += 1; return this; } hasNext() { return this._pos < this._value.length - 1; } cmp(a) { const aCode = a.charCodeAt(0); const thisCode = this._value.charCodeAt(this._pos); return aCode - thisCode; } value() { return this._value[this._pos]; } } class ConfigKeysIterator { constructor(_caseSensitive = true) { this._caseSensitive = _caseSensitive; } reset(key) { this._value = key; this._from = 0; this._to = 0; return this.next(); } hasNext() { return this._to < this._value.length; } next() { // this._data = key.split(/[\\/]/).filter(s => !!s); this._from = this._to; let justSeps = true; for (; this._to < this._value.length; this._to++) { const ch = this._value.charCodeAt(this._to); if (ch === 46 /* Period */) { if (justSeps) { this._from++; } else { break; } } else { justSeps = false; } } return this; } cmp(a) { return this._caseSensitive ? (0,_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .compareSubstring */ .TT)(a, this._value, 0, a.length, this._from, this._to) : (0,_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .compareSubstringIgnoreCase */ .j_)(a, this._value, 0, a.length, this._from, this._to); } value() { return this._value.substring(this._from, this._to); } } class PathIterator { constructor(_splitOnBackslash = true, _caseSensitive = true) { this._splitOnBackslash = _splitOnBackslash; this._caseSensitive = _caseSensitive; } reset(key) { this._value = key.replace(/\\$|\/$/, ''); this._from = 0; this._to = 0; return this.next(); } hasNext() { return this._to < this._value.length; } next() { // this._data = key.split(/[\\/]/).filter(s => !!s); this._from = this._to; let justSeps = true; for (; this._to < this._value.length; this._to++) { const ch = this._value.charCodeAt(this._to); if (ch === 47 /* Slash */ || this._splitOnBackslash && ch === 92 /* Backslash */) { if (justSeps) { this._from++; } else { break; } } else { justSeps = false; } } return this; } cmp(a) { return this._caseSensitive ? (0,_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .compareSubstring */ .TT)(a, this._value, 0, a.length, this._from, this._to) : (0,_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .compareSubstringIgnoreCase */ .j_)(a, this._value, 0, a.length, this._from, this._to); } value() { return this._value.substring(this._from, this._to); } } class UriIterator { constructor(_ignorePathCasing) { this._ignorePathCasing = _ignorePathCasing; this._states = []; this._stateIdx = 0; } reset(key) { this._value = key; this._states = []; if (this._value.scheme) { this._states.push(1 /* Scheme */); } if (this._value.authority) { this._states.push(2 /* Authority */); } if (this._value.path) { this._pathIterator = new PathIterator(false, !this._ignorePathCasing(key)); this._pathIterator.reset(key.path); if (this._pathIterator.value()) { this._states.push(3 /* Path */); } } if (this._value.query) { this._states.push(4 /* Query */); } if (this._value.fragment) { this._states.push(5 /* Fragment */); } this._stateIdx = 0; return this; } next() { if (this._states[this._stateIdx] === 3 /* Path */ && this._pathIterator.hasNext()) { this._pathIterator.next(); } else { this._stateIdx += 1; } return this; } hasNext() { return (this._states[this._stateIdx] === 3 /* Path */ && this._pathIterator.hasNext()) || this._stateIdx < this._states.length - 1; } cmp(a) { if (this._states[this._stateIdx] === 1 /* Scheme */) { return (0,_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .compareIgnoreCase */ .zY)(a, this._value.scheme); } else if (this._states[this._stateIdx] === 2 /* Authority */) { return (0,_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .compareIgnoreCase */ .zY)(a, this._value.authority); } else if (this._states[this._stateIdx] === 3 /* Path */) { return this._pathIterator.cmp(a); } else if (this._states[this._stateIdx] === 4 /* Query */) { return (0,_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .compare */ .qu)(a, this._value.query); } else if (this._states[this._stateIdx] === 5 /* Fragment */) { return (0,_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .compare */ .qu)(a, this._value.fragment); } throw new Error(); } value() { if (this._states[this._stateIdx] === 1 /* Scheme */) { return this._value.scheme; } else if (this._states[this._stateIdx] === 2 /* Authority */) { return this._value.authority; } else if (this._states[this._stateIdx] === 3 /* Path */) { return this._pathIterator.value(); } else if (this._states[this._stateIdx] === 4 /* Query */) { return this._value.query; } else if (this._states[this._stateIdx] === 5 /* Fragment */) { return this._value.fragment; } throw new Error(); } } class TernarySearchTreeNode { constructor() { this.height = 1; } rotateLeft() { const tmp = this.right; this.right = tmp.left; tmp.left = this; this.updateHeight(); tmp.updateHeight(); return tmp; } rotateRight() { const tmp = this.left; this.left = tmp.right; tmp.right = this; this.updateHeight(); tmp.updateHeight(); return tmp; } updateHeight() { this.height = 1 + Math.max(this.heightLeft, this.heightRight); } balanceFactor() { return this.heightRight - this.heightLeft; } get heightLeft() { var _c, _d; return (_d = (_c = this.left) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 0; } get heightRight() { var _c, _d; return (_d = (_c = this.right) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 0; } } class TernarySearchTree { constructor(segments) { this._iter = segments; } static forUris(ignorePathCasing = () => false) { return new TernarySearchTree(new UriIterator(ignorePathCasing)); } static forStrings() { return new TernarySearchTree(new StringIterator()); } static forConfigKeys() { return new TernarySearchTree(new ConfigKeysIterator()); } clear() { this._root = undefined; } set(key, element) { const iter = this._iter.reset(key); let node; if (!this._root) { this._root = new TernarySearchTreeNode(); this._root.segment = iter.value(); } const stack = []; // find insert_node node = this._root; while (true) { const val = iter.cmp(node.segment); if (val > 0) { // left if (!node.left) { node.left = new TernarySearchTreeNode(); node.left.segment = iter.value(); } stack.push([-1 /* Left */, node]); node = node.left; } else if (val < 0) { // right if (!node.right) { node.right = new TernarySearchTreeNode(); node.right.segment = iter.value(); } stack.push([1 /* Right */, node]); node = node.right; } else if (iter.hasNext()) { // mid iter.next(); if (!node.mid) { node.mid = new TernarySearchTreeNode(); node.mid.segment = iter.value(); } stack.push([0 /* Mid */, node]); node = node.mid; } else { break; } } // set value const oldElement = node.value; node.value = element; node.key = key; // balance for (let i = stack.length - 1; i >= 0; i--) { const node = stack[i][1]; node.updateHeight(); const bf = node.balanceFactor(); if (bf < -1 || bf > 1) { // needs rotate const d1 = stack[i][0]; const d2 = stack[i + 1][0]; if (d1 === 1 /* Right */ && d2 === 1 /* Right */) { //right, right -> rotate left stack[i][1] = node.rotateLeft(); } else if (d1 === -1 /* Left */ && d2 === -1 /* Left */) { // left, left -> rotate right stack[i][1] = node.rotateRight(); } else if (d1 === 1 /* Right */ && d2 === -1 /* Left */) { // right, left -> double rotate right, left node.right = stack[i + 1][1] = stack[i + 1][1].rotateRight(); stack[i][1] = node.rotateLeft(); } else if (d1 === -1 /* Left */ && d2 === 1 /* Right */) { // left, right -> double rotate left, right node.left = stack[i + 1][1] = stack[i + 1][1].rotateLeft(); stack[i][1] = node.rotateRight(); } else { throw new Error(); } // patch path to parent if (i > 0) { switch (stack[i - 1][0]) { case -1 /* Left */: stack[i - 1][1].left = stack[i][1]; break; case 1 /* Right */: stack[i - 1][1].right = stack[i][1]; break; case 0 /* Mid */: stack[i - 1][1].mid = stack[i][1]; break; } } else { this._root = stack[0][1]; } } } return oldElement; } get(key) { var _c; return (_c = this._getNode(key)) === null || _c === void 0 ? void 0 : _c.value; } _getNode(key) { const iter = this._iter.reset(key); let node = this._root; while (node) { const val = iter.cmp(node.segment); if (val > 0) { // left node = node.left; } else if (val < 0) { // right node = node.right; } else if (iter.hasNext()) { // mid iter.next(); node = node.mid; } else { break; } } return node; } has(key) { const node = this._getNode(key); return !((node === null || node === void 0 ? void 0 : node.value) === undefined && (node === null || node === void 0 ? void 0 : node.mid) === undefined); } delete(key) { return this._delete(key, false); } deleteSuperstr(key) { return this._delete(key, true); } _delete(key, superStr) { var _c; const iter = this._iter.reset(key); const stack = []; let node = this._root; // find node while (node) { const val = iter.cmp(node.segment); if (val > 0) { // left stack.push([-1 /* Left */, node]); node = node.left; } else if (val < 0) { // right stack.push([1 /* Right */, node]); node = node.right; } else if (iter.hasNext()) { // mid iter.next(); stack.push([0 /* Mid */, node]); node = node.mid; } else { break; } } if (!node) { // node not found return; } if (superStr) { // removing children, reset height node.left = undefined; node.mid = undefined; node.right = undefined; node.height = 1; } else { // removing element node.key = undefined; node.value = undefined; } // BST node removal if (!node.mid && !node.value) { if (node.left && node.right) { // full node const min = this._min(node.right); const { key, value, segment } = min; this._delete(min.key, false); node.key = key; node.value = value; node.segment = segment; } else { // empty or half empty const newChild = (_c = node.left) !== null && _c !== void 0 ? _c : node.right; if (stack.length > 0) { const [dir, parent] = stack[stack.length - 1]; switch (dir) { case -1 /* Left */: parent.left = newChild; break; case 0 /* Mid */: parent.mid = newChild; break; case 1 /* Right */: parent.right = newChild; break; } } else { this._root = newChild; } } } // AVL balance for (let i = stack.length - 1; i >= 0; i--) { const node = stack[i][1]; node.updateHeight(); const bf = node.balanceFactor(); if (bf > 1) { // right heavy if (node.right.balanceFactor() >= 0) { // right, right -> rotate left stack[i][1] = node.rotateLeft(); } else { // right, left -> double rotate node.right = stack[i + 1][1] = stack[i + 1][1].rotateRight(); stack[i][1] = node.rotateLeft(); } } else if (bf < -1) { // left heavy if (node.left.balanceFactor() <= 0) { // left, left -> rotate right stack[i][1] = node.rotateRight(); } else { // left, right -> double rotate node.left = stack[i + 1][1] = stack[i + 1][1].rotateLeft(); stack[i][1] = node.rotateRight(); } } // patch path to parent if (i > 0) { switch (stack[i - 1][0]) { case -1 /* Left */: stack[i - 1][1].left = stack[i][1]; break; case 1 /* Right */: stack[i - 1][1].right = stack[i][1]; break; case 0 /* Mid */: stack[i - 1][1].mid = stack[i][1]; break; } } else { this._root = stack[0][1]; } } } _min(node) { while (node.left) { node = node.left; } return node; } findSubstr(key) { const iter = this._iter.reset(key); let node = this._root; let candidate = undefined; while (node) { const val = iter.cmp(node.segment); if (val > 0) { // left node = node.left; } else if (val < 0) { // right node = node.right; } else if (iter.hasNext()) { // mid iter.next(); candidate = node.value || candidate; node = node.mid; } else { break; } } return node && node.value || candidate; } findSuperstr(key) { const iter = this._iter.reset(key); let node = this._root; while (node) { const val = iter.cmp(node.segment); if (val > 0) { // left node = node.left; } else if (val < 0) { // right node = node.right; } else if (iter.hasNext()) { // mid iter.next(); node = node.mid; } else { // collect if (!node.mid) { return undefined; } else { return this._entries(node.mid); } } } return undefined; } forEach(callback) { for (const [key, value] of this) { callback(value, key); } } *[Symbol.iterator]() { yield* this._entries(this._root); } *_entries(node) { // DFS if (!node) { return; } if (node.left) { yield* this._entries(node.left); } if (node.value) { yield [node.key, node.value]; } if (node.mid) { yield* this._entries(node.mid); } if (node.right) { yield* this._entries(node.right); } } } class ResourceMapEntry { constructor(uri, value) { this.uri = uri; this.value = value; } } class ResourceMap { constructor(mapOrKeyFn, toKey) { this[_a] = 'ResourceMap'; if (mapOrKeyFn instanceof ResourceMap) { this.map = new Map(mapOrKeyFn.map); this.toKey = toKey !== null && toKey !== void 0 ? toKey : ResourceMap.defaultToKey; } else { this.map = new Map(); this.toKey = mapOrKeyFn !== null && mapOrKeyFn !== void 0 ? mapOrKeyFn : ResourceMap.defaultToKey; } } set(resource, value) { this.map.set(this.toKey(resource), new ResourceMapEntry(resource, value)); return this; } get(resource) { var _c; return (_c = this.map.get(this.toKey(resource))) === null || _c === void 0 ? void 0 : _c.value; } has(resource) { return this.map.has(this.toKey(resource)); } get size() { return this.map.size; } clear() { this.map.clear(); } delete(resource) { return this.map.delete(this.toKey(resource)); } forEach(clb, thisArg) { if (typeof thisArg !== 'undefined') { clb = clb.bind(thisArg); } for (let [_, entry] of this.map) { clb(entry.value, entry.uri, this); } } *values() { for (let entry of this.map.values()) { yield entry.value; } } *keys() { for (let entry of this.map.values()) { yield entry.uri; } } *entries() { for (let entry of this.map.values()) { yield [entry.uri, entry.value]; } } *[(_a = Symbol.toStringTag, Symbol.iterator)]() { for (let [, entry] of this.map) { yield [entry.uri, entry.value]; } } } ResourceMap.defaultToKey = (resource) => resource.toString(); class LinkedMap { constructor() { this[_b] = 'LinkedMap'; this._map = new Map(); this._head = undefined; this._tail = undefined; this._size = 0; this._state = 0; } clear() { this._map.clear(); this._head = undefined; this._tail = undefined; this._size = 0; this._state++; } isEmpty() { return !this._head && !this._tail; } get size() { return this._size; } get first() { var _c; return (_c = this._head) === null || _c === void 0 ? void 0 : _c.value; } get last() { var _c; return (_c = this._tail) === null || _c === void 0 ? void 0 : _c.value; } has(key) { return this._map.has(key); } get(key, touch = 0 /* None */) { const item = this._map.get(key); if (!item) { return undefined; } if (touch !== 0 /* None */) { this.touch(item, touch); } return item.value; } set(key, value, touch = 0 /* None */) { let item = this._map.get(key); if (item) { item.value = value; if (touch !== 0 /* None */) { this.touch(item, touch); } } else { item = { key, value, next: undefined, previous: undefined }; switch (touch) { case 0 /* None */: this.addItemLast(item); break; case 1 /* AsOld */: this.addItemFirst(item); break; case 2 /* AsNew */: this.addItemLast(item); break; default: this.addItemLast(item); break; } this._map.set(key, item); this._size++; } return this; } delete(key) { return !!this.remove(key); } remove(key) { const item = this._map.get(key); if (!item) { return undefined; } this._map.delete(key); this.removeItem(item); this._size--; return item.value; } shift() { if (!this._head && !this._tail) { return undefined; } if (!this._head || !this._tail) { throw new Error('Invalid list'); } const item = this._head; this._map.delete(item.key); this.removeItem(item); this._size--; return item.value; } forEach(callbackfn, thisArg) { const state = this._state; let current = this._head; while (current) { if (thisArg) { callbackfn.bind(thisArg)(current.value, current.key, this); } else { callbackfn(current.value, current.key, this); } if (this._state !== state) { throw new Error(`LinkedMap got modified during iteration.`); } current = current.next; } } keys() { const map = this; const state = this._state; let current = this._head; const iterator = { [Symbol.iterator]() { return iterator; }, next() { if (map._state !== state) { throw new Error(`LinkedMap got modified during iteration.`); } if (current) { const result = { value: current.key, done: false }; current = current.next; return result; } else { return { value: undefined, done: true }; } } }; return iterator; } values() { const map = this; const state = this._state; let current = this._head; const iterator = { [Symbol.iterator]() { return iterator; }, next() { if (map._state !== state) { throw new Error(`LinkedMap got modified during iteration.`); } if (current) { const result = { value: current.value, done: false }; current = current.next; return result; } else { return { value: undefined, done: true }; } } }; return iterator; } entries() { const map = this; const state = this._state; let current = this._head; const iterator = { [Symbol.iterator]() { return iterator; }, next() { if (map._state !== state) { throw new Error(`LinkedMap got modified during iteration.`); } if (current) { const result = { value: [current.key, current.value], done: false }; current = current.next; return result; } else { return { value: undefined, done: true }; } } }; return iterator; } [(_b = Symbol.toStringTag, Symbol.iterator)]() { return this.entries(); } trimOld(newSize) { if (newSize >= this.size) { return; } if (newSize === 0) { this.clear(); return; } let current = this._head; let currentSize = this.size; while (current && currentSize > newSize) { this._map.delete(current.key); current = current.next; currentSize--; } this._head = current; this._size = currentSize; if (current) { current.previous = undefined; } this._state++; } addItemFirst(item) { // First time Insert if (!this._head && !this._tail) { this._tail = item; } else if (!this._head) { throw new Error('Invalid list'); } else { item.next = this._head; this._head.previous = item; } this._head = item; this._state++; } addItemLast(item) { // First time Insert if (!this._head && !this._tail) { this._head = item; } else if (!this._tail) { throw new Error('Invalid list'); } else { item.previous = this._tail; this._tail.next = item; } this._tail = item; this._state++; } removeItem(item) { if (item === this._head && item === this._tail) { this._head = undefined; this._tail = undefined; } else if (item === this._head) { // This can only happen if size === 1 which is handled // by the case above. if (!item.next) { throw new Error('Invalid list'); } item.next.previous = undefined; this._head = item.next; } else if (item === this._tail) { // This can only happen if size === 1 which is handled // by the case above. if (!item.previous) { throw new Error('Invalid list'); } item.previous.next = undefined; this._tail = item.previous; } else { const next = item.next; const previous = item.previous; if (!next || !previous) { throw new Error('Invalid list'); } next.previous = previous; previous.next = next; } item.next = undefined; item.previous = undefined; this._state++; } touch(item, touch) { if (!this._head || !this._tail) { throw new Error('Invalid list'); } if ((touch !== 1 /* AsOld */ && touch !== 2 /* AsNew */)) { return; } if (touch === 1 /* AsOld */) { if (item === this._head) { return; } const next = item.next; const previous = item.previous; // Unlink the item if (item === this._tail) { // previous must be defined since item was not head but is tail // So there are more than on item in the map previous.next = undefined; this._tail = previous; } else { // Both next and previous are not undefined since item was neither head nor tail. next.previous = previous; previous.next = next; } // Insert the node at head item.previous = undefined; item.next = this._head; this._head.previous = item; this._head = item; this._state++; } else if (touch === 2 /* AsNew */) { if (item === this._tail) { return; } const next = item.next; const previous = item.previous; // Unlink the item. if (item === this._head) { // next must be defined since item was not tail but is head // So there are more than on item in the map next.previous = undefined; this._head = next; } else { // Both next and previous are not undefined since item was neither head nor tail. next.previous = previous; previous.next = next; } item.next = undefined; item.previous = this._tail; this._tail.next = item; this._tail = item; this._state++; } } toJSON() { const data = []; this.forEach((value, key) => { data.push([key, value]); }); return data; } fromJSON(data) { this.clear(); for (const [key, value] of data) { this.set(key, value); } } } class LRUCache extends LinkedMap { constructor(limit, ratio = 1) { super(); this._limit = limit; this._ratio = Math.min(Math.max(0, ratio), 1); } get limit() { return this._limit; } set limit(limit) { this._limit = limit; this.checkTrim(); } get(key, touch = 2 /* AsNew */) { return super.get(key, touch); } peek(key) { return super.get(key, 0 /* None */); } set(key, value) { super.set(key, value, 2 /* AsNew */); this.checkTrim(); return this; } checkTrim() { if (this.size > this._limit) { this.trimOld(Math.round(this._limit * this._ratio)); } } } /***/ }), /***/ 39941: /*!**********************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/marked/marked.js ***! \**********************************************************************************************/ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Qc: function() { return /* binding */ parse; }, /* harmony export */ Th: function() { return /* binding */ Renderer; } /* harmony export */ }); /* unused harmony exports marked, Parser, parser, TextRenderer, Lexer, lexer, Tokenizer, Slugger */ /* module decorator */ module = __webpack_require__.hmd(module); /** * marked - a markdown parser * Copyright (c) 2011-2021, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ /** * DO NOT EDIT THIS FILE * The code in this file is generated from files in ./src/ */ // ESM-uncomment-begin let __marked_exports; (function() { function define(factory) { __marked_exports = factory(); } define.amd = true; // ESM-uncomment-end (function (global, factory) { typeof exports === 'object' && "object" !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.marked = factory()); }(this, (function () { 'use strict'; function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var defaults$5 = {exports: {}}; function getDefaults$1() { return { baseUrl: null, breaks: false, extensions: null, gfm: true, headerIds: true, headerPrefix: '', highlight: null, langPrefix: 'language-', mangle: true, pedantic: false, renderer: null, sanitize: false, sanitizer: null, silent: false, smartLists: false, smartypants: false, tokenizer: null, walkTokens: null, xhtml: false }; } function changeDefaults$1(newDefaults) { defaults$5.exports.defaults = newDefaults; } defaults$5.exports = { defaults: getDefaults$1(), getDefaults: getDefaults$1, changeDefaults: changeDefaults$1 }; /** * Helpers */ var escapeTest = /[&<>"']/; var escapeReplace = /[&<>"']/g; var escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/; var escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g; var escapeReplacements = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; var getEscapeReplacement = function getEscapeReplacement(ch) { return escapeReplacements[ch]; }; function escape$2(html, encode) { if (encode) { if (escapeTest.test(html)) { return html.replace(escapeReplace, getEscapeReplacement); } } else { if (escapeTestNoEncode.test(html)) { return html.replace(escapeReplaceNoEncode, getEscapeReplacement); } } return html; } var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; function unescape$1(html) { // explicitly match decimal, hex, and named HTML entities return html.replace(unescapeTest, function (_, n) { n = n.toLowerCase(); if (n === 'colon') return ':'; if (n.charAt(0) === '#') { return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)); } return ''; }); } var caret = /(^|[^\[])\^/g; function edit$1(regex, opt) { regex = regex.source || regex; opt = opt || ''; var obj = { replace: function replace(name, val) { val = val.source || val; val = val.replace(caret, '$1'); regex = regex.replace(name, val); return obj; }, getRegex: function getRegex() { return new RegExp(regex, opt); } }; return obj; } var nonWordAndColonTest = /[^\w:]/g; var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; function cleanUrl$1(sanitize, base, href) { if (sanitize) { var prot; try { prot = decodeURIComponent(unescape$1(href)).replace(nonWordAndColonTest, '').toLowerCase(); } catch (e) { return null; } if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { return null; } } if (base && !originIndependentUrl.test(href)) { href = resolveUrl(base, href); } try { href = encodeURI(href).replace(/%25/g, '%'); } catch (e) { return null; } return href; } var baseUrls = {}; var justDomain = /^[^:]+:\/*[^/]*$/; var protocol = /^([^:]+:)[\s\S]*$/; var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/; function resolveUrl(base, href) { if (!baseUrls[' ' + base]) { // we can ignore everything in base after the last slash of its path component, // but we might need to add _that_ // https://tools.ietf.org/html/rfc3986#section-3 if (justDomain.test(base)) { baseUrls[' ' + base] = base + '/'; } else { baseUrls[' ' + base] = rtrim$1(base, '/', true); } } base = baseUrls[' ' + base]; var relativeBase = base.indexOf(':') === -1; if (href.substring(0, 2) === '//') { if (relativeBase) { return href; } return base.replace(protocol, '$1') + href; } else if (href.charAt(0) === '/') { if (relativeBase) { return href; } return base.replace(domain, '$1') + href; } else { return base + href; } } var noopTest$1 = { exec: function noopTest() {} }; function merge$2(obj) { var i = 1, target, key; for (; i < arguments.length; i++) { target = arguments[i]; for (key in target) { if (Object.prototype.hasOwnProperty.call(target, key)) { obj[key] = target[key]; } } } return obj; } function splitCells$1(tableRow, count) { // ensure that every cell-delimiting pipe has a space // before it to distinguish it from an escaped pipe var row = tableRow.replace(/\|/g, function (match, offset, str) { var escaped = false, curr = offset; while (--curr >= 0 && str[curr] === '\\') { escaped = !escaped; } if (escaped) { // odd number of slashes means | is escaped // so we leave it alone return '|'; } else { // add space before unescaped | return ' |'; } }), cells = row.split(/ \|/); var i = 0; // First/last cell in a row cannot be empty if it has no leading/trailing pipe if (!cells[0].trim()) { cells.shift(); } if (!cells[cells.length - 1].trim()) { cells.pop(); } if (cells.length > count) { cells.splice(count); } else { while (cells.length < count) { cells.push(''); } } for (; i < cells.length; i++) { // leading or trailing whitespace is ignored per the gfm spec cells[i] = cells[i].trim().replace(/\\\|/g, '|'); } return cells; } // Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). // /c*$/ is vulnerable to REDOS. // invert: Remove suffix of non-c chars instead. Default falsey. function rtrim$1(str, c, invert) { var l = str.length; if (l === 0) { return ''; } // Length of suffix matching the invert condition. var suffLen = 0; // Step left until we fail to match the invert condition. while (suffLen < l) { var currChar = str.charAt(l - suffLen - 1); if (currChar === c && !invert) { suffLen++; } else if (currChar !== c && invert) { suffLen++; } else { break; } } return str.substr(0, l - suffLen); } function findClosingBracket$1(str, b) { if (str.indexOf(b[1]) === -1) { return -1; } var l = str.length; var level = 0, i = 0; for (; i < l; i++) { if (str[i] === '\\') { i++; } else if (str[i] === b[0]) { level++; } else if (str[i] === b[1]) { level--; if (level < 0) { return i; } } } return -1; } function checkSanitizeDeprecation$1(opt) { if (opt && opt.sanitize && !opt.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'); } } // copied from https://stackoverflow.com/a/5450113/806777 function repeatString$1(pattern, count) { if (count < 1) { return ''; } var result = ''; while (count > 1) { if (count & 1) { result += pattern; } count >>= 1; pattern += pattern; } return result + pattern; } var helpers = { escape: escape$2, unescape: unescape$1, edit: edit$1, cleanUrl: cleanUrl$1, resolveUrl: resolveUrl, noopTest: noopTest$1, merge: merge$2, splitCells: splitCells$1, rtrim: rtrim$1, findClosingBracket: findClosingBracket$1, checkSanitizeDeprecation: checkSanitizeDeprecation$1, repeatString: repeatString$1 }; var defaults$4 = defaults$5.exports.defaults; var rtrim = helpers.rtrim, splitCells = helpers.splitCells, _escape = helpers.escape, findClosingBracket = helpers.findClosingBracket; function outputLink(cap, link, raw, lexer) { var href = link.href; var title = link.title ? _escape(link.title) : null; var text = cap[1].replace(/\\([\[\]])/g, '$1'); if (cap[0].charAt(0) !== '!') { lexer.state.inLink = true; var token = { type: 'link', raw: raw, href: href, title: title, text: text, tokens: lexer.inlineTokens(text, []) }; lexer.state.inLink = false; return token; } else { return { type: 'image', raw: raw, href: href, title: title, text: _escape(text) }; } } function indentCodeCompensation(raw, text) { var matchIndentToCode = raw.match(/^(\s+)(?:```)/); if (matchIndentToCode === null) { return text; } var indentToCode = matchIndentToCode[1]; return text.split('\n').map(function (node) { var matchIndentInNode = node.match(/^\s+/); if (matchIndentInNode === null) { return node; } var indentInNode = matchIndentInNode[0]; if (indentInNode.length >= indentToCode.length) { return node.slice(indentToCode.length); } return node; }).join('\n'); } /** * Tokenizer */ var Tokenizer_1 = /*#__PURE__*/function () { function Tokenizer(options) { this.options = options || defaults$4; } var _proto = Tokenizer.prototype; _proto.space = function space(src) { var cap = this.rules.block.newline.exec(src); if (cap) { if (cap[0].length > 1) { return { type: 'space', raw: cap[0] }; } return { raw: '\n' }; } }; _proto.code = function code(src) { var cap = this.rules.block.code.exec(src); if (cap) { var text = cap[0].replace(/^ {1,4}/gm, ''); return { type: 'code', raw: cap[0], codeBlockStyle: 'indented', text: !this.options.pedantic ? rtrim(text, '\n') : text }; } }; _proto.fences = function fences(src) { var cap = this.rules.block.fences.exec(src); if (cap) { var raw = cap[0]; var text = indentCodeCompensation(raw, cap[3] || ''); return { type: 'code', raw: raw, lang: cap[2] ? cap[2].trim() : cap[2], text: text }; } }; _proto.heading = function heading(src) { var cap = this.rules.block.heading.exec(src); if (cap) { var text = cap[2].trim(); // remove trailing #s if (/#$/.test(text)) { var trimmed = rtrim(text, '#'); if (this.options.pedantic) { text = trimmed.trim(); } else if (!trimmed || / $/.test(trimmed)) { // CommonMark requires space before trailing #s text = trimmed.trim(); } } var token = { type: 'heading', raw: cap[0], depth: cap[1].length, text: text, tokens: [] }; this.lexer.inline(token.text, token.tokens); return token; } }; _proto.hr = function hr(src) { var cap = this.rules.block.hr.exec(src); if (cap) { return { type: 'hr', raw: cap[0] }; } }; _proto.blockquote = function blockquote(src) { var cap = this.rules.block.blockquote.exec(src); if (cap) { var text = cap[0].replace(/^ *> ?/gm, ''); return { type: 'blockquote', raw: cap[0], tokens: this.lexer.blockTokens(text, []), text: text }; } }; _proto.list = function list(src) { var cap = this.rules.block.list.exec(src); if (cap) { var raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, line, lines, itemContents; var bull = cap[1].trim(); var isordered = bull.length > 1; var list = { type: 'list', raw: '', ordered: isordered, start: isordered ? +bull.slice(0, -1) : '', loose: false, items: [] }; bull = isordered ? "\\d{1,9}\\" + bull.slice(-1) : "\\" + bull; if (this.options.pedantic) { bull = isordered ? bull : '[*+-]'; } // Get next list item var itemRegex = new RegExp("^( {0,3}" + bull + ")((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))"); // Get each top-level item while (src) { if (this.rules.block.hr.test(src)) { // End list if we encounter an HR (possibly move into itemRegex?) break; } if (!(cap = itemRegex.exec(src))) { break; } lines = cap[2].split('\n'); if (this.options.pedantic) { indent = 2; itemContents = lines[0].trimLeft(); } else { indent = cap[2].search(/[^ ]/); // Find first non-space char indent = cap[1].length + (indent > 4 ? 1 : indent); // intented code blocks after 4 spaces; indent is always 1 itemContents = lines[0].slice(indent - cap[1].length); } blankLine = false; raw = cap[0]; if (!lines[0] && /^ *$/.test(lines[1])) { // items begin with at most one blank line raw = cap[1] + lines.slice(0, 2).join('\n') + '\n'; list.loose = true; lines = []; } var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])"); for (i = 1; i < lines.length; i++) { line = lines[i]; if (this.options.pedantic) { // Re-align to follow commonmark nesting rules line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' '); } // End list item if found start of new bullet if (nextBulletRegex.test(line)) { raw = cap[1] + lines.slice(0, i).join('\n') + '\n'; break; } // Until we encounter a blank line, item contents do not need indentation if (!blankLine) { if (!line.trim()) { // Check if current line is empty blankLine = true; } // Dedent if possible if (line.search(/[^ ]/) >= indent) { itemContents += '\n' + line.slice(indent); } else { itemContents += '\n' + line; } continue; } // Dedent this line if (line.search(/[^ ]/) >= indent || !line.trim()) { itemContents += '\n' + line.slice(indent); continue; } else { // Line was not properly indented; end of this item raw = cap[1] + lines.slice(0, i).join('\n') + '\n'; break; } } if (!list.loose) { // If the previous item ended with a blank line, the list is loose if (endsWithBlankLine) { list.loose = true; } else if (/\n *\n *$/.test(raw)) { endsWithBlankLine = true; } } // Check for task list items if (this.options.gfm) { istask = /^\[[ xX]\] /.exec(itemContents); if (istask) { ischecked = istask[0] !== '[ ] '; itemContents = itemContents.replace(/^\[[ xX]\] +/, ''); } } list.items.push({ type: 'list_item', raw: raw, task: !!istask, checked: ischecked, loose: false, text: itemContents }); list.raw += raw; src = src.slice(raw.length); } // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic list.items[list.items.length - 1].raw = raw.trimRight(); list.items[list.items.length - 1].text = itemContents.trimRight(); list.raw = list.raw.trimRight(); var l = list.items.length; // Item child tokens handled here at end because we needed to have the final item to trim it first for (i = 0; i < l; i++) { this.lexer.state.top = false; list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []); if (list.items[i].tokens.some(function (t) { return t.type === 'space'; })) { list.loose = true; list.items[i].loose = true; } } return list; } }; _proto.html = function html(src) { var cap = this.rules.block.html.exec(src); if (cap) { var token = { type: 'html', raw: cap[0], pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), text: cap[0] }; if (this.options.sanitize) { token.type = 'paragraph'; token.text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]); token.tokens = []; this.lexer.inline(token.text, token.tokens); } return token; } }; _proto.def = function def(src) { var cap = this.rules.block.def.exec(src); if (cap) { if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1); var tag = cap[1].toLowerCase().replace(/\s+/g, ' '); return { type: 'def', tag: tag, raw: cap[0], href: cap[2], title: cap[3] }; } }; _proto.table = function table(src) { var cap = this.rules.block.table.exec(src); if (cap) { var item = { type: 'table', header: splitCells(cap[1]).map(function (c) { return { text: c }; }), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), rows: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] }; if (item.header.length === item.align.length) { item.raw = cap[0]; var l = item.align.length; var i, j, k, row; for (i = 0; i < l; i++) { if (/^ *-+: *$/.test(item.align[i])) { item.align[i] = 'right'; } else if (/^ *:-+: *$/.test(item.align[i])) { item.align[i] = 'center'; } else if (/^ *:-+ *$/.test(item.align[i])) { item.align[i] = 'left'; } else { item.align[i] = null; } } l = item.rows.length; for (i = 0; i < l; i++) { item.rows[i] = splitCells(item.rows[i], item.header.length).map(function (c) { return { text: c }; }); } // parse child tokens inside headers and cells // header child tokens l = item.header.length; for (j = 0; j < l; j++) { item.header[j].tokens = []; this.lexer.inlineTokens(item.header[j].text, item.header[j].tokens); } // cell child tokens l = item.rows.length; for (j = 0; j < l; j++) { row = item.rows[j]; for (k = 0; k < row.length; k++) { row[k].tokens = []; this.lexer.inlineTokens(row[k].text, row[k].tokens); } } return item; } } }; _proto.lheading = function lheading(src) { var cap = this.rules.block.lheading.exec(src); if (cap) { var token = { type: 'heading', raw: cap[0], depth: cap[2].charAt(0) === '=' ? 1 : 2, text: cap[1], tokens: [] }; this.lexer.inline(token.text, token.tokens); return token; } }; _proto.paragraph = function paragraph(src) { var cap = this.rules.block.paragraph.exec(src); if (cap) { var token = { type: 'paragraph', raw: cap[0], text: cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1], tokens: [] }; this.lexer.inline(token.text, token.tokens); return token; } }; _proto.text = function text(src) { var cap = this.rules.block.text.exec(src); if (cap) { var token = { type: 'text', raw: cap[0], text: cap[0], tokens: [] }; this.lexer.inline(token.text, token.tokens); return token; } }; _proto.escape = function escape(src) { var cap = this.rules.inline.escape.exec(src); if (cap) { return { type: 'escape', raw: cap[0], text: _escape(cap[1]) }; } }; _proto.tag = function tag(src) { var cap = this.rules.inline.tag.exec(src); if (cap) { if (!this.lexer.state.inLink && /^/i.test(cap[0])) { this.lexer.state.inLink = false; } if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { this.lexer.state.inRawBlock = true; } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { this.lexer.state.inRawBlock = false; } return { type: this.options.sanitize ? 'text' : 'html', raw: cap[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]) : cap[0] }; } }; _proto.link = function link(src) { var cap = this.rules.inline.link.exec(src); if (cap) { var trimmedUrl = cap[2].trim(); if (!this.options.pedantic && /^$/.test(trimmedUrl)) { return; } // ending angle bracket cannot be escaped var rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\'); if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) { return; } } else { // find closing parenthesis var lastParenIndex = findClosingBracket(cap[2], '()'); if (lastParenIndex > -1) { var start = cap[0].indexOf('!') === 0 ? 5 : 4; var linkLen = start + cap[1].length + lastParenIndex; cap[2] = cap[2].substring(0, lastParenIndex); cap[0] = cap[0].substring(0, linkLen).trim(); cap[3] = ''; } } var href = cap[2]; var title = ''; if (this.options.pedantic) { // split pedantic href and title var link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); if (link) { href = link[1]; title = link[3]; } } else { title = cap[3] ? cap[3].slice(1, -1) : ''; } href = href.trim(); if (/^$/.test(trimmedUrl)) { // pedantic allows starting angle bracket without ending angle bracket href = href.slice(1); } else { href = href.slice(1, -1); } } return outputLink(cap, { href: href ? href.replace(this.rules.inline._escapes, '$1') : href, title: title ? title.replace(this.rules.inline._escapes, '$1') : title }, cap[0], this.lexer); } }; _proto.reflink = function reflink(src, links) { var cap; if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) { var link = (cap[2] || cap[1]).replace(/\s+/g, ' '); link = links[link.toLowerCase()]; if (!link || !link.href) { var text = cap[0].charAt(0); return { type: 'text', raw: text, text: text }; } return outputLink(cap, link, cap[0], this.lexer); } }; _proto.emStrong = function emStrong(src, maskedSrc, prevChar) { if (prevChar === void 0) { prevChar = ''; } var match = this.rules.inline.emStrong.lDelim.exec(src); if (!match) return; // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well if (match[3] && prevChar.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\u08A0-\u08B4\u08B6-\u08C7\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\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\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-\u170C\u170E-\u1711\u1720-\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-\u1B4B\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-\u2C2E\u2C30-\u2C5E\u2C60-\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-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\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\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\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\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\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]|\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\uDEC0-\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]|[\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\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]|\uD82C[\uDC00-\uDD1E\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]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\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-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/)) return; var nextChar = match[1] || match[2] || ''; if (!nextChar || nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))) { var lLength = match[0].length - 1; var rDelim, rLength, delimTotal = lLength, midDelimTotal = 0; var endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd; endReg.lastIndex = 0; // Clip maskedSrc to same section of string as src (move to lexer?) maskedSrc = maskedSrc.slice(-1 * src.length + lLength); while ((match = endReg.exec(maskedSrc)) != null) { rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6]; if (!rDelim) continue; // skip single * in __abc*abc__ rLength = rDelim.length; if (match[3] || match[4]) { // found another Left Delim delimTotal += rLength; continue; } else if (match[5] || match[6]) { // either Left or Right Delim if (lLength % 3 && !((lLength + rLength) % 3)) { midDelimTotal += rLength; continue; // CommonMark Emphasis Rules 9-10 } } delimTotal -= rLength; if (delimTotal > 0) continue; // Haven't found enough closing delimiters // Remove extra characters. *a*** -> *a* rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); // Create `em` if smallest delimiter has odd char count. *a*** if (Math.min(lLength, rLength) % 2) { var _text = src.slice(1, lLength + match.index + rLength); return { type: 'em', raw: src.slice(0, lLength + match.index + rLength + 1), text: _text, tokens: this.lexer.inlineTokens(_text, []) }; } // Create 'strong' if smallest delimiter has even char count. **a*** var text = src.slice(2, lLength + match.index + rLength - 1); return { type: 'strong', raw: src.slice(0, lLength + match.index + rLength + 1), text: text, tokens: this.lexer.inlineTokens(text, []) }; } } }; _proto.codespan = function codespan(src) { var cap = this.rules.inline.code.exec(src); if (cap) { var text = cap[2].replace(/\n/g, ' '); var hasNonSpaceChars = /[^ ]/.test(text); var hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text); if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { text = text.substring(1, text.length - 1); } text = _escape(text, true); return { type: 'codespan', raw: cap[0], text: text }; } }; _proto.br = function br(src) { var cap = this.rules.inline.br.exec(src); if (cap) { return { type: 'br', raw: cap[0] }; } }; _proto.del = function del(src) { var cap = this.rules.inline.del.exec(src); if (cap) { return { type: 'del', raw: cap[0], text: cap[2], tokens: this.lexer.inlineTokens(cap[2], []) }; } }; _proto.autolink = function autolink(src, mangle) { var cap = this.rules.inline.autolink.exec(src); if (cap) { var text, href; if (cap[2] === '@') { text = _escape(this.options.mangle ? mangle(cap[1]) : cap[1]); href = 'mailto:' + text; } else { text = _escape(cap[1]); href = text; } return { type: 'link', raw: cap[0], text: text, href: href, tokens: [{ type: 'text', raw: text, text: text }] }; } }; _proto.url = function url(src, mangle) { var cap; if (cap = this.rules.inline.url.exec(src)) { var text, href; if (cap[2] === '@') { text = _escape(this.options.mangle ? mangle(cap[0]) : cap[0]); href = 'mailto:' + text; } else { // do extended autolink path validation var prevCapZero; do { prevCapZero = cap[0]; cap[0] = this.rules.inline._backpedal.exec(cap[0])[0]; } while (prevCapZero !== cap[0]); text = _escape(cap[0]); if (cap[1] === 'www.') { href = 'http://' + text; } else { href = text; } } return { type: 'link', raw: cap[0], text: text, href: href, tokens: [{ type: 'text', raw: text, text: text }] }; } }; _proto.inlineText = function inlineText(src, smartypants) { var cap = this.rules.inline.text.exec(src); if (cap) { var text; if (this.lexer.state.inRawBlock) { text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]) : cap[0]; } else { text = _escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]); } return { type: 'text', raw: cap[0], text: text }; } }; return Tokenizer; }(); var noopTest = helpers.noopTest, edit = helpers.edit, merge$1 = helpers.merge; /** * Block-Level Grammar */ var block$1 = { 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}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, list: /^( {0,3}bull)( [^\n]+?)?(?:\n|$)/, html: '^ {0,3}(?:' // optional indentation + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) + '|comment[^\\n]*(\\n+|$)' // (2) + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3) + '|\\n*|$)' // (4) + '|\\n*|$)' // (5) + '|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6) + '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag + '|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag + ')', def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noopTest, lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/, // regex template, placeholders will be replaced according to different paragraph // interruption rules of commonmark and the original markdown spec: _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/, text: /^[^\n]+/ }; block$1._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; block$1._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; block$1.def = edit(block$1.def).replace('label', block$1._label).replace('title', block$1._title).getRegex(); block$1.bullet = /(?:[*+-]|\d{1,9}[.)])/; block$1.listItemStart = edit(/^( *)(bull) */).replace('bull', block$1.bullet).getRegex(); block$1.list = edit(block$1.list).replace(/bull/g, block$1.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block$1.def.source + ')').getRegex(); block$1._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'; block$1._comment = /|$)/; block$1.html = edit(block$1.html, 'i').replace('comment', block$1._comment).replace('tag', block$1._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(); block$1.paragraph = edit(block$1._paragraph).replace('hr', block$1.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs .replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt .replace('html', ')|<(?:script|pre|style|textarea|!--)').replace('tag', block$1._tag) // pars can be interrupted by type (6) html blocks .getRegex(); block$1.blockquote = edit(block$1.blockquote).replace('paragraph', block$1.paragraph).getRegex(); /** * Normal Block Grammar */ block$1.normal = merge$1({}, block$1); /** * GFM Block Grammar */ block$1.gfm = merge$1({}, block$1.normal, { table: '^ *([^\\n ].*\\|.*)\\n' // Header + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?' // Align + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells }); block$1.gfm.table = edit(block$1.gfm.table).replace('hr', block$1.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[.)]) ') // only lists starting from 1 can interrupt .replace('html', ')|<(?:script|pre|style|textarea|!--)').replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks .getRegex(); /** * Pedantic grammar (original John Gruber's loose markdown specification) */ block$1.pedantic = merge$1({}, block$1.normal, { html: edit('^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))').replace('comment', block$1._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: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: noopTest, // fences not supported paragraph: edit(block$1.normal._paragraph).replace('hr', block$1.hr).replace('heading', ' *#{1,6} *[^\n]').replace('lheading', block$1.lheading).replace('blockquote', ' {0,3}>').replace('|fences', '').replace('|list', '').replace('|html', '').getRegex() }); /** * Inline-Level Grammar */ var inline$1 = { escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, url: noopTest, tag: '^comment' + '|^' // self-closing tag + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. + '|^' // declaration, e.g. + '|^', // CDATA section link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/, reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, reflinkSearch: 'reflink|nolink(?!\\()', emStrong: { lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/, // (1) and (2) can only be a Right Delimiter. (3) and (4) can only be Left. (5) and (6) can be either Left or Right. // () Skip other delimiter (1) #*** (2) a***#, a*** (3) #***a, ***a (4) ***# (5) #***# (6) a***a 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*])/ // ^- Not allowed for _ }, code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, br: /^( {2,}|\\)\n(?!\s*$)/, del: noopTest, text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~'; inline$1.punctuation = edit(inline$1.punctuation).replace(/punctuation/g, inline$1._punctuation).getRegex(); // sequences em should skip over [title](link), `code`, inline$1.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g; inline$1.escapedEmSt = /\\\*|\\_/g; inline$1._comment = edit(block$1._comment).replace('(?:-->|$)', '-->').getRegex(); inline$1.emStrong.lDelim = edit(inline$1.emStrong.lDelim).replace(/punct/g, inline$1._punctuation).getRegex(); inline$1.emStrong.rDelimAst = edit(inline$1.emStrong.rDelimAst, 'g').replace(/punct/g, inline$1._punctuation).getRegex(); inline$1.emStrong.rDelimUnd = edit(inline$1.emStrong.rDelimUnd, 'g').replace(/punct/g, inline$1._punctuation).getRegex(); inline$1._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g; inline$1._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; inline$1._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])?)+(?![-_])/; inline$1.autolink = edit(inline$1.autolink).replace('scheme', inline$1._scheme).replace('email', inline$1._email).getRegex(); inline$1._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; inline$1.tag = edit(inline$1.tag).replace('comment', inline$1._comment).replace('attribute', inline$1._attribute).getRegex(); inline$1._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/; inline$1._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/; inline$1._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; inline$1.link = edit(inline$1.link).replace('label', inline$1._label).replace('href', inline$1._href).replace('title', inline$1._title).getRegex(); inline$1.reflink = edit(inline$1.reflink).replace('label', inline$1._label).getRegex(); inline$1.reflinkSearch = edit(inline$1.reflinkSearch, 'g').replace('reflink', inline$1.reflink).replace('nolink', inline$1.nolink).getRegex(); /** * Normal Inline Grammar */ inline$1.normal = merge$1({}, inline$1); /** * Pedantic Inline Grammar */ inline$1.pedantic = merge$1({}, inline$1.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: edit(/^!?\[(label)\]\((.*?)\)/).replace('label', inline$1._label).getRegex(), reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace('label', inline$1._label).getRegex() }); /** * GFM Inline Grammar */ inline$1.gfm = merge$1({}, inline$1.normal, { escape: edit(inline$1.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]*?(?:(?=[\\ 0.5) { ch = 'x' + ch.toString(16); } out += '&#' + ch + ';'; } return out; } /** * Block Lexer */ var Lexer_1 = /*#__PURE__*/function () { function Lexer(options) { this.tokens = []; this.tokens.links = Object.create(null); this.options = options || defaults$3; this.options.tokenizer = this.options.tokenizer || new Tokenizer$1(); this.tokenizer = this.options.tokenizer; this.tokenizer.options = this.options; this.tokenizer.lexer = this; this.inlineQueue = []; this.state = { inLink: false, inRawBlock: false, top: true }; var rules = { block: block.normal, inline: inline.normal }; if (this.options.pedantic) { rules.block = block.pedantic; rules.inline = inline.pedantic; } else if (this.options.gfm) { rules.block = block.gfm; if (this.options.breaks) { rules.inline = inline.breaks; } else { rules.inline = inline.gfm; } } this.tokenizer.rules = rules; } /** * Expose Rules */ /** * Static Lex Method */ Lexer.lex = function lex(src, options) { var lexer = new Lexer(options); return lexer.lex(src); } /** * Static Lex Inline Method */ ; Lexer.lexInline = function lexInline(src, options) { var lexer = new Lexer(options); return lexer.inlineTokens(src); } /** * Preprocessing */ ; var _proto = Lexer.prototype; _proto.lex = function lex(src) { src = src.replace(/\r\n|\r/g, '\n').replace(/\t/g, ' '); this.blockTokens(src, this.tokens); var next; while (next = this.inlineQueue.shift()) { this.inlineTokens(next.src, next.tokens); } return this.tokens; } /** * Lexing */ ; _proto.blockTokens = function blockTokens(src, tokens) { var _this = this; if (tokens === void 0) { tokens = []; } if (this.options.pedantic) { src = src.replace(/^ +$/gm, ''); } var token, lastToken, cutSrc, lastParagraphClipped; while (src) { if (this.options.extensions && this.options.extensions.block && this.options.extensions.block.some(function (extTokenizer) { if (token = extTokenizer.call({ lexer: _this }, src, tokens)) { src = src.substring(token.raw.length); tokens.push(token); return true; } return false; })) { continue; } // newline if (token = this.tokenizer.space(src)) { src = src.substring(token.raw.length); if (token.type) { tokens.push(token); } continue; } // code if (token = this.tokenizer.code(src)) { src = src.substring(token.raw.length); lastToken = tokens[tokens.length - 1]; // An indented code block cannot interrupt a paragraph. if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { lastToken.raw += '\n' + token.raw; lastToken.text += '\n' + token.text; this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; } else { tokens.push(token); } continue; } // fences if (token = this.tokenizer.fences(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // heading if (token = this.tokenizer.heading(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // hr if (token = this.tokenizer.hr(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // blockquote if (token = this.tokenizer.blockquote(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // list if (token = this.tokenizer.list(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // html if (token = this.tokenizer.html(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // def if (token = this.tokenizer.def(src)) { src = src.substring(token.raw.length); lastToken = tokens[tokens.length - 1]; if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { lastToken.raw += '\n' + token.raw; lastToken.text += '\n' + token.raw; this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; } else if (!this.tokens.links[token.tag]) { this.tokens.links[token.tag] = { href: token.href, title: token.title }; } continue; } // table (gfm) if (token = this.tokenizer.table(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // lheading if (token = this.tokenizer.lheading(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // top-level paragraph // prevent paragraph consuming extensions by clipping 'src' to extension start cutSrc = src; if (this.options.extensions && this.options.extensions.startBlock) { (function () { var startIndex = Infinity; var tempSrc = src.slice(1); var tempStart = void 0; _this.options.extensions.startBlock.forEach(function (getStartIndex) { tempStart = getStartIndex.call({ lexer: this }, tempSrc); if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); } }); if (startIndex < Infinity && startIndex >= 0) { cutSrc = src.substring(0, startIndex + 1); } })(); } if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) { lastToken = tokens[tokens.length - 1]; if (lastParagraphClipped && lastToken.type === 'paragraph') { lastToken.raw += '\n' + token.raw; lastToken.text += '\n' + token.text; this.inlineQueue.pop(); this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; } else { tokens.push(token); } lastParagraphClipped = cutSrc.length !== src.length; src = src.substring(token.raw.length); continue; } // text if (token = this.tokenizer.text(src)) { src = src.substring(token.raw.length); lastToken = tokens[tokens.length - 1]; if (lastToken && lastToken.type === 'text') { lastToken.raw += '\n' + token.raw; lastToken.text += '\n' + token.text; this.inlineQueue.pop(); this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; } else { tokens.push(token); } continue; } if (src) { var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); if (this.options.silent) { console.error(errMsg); break; } else { throw new Error(errMsg); } } } this.state.top = true; return tokens; }; _proto.inline = function inline(src, tokens) { this.inlineQueue.push({ src: src, tokens: tokens }); } /** * Lexing/Compiling */ ; _proto.inlineTokens = function inlineTokens(src, tokens) { var _this2 = this; if (tokens === void 0) { tokens = []; } var token, lastToken, cutSrc; // String with links masked to avoid interference with em and strong var maskedSrc = src; var match; var keepPrevChar, prevChar; // Mask out reflinks if (this.tokens.links) { var links = Object.keys(this.tokens.links); if (links.length > 0) { while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) { if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) { maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex); } } } } // Mask out other blocks while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); } // Mask out escaped em & strong delimiters while ((match = this.tokenizer.rules.inline.escapedEmSt.exec(maskedSrc)) != null) { maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex); } while (src) { if (!keepPrevChar) { prevChar = ''; } keepPrevChar = false; // extensions if (this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some(function (extTokenizer) { if (token = extTokenizer.call({ lexer: _this2 }, src, tokens)) { src = src.substring(token.raw.length); tokens.push(token); return true; } return false; })) { continue; } // escape if (token = this.tokenizer.escape(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // tag if (token = this.tokenizer.tag(src)) { src = src.substring(token.raw.length); lastToken = tokens[tokens.length - 1]; if (lastToken && token.type === 'text' && lastToken.type === 'text') { lastToken.raw += token.raw; lastToken.text += token.text; } else { tokens.push(token); } continue; } // link if (token = this.tokenizer.link(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // reflink, nolink if (token = this.tokenizer.reflink(src, this.tokens.links)) { src = src.substring(token.raw.length); lastToken = tokens[tokens.length - 1]; if (lastToken && token.type === 'text' && lastToken.type === 'text') { lastToken.raw += token.raw; lastToken.text += token.text; } else { tokens.push(token); } continue; } // em & strong if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // code if (token = this.tokenizer.codespan(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // br if (token = this.tokenizer.br(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // del (gfm) if (token = this.tokenizer.del(src)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // autolink if (token = this.tokenizer.autolink(src, mangle)) { src = src.substring(token.raw.length); tokens.push(token); continue; } // url (gfm) if (!this.state.inLink && (token = this.tokenizer.url(src, mangle))) { src = src.substring(token.raw.length); tokens.push(token); continue; } // text // prevent inlineText consuming extensions by clipping 'src' to extension start cutSrc = src; if (this.options.extensions && this.options.extensions.startInline) { (function () { var startIndex = Infinity; var tempSrc = src.slice(1); var tempStart = void 0; _this2.options.extensions.startInline.forEach(function (getStartIndex) { tempStart = getStartIndex.call({ lexer: this }, tempSrc); if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); } }); if (startIndex < Infinity && startIndex >= 0) { cutSrc = src.substring(0, startIndex + 1); } })(); } if (token = this.tokenizer.inlineText(cutSrc, smartypants)) { src = src.substring(token.raw.length); if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started prevChar = token.raw.slice(-1); } keepPrevChar = true; lastToken = tokens[tokens.length - 1]; if (lastToken && lastToken.type === 'text') { lastToken.raw += token.raw; lastToken.text += token.text; } else { tokens.push(token); } continue; } if (src) { var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0); if (this.options.silent) { console.error(errMsg); break; } else { throw new Error(errMsg); } } } return tokens; }; _createClass(Lexer, null, [{ key: "rules", get: function get() { return { block: block, inline: inline }; } }]); return Lexer; }(); var defaults$2 = defaults$5.exports.defaults; var cleanUrl = helpers.cleanUrl, escape$1 = helpers.escape; /** * Renderer */ var Renderer_1 = /*#__PURE__*/function () { function Renderer(options) { this.options = options || defaults$2; } var _proto = Renderer.prototype; _proto.code = function code(_code, infostring, escaped) { var lang = (infostring || '').match(/\S*/)[0]; if (this.options.highlight) { var out = this.options.highlight(_code, lang); if (out != null && out !== _code) { escaped = true; _code = out; } } _code = _code.replace(/\n$/, '') + '\n'; if (!lang) { return '
' + (escaped ? _code : escape$1(_code, true)) + '
\n'; } return '
' + (escaped ? _code : escape$1(_code, true)) + '
\n'; }; _proto.blockquote = function blockquote(quote) { return '
\n' + quote + '
\n'; }; _proto.html = function html(_html) { return _html; }; _proto.heading = function heading(text, level, raw, slugger) { if (this.options.headerIds) { return '' + text + '\n'; } // ignore IDs return '' + text + '\n'; }; _proto.hr = function hr() { return this.options.xhtml ? '
\n' : '
\n'; }; _proto.list = function list(body, ordered, start) { var type = ordered ? 'ol' : 'ul', startatt = ordered && start !== 1 ? ' start="' + start + '"' : ''; return '<' + type + startatt + '>\n' + body + '\n'; }; _proto.listitem = function listitem(text) { return '
  • ' + text + '
  • \n'; }; _proto.checkbox = function checkbox(checked) { return ' '; }; _proto.paragraph = function paragraph(text) { return '

    ' + text + '

    \n'; }; _proto.table = function table(header, body) { if (body) body = '' + body + ''; return '\n' + '\n' + header + '\n' + body + '
    \n'; }; _proto.tablerow = function tablerow(content) { return '\n' + content + '\n'; }; _proto.tablecell = function tablecell(content, flags) { var type = flags.header ? 'th' : 'td'; var tag = flags.align ? '<' + type + ' align="' + flags.align + '">' : '<' + type + '>'; return tag + content + '\n'; } // span level renderer ; _proto.strong = function strong(text) { return '' + text + ''; }; _proto.em = function em(text) { return '' + text + ''; }; _proto.codespan = function codespan(text) { return '' + text + ''; }; _proto.br = function br() { return this.options.xhtml ? '
    ' : '
    '; }; _proto.del = function del(text) { return '' + text + ''; }; _proto.link = function link(href, title, text) { href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); if (href === null) { return text; } var out = '
    '; return out; }; _proto.image = function image(href, title, text) { href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); if (href === null) { return text; } var out = '' + text + '' : '>'; return out; }; _proto.text = function text(_text) { return _text; }; return Renderer; }(); /** * TextRenderer * returns only the textual part of the token */ var TextRenderer_1 = /*#__PURE__*/function () { function TextRenderer() {} var _proto = TextRenderer.prototype; // no need for block level renderers _proto.strong = function strong(text) { return text; }; _proto.em = function em(text) { return text; }; _proto.codespan = function codespan(text) { return text; }; _proto.del = function del(text) { return text; }; _proto.html = function html(text) { return text; }; _proto.text = function text(_text) { return _text; }; _proto.link = function link(href, title, text) { return '' + text; }; _proto.image = function image(href, title, text) { return '' + text; }; _proto.br = function br() { return ''; }; return TextRenderer; }(); /** * Slugger generates header id */ var Slugger_1 = /*#__PURE__*/function () { function Slugger() { this.seen = {}; } var _proto = Slugger.prototype; _proto.serialize = function serialize(value) { return value.toLowerCase().trim() // remove html tags .replace(/<[!\/a-z].*?>/ig, '') // remove unwanted chars .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '').replace(/\s/g, '-'); } /** * Finds the next safe (unique) slug to use */ ; _proto.getNextSafeSlug = function getNextSafeSlug(originalSlug, isDryRun) { var slug = originalSlug; var occurenceAccumulator = 0; if (this.seen.hasOwnProperty(slug)) { occurenceAccumulator = this.seen[originalSlug]; do { occurenceAccumulator++; slug = originalSlug + '-' + occurenceAccumulator; } while (this.seen.hasOwnProperty(slug)); } if (!isDryRun) { this.seen[originalSlug] = occurenceAccumulator; this.seen[slug] = 0; } return slug; } /** * Convert string to unique id * @param {object} options * @param {boolean} options.dryrun Generates the next unique slug without updating the internal accumulator. */ ; _proto.slug = function slug(value, options) { if (options === void 0) { options = {}; } var slug = this.serialize(value); return this.getNextSafeSlug(slug, options.dryrun); }; return Slugger; }(); var Renderer$1 = Renderer_1; var TextRenderer$1 = TextRenderer_1; var Slugger$1 = Slugger_1; var defaults$1 = defaults$5.exports.defaults; var unescape = helpers.unescape; /** * Parsing & Compiling */ var Parser_1 = /*#__PURE__*/function () { function Parser(options) { this.options = options || defaults$1; this.options.renderer = this.options.renderer || new Renderer$1(); this.renderer = this.options.renderer; this.renderer.options = this.options; this.textRenderer = new TextRenderer$1(); this.slugger = new Slugger$1(); } /** * Static Parse Method */ Parser.parse = function parse(tokens, options) { var parser = new Parser(options); return parser.parse(tokens); } /** * Static Parse Inline Method */ ; Parser.parseInline = function parseInline(tokens, options) { var parser = new Parser(options); return parser.parseInline(tokens); } /** * Parse Loop */ ; var _proto = Parser.prototype; _proto.parse = function parse(tokens, top) { if (top === void 0) { top = true; } var out = '', i, j, k, l2, l3, row, cell, header, body, token, ordered, start, loose, itemBody, item, checked, task, checkbox, ret; var l = tokens.length; for (i = 0; i < l; i++) { token = tokens[i]; // Run any renderer extensions if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) { ret = this.options.extensions.renderers[token.type].call({ parser: this }, token); if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) { out += ret || ''; continue; } } switch (token.type) { case 'space': { continue; } case 'hr': { out += this.renderer.hr(); continue; } case 'heading': { out += this.renderer.heading(this.parseInline(token.tokens), token.depth, unescape(this.parseInline(token.tokens, this.textRenderer)), this.slugger); continue; } case 'code': { out += this.renderer.code(token.text, token.lang, token.escaped); continue; } case 'table': { header = ''; // header cell = ''; l2 = token.header.length; for (j = 0; j < l2; j++) { cell += this.renderer.tablecell(this.parseInline(token.header[j].tokens), { header: true, align: token.align[j] }); } header += this.renderer.tablerow(cell); body = ''; l2 = token.rows.length; for (j = 0; j < l2; j++) { row = token.rows[j]; cell = ''; l3 = row.length; for (k = 0; k < l3; k++) { cell += this.renderer.tablecell(this.parseInline(row[k].tokens), { header: false, align: token.align[k] }); } body += this.renderer.tablerow(cell); } out += this.renderer.table(header, body); continue; } case 'blockquote': { body = this.parse(token.tokens); out += this.renderer.blockquote(body); continue; } case 'list': { ordered = token.ordered; start = token.start; loose = token.loose; l2 = token.items.length; body = ''; for (j = 0; j < l2; j++) { item = token.items[j]; checked = item.checked; task = item.task; itemBody = ''; if (item.task) { checkbox = this.renderer.checkbox(checked); if (loose) { if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') { item.tokens[0].text = checkbox + ' ' + item.tokens[0].text; if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') { item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text; } } else { item.tokens.unshift({ type: 'text', text: checkbox }); } } else { itemBody += checkbox; } } itemBody += this.parse(item.tokens, loose); body += this.renderer.listitem(itemBody, task, checked); } out += this.renderer.list(body, ordered, start); continue; } case 'html': { // TODO parse inline content if parameter markdown=1 out += this.renderer.html(token.text); continue; } case 'paragraph': { out += this.renderer.paragraph(this.parseInline(token.tokens)); continue; } case 'text': { body = token.tokens ? this.parseInline(token.tokens) : token.text; while (i + 1 < l && tokens[i + 1].type === 'text') { token = tokens[++i]; body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text); } out += top ? this.renderer.paragraph(body) : body; continue; } default: { var errMsg = 'Token with "' + token.type + '" type was not found.'; if (this.options.silent) { console.error(errMsg); return; } else { throw new Error(errMsg); } } } } return out; } /** * Parse Inline Tokens */ ; _proto.parseInline = function parseInline(tokens, renderer) { renderer = renderer || this.renderer; var out = '', i, token, ret; var l = tokens.length; for (i = 0; i < l; i++) { token = tokens[i]; // Run any renderer extensions if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) { ret = this.options.extensions.renderers[token.type].call({ parser: this }, token); if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) { out += ret || ''; continue; } } switch (token.type) { case 'escape': { out += renderer.text(token.text); break; } case 'html': { out += renderer.html(token.text); break; } case 'link': { out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer)); break; } case 'image': { out += renderer.image(token.href, token.title, token.text); break; } case 'strong': { out += renderer.strong(this.parseInline(token.tokens, renderer)); break; } case 'em': { out += renderer.em(this.parseInline(token.tokens, renderer)); break; } case 'codespan': { out += renderer.codespan(token.text); break; } case 'br': { out += renderer.br(); break; } case 'del': { out += renderer.del(this.parseInline(token.tokens, renderer)); break; } case 'text': { out += renderer.text(token.text); break; } default: { var errMsg = 'Token with "' + token.type + '" type was not found.'; if (this.options.silent) { console.error(errMsg); return; } else { throw new Error(errMsg); } } } } return out; }; return Parser; }(); var Lexer = Lexer_1; var Parser = Parser_1; var Tokenizer = Tokenizer_1; var Renderer = Renderer_1; var TextRenderer = TextRenderer_1; var Slugger = Slugger_1; var merge = helpers.merge, checkSanitizeDeprecation = helpers.checkSanitizeDeprecation, escape = helpers.escape; var getDefaults = defaults$5.exports.getDefaults, changeDefaults = defaults$5.exports.changeDefaults, defaults = defaults$5.exports.defaults; /** * Marked */ function marked(src, opt, callback) { // throw error in case of non string input if (typeof src === 'undefined' || src === null) { throw new Error('marked(): input parameter is undefined or null'); } if (typeof src !== 'string') { throw new Error('marked(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected'); } if (typeof opt === 'function') { callback = opt; opt = null; } opt = merge({}, marked.defaults, opt || {}); checkSanitizeDeprecation(opt); if (callback) { var highlight = opt.highlight; var tokens; try { tokens = Lexer.lex(src, opt); } catch (e) { return callback(e); } var done = function done(err) { var out; if (!err) { try { if (opt.walkTokens) { marked.walkTokens(tokens, opt.walkTokens); } out = Parser.parse(tokens, opt); } catch (e) { err = e; } } opt.highlight = highlight; return err ? callback(err) : callback(null, out); }; if (!highlight || highlight.length < 3) { return done(); } delete opt.highlight; if (!tokens.length) return done(); var pending = 0; marked.walkTokens(tokens, function (token) { if (token.type === 'code') { pending++; setTimeout(function () { highlight(token.text, token.lang, function (err, code) { if (err) { return done(err); } if (code != null && code !== token.text) { token.text = code; token.escaped = true; } pending--; if (pending === 0) { done(); } }); }, 0); } }); if (pending === 0) { done(); } return; } try { var _tokens = Lexer.lex(src, opt); if (opt.walkTokens) { marked.walkTokens(_tokens, opt.walkTokens); } return Parser.parse(_tokens, opt); } catch (e) { e.message += '\nPlease report this to https://github.com/markedjs/marked.'; if (opt.silent) { return '

    An error occurred:

    ' + escape(e.message + '', true) + '
    '; } throw e; } } /** * Options */ marked.options = marked.setOptions = function (opt) { merge(marked.defaults, opt); changeDefaults(marked.defaults); return marked; }; marked.getDefaults = getDefaults; marked.defaults = defaults; /** * Use Extension */ marked.use = function () { var _this = this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var opts = merge.apply(void 0, [{}].concat(args)); var extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} }; var hasExtensions; args.forEach(function (pack) { // ==-- Parse "addon" extensions --== // if (pack.extensions) { hasExtensions = true; pack.extensions.forEach(function (ext) { if (!ext.name) { throw new Error('extension name required'); } if (ext.renderer) { // Renderer extensions var prevRenderer = extensions.renderers ? extensions.renderers[ext.name] : null; if (prevRenderer) { // Replace extension with func to run new extension but fall back if false extensions.renderers[ext.name] = function () { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } var ret = ext.renderer.apply(this, args); if (ret === false) { ret = prevRenderer.apply(this, args); } return ret; }; } else { extensions.renderers[ext.name] = ext.renderer; } } if (ext.tokenizer) { // Tokenizer Extensions if (!ext.level || ext.level !== 'block' && ext.level !== 'inline') { throw new Error("extension level must be 'block' or 'inline'"); } if (extensions[ext.level]) { extensions[ext.level].unshift(ext.tokenizer); } else { extensions[ext.level] = [ext.tokenizer]; } if (ext.start) { // Function to check for start of token if (ext.level === 'block') { if (extensions.startBlock) { extensions.startBlock.push(ext.start); } else { extensions.startBlock = [ext.start]; } } else if (ext.level === 'inline') { if (extensions.startInline) { extensions.startInline.push(ext.start); } else { extensions.startInline = [ext.start]; } } } } if (ext.childTokens) { // Child tokens to be visited by walkTokens extensions.childTokens[ext.name] = ext.childTokens; } }); } // ==-- Parse "overwrite" extensions --== // if (pack.renderer) { (function () { var renderer = marked.defaults.renderer || new Renderer(); var _loop = function _loop(prop) { var prevRenderer = renderer[prop]; // Replace renderer with func to run extension, but fall back if false renderer[prop] = function () { for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } var ret = pack.renderer[prop].apply(renderer, args); if (ret === false) { ret = prevRenderer.apply(renderer, args); } return ret; }; }; for (var prop in pack.renderer) { _loop(prop); } opts.renderer = renderer; })(); } if (pack.tokenizer) { (function () { var tokenizer = marked.defaults.tokenizer || new Tokenizer(); var _loop2 = function _loop2(prop) { var prevTokenizer = tokenizer[prop]; // Replace tokenizer with func to run extension, but fall back if false tokenizer[prop] = function () { for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { args[_key4] = arguments[_key4]; } var ret = pack.tokenizer[prop].apply(tokenizer, args); if (ret === false) { ret = prevTokenizer.apply(tokenizer, args); } return ret; }; }; for (var prop in pack.tokenizer) { _loop2(prop); } opts.tokenizer = tokenizer; })(); } // ==-- Parse WalkTokens extensions --== // if (pack.walkTokens) { var walkTokens = marked.defaults.walkTokens; opts.walkTokens = function (token) { pack.walkTokens.call(_this, token); if (walkTokens) { walkTokens(token); } }; } if (hasExtensions) { opts.extensions = extensions; } marked.setOptions(opts); }); }; /** * Run callback for every token */ marked.walkTokens = function (tokens, callback) { var _loop3 = function _loop3() { var token = _step.value; callback(token); switch (token.type) { case 'table': { for (var _iterator2 = _createForOfIteratorHelperLoose(token.header), _step2; !(_step2 = _iterator2()).done;) { var cell = _step2.value; marked.walkTokens(cell.tokens, callback); } for (var _iterator3 = _createForOfIteratorHelperLoose(token.rows), _step3; !(_step3 = _iterator3()).done;) { var row = _step3.value; for (var _iterator4 = _createForOfIteratorHelperLoose(row), _step4; !(_step4 = _iterator4()).done;) { var _cell = _step4.value; marked.walkTokens(_cell.tokens, callback); } } break; } case 'list': { marked.walkTokens(token.items, callback); break; } default: { if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions marked.defaults.extensions.childTokens[token.type].forEach(function (childTokens) { marked.walkTokens(token[childTokens], callback); }); } else if (token.tokens) { marked.walkTokens(token.tokens, callback); } } } }; for (var _iterator = _createForOfIteratorHelperLoose(tokens), _step; !(_step = _iterator()).done;) { _loop3(); } }; /** * Parse Inline */ marked.parseInline = function (src, opt) { // throw error in case of non string input if (typeof src === 'undefined' || src === null) { throw new Error('marked.parseInline(): input parameter is undefined or null'); } if (typeof src !== 'string') { throw new Error('marked.parseInline(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected'); } opt = merge({}, marked.defaults, opt || {}); checkSanitizeDeprecation(opt); try { var tokens = Lexer.lexInline(src, opt); if (opt.walkTokens) { marked.walkTokens(tokens, opt.walkTokens); } return Parser.parseInline(tokens, opt); } catch (e) { e.message += '\nPlease report this to https://github.com/markedjs/marked.'; if (opt.silent) { return '

    An error occurred:

    ' + escape(e.message + '', true) + '
    '; } throw e; } }; /** * Expose */ marked.Parser = Parser; marked.parser = Parser.parse; marked.Renderer = Renderer; marked.TextRenderer = TextRenderer; marked.Lexer = Lexer; marked.lexer = Lexer.lex; marked.Tokenizer = Tokenizer; marked.Slugger = Slugger; marked.parse = marked; var marked_1 = marked; return marked_1; }))); // ESM-uncomment-begin })(); var marked = (/* unused pure expression or super */ null && (__marked_exports)); var Parser = __marked_exports.Parser; var parser = __marked_exports.parser; var Renderer = __marked_exports.Renderer; var TextRenderer = __marked_exports.TextRenderer; var Lexer = __marked_exports.Lexer; var lexer = __marked_exports.lexer; var Tokenizer = __marked_exports.Tokenizer; var Slugger = __marked_exports.Slugger; var parse = __marked_exports.parse; // ESM-uncomment-end /***/ }), /***/ 96211: /*!********************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/marshalling.js ***! \********************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Q: function() { return /* binding */ parse; } /* harmony export */ }); /* unused harmony export revive */ /* harmony import */ var _buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./buffer.js */ 90794); /* harmony import */ var _uri_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uri.js */ 5472); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function parse(text) { let data = JSON.parse(text); data = revive(data); return data; } function revive(obj, depth = 0) { if (!obj || depth > 200) { return obj; } if (typeof obj === 'object') { switch (obj.$mid) { case 1 /* Uri */: return _uri_js__WEBPACK_IMPORTED_MODULE_1__/* .URI */ .o.revive(obj); case 2 /* Regexp */: return new RegExp(obj.source, obj.flags); } if (obj instanceof _buffer_js__WEBPACK_IMPORTED_MODULE_0__/* .VSBuffer */ .KN || obj instanceof Uint8Array) { return obj; } if (Array.isArray(obj)) { for (let i = 0; i < obj.length; ++i) { obj[i] = revive(obj[i], depth + 1); } } else { // walk object for (const key in obj) { if (Object.hasOwnProperty.call(obj, key)) { obj[key] = revive(obj[key], depth + 1); } } } } return obj; } /***/ }), /***/ 8473: /*!*************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/mime.js ***! \*************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ G8: function() { return /* binding */ guessMimeTypes; }, /* harmony export */ bS: function() { return /* binding */ clearTextMimes; }, /* harmony export */ sA: function() { return /* binding */ registerTextMime; }, /* harmony export */ vW: function() { return /* binding */ Mimes; } /* harmony export */ }); /* harmony import */ var _glob_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./glob.js */ 63224); /* harmony import */ var _network_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./network.js */ 66657); /* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./path.js */ 86408); /* harmony import */ var _resources_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./resources.js */ 9365); /* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./strings.js */ 82983); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var Mimes; (function (Mimes) { Mimes.text = 'text/plain'; Mimes.binary = 'application/octet-stream'; Mimes.unknown = 'application/unknown'; Mimes.markdown = 'text/markdown'; Mimes.latex = 'text/latex'; })(Mimes || (Mimes = {})); let registeredAssociations = []; let nonUserRegisteredAssociations = []; let userRegisteredAssociations = []; /** * Associate a text mime to the registry. */ function registerTextMime(association, warnOnOverwrite = false) { // Register const associationItem = toTextMimeAssociationItem(association); registeredAssociations.push(associationItem); if (!associationItem.userConfigured) { nonUserRegisteredAssociations.push(associationItem); } else { userRegisteredAssociations.push(associationItem); } // Check for conflicts unless this is a user configured association if (warnOnOverwrite && !associationItem.userConfigured) { registeredAssociations.forEach(a => { if (a.mime === associationItem.mime || a.userConfigured) { return; // same mime or userConfigured is ok } if (associationItem.extension && a.extension === associationItem.extension) { console.warn(`Overwriting extension <<${associationItem.extension}>> to now point to mime <<${associationItem.mime}>>`); } if (associationItem.filename && a.filename === associationItem.filename) { console.warn(`Overwriting filename <<${associationItem.filename}>> to now point to mime <<${associationItem.mime}>>`); } if (associationItem.filepattern && a.filepattern === associationItem.filepattern) { console.warn(`Overwriting filepattern <<${associationItem.filepattern}>> to now point to mime <<${associationItem.mime}>>`); } if (associationItem.firstline && a.firstline === associationItem.firstline) { console.warn(`Overwriting firstline <<${associationItem.firstline}>> to now point to mime <<${associationItem.mime}>>`); } }); } } function toTextMimeAssociationItem(association) { return { id: association.id, mime: association.mime, filename: association.filename, extension: association.extension, filepattern: association.filepattern, firstline: association.firstline, userConfigured: association.userConfigured, filenameLowercase: association.filename ? association.filename.toLowerCase() : undefined, extensionLowercase: association.extension ? association.extension.toLowerCase() : undefined, filepatternLowercase: association.filepattern ? (0,_glob_js__WEBPACK_IMPORTED_MODULE_0__/* .parse */ .Qc)(association.filepattern.toLowerCase()) : undefined, filepatternOnPath: association.filepattern ? association.filepattern.indexOf(_path_js__WEBPACK_IMPORTED_MODULE_2__/* .posix */ .KR.sep) >= 0 : false }; } /** * Clear text mimes from the registry. */ function clearTextMimes(onlyUserConfigured) { if (!onlyUserConfigured) { registeredAssociations = []; nonUserRegisteredAssociations = []; userRegisteredAssociations = []; } else { registeredAssociations = registeredAssociations.filter(a => !a.userConfigured); userRegisteredAssociations = []; } } /** * Given a file, return the best matching mime type for it */ function guessMimeTypes(resource, firstLine) { let path; if (resource) { switch (resource.scheme) { case _network_js__WEBPACK_IMPORTED_MODULE_1__/* .Schemas */ .lg.file: path = resource.fsPath; break; case _network_js__WEBPACK_IMPORTED_MODULE_1__/* .Schemas */ .lg.data: const metadata = _resources_js__WEBPACK_IMPORTED_MODULE_3__/* .DataUri */ .Vb.parseMetaData(resource); path = metadata.get(_resources_js__WEBPACK_IMPORTED_MODULE_3__/* .DataUri */ .Vb.META_DATA_LABEL); break; default: path = resource.path; } } if (!path) { return [Mimes.unknown]; } path = path.toLowerCase(); const filename = (0,_path_js__WEBPACK_IMPORTED_MODULE_2__/* .basename */ .EZ)(path); // 1.) User configured mappings have highest priority const configuredMime = guessMimeTypeByPath(path, filename, userRegisteredAssociations); if (configuredMime) { return [configuredMime, Mimes.text]; } // 2.) Registered mappings have middle priority const registeredMime = guessMimeTypeByPath(path, filename, nonUserRegisteredAssociations); if (registeredMime) { return [registeredMime, Mimes.text]; } // 3.) Firstline has lowest priority if (firstLine) { const firstlineMime = guessMimeTypeByFirstline(firstLine); if (firstlineMime) { return [firstlineMime, Mimes.text]; } } return [Mimes.unknown]; } function guessMimeTypeByPath(path, filename, associations) { var _a; let filenameMatch = null; let patternMatch = null; let extensionMatch = null; // We want to prioritize associations based on the order they are registered so that the last registered // association wins over all other. This is for https://github.com/microsoft/vscode/issues/20074 for (let i = associations.length - 1; i >= 0; i--) { const association = associations[i]; // First exact name match if (filename === association.filenameLowercase) { filenameMatch = association; break; // take it! } // Longest pattern match if (association.filepattern) { if (!patternMatch || association.filepattern.length > patternMatch.filepattern.length) { const target = association.filepatternOnPath ? path : filename; // match on full path if pattern contains path separator if ((_a = association.filepatternLowercase) === null || _a === void 0 ? void 0 : _a.call(association, target)) { patternMatch = association; } } } // Longest extension match if (association.extension) { if (!extensionMatch || association.extension.length > extensionMatch.extension.length) { if (filename.endsWith(association.extensionLowercase)) { extensionMatch = association; } } } } // 1.) Exact name match has second highest priority if (filenameMatch) { return filenameMatch.mime; } // 2.) Match on pattern if (patternMatch) { return patternMatch.mime; } // 3.) Match on extension comes next if (extensionMatch) { return extensionMatch.mime; } return null; } function guessMimeTypeByFirstline(firstLine) { if ((0,_strings_js__WEBPACK_IMPORTED_MODULE_4__/* .startsWithUTF8BOM */ .uS)(firstLine)) { firstLine = firstLine.substr(1); } if (firstLine.length > 0) { // We want to prioritize associations based on the order they are registered so that the last registered // association wins over all other. This is for https://github.com/microsoft/vscode/issues/20074 for (let i = registeredAssociations.length - 1; i >= 0; i--) { const association = registeredAssociations[i]; if (!association.firstline) { continue; } const matches = firstLine.match(association.firstline); if (matches && matches.length > 0) { return association.mime; } } } return null; } /***/ }), /***/ 66657: /*!****************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/network.js ***! \****************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Gi: function() { return /* binding */ FileAccess; }, /* harmony export */ WX: function() { return /* binding */ RemoteAuthorities; }, /* harmony export */ lg: function() { return /* binding */ Schemas; } /* harmony export */ }); /* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ 23345); /* harmony import */ var _uri_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uri.js */ 5472); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var Schemas; (function (Schemas) { /** * A schema that is used for models that exist in memory * only and that have no correspondence on a server or such. */ Schemas.inMemory = 'inmemory'; /** * A schema that is used for setting files */ Schemas.vscode = 'vscode'; /** * A schema that is used for internal private files */ Schemas.internal = 'private'; /** * A walk-through document. */ Schemas.walkThrough = 'walkThrough'; /** * An embedded code snippet. */ Schemas.walkThroughSnippet = 'walkThroughSnippet'; Schemas.http = 'http'; Schemas.https = 'https'; Schemas.file = 'file'; Schemas.mailto = 'mailto'; Schemas.untitled = 'untitled'; Schemas.data = 'data'; Schemas.command = 'command'; Schemas.vscodeRemote = 'vscode-remote'; Schemas.vscodeRemoteResource = 'vscode-remote-resource'; Schemas.userData = 'vscode-userdata'; Schemas.vscodeCustomEditor = 'vscode-custom-editor'; Schemas.vscodeNotebook = 'vscode-notebook'; Schemas.vscodeNotebookCell = 'vscode-notebook-cell'; Schemas.vscodeNotebookCellMetadata = 'vscode-notebook-cell-metadata'; Schemas.vscodeNotebookCellOutput = 'vscode-notebook-cell-output'; Schemas.vscodeInteractive = 'vscode-interactive'; Schemas.vscodeInteractiveInput = 'vscode-interactive-input'; Schemas.vscodeSettings = 'vscode-settings'; Schemas.vscodeWorkspaceTrust = 'vscode-workspace-trust'; Schemas.vscodeTerminal = 'vscode-terminal'; Schemas.webviewPanel = 'webview-panel'; /** * Scheme used for loading the wrapper html and script in webviews. */ Schemas.vscodeWebview = 'vscode-webview'; /** * Scheme used for extension pages */ Schemas.extension = 'extension'; /** * Scheme used as a replacement of `file` scheme to load * files with our custom protocol handler (desktop only). */ Schemas.vscodeFileResource = 'vscode-file'; /** * Scheme used for temporary resources */ Schemas.tmp = 'tmp'; })(Schemas || (Schemas = {})); class RemoteAuthoritiesImpl { constructor() { this._hosts = Object.create(null); this._ports = Object.create(null); this._connectionTokens = Object.create(null); this._preferredWebSchema = 'http'; this._delegate = null; } setPreferredWebSchema(schema) { this._preferredWebSchema = schema; } rewrite(uri) { if (this._delegate) { return this._delegate(uri); } const authority = uri.authority; let host = this._hosts[authority]; if (host && host.indexOf(':') !== -1) { host = `[${host}]`; } const port = this._ports[authority]; const connectionToken = this._connectionTokens[authority]; let query = `path=${encodeURIComponent(uri.path)}`; if (typeof connectionToken === 'string') { query += `&tkn=${encodeURIComponent(connectionToken)}`; } return _uri_js__WEBPACK_IMPORTED_MODULE_1__/* .URI */ .o.from({ scheme: _platform_js__WEBPACK_IMPORTED_MODULE_0__/* .isWeb */ .$L ? this._preferredWebSchema : Schemas.vscodeRemoteResource, authority: `${host}:${port}`, path: `/vscode-remote-resource`, query }); } } const RemoteAuthorities = new RemoteAuthoritiesImpl(); class FileAccessImpl { asBrowserUri(uriOrModule, moduleIdToUrl) { const uri = this.toUri(uriOrModule, moduleIdToUrl); // Handle remote URIs via `RemoteAuthorities` if (uri.scheme === Schemas.vscodeRemote) { return RemoteAuthorities.rewrite(uri); } // Convert to `vscode-file` resource.. if ( // ...only ever for `file` resources uri.scheme === Schemas.file && ( // ...and we run in native environments _platform_js__WEBPACK_IMPORTED_MODULE_0__/* .isNative */ .tY || // ...or web worker extensions on desktop (typeof _platform_js__WEBPACK_IMPORTED_MODULE_0__/* .globals */ .li.importScripts === 'function' && _platform_js__WEBPACK_IMPORTED_MODULE_0__/* .globals */ .li.origin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`))) { return uri.with({ scheme: Schemas.vscodeFileResource, // We need to provide an authority here so that it can serve // as origin for network and loading matters in chromium. // If the URI is not coming with an authority already, we // add our own authority: uri.authority || FileAccessImpl.FALLBACK_AUTHORITY, query: null, fragment: null }); } return uri; } toUri(uriOrModule, moduleIdToUrl) { if (_uri_js__WEBPACK_IMPORTED_MODULE_1__/* .URI */ .o.isUri(uriOrModule)) { return uriOrModule; } return _uri_js__WEBPACK_IMPORTED_MODULE_1__/* .URI */ .o.parse(moduleIdToUrl.toUrl(uriOrModule)); } } FileAccessImpl.FALLBACK_AUTHORITY = 'vscode-app'; const FileAccess = new FileAccessImpl(); /***/ }), /***/ 56722: /*!****************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/numbers.js ***! \****************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ n: function() { return /* binding */ MovingAverage; }, /* harmony export */ u: function() { return /* binding */ clamp; } /* harmony export */ }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function clamp(value, min, max) { return Math.min(Math.max(value, min), max); } class MovingAverage { constructor() { this._n = 1; this._val = 0; } update(value) { this._val = this._val + (value - this._val) / this._n; this._n += 1; return this; } get value() { return this._val; } } /***/ }), /***/ 80470: /*!****************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/objects.js ***! \****************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CJ: function() { return /* binding */ getOrDefault; }, /* harmony export */ I8: function() { return /* binding */ deepClone; }, /* harmony export */ _A: function() { return /* binding */ deepFreeze; }, /* harmony export */ fS: function() { return /* binding */ equals; }, /* harmony export */ jB: function() { return /* binding */ mixin; }, /* harmony export */ rs: function() { return /* binding */ cloneAndChange; } /* harmony export */ }); /* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types.js */ 72999); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function deepClone(obj) { if (!obj || typeof obj !== 'object') { return obj; } if (obj instanceof RegExp) { // See https://github.com/microsoft/TypeScript/issues/10990 return obj; } const result = Array.isArray(obj) ? [] : {}; Object.keys(obj).forEach((key) => { if (obj[key] && typeof obj[key] === 'object') { result[key] = deepClone(obj[key]); } else { result[key] = obj[key]; } }); return result; } function deepFreeze(obj) { if (!obj || typeof obj !== 'object') { return obj; } const stack = [obj]; while (stack.length > 0) { const obj = stack.shift(); Object.freeze(obj); for (const key in obj) { if (_hasOwnProperty.call(obj, key)) { const prop = obj[key]; if (typeof prop === 'object' && !Object.isFrozen(prop)) { stack.push(prop); } } } } return obj; } const _hasOwnProperty = Object.prototype.hasOwnProperty; function cloneAndChange(obj, changer) { return _cloneAndChange(obj, changer, new Set()); } function _cloneAndChange(obj, changer, seen) { if ((0,_types_js__WEBPACK_IMPORTED_MODULE_0__/* .isUndefinedOrNull */ .Jp)(obj)) { return obj; } const changed = changer(obj); if (typeof changed !== 'undefined') { return changed; } if ((0,_types_js__WEBPACK_IMPORTED_MODULE_0__/* .isArray */ .kJ)(obj)) { const r1 = []; for (const e of obj) { r1.push(_cloneAndChange(e, changer, seen)); } return r1; } if ((0,_types_js__WEBPACK_IMPORTED_MODULE_0__/* .isObject */ .Kn)(obj)) { if (seen.has(obj)) { throw new Error('Cannot clone recursive data-structure'); } seen.add(obj); const r2 = {}; for (let i2 in obj) { if (_hasOwnProperty.call(obj, i2)) { r2[i2] = _cloneAndChange(obj[i2], changer, seen); } } seen.delete(obj); return r2; } return obj; } /** * Copies all properties of source into destination. The optional parameter "overwrite" allows to control * if existing properties on the destination should be overwritten or not. Defaults to true (overwrite). */ function mixin(destination, source, overwrite = true) { if (!(0,_types_js__WEBPACK_IMPORTED_MODULE_0__/* .isObject */ .Kn)(destination)) { return source; } if ((0,_types_js__WEBPACK_IMPORTED_MODULE_0__/* .isObject */ .Kn)(source)) { Object.keys(source).forEach(key => { if (key in destination) { if (overwrite) { if ((0,_types_js__WEBPACK_IMPORTED_MODULE_0__/* .isObject */ .Kn)(destination[key]) && (0,_types_js__WEBPACK_IMPORTED_MODULE_0__/* .isObject */ .Kn)(source[key])) { mixin(destination[key], source[key], overwrite); } else { destination[key] = source[key]; } } } else { destination[key] = source[key]; } }); } return destination; } function equals(one, other) { if (one === other) { return true; } if (one === null || one === undefined || other === null || other === undefined) { return false; } if (typeof one !== typeof other) { return false; } if (typeof one !== 'object') { return false; } if ((Array.isArray(one)) !== (Array.isArray(other))) { return false; } let i; let key; if (Array.isArray(one)) { if (one.length !== other.length) { return false; } for (i = 0; i < one.length; i++) { if (!equals(one[i], other[i])) { return false; } } } else { const oneKeys = []; for (key in one) { oneKeys.push(key); } oneKeys.sort(); const otherKeys = []; for (key in other) { otherKeys.push(key); } otherKeys.sort(); if (!equals(oneKeys, otherKeys)) { return false; } for (i = 0; i < oneKeys.length; i++) { if (!equals(one[oneKeys[i]], other[oneKeys[i]])) { return false; } } } return true; } function getOrDefault(obj, fn, defaultValue) { const result = fn(obj); return typeof result === 'undefined' ? defaultValue : result; } /***/ }), /***/ 86408: /*!*************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/path.js + 1 modules ***! \*************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { EZ: function() { return /* binding */ basename; }, XX: function() { return /* binding */ dirname; }, DZ: function() { return /* binding */ extname; }, Fv: function() { return /* binding */ normalize; }, KR: function() { return /* binding */ posix; }, Gf: function() { return /* binding */ relative; }, DB: function() { return /* binding */ resolve; }, ir: function() { return /* binding */ sep; }, Ku: function() { return /* binding */ win32; } }); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/platform.js var platform = __webpack_require__(23345); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/process.js /* provided dependency */ var process = __webpack_require__(/*! ./node_modules/_process@0.11.10@process/browser.js */ 97671); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ let safeProcess; // Native sandbox environment if (typeof platform/* globals */.li.vscode !== 'undefined' && typeof platform/* globals */.li.vscode.process !== 'undefined') { const sandboxProcess = platform/* globals */.li.vscode.process; safeProcess = { get platform() { return sandboxProcess.platform; }, get arch() { return sandboxProcess.arch; }, get env() { return sandboxProcess.env; }, cwd() { return sandboxProcess.cwd(); }, nextTick(callback) { return (0,platform/* setImmediate */.xS)(callback); } }; } // Native node.js environment else if (typeof process !== 'undefined') { safeProcess = { get platform() { return process.platform; }, get arch() { return process.arch; }, get env() { return ({"NODE_ENV":"production","PUBLIC_PATH":"/react/build/"}); }, cwd() { return ({"NODE_ENV":"production","PUBLIC_PATH":"/react/build/"})['VSCODE_CWD'] || process.cwd(); }, nextTick(callback) { return process.nextTick(callback); } }; } // Web environment else { safeProcess = { // Supported get platform() { return platform/* isWindows */.ED ? 'win32' : platform/* isMacintosh */.dz ? 'darwin' : 'linux'; }, get arch() { return undefined; /* arch is undefined in web */ }, nextTick(callback) { return (0,platform/* setImmediate */.xS)(callback); }, // Unsupported get env() { return {}; }, cwd() { return '/'; } }; } /** * Provides safe access to the `cwd` property in node.js, sandboxed or web * environments. * * Note: in web, this property is hardcoded to be `/`. */ const cwd = safeProcess.cwd; /** * Provides safe access to the `env` property in node.js, sandboxed or web * environments. * * Note: in web, this property is hardcoded to be `{}`. */ const env = safeProcess.env; /** * Provides safe access to the `platform` property in node.js, sandboxed or web * environments. */ const process_platform = safeProcess.platform; ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/path.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // NOTE: VSCode's copy of nodejs path library to be usable in common (non-node) namespace // Copied from: https://github.com/nodejs/node/blob/v14.16.0/lib/path.js /** * Copyright Joyent, Inc. and other Node contributors. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the * following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ const CHAR_UPPERCASE_A = 65; /* A */ const CHAR_LOWERCASE_A = 97; /* a */ const CHAR_UPPERCASE_Z = 90; /* Z */ const CHAR_LOWERCASE_Z = 122; /* z */ const CHAR_DOT = 46; /* . */ const CHAR_FORWARD_SLASH = 47; /* / */ const CHAR_BACKWARD_SLASH = 92; /* \ */ const CHAR_COLON = 58; /* : */ const CHAR_QUESTION_MARK = 63; /* ? */ class ErrorInvalidArgType extends Error { constructor(name, expected, actual) { // determiner: 'must be' or 'must not be' let determiner; if (typeof expected === 'string' && expected.indexOf('not ') === 0) { determiner = 'must not be'; expected = expected.replace(/^not /, ''); } else { determiner = 'must be'; } const type = name.indexOf('.') !== -1 ? 'property' : 'argument'; let msg = `The "${name}" ${type} ${determiner} of type ${expected}`; msg += `. Received type ${typeof actual}`; super(msg); this.code = 'ERR_INVALID_ARG_TYPE'; } } function validateString(value, name) { if (typeof value !== 'string') { throw new ErrorInvalidArgType(name, 'string', value); } } function isPathSeparator(code) { return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; } function isPosixPathSeparator(code) { return code === CHAR_FORWARD_SLASH; } function isWindowsDeviceRoot(code) { return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) || (code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z); } // Resolves . and .. elements in a path with directory names function normalizeString(path, allowAboveRoot, separator, isPathSeparator) { let res = ''; let lastSegmentLength = 0; let lastSlash = -1; let dots = 0; let code = 0; for (let i = 0; i <= path.length; ++i) { if (i < path.length) { code = path.charCodeAt(i); } else if (isPathSeparator(code)) { break; } else { code = CHAR_FORWARD_SLASH; } if (isPathSeparator(code)) { if (lastSlash === i - 1 || dots === 1) { // NOOP } else if (dots === 2) { if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) { if (res.length > 2) { const lastSlashIndex = res.lastIndexOf(separator); if (lastSlashIndex === -1) { res = ''; lastSegmentLength = 0; } else { res = res.slice(0, lastSlashIndex); lastSegmentLength = res.length - 1 - res.lastIndexOf(separator); } lastSlash = i; dots = 0; continue; } else if (res.length !== 0) { res = ''; lastSegmentLength = 0; lastSlash = i; dots = 0; continue; } } if (allowAboveRoot) { res += res.length > 0 ? `${separator}..` : '..'; lastSegmentLength = 2; } } else { if (res.length > 0) { res += `${separator}${path.slice(lastSlash + 1, i)}`; } else { res = path.slice(lastSlash + 1, i); } lastSegmentLength = i - lastSlash - 1; } lastSlash = i; dots = 0; } else if (code === CHAR_DOT && dots !== -1) { ++dots; } else { dots = -1; } } return res; } function _format(sep, pathObject) { if (pathObject === null || typeof pathObject !== 'object') { throw new ErrorInvalidArgType('pathObject', 'Object', pathObject); } const dir = pathObject.dir || pathObject.root; const base = pathObject.base || `${pathObject.name || ''}${pathObject.ext || ''}`; if (!dir) { return base; } return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep}${base}`; } const win32 = { // path.resolve([from ...], to) resolve(...pathSegments) { let resolvedDevice = ''; let resolvedTail = ''; let resolvedAbsolute = false; for (let i = pathSegments.length - 1; i >= -1; i--) { let path; if (i >= 0) { path = pathSegments[i]; validateString(path, 'path'); // Skip empty entries if (path.length === 0) { continue; } } else if (resolvedDevice.length === 0) { path = cwd(); } else { // Windows has the concept of drive-specific current working // directories. If we've resolved a drive letter but not yet an // absolute path, get cwd for that drive, or the process cwd if // the drive cwd is not available. We're sure the device is not // a UNC path at this points, because UNC paths are always absolute. path = ({"NODE_ENV":"production","PUBLIC_PATH":"/react/build/"})[`=${resolvedDevice}`] || cwd(); // Verify that a cwd was found and that it actually points // to our drive. If not, default to the drive's root. if (path === undefined || (path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() && path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) { path = `${resolvedDevice}\\`; } } const len = path.length; let rootEnd = 0; let device = ''; let isAbsolute = false; const code = path.charCodeAt(0); // Try to match a root if (len === 1) { if (isPathSeparator(code)) { // `path` contains just a path separator rootEnd = 1; isAbsolute = true; } } else if (isPathSeparator(code)) { // Possible UNC root // If we started with a separator, we know we at least have an // absolute path of some kind (UNC or otherwise) isAbsolute = true; if (isPathSeparator(path.charCodeAt(1))) { // Matched double path separator at beginning let j = 2; let last = j; // Match 1 or more non-path separators while (j < len && !isPathSeparator(path.charCodeAt(j))) { j++; } if (j < len && j !== last) { const firstPart = path.slice(last, j); // Matched! last = j; // Match 1 or more path separators while (j < len && isPathSeparator(path.charCodeAt(j))) { j++; } if (j < len && j !== last) { // Matched! last = j; // Match 1 or more non-path separators while (j < len && !isPathSeparator(path.charCodeAt(j))) { j++; } if (j === len || j !== last) { // We matched a UNC root device = `\\\\${firstPart}\\${path.slice(last, j)}`; rootEnd = j; } } } } else { rootEnd = 1; } } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { // Possible device root device = path.slice(0, 2); rootEnd = 2; if (len > 2 && isPathSeparator(path.charCodeAt(2))) { // Treat separator following drive name as an absolute path // indicator isAbsolute = true; rootEnd = 3; } } if (device.length > 0) { if (resolvedDevice.length > 0) { if (device.toLowerCase() !== resolvedDevice.toLowerCase()) { // This path points to another device so it is not applicable continue; } } else { resolvedDevice = device; } } if (resolvedAbsolute) { if (resolvedDevice.length > 0) { break; } } else { resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`; resolvedAbsolute = isAbsolute; if (isAbsolute && resolvedDevice.length > 0) { break; } } } // At this point the path should be resolved to a full absolute path, // but handle relative paths to be safe (might happen when process.cwd() // fails) // Normalize the tail path resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparator); return resolvedAbsolute ? `${resolvedDevice}\\${resolvedTail}` : `${resolvedDevice}${resolvedTail}` || '.'; }, normalize(path) { validateString(path, 'path'); const len = path.length; if (len === 0) { return '.'; } let rootEnd = 0; let device; let isAbsolute = false; const code = path.charCodeAt(0); // Try to match a root if (len === 1) { // `path` contains just a single char, exit early to avoid // unnecessary work return isPosixPathSeparator(code) ? '\\' : path; } if (isPathSeparator(code)) { // Possible UNC root // If we started with a separator, we know we at least have an absolute // path of some kind (UNC or otherwise) isAbsolute = true; if (isPathSeparator(path.charCodeAt(1))) { // Matched double path separator at beginning let j = 2; let last = j; // Match 1 or more non-path separators while (j < len && !isPathSeparator(path.charCodeAt(j))) { j++; } if (j < len && j !== last) { const firstPart = path.slice(last, j); // Matched! last = j; // Match 1 or more path separators while (j < len && isPathSeparator(path.charCodeAt(j))) { j++; } if (j < len && j !== last) { // Matched! last = j; // Match 1 or more non-path separators while (j < len && !isPathSeparator(path.charCodeAt(j))) { j++; } if (j === len) { // We matched a UNC root only // Return the normalized version of the UNC root since there // is nothing left to process return `\\\\${firstPart}\\${path.slice(last)}\\`; } if (j !== last) { // We matched a UNC root with leftovers device = `\\\\${firstPart}\\${path.slice(last, j)}`; rootEnd = j; } } } } else { rootEnd = 1; } } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { // Possible device root device = path.slice(0, 2); rootEnd = 2; if (len > 2 && isPathSeparator(path.charCodeAt(2))) { // Treat separator following drive name as an absolute path // indicator isAbsolute = true; rootEnd = 3; } } let tail = rootEnd < len ? normalizeString(path.slice(rootEnd), !isAbsolute, '\\', isPathSeparator) : ''; if (tail.length === 0 && !isAbsolute) { tail = '.'; } if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) { tail += '\\'; } if (device === undefined) { return isAbsolute ? `\\${tail}` : tail; } return isAbsolute ? `${device}\\${tail}` : `${device}${tail}`; }, isAbsolute(path) { validateString(path, 'path'); const len = path.length; if (len === 0) { return false; } const code = path.charCodeAt(0); return isPathSeparator(code) || // Possible device root (len > 2 && isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON && isPathSeparator(path.charCodeAt(2))); }, join(...paths) { if (paths.length === 0) { return '.'; } let joined; let firstPart; for (let i = 0; i < paths.length; ++i) { const arg = paths[i]; validateString(arg, 'path'); if (arg.length > 0) { if (joined === undefined) { joined = firstPart = arg; } else { joined += `\\${arg}`; } } } if (joined === undefined) { return '.'; } // Make sure that the joined path doesn't start with two slashes, because // normalize() will mistake it for a UNC path then. // // This step is skipped when it is very clear that the user actually // intended to point at a UNC path. This is assumed when the first // non-empty string arguments starts with exactly two slashes followed by // at least one more non-slash character. // // Note that for normalize() to treat a path as a UNC path it needs to // have at least 2 components, so we don't filter for that here. // This means that the user can use join to construct UNC paths from // a server name and a share name; for example: // path.join('//server', 'share') -> '\\\\server\\share\\') let needsReplace = true; let slashCount = 0; if (typeof firstPart === 'string' && isPathSeparator(firstPart.charCodeAt(0))) { ++slashCount; const firstLen = firstPart.length; if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) { ++slashCount; if (firstLen > 2) { if (isPathSeparator(firstPart.charCodeAt(2))) { ++slashCount; } else { // We matched a UNC path in the first part needsReplace = false; } } } } if (needsReplace) { // Find any more consecutive slashes we need to replace while (slashCount < joined.length && isPathSeparator(joined.charCodeAt(slashCount))) { slashCount++; } // Replace the slashes if needed if (slashCount >= 2) { joined = `\\${joined.slice(slashCount)}`; } } return win32.normalize(joined); }, // It will solve the relative path from `from` to `to`, for instance: // from = 'C:\\orandea\\test\\aaa' // to = 'C:\\orandea\\impl\\bbb' // The output of the function should be: '..\\..\\impl\\bbb' relative(from, to) { validateString(from, 'from'); validateString(to, 'to'); if (from === to) { return ''; } const fromOrig = win32.resolve(from); const toOrig = win32.resolve(to); if (fromOrig === toOrig) { return ''; } from = fromOrig.toLowerCase(); to = toOrig.toLowerCase(); if (from === to) { return ''; } // Trim any leading backslashes let fromStart = 0; while (fromStart < from.length && from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) { fromStart++; } // Trim trailing backslashes (applicable to UNC paths only) let fromEnd = from.length; while (fromEnd - 1 > fromStart && from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) { fromEnd--; } const fromLen = fromEnd - fromStart; // Trim any leading backslashes let toStart = 0; while (toStart < to.length && to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) { toStart++; } // Trim trailing backslashes (applicable to UNC paths only) let toEnd = to.length; while (toEnd - 1 > toStart && to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) { toEnd--; } const toLen = toEnd - toStart; // Compare paths to find the longest common path from root const length = fromLen < toLen ? fromLen : toLen; let lastCommonSep = -1; let i = 0; for (; i < length; i++) { const fromCode = from.charCodeAt(fromStart + i); if (fromCode !== to.charCodeAt(toStart + i)) { break; } else if (fromCode === CHAR_BACKWARD_SLASH) { lastCommonSep = i; } } // We found a mismatch before the first common path separator was seen, so // return the original `to`. if (i !== length) { if (lastCommonSep === -1) { return toOrig; } } else { if (toLen > length) { if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) { // We get here if `from` is the exact base path for `to`. // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz' return toOrig.slice(toStart + i + 1); } if (i === 2) { // We get here if `from` is the device root. // For example: from='C:\\'; to='C:\\foo' return toOrig.slice(toStart + i); } } if (fromLen > length) { if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) { // We get here if `to` is the exact base path for `from`. // For example: from='C:\\foo\\bar'; to='C:\\foo' lastCommonSep = i; } else if (i === 2) { // We get here if `to` is the device root. // For example: from='C:\\foo\\bar'; to='C:\\' lastCommonSep = 3; } } if (lastCommonSep === -1) { lastCommonSep = 0; } } let out = ''; // Generate the relative path based on the path difference between `to` and // `from` for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) { out += out.length === 0 ? '..' : '\\..'; } } toStart += lastCommonSep; // Lastly, append the rest of the destination (`to`) path that comes after // the common path parts if (out.length > 0) { return `${out}${toOrig.slice(toStart, toEnd)}`; } if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) { ++toStart; } return toOrig.slice(toStart, toEnd); }, toNamespacedPath(path) { // Note: this will *probably* throw somewhere. if (typeof path !== 'string') { return path; } if (path.length === 0) { return ''; } const resolvedPath = win32.resolve(path); if (resolvedPath.length <= 2) { return path; } if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) { // Possible UNC root if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) { const code = resolvedPath.charCodeAt(2); if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) { // Matched non-long UNC root, convert the path to a long UNC path return `\\\\?\\UNC\\${resolvedPath.slice(2)}`; } } } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) && resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) { // Matched device root, convert the path to a long UNC path return `\\\\?\\${resolvedPath}`; } return path; }, dirname(path) { validateString(path, 'path'); const len = path.length; if (len === 0) { return '.'; } let rootEnd = -1; let offset = 0; const code = path.charCodeAt(0); if (len === 1) { // `path` contains just a path separator, exit early to avoid // unnecessary work or a dot. return isPathSeparator(code) ? path : '.'; } // Try to match a root if (isPathSeparator(code)) { // Possible UNC root rootEnd = offset = 1; if (isPathSeparator(path.charCodeAt(1))) { // Matched double path separator at beginning let j = 2; let last = j; // Match 1 or more non-path separators while (j < len && !isPathSeparator(path.charCodeAt(j))) { j++; } if (j < len && j !== last) { // Matched! last = j; // Match 1 or more path separators while (j < len && isPathSeparator(path.charCodeAt(j))) { j++; } if (j < len && j !== last) { // Matched! last = j; // Match 1 or more non-path separators while (j < len && !isPathSeparator(path.charCodeAt(j))) { j++; } if (j === len) { // We matched a UNC root only return path; } if (j !== last) { // We matched a UNC root with leftovers // Offset by 1 to include the separator after the UNC root to // treat it as a "normal root" on top of a (UNC) root rootEnd = offset = j + 1; } } } } // Possible device root } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2; offset = rootEnd; } let end = -1; let matchedSlash = true; for (let i = len - 1; i >= offset; --i) { if (isPathSeparator(path.charCodeAt(i))) { if (!matchedSlash) { end = i; break; } } else { // We saw the first non-path separator matchedSlash = false; } } if (end === -1) { if (rootEnd === -1) { return '.'; } end = rootEnd; } return path.slice(0, end); }, basename(path, ext) { if (ext !== undefined) { validateString(ext, 'ext'); } validateString(path, 'path'); let start = 0; let end = -1; let matchedSlash = true; let i; // Check for a drive letter prefix so as not to mistake the following // path separator as an extra separator at the end of the path that can be // disregarded if (path.length >= 2 && isWindowsDeviceRoot(path.charCodeAt(0)) && path.charCodeAt(1) === CHAR_COLON) { start = 2; } if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { if (ext === path) { return ''; } let extIdx = ext.length - 1; let firstNonSlashEnd = -1; for (i = path.length - 1; i >= start; --i) { const code = path.charCodeAt(i); if (isPathSeparator(code)) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { start = i + 1; break; } } else { if (firstNonSlashEnd === -1) { // We saw the first non-path separator, remember this index in case // we need it if the extension ends up not matching matchedSlash = false; firstNonSlashEnd = i + 1; } if (extIdx >= 0) { // Try to match the explicit extension if (code === ext.charCodeAt(extIdx)) { if (--extIdx === -1) { // We matched the extension, so mark this as the end of our path // component end = i; } } else { // Extension does not match, so our result is the entire path // component extIdx = -1; end = firstNonSlashEnd; } } } } if (start === end) { end = firstNonSlashEnd; } else if (end === -1) { end = path.length; } return path.slice(start, end); } for (i = path.length - 1; i >= start; --i) { if (isPathSeparator(path.charCodeAt(i))) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { start = i + 1; break; } } else if (end === -1) { // We saw the first non-path separator, mark this as the end of our // path component matchedSlash = false; end = i + 1; } } if (end === -1) { return ''; } return path.slice(start, end); }, extname(path) { validateString(path, 'path'); let start = 0; let startDot = -1; let startPart = 0; let end = -1; let matchedSlash = true; // Track the state of characters (if any) we see before our first dot and // after any path separator we find let preDotState = 0; // Check for a drive letter prefix so as not to mistake the following // path separator as an extra separator at the end of the path that can be // disregarded if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) { start = startPart = 2; } for (let i = path.length - 1; i >= start; --i) { const code = path.charCodeAt(i); if (isPathSeparator(code)) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { startPart = i + 1; break; } continue; } if (end === -1) { // We saw the first non-path separator, mark this as the end of our // extension matchedSlash = false; end = i + 1; } if (code === CHAR_DOT) { // If this is our first dot, mark it as the start of our extension if (startDot === -1) { startDot = i; } else if (preDotState !== 1) { preDotState = 1; } } else if (startDot !== -1) { // We saw a non-dot and non-path separator before our dot, so we should // have a good chance at having a non-empty extension preDotState = -1; } } if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot preDotState === 0 || // The (right-most) trimmed path component is exactly '..' (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) { return ''; } return path.slice(startDot, end); }, format: _format.bind(null, '\\'), parse(path) { validateString(path, 'path'); const ret = { root: '', dir: '', base: '', ext: '', name: '' }; if (path.length === 0) { return ret; } const len = path.length; let rootEnd = 0; let code = path.charCodeAt(0); if (len === 1) { if (isPathSeparator(code)) { // `path` contains just a path separator, exit early to avoid // unnecessary work ret.root = ret.dir = path; return ret; } ret.base = ret.name = path; return ret; } // Try to match a root if (isPathSeparator(code)) { // Possible UNC root rootEnd = 1; if (isPathSeparator(path.charCodeAt(1))) { // Matched double path separator at beginning let j = 2; let last = j; // Match 1 or more non-path separators while (j < len && !isPathSeparator(path.charCodeAt(j))) { j++; } if (j < len && j !== last) { // Matched! last = j; // Match 1 or more path separators while (j < len && isPathSeparator(path.charCodeAt(j))) { j++; } if (j < len && j !== last) { // Matched! last = j; // Match 1 or more non-path separators while (j < len && !isPathSeparator(path.charCodeAt(j))) { j++; } if (j === len) { // We matched a UNC root only rootEnd = j; } else if (j !== last) { // We matched a UNC root with leftovers rootEnd = j + 1; } } } } } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { // Possible device root if (len <= 2) { // `path` contains just a drive root, exit early to avoid // unnecessary work ret.root = ret.dir = path; return ret; } rootEnd = 2; if (isPathSeparator(path.charCodeAt(2))) { if (len === 3) { // `path` contains just a drive root, exit early to avoid // unnecessary work ret.root = ret.dir = path; return ret; } rootEnd = 3; } } if (rootEnd > 0) { ret.root = path.slice(0, rootEnd); } let startDot = -1; let startPart = rootEnd; let end = -1; let matchedSlash = true; let i = path.length - 1; // Track the state of characters (if any) we see before our first dot and // after any path separator we find let preDotState = 0; // Get non-dir info for (; i >= rootEnd; --i) { code = path.charCodeAt(i); if (isPathSeparator(code)) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { startPart = i + 1; break; } continue; } if (end === -1) { // We saw the first non-path separator, mark this as the end of our // extension matchedSlash = false; end = i + 1; } if (code === CHAR_DOT) { // If this is our first dot, mark it as the start of our extension if (startDot === -1) { startDot = i; } else if (preDotState !== 1) { preDotState = 1; } } else if (startDot !== -1) { // We saw a non-dot and non-path separator before our dot, so we should // have a good chance at having a non-empty extension preDotState = -1; } } if (end !== -1) { if (startDot === -1 || // We saw a non-dot character immediately before the dot preDotState === 0 || // The (right-most) trimmed path component is exactly '..' (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) { ret.base = ret.name = path.slice(startPart, end); } else { ret.name = path.slice(startPart, startDot); ret.base = path.slice(startPart, end); ret.ext = path.slice(startDot, end); } } // If the directory is the root, use the entire root as the `dir` including // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the // trailing slash (`C:\abc\def` -> `C:\abc`). if (startPart > 0 && startPart !== rootEnd) { ret.dir = path.slice(0, startPart - 1); } else { ret.dir = ret.root; } return ret; }, sep: '\\', delimiter: ';', win32: null, posix: null }; const posix = { // path.resolve([from ...], to) resolve(...pathSegments) { let resolvedPath = ''; let resolvedAbsolute = false; for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) { const path = i >= 0 ? pathSegments[i] : cwd(); validateString(path, 'path'); // Skip empty entries if (path.length === 0) { continue; } resolvedPath = `${path}/${resolvedPath}`; resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, '/', isPosixPathSeparator); if (resolvedAbsolute) { return `/${resolvedPath}`; } return resolvedPath.length > 0 ? resolvedPath : '.'; }, normalize(path) { validateString(path, 'path'); if (path.length === 0) { return '.'; } const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH; // Normalize the path path = normalizeString(path, !isAbsolute, '/', isPosixPathSeparator); if (path.length === 0) { if (isAbsolute) { return '/'; } return trailingSeparator ? './' : '.'; } if (trailingSeparator) { path += '/'; } return isAbsolute ? `/${path}` : path; }, isAbsolute(path) { validateString(path, 'path'); return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH; }, join(...paths) { if (paths.length === 0) { return '.'; } let joined; for (let i = 0; i < paths.length; ++i) { const arg = paths[i]; validateString(arg, 'path'); if (arg.length > 0) { if (joined === undefined) { joined = arg; } else { joined += `/${arg}`; } } } if (joined === undefined) { return '.'; } return posix.normalize(joined); }, relative(from, to) { validateString(from, 'from'); validateString(to, 'to'); if (from === to) { return ''; } // Trim leading forward slashes. from = posix.resolve(from); to = posix.resolve(to); if (from === to) { return ''; } const fromStart = 1; const fromEnd = from.length; const fromLen = fromEnd - fromStart; const toStart = 1; const toLen = to.length - toStart; // Compare paths to find the longest common path from root const length = (fromLen < toLen ? fromLen : toLen); let lastCommonSep = -1; let i = 0; for (; i < length; i++) { const fromCode = from.charCodeAt(fromStart + i); if (fromCode !== to.charCodeAt(toStart + i)) { break; } else if (fromCode === CHAR_FORWARD_SLASH) { lastCommonSep = i; } } if (i === length) { if (toLen > length) { if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) { // We get here if `from` is the exact base path for `to`. // For example: from='/foo/bar'; to='/foo/bar/baz' return to.slice(toStart + i + 1); } if (i === 0) { // We get here if `from` is the root // For example: from='/'; to='/foo' return to.slice(toStart + i); } } else if (fromLen > length) { if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) { // We get here if `to` is the exact base path for `from`. // For example: from='/foo/bar/baz'; to='/foo/bar' lastCommonSep = i; } else if (i === 0) { // We get here if `to` is the root. // For example: from='/foo/bar'; to='/' lastCommonSep = 0; } } } let out = ''; // Generate the relative path based on the path difference between `to` // and `from`. for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) { out += out.length === 0 ? '..' : '/..'; } } // Lastly, append the rest of the destination (`to`) path that comes after // the common path parts. return `${out}${to.slice(toStart + lastCommonSep)}`; }, toNamespacedPath(path) { // Non-op on posix systems return path; }, dirname(path) { validateString(path, 'path'); if (path.length === 0) { return '.'; } const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH; let end = -1; let matchedSlash = true; for (let i = path.length - 1; i >= 1; --i) { if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { if (!matchedSlash) { end = i; break; } } else { // We saw the first non-path separator matchedSlash = false; } } if (end === -1) { return hasRoot ? '/' : '.'; } if (hasRoot && end === 1) { return '//'; } return path.slice(0, end); }, basename(path, ext) { if (ext !== undefined) { validateString(ext, 'ext'); } validateString(path, 'path'); let start = 0; let end = -1; let matchedSlash = true; let i; if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { if (ext === path) { return ''; } let extIdx = ext.length - 1; let firstNonSlashEnd = -1; for (i = path.length - 1; i >= 0; --i) { const code = path.charCodeAt(i); if (code === CHAR_FORWARD_SLASH) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { start = i + 1; break; } } else { if (firstNonSlashEnd === -1) { // We saw the first non-path separator, remember this index in case // we need it if the extension ends up not matching matchedSlash = false; firstNonSlashEnd = i + 1; } if (extIdx >= 0) { // Try to match the explicit extension if (code === ext.charCodeAt(extIdx)) { if (--extIdx === -1) { // We matched the extension, so mark this as the end of our path // component end = i; } } else { // Extension does not match, so our result is the entire path // component extIdx = -1; end = firstNonSlashEnd; } } } } if (start === end) { end = firstNonSlashEnd; } else if (end === -1) { end = path.length; } return path.slice(start, end); } for (i = path.length - 1; i >= 0; --i) { if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { start = i + 1; break; } } else if (end === -1) { // We saw the first non-path separator, mark this as the end of our // path component matchedSlash = false; end = i + 1; } } if (end === -1) { return ''; } return path.slice(start, end); }, extname(path) { validateString(path, 'path'); let startDot = -1; let startPart = 0; let end = -1; let matchedSlash = true; // Track the state of characters (if any) we see before our first dot and // after any path separator we find let preDotState = 0; for (let i = path.length - 1; i >= 0; --i) { const code = path.charCodeAt(i); if (code === CHAR_FORWARD_SLASH) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { startPart = i + 1; break; } continue; } if (end === -1) { // We saw the first non-path separator, mark this as the end of our // extension matchedSlash = false; end = i + 1; } if (code === CHAR_DOT) { // If this is our first dot, mark it as the start of our extension if (startDot === -1) { startDot = i; } else if (preDotState !== 1) { preDotState = 1; } } else if (startDot !== -1) { // We saw a non-dot and non-path separator before our dot, so we should // have a good chance at having a non-empty extension preDotState = -1; } } if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot preDotState === 0 || // The (right-most) trimmed path component is exactly '..' (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) { return ''; } return path.slice(startDot, end); }, format: _format.bind(null, '/'), parse(path) { validateString(path, 'path'); const ret = { root: '', dir: '', base: '', ext: '', name: '' }; if (path.length === 0) { return ret; } const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; let start; if (isAbsolute) { ret.root = '/'; start = 1; } else { start = 0; } let startDot = -1; let startPart = 0; let end = -1; let matchedSlash = true; let i = path.length - 1; // Track the state of characters (if any) we see before our first dot and // after any path separator we find let preDotState = 0; // Get non-dir info for (; i >= start; --i) { const code = path.charCodeAt(i); if (code === CHAR_FORWARD_SLASH) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now if (!matchedSlash) { startPart = i + 1; break; } continue; } if (end === -1) { // We saw the first non-path separator, mark this as the end of our // extension matchedSlash = false; end = i + 1; } if (code === CHAR_DOT) { // If this is our first dot, mark it as the start of our extension if (startDot === -1) { startDot = i; } else if (preDotState !== 1) { preDotState = 1; } } else if (startDot !== -1) { // We saw a non-dot and non-path separator before our dot, so we should // have a good chance at having a non-empty extension preDotState = -1; } } if (end !== -1) { const start = startPart === 0 && isAbsolute ? 1 : startPart; if (startDot === -1 || // We saw a non-dot character immediately before the dot preDotState === 0 || // The (right-most) trimmed path component is exactly '..' (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)) { ret.base = ret.name = path.slice(start, end); } else { ret.name = path.slice(start, startDot); ret.base = path.slice(start, end); ret.ext = path.slice(startDot, end); } } if (startPart > 0) { ret.dir = path.slice(0, startPart - 1); } else if (isAbsolute) { ret.dir = '/'; } return ret; }, sep: '/', delimiter: ':', win32: null, posix: null }; posix.win32 = win32.win32 = win32; posix.posix = win32.posix = posix; const normalize = (process_platform === 'win32' ? win32.normalize : posix.normalize); const resolve = (process_platform === 'win32' ? win32.resolve : posix.resolve); const relative = (process_platform === 'win32' ? win32.relative : posix.relative); const dirname = (process_platform === 'win32' ? win32.dirname : posix.dirname); const basename = (process_platform === 'win32' ? win32.basename : posix.basename); const extname = (process_platform === 'win32' ? win32.extname : posix.extname); const sep = (process_platform === 'win32' ? win32.sep : posix.sep); /***/ }), /***/ 17981: /*!**************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/range.js ***! \**************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ e: function() { return /* binding */ Range; } /* harmony export */ }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var Range; (function (Range) { /** * Returns the intersection between two ranges as a range itself. * Returns `{ start: 0, end: 0 }` if the intersection is empty. */ function intersect(one, other) { if (one.start >= other.end || other.start >= one.end) { return { start: 0, end: 0 }; } const start = Math.max(one.start, other.start); const end = Math.min(one.end, other.end); if (end - start <= 0) { return { start: 0, end: 0 }; } return { start, end }; } Range.intersect = intersect; function isEmpty(range) { return range.end - range.start <= 0; } Range.isEmpty = isEmpty; function intersects(one, other) { return !isEmpty(intersect(one, other)); } Range.intersects = intersects; function relativeComplement(one, other) { const result = []; const first = { start: one.start, end: Math.min(other.start, one.end) }; const second = { start: Math.max(other.end, one.start), end: one.end }; if (!isEmpty(first)) { result.push(first); } if (!isEmpty(second)) { result.push(second); } return result; } Range.relativeComplement = relativeComplement; })(Range || (Range = {})); /***/ }), /***/ 9365: /*!******************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/resources.js ***! \******************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AH: function() { return /* binding */ normalizePath; }, /* harmony export */ EZ: function() { return /* binding */ basename; }, /* harmony export */ Hx: function() { return /* binding */ basenameOrAuthority; }, /* harmony export */ SF: function() { return /* binding */ extUri; }, /* harmony export */ Vb: function() { return /* binding */ DataUri; }, /* harmony export */ Vo: function() { return /* binding */ joinPath; }, /* harmony export */ XX: function() { return /* binding */ dirname; }, /* harmony export */ Xy: function() { return /* binding */ isEqual; }, /* harmony export */ i3: function() { return /* binding */ resolvePath; }, /* harmony export */ z_: function() { return /* binding */ originalFSPath; } /* harmony export */ }); /* unused harmony export ExtUri */ /* harmony import */ var _extpath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extpath.js */ 57637); /* harmony import */ var _network_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./network.js */ 66657); /* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./path.js */ 86408); /* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./strings.js */ 82983); /* harmony import */ var _uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./uri.js */ 5472); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function originalFSPath(uri) { return (0,_uri_js__WEBPACK_IMPORTED_MODULE_4__/* .uriToFsPath */ .q)(uri, true); } class ExtUri { constructor(_ignorePathCasing) { this._ignorePathCasing = _ignorePathCasing; } compare(uri1, uri2, ignoreFragment = false) { if (uri1 === uri2) { return 0; } return (0,_strings_js__WEBPACK_IMPORTED_MODULE_3__/* .compare */ .qu)(this.getComparisonKey(uri1, ignoreFragment), this.getComparisonKey(uri2, ignoreFragment)); } isEqual(uri1, uri2, ignoreFragment = false) { if (uri1 === uri2) { return true; } if (!uri1 || !uri2) { return false; } return this.getComparisonKey(uri1, ignoreFragment) === this.getComparisonKey(uri2, ignoreFragment); } getComparisonKey(uri, ignoreFragment = false) { return uri.with({ path: this._ignorePathCasing(uri) ? uri.path.toLowerCase() : undefined, fragment: ignoreFragment ? null : undefined }).toString(); } // --- path math joinPath(resource, ...pathFragment) { return _uri_js__WEBPACK_IMPORTED_MODULE_4__/* .URI */ .o.joinPath(resource, ...pathFragment); } basenameOrAuthority(resource) { return basename(resource) || resource.authority; } basename(resource) { return _path_js__WEBPACK_IMPORTED_MODULE_2__/* .posix */ .KR.basename(resource.path); } dirname(resource) { if (resource.path.length === 0) { return resource; } let dirname; if (resource.scheme === _network_js__WEBPACK_IMPORTED_MODULE_1__/* .Schemas */ .lg.file) { dirname = _uri_js__WEBPACK_IMPORTED_MODULE_4__/* .URI */ .o.file(_path_js__WEBPACK_IMPORTED_MODULE_2__/* .dirname */ .XX(originalFSPath(resource))).path; } else { dirname = _path_js__WEBPACK_IMPORTED_MODULE_2__/* .posix */ .KR.dirname(resource.path); if (resource.authority && dirname.length && dirname.charCodeAt(0) !== 47 /* Slash */) { console.error(`dirname("${resource.toString})) resulted in a relative path`); dirname = '/'; // If a URI contains an authority component, then the path component must either be empty or begin with a CharCode.Slash ("/") character } } return resource.with({ path: dirname }); } normalizePath(resource) { if (!resource.path.length) { return resource; } let normalizedPath; if (resource.scheme === _network_js__WEBPACK_IMPORTED_MODULE_1__/* .Schemas */ .lg.file) { normalizedPath = _uri_js__WEBPACK_IMPORTED_MODULE_4__/* .URI */ .o.file(_path_js__WEBPACK_IMPORTED_MODULE_2__/* .normalize */ .Fv(originalFSPath(resource))).path; } else { normalizedPath = _path_js__WEBPACK_IMPORTED_MODULE_2__/* .posix */ .KR.normalize(resource.path); } return resource.with({ path: normalizedPath }); } resolvePath(base, path) { if (base.scheme === _network_js__WEBPACK_IMPORTED_MODULE_1__/* .Schemas */ .lg.file) { const newURI = _uri_js__WEBPACK_IMPORTED_MODULE_4__/* .URI */ .o.file(_path_js__WEBPACK_IMPORTED_MODULE_2__/* .resolve */ .DB(originalFSPath(base), path)); return base.with({ authority: newURI.authority, path: newURI.path }); } path = _extpath_js__WEBPACK_IMPORTED_MODULE_0__/* .toPosixPath */ .fn(path); // we allow path to be a windows path return base.with({ path: _path_js__WEBPACK_IMPORTED_MODULE_2__/* .posix */ .KR.resolve(base.path, path) }); } } /** * Unbiased utility that takes uris "as they are". This means it can be interchanged with * uri#toString() usages. The following is true * ``` * assertEqual(aUri.toString() === bUri.toString(), exturi.isEqual(aUri, bUri)) * ``` */ const extUri = new ExtUri(() => false); const isEqual = extUri.isEqual.bind(extUri); const basenameOrAuthority = extUri.basenameOrAuthority.bind(extUri); const basename = extUri.basename.bind(extUri); const dirname = extUri.dirname.bind(extUri); const joinPath = extUri.joinPath.bind(extUri); const normalizePath = extUri.normalizePath.bind(extUri); const resolvePath = extUri.resolvePath.bind(extUri); /** * Data URI related helpers. */ var DataUri; (function (DataUri) { DataUri.META_DATA_LABEL = 'label'; DataUri.META_DATA_DESCRIPTION = 'description'; DataUri.META_DATA_SIZE = 'size'; DataUri.META_DATA_MIME = 'mime'; function parseMetaData(dataUri) { const metadata = new Map(); // Given a URI of: data:image/png;size:2313;label:SomeLabel;description:SomeDescription;base64,77+9UE5... // the metadata is: size:2313;label:SomeLabel;description:SomeDescription const meta = dataUri.path.substring(dataUri.path.indexOf(';') + 1, dataUri.path.lastIndexOf(';')); meta.split(';').forEach(property => { const [key, value] = property.split(':'); if (key && value) { metadata.set(key, value); } }); // Given a URI of: data:image/png;size:2313;label:SomeLabel;description:SomeDescription;base64,77+9UE5... // the mime is: image/png const mime = dataUri.path.substring(0, dataUri.path.indexOf(';')); if (mime) { metadata.set(DataUri.META_DATA_MIME, mime); } return metadata; } DataUri.parseMetaData = parseMetaData; })(DataUri || (DataUri = {})); /***/ }), /***/ 28962: /*!*******************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/scrollable.js ***! \*******************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Rm: function() { return /* binding */ Scrollable; } /* harmony export */ }); /* unused harmony exports ScrollState, SmoothScrollingUpdate, SmoothScrollingOperation */ /* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ 4348); /* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lifecycle.js */ 69323); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class ScrollState { constructor(width, scrollWidth, scrollLeft, height, scrollHeight, scrollTop) { this._scrollStateBrand = undefined; width = width | 0; scrollWidth = scrollWidth | 0; scrollLeft = scrollLeft | 0; height = height | 0; scrollHeight = scrollHeight | 0; scrollTop = scrollTop | 0; this.rawScrollLeft = scrollLeft; // before validation this.rawScrollTop = scrollTop; // before validation if (width < 0) { width = 0; } if (scrollLeft + width > scrollWidth) { scrollLeft = scrollWidth - width; } if (scrollLeft < 0) { scrollLeft = 0; } if (height < 0) { height = 0; } if (scrollTop + height > scrollHeight) { scrollTop = scrollHeight - height; } if (scrollTop < 0) { scrollTop = 0; } this.width = width; this.scrollWidth = scrollWidth; this.scrollLeft = scrollLeft; this.height = height; this.scrollHeight = scrollHeight; this.scrollTop = scrollTop; } equals(other) { return (this.rawScrollLeft === other.rawScrollLeft && this.rawScrollTop === other.rawScrollTop && this.width === other.width && this.scrollWidth === other.scrollWidth && this.scrollLeft === other.scrollLeft && this.height === other.height && this.scrollHeight === other.scrollHeight && this.scrollTop === other.scrollTop); } withScrollDimensions(update, useRawScrollPositions) { return new ScrollState((typeof update.width !== 'undefined' ? update.width : this.width), (typeof update.scrollWidth !== 'undefined' ? update.scrollWidth : this.scrollWidth), useRawScrollPositions ? this.rawScrollLeft : this.scrollLeft, (typeof update.height !== 'undefined' ? update.height : this.height), (typeof update.scrollHeight !== 'undefined' ? update.scrollHeight : this.scrollHeight), useRawScrollPositions ? this.rawScrollTop : this.scrollTop); } withScrollPosition(update) { return new ScrollState(this.width, this.scrollWidth, (typeof update.scrollLeft !== 'undefined' ? update.scrollLeft : this.rawScrollLeft), this.height, this.scrollHeight, (typeof update.scrollTop !== 'undefined' ? update.scrollTop : this.rawScrollTop)); } createScrollEvent(previous, inSmoothScrolling) { const widthChanged = (this.width !== previous.width); const scrollWidthChanged = (this.scrollWidth !== previous.scrollWidth); const scrollLeftChanged = (this.scrollLeft !== previous.scrollLeft); const heightChanged = (this.height !== previous.height); const scrollHeightChanged = (this.scrollHeight !== previous.scrollHeight); const scrollTopChanged = (this.scrollTop !== previous.scrollTop); return { inSmoothScrolling: inSmoothScrolling, oldWidth: previous.width, oldScrollWidth: previous.scrollWidth, oldScrollLeft: previous.scrollLeft, width: this.width, scrollWidth: this.scrollWidth, scrollLeft: this.scrollLeft, oldHeight: previous.height, oldScrollHeight: previous.scrollHeight, oldScrollTop: previous.scrollTop, height: this.height, scrollHeight: this.scrollHeight, scrollTop: this.scrollTop, widthChanged: widthChanged, scrollWidthChanged: scrollWidthChanged, scrollLeftChanged: scrollLeftChanged, heightChanged: heightChanged, scrollHeightChanged: scrollHeightChanged, scrollTopChanged: scrollTopChanged, }; } } class Scrollable extends _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__/* .Disposable */ .JT { constructor(smoothScrollDuration, scheduleAtNextAnimationFrame) { super(); this._scrollableBrand = undefined; this._onScroll = this._register(new _event_js__WEBPACK_IMPORTED_MODULE_0__/* .Emitter */ .Q5()); this.onScroll = this._onScroll.event; this._smoothScrollDuration = smoothScrollDuration; this._scheduleAtNextAnimationFrame = scheduleAtNextAnimationFrame; this._state = new ScrollState(0, 0, 0, 0, 0, 0); this._smoothScrolling = null; } dispose() { if (this._smoothScrolling) { this._smoothScrolling.dispose(); this._smoothScrolling = null; } super.dispose(); } setSmoothScrollDuration(smoothScrollDuration) { this._smoothScrollDuration = smoothScrollDuration; } validateScrollPosition(scrollPosition) { return this._state.withScrollPosition(scrollPosition); } getScrollDimensions() { return this._state; } setScrollDimensions(dimensions, useRawScrollPositions) { const newState = this._state.withScrollDimensions(dimensions, useRawScrollPositions); this._setState(newState, Boolean(this._smoothScrolling)); // Validate outstanding animated scroll position target if (this._smoothScrolling) { this._smoothScrolling.acceptScrollDimensions(this._state); } } /** * Returns the final scroll position that the instance will have once the smooth scroll animation concludes. * If no scroll animation is occurring, it will return the current scroll position instead. */ getFutureScrollPosition() { if (this._smoothScrolling) { return this._smoothScrolling.to; } return this._state; } /** * Returns the current scroll position. * Note: This result might be an intermediate scroll position, as there might be an ongoing smooth scroll animation. */ getCurrentScrollPosition() { return this._state; } setScrollPositionNow(update) { // no smooth scrolling requested const newState = this._state.withScrollPosition(update); // Terminate any outstanding smooth scrolling if (this._smoothScrolling) { this._smoothScrolling.dispose(); this._smoothScrolling = null; } this._setState(newState, false); } setScrollPositionSmooth(update, reuseAnimation) { if (this._smoothScrollDuration === 0) { // Smooth scrolling not supported. return this.setScrollPositionNow(update); } if (this._smoothScrolling) { // Combine our pending scrollLeft/scrollTop with incoming scrollLeft/scrollTop update = { scrollLeft: (typeof update.scrollLeft === 'undefined' ? this._smoothScrolling.to.scrollLeft : update.scrollLeft), scrollTop: (typeof update.scrollTop === 'undefined' ? this._smoothScrolling.to.scrollTop : update.scrollTop) }; // Validate `update` const validTarget = this._state.withScrollPosition(update); if (this._smoothScrolling.to.scrollLeft === validTarget.scrollLeft && this._smoothScrolling.to.scrollTop === validTarget.scrollTop) { // No need to interrupt or extend the current animation since we're going to the same place return; } let newSmoothScrolling; if (reuseAnimation) { newSmoothScrolling = new SmoothScrollingOperation(this._smoothScrolling.from, validTarget, this._smoothScrolling.startTime, this._smoothScrolling.duration); } else { newSmoothScrolling = this._smoothScrolling.combine(this._state, validTarget, this._smoothScrollDuration); } this._smoothScrolling.dispose(); this._smoothScrolling = newSmoothScrolling; } else { // Validate `update` const validTarget = this._state.withScrollPosition(update); this._smoothScrolling = SmoothScrollingOperation.start(this._state, validTarget, this._smoothScrollDuration); } // Begin smooth scrolling animation this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => { if (!this._smoothScrolling) { return; } this._smoothScrolling.animationFrameDisposable = null; this._performSmoothScrolling(); }); } _performSmoothScrolling() { if (!this._smoothScrolling) { return; } const update = this._smoothScrolling.tick(); const newState = this._state.withScrollPosition(update); this._setState(newState, true); if (!this._smoothScrolling) { // Looks like someone canceled the smooth scrolling // from the scroll event handler return; } if (update.isDone) { this._smoothScrolling.dispose(); this._smoothScrolling = null; return; } // Continue smooth scrolling animation this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => { if (!this._smoothScrolling) { return; } this._smoothScrolling.animationFrameDisposable = null; this._performSmoothScrolling(); }); } _setState(newState, inSmoothScrolling) { const oldState = this._state; if (oldState.equals(newState)) { // no change return; } this._state = newState; this._onScroll.fire(this._state.createScrollEvent(oldState, inSmoothScrolling)); } } class SmoothScrollingUpdate { constructor(scrollLeft, scrollTop, isDone) { this.scrollLeft = scrollLeft; this.scrollTop = scrollTop; this.isDone = isDone; } } function createEaseOutCubic(from, to) { const delta = to - from; return function (completion) { return from + delta * easeOutCubic(completion); }; } function createComposed(a, b, cut) { return function (completion) { if (completion < cut) { return a(completion / cut); } return b((completion - cut) / (1 - cut)); }; } class SmoothScrollingOperation { constructor(from, to, startTime, duration) { this.from = from; this.to = to; this.duration = duration; this.startTime = startTime; 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(from, to, viewportSize) { const delta = Math.abs(from - to); if (delta > 2.5 * viewportSize) { let stop1, stop2; if (from < to) { // scroll to 75% of the viewportSize stop1 = from + 0.75 * viewportSize; stop2 = to - 0.75 * viewportSize; } else { stop1 = from - 0.75 * viewportSize; stop2 = to + 0.75 * viewportSize; } return createComposed(createEaseOutCubic(from, stop1), createEaseOutCubic(stop2, to), 0.33); } return createEaseOutCubic(from, to); } dispose() { if (this.animationFrameDisposable !== null) { this.animationFrameDisposable.dispose(); this.animationFrameDisposable = null; } } acceptScrollDimensions(state) { this.to = state.withScrollPosition(this.to); this._initAnimations(); } tick() { return this._tick(Date.now()); } _tick(now) { const completion = (now - this.startTime) / this.duration; if (completion < 1) { const newScrollLeft = this.scrollLeft(completion); const newScrollTop = this.scrollTop(completion); return new SmoothScrollingUpdate(newScrollLeft, newScrollTop, false); } return new SmoothScrollingUpdate(this.to.scrollLeft, this.to.scrollTop, true); } combine(from, to, duration) { return SmoothScrollingOperation.start(from, to, duration); } static start(from, to, duration) { // +10 / -10 : pretend the animation already started for a quicker response to a scroll request duration = duration + 10; const startTime = Date.now() - 10; return new SmoothScrollingOperation(from, to, startTime, duration); } } function easeInCubic(t) { return Math.pow(t, 3); } function easeOutCubic(t) { return 1 - easeInCubic(1 - t); } /***/ }), /***/ 37254: /*!*****************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/severity.js ***! \*****************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./strings.js */ 82983); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var Severity; (function (Severity) { Severity[Severity["Ignore"] = 0] = "Ignore"; Severity[Severity["Info"] = 1] = "Info"; Severity[Severity["Warning"] = 2] = "Warning"; Severity[Severity["Error"] = 3] = "Error"; })(Severity || (Severity = {})); (function (Severity) { const _error = 'error'; const _warning = 'warning'; const _warn = 'warn'; const _info = 'info'; const _ignore = 'ignore'; /** * Parses 'error', 'warning', 'warn', 'info' in call casings * and falls back to ignore. */ function fromValue(value) { if (!value) { return Severity.Ignore; } if (_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .equalsIgnoreCase */ .qq(_error, value)) { return Severity.Error; } if (_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .equalsIgnoreCase */ .qq(_warning, value) || _strings_js__WEBPACK_IMPORTED_MODULE_0__/* .equalsIgnoreCase */ .qq(_warn, value)) { return Severity.Warning; } if (_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .equalsIgnoreCase */ .qq(_info, value)) { return Severity.Info; } return Severity.Ignore; } Severity.fromValue = fromValue; function toString(severity) { switch (severity) { case Severity.Error: return _error; case Severity.Warning: return _warning; case Severity.Info: return _info; default: return _ignore; } } Severity.toString = toString; })(Severity || (Severity = {})); /* harmony default export */ __webpack_exports__.Z = (Severity); /***/ }), /***/ 41301: /*!*************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/uint.js ***! \*************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ A: function() { return /* binding */ toUint32; }, /* harmony export */ K: function() { return /* binding */ toUint8; } /* harmony export */ }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function toUint8(v) { if (v < 0) { return 0; } if (v > 255 /* MAX_UINT_8 */) { return 255 /* MAX_UINT_8 */; } return v | 0; } function toUint32(v) { if (v < 0) { return 0; } if (v > 4294967295 /* MAX_UINT_32 */) { return 4294967295 /* MAX_UINT_32 */; } return v | 0; } /***/ }), /***/ 5472: /*!************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/uri.js ***! \************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ o: function() { return /* binding */ URI; }, /* harmony export */ q: function() { return /* binding */ uriToFsPath; } /* harmony export */ }); /* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./path.js */ 86408); /* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./platform.js */ 23345); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const _schemePattern = /^\w[\w\d+.-]*$/; const _singleSlashStart = /^\//; const _doubleSlashStart = /^\/\//; function _validateUri(ret, _strict) { // scheme, must be set if (!ret.scheme && _strict) { throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${ret.authority}", path: "${ret.path}", query: "${ret.query}", fragment: "${ret.fragment}"}`); } // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) if (ret.scheme && !_schemePattern.test(ret.scheme)) { throw new Error('[UriError]: Scheme contains illegal characters.'); } // path, http://tools.ietf.org/html/rfc3986#section-3.3 // If a URI contains an authority component, then the path component // must either be empty or begin with a slash ("/") character. If a URI // does not contain an authority component, then the path cannot begin // with two slash characters ("//"). if (ret.path) { if (ret.authority) { if (!_singleSlashStart.test(ret.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 (_doubleSlashStart.test(ret.path)) { throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); } } } } // for a while we allowed uris *without* schemes and this is the migration // for them, e.g. an uri without scheme and without strict-mode warns and falls // back to the file-scheme. that should cause the least carnage and still be a // clear warning function _schemeFix(scheme, _strict) { if (!scheme && !_strict) { return 'file'; } return scheme; } // implements a bit of https://tools.ietf.org/html/rfc3986#section-5 function _referenceResolution(scheme, path) { // the slash-character is our 'default base' as we don't // support constructing URIs relative to other URIs. This // also means that we alter and potentially break paths. // see https://tools.ietf.org/html/rfc3986#section-5.1.4 switch (scheme) { case 'https': case 'http': case 'file': if (!path) { path = _slash; } else if (path[0] !== _slash) { path = _slash + path; } break; } return path; } const _empty = ''; const _slash = '/'; const _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; /** * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. * This class is a simple parser which creates the basic component parts * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation * and encoding. * * ```txt * foo://example.com:8042/over/there?name=ferret#nose * \_/ \______________/\_________/ \_________/ \__/ * | | | | | * scheme authority path query fragment * | _____________________|__ * / \ / \ * urn:example:animal:ferret:nose * ``` */ class URI { /** * @internal */ constructor(schemeOrData, authority, path, query, fragment, _strict = false) { if (typeof schemeOrData === 'object') { this.scheme = schemeOrData.scheme || _empty; this.authority = schemeOrData.authority || _empty; this.path = schemeOrData.path || _empty; this.query = schemeOrData.query || _empty; this.fragment = schemeOrData.fragment || _empty; // no validation because it's this URI // that creates uri components. // _validateUri(this); } else { this.scheme = _schemeFix(schemeOrData, _strict); this.authority = authority || _empty; this.path = _referenceResolution(this.scheme, path || _empty); this.query = query || _empty; this.fragment = fragment || _empty; _validateUri(this, _strict); } } static isUri(thing) { if (thing instanceof URI) { return true; } if (!thing) { return false; } return typeof thing.authority === 'string' && typeof thing.fragment === 'string' && typeof thing.path === 'string' && typeof thing.query === 'string' && typeof thing.scheme === 'string' && typeof thing.fsPath === 'string' && typeof thing.with === 'function' && typeof thing.toString === 'function'; } // ---- filesystem path ----------------------- /** * Returns a string representing the corresponding file system path of this URI. * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the * platform specific path separator. * * * Will *not* validate the path for invalid characters and semantics. * * Will *not* look at the scheme of this URI. * * The result shall *not* be used for display purposes but for accessing a file on disk. * * * The *difference* to `URI#path` is the use of the platform specific separator and the handling * of UNC paths. See the below sample of a file-uri with an authority (UNC path). * * ```ts const u = URI.parse('file://server/c$/folder/file.txt') u.authority === 'server' u.path === '/shares/c$/file.txt' u.fsPath === '\\server\c$\folder\file.txt' ``` * * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working * with URIs that represent files on disk (`file` scheme). */ get fsPath() { // if (this.scheme !== 'file') { // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); // } return uriToFsPath(this, false); } // ---- modify to new ------------------------- with(change) { if (!change) { return this; } let { scheme, authority, path, query, fragment } = change; if (scheme === undefined) { scheme = this.scheme; } else if (scheme === null) { scheme = _empty; } if (authority === undefined) { authority = this.authority; } else if (authority === null) { authority = _empty; } if (path === undefined) { path = this.path; } else if (path === null) { path = _empty; } if (query === undefined) { query = this.query; } else if (query === null) { query = _empty; } if (fragment === undefined) { fragment = this.fragment; } else if (fragment === null) { fragment = _empty; } if (scheme === this.scheme && authority === this.authority && path === this.path && query === this.query && fragment === this.fragment) { return this; } return new Uri(scheme, authority, path, query, fragment); } // ---- parse & validate ------------------------ /** * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, * `file:///usr/home`, or `scheme:with/path`. * * @param value A string which represents an URI (see `URI#toString`). */ static parse(value, _strict = false) { const match = _regexp.exec(value); if (!match) { return new Uri(_empty, _empty, _empty, _empty, _empty); } return new Uri(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict); } /** * Creates a new URI from a file system path, e.g. `c:\my\files`, * `/usr/home`, or `\\server\share\some\path`. * * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** * `URI.parse('file://' + path)` because the path might contain characters that are * interpreted (# and ?). See the following sample: * ```ts const good = URI.file('/coding/c#/project1'); good.scheme === 'file'; good.path === '/coding/c#/project1'; good.fragment === ''; const bad = URI.parse('file://' + '/coding/c#/project1'); bad.scheme === 'file'; bad.path === '/coding/c'; // path is now broken bad.fragment === '/project1'; ``` * * @param path A file system path (see `URI#fsPath`) */ static file(path) { let authority = _empty; // normalize to fwd-slashes on windows, // on other systems bwd-slashes are valid // filename character, eg /f\oo/ba\r.txt if (_platform_js__WEBPACK_IMPORTED_MODULE_1__/* .isWindows */ .ED) { path = path.replace(/\\/g, _slash); } // check for authority as used in UNC shares // or use the path as given if (path[0] === _slash && path[1] === _slash) { const idx = path.indexOf(_slash, 2); if (idx === -1) { authority = path.substring(2); path = _slash; } else { authority = path.substring(2, idx); path = path.substring(idx) || _slash; } } return new Uri('file', authority, path, _empty, _empty); } static from(components) { const result = new Uri(components.scheme, components.authority, components.path, components.query, components.fragment); _validateUri(result, true); return result; } /** * Join a URI path with path fragments and normalizes the resulting path. * * @param uri The input URI. * @param pathFragment The path fragment to add to the URI path. * @returns The resulting URI. */ static joinPath(uri, ...pathFragment) { if (!uri.path) { throw new Error(`[UriError]: cannot call joinPath on URI without path`); } let newPath; if (_platform_js__WEBPACK_IMPORTED_MODULE_1__/* .isWindows */ .ED && uri.scheme === 'file') { newPath = URI.file(_path_js__WEBPACK_IMPORTED_MODULE_0__/* .win32 */ .Ku.join(uriToFsPath(uri, true), ...pathFragment)).path; } else { newPath = _path_js__WEBPACK_IMPORTED_MODULE_0__/* .posix */ .KR.join(uri.path, ...pathFragment); } return uri.with({ path: newPath }); } // ---- printing/externalize --------------------------- /** * Creates a string representation for this URI. It's guaranteed that calling * `URI.parse` with the result of this function creates an URI which is equal * to this URI. * * * The result shall *not* be used for display purposes but for externalization or transport. * * The result will be encoded using the percentage encoding and encoding happens mostly * ignore the scheme-specific encoding rules. * * @param skipEncoding Do not encode the result, default is `false` */ toString(skipEncoding = false) { return _asFormatted(this, skipEncoding); } toJSON() { return this; } static revive(data) { if (!data) { return data; } else if (data instanceof URI) { return data; } else { const result = new Uri(data); result._formatted = data.external; result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null; return result; } } } const _pathSepMarker = _platform_js__WEBPACK_IMPORTED_MODULE_1__/* .isWindows */ .ED ? 1 : undefined; // This class exists so that URI is compatible with vscode.Uri (API). class Uri extends URI { constructor() { super(...arguments); this._formatted = null; this._fsPath = null; } get fsPath() { if (!this._fsPath) { this._fsPath = uriToFsPath(this, false); } return this._fsPath; } toString(skipEncoding = false) { if (!skipEncoding) { if (!this._formatted) { this._formatted = _asFormatted(this, false); } return this._formatted; } else { // we don't cache that return _asFormatted(this, true); } } toJSON() { const res = { $mid: 1 /* Uri */ }; // cached state if (this._fsPath) { res.fsPath = this._fsPath; res._sep = _pathSepMarker; } if (this._formatted) { res.external = this._formatted; } // uri components if (this.path) { res.path = this.path; } if (this.scheme) { res.scheme = this.scheme; } if (this.authority) { res.authority = this.authority; } if (this.query) { res.query = this.query; } if (this.fragment) { res.fragment = this.fragment; } return res; } } // reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 const encodeTable = { [58 /* Colon */]: '%3A', [47 /* Slash */]: '%2F', [63 /* QuestionMark */]: '%3F', [35 /* Hash */]: '%23', [91 /* OpenSquareBracket */]: '%5B', [93 /* CloseSquareBracket */]: '%5D', [64 /* AtSign */]: '%40', [33 /* ExclamationMark */]: '%21', [36 /* DollarSign */]: '%24', [38 /* Ampersand */]: '%26', [39 /* SingleQuote */]: '%27', [40 /* OpenParen */]: '%28', [41 /* CloseParen */]: '%29', [42 /* Asterisk */]: '%2A', [43 /* Plus */]: '%2B', [44 /* Comma */]: '%2C', [59 /* Semicolon */]: '%3B', [61 /* Equals */]: '%3D', [32 /* Space */]: '%20', }; function encodeURIComponentFast(uriComponent, allowSlash) { let res = undefined; let nativeEncodePos = -1; for (let pos = 0; pos < uriComponent.length; pos++) { const code = uriComponent.charCodeAt(pos); // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 if ((code >= 97 /* a */ && code <= 122 /* z */) || (code >= 65 /* A */ && code <= 90 /* Z */) || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) || code === 45 /* Dash */ || code === 46 /* Period */ || code === 95 /* Underline */ || code === 126 /* Tilde */ || (allowSlash && code === 47 /* Slash */)) { // check if we are delaying native encode if (nativeEncodePos !== -1) { res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); nativeEncodePos = -1; } // check if we write into a new string (by default we try to return the param) if (res !== undefined) { res += uriComponent.charAt(pos); } } else { // encoding needed, we need to allocate a new string if (res === undefined) { res = uriComponent.substr(0, pos); } // check with default table first const escaped = encodeTable[code]; if (escaped !== undefined) { // check if we are delaying native encode if (nativeEncodePos !== -1) { res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); nativeEncodePos = -1; } // append escaped variant to result res += escaped; } else if (nativeEncodePos === -1) { // use native encode only when needed nativeEncodePos = pos; } } } if (nativeEncodePos !== -1) { res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); } return res !== undefined ? res : uriComponent; } function encodeURIComponentMinimal(path) { let res = undefined; for (let pos = 0; pos < path.length; pos++) { const code = path.charCodeAt(pos); if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { if (res === undefined) { res = path.substr(0, pos); } res += encodeTable[code]; } else { if (res !== undefined) { res += path[pos]; } } } return res !== undefined ? res : path; } /** * Compute `fsPath` for the given uri */ function uriToFsPath(uri, keepDriveLetterCasing) { let value; if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { // unc path: file://shares/c$/far/boo value = `//${uri.authority}${uri.path}`; } else if (uri.path.charCodeAt(0) === 47 /* Slash */ && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) && uri.path.charCodeAt(2) === 58 /* Colon */) { if (!keepDriveLetterCasing) { // windows drive letter: file:///c:/far/boo value = uri.path[1].toLowerCase() + uri.path.substr(2); } else { value = uri.path.substr(1); } } else { // other path value = uri.path; } if (_platform_js__WEBPACK_IMPORTED_MODULE_1__/* .isWindows */ .ED) { value = value.replace(/\//g, '\\'); } return value; } /** * Create the external version of a uri */ function _asFormatted(uri, skipEncoding) { const encoder = !skipEncoding ? encodeURIComponentFast : encodeURIComponentMinimal; let res = ''; let { scheme, authority, path, query, fragment } = uri; if (scheme) { res += scheme; res += ':'; } if (authority || scheme === 'file') { res += _slash; res += _slash; } if (authority) { let idx = authority.indexOf('@'); if (idx !== -1) { // @ const userinfo = authority.substr(0, idx); authority = authority.substr(idx + 1); idx = userinfo.indexOf(':'); if (idx === -1) { res += encoder(userinfo, false); } else { // :@ res += encoder(userinfo.substr(0, idx), false); res += ':'; res += encoder(userinfo.substr(idx + 1), false); } res += '@'; } authority = authority.toLowerCase(); idx = authority.indexOf(':'); if (idx === -1) { res += encoder(authority, false); } else { // : res += encoder(authority.substr(0, idx), false); res += authority.substr(idx); } } if (path) { // lower-case windows drive letters in /C:/fff or C:/fff if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { const code = path.charCodeAt(1); if (code >= 65 /* A */ && code <= 90 /* Z */) { path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`; // "/c:".length === 3 } } else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { const code = path.charCodeAt(0); if (code >= 65 /* A */ && code <= 90 /* Z */) { path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`; // "/c:".length === 3 } } // encode the rest of the path res += encoder(path, true); } if (query) { res += '?'; res += encoder(query, false); } if (fragment) { res += '#'; res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; } return res; } // --- decode function decodeURIComponentGraceful(str) { try { return decodeURIComponent(str); } catch (_a) { if (str.length > 3) { return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3)); } else { return str; } } } const _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g; function percentDecode(str) { if (!str.match(_rEncodedAsHex)) { return str; } return str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match)); } /***/ }), /***/ 29711: /*!************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/parts/quickinput/common/quickInput.js ***! \************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Jq: function() { return /* binding */ QuickInputHideReason; }, /* harmony export */ X5: function() { return /* binding */ NO_KEY_MODS; }, /* harmony export */ jG: function() { return /* binding */ ItemActivation; } /* harmony export */ }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const NO_KEY_MODS = { ctrlCmd: false, alt: false }; var QuickInputHideReason; (function (QuickInputHideReason) { /** * Focus moved away from the quick input. */ QuickInputHideReason[QuickInputHideReason["Blur"] = 1] = "Blur"; /** * An explicit user gesture, e.g. pressing Escape key. */ QuickInputHideReason[QuickInputHideReason["Gesture"] = 2] = "Gesture"; /** * Anything else. */ QuickInputHideReason[QuickInputHideReason["Other"] = 3] = "Other"; })(QuickInputHideReason || (QuickInputHideReason = {})); var ItemActivation; (function (ItemActivation) { ItemActivation[ItemActivation["NONE"] = 0] = "NONE"; ItemActivation[ItemActivation["FIRST"] = 1] = "FIRST"; ItemActivation[ItemActivation["SECOND"] = 2] = "SECOND"; ItemActivation[ItemActivation["LAST"] = 3] = "LAST"; })(ItemActivation || (ItemActivation = {})); //#endregion /***/ }), /***/ 98909: /*!***************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/_.contribution.js ***! \***************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ H: function() { return /* binding */ registerLanguage; } /* harmony export */ }); /* unused harmony export loadLanguage */ /* harmony import */ var _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fillers/monaco-editor-core.js */ 5359); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var languageDefinitions = {}; var lazyLanguageLoaders = {}; var LazyLanguageLoader = /** @class */ (function () { function LazyLanguageLoader(languageId) { var _this = this; this._languageId = languageId; this._loadingTriggered = false; this._lazyLoadPromise = new Promise(function (resolve, reject) { _this._lazyLoadPromiseResolve = resolve; _this._lazyLoadPromiseReject = reject; }); } LazyLanguageLoader.getOrCreate = function (languageId) { if (!lazyLanguageLoaders[languageId]) { lazyLanguageLoaders[languageId] = new LazyLanguageLoader(languageId); } return lazyLanguageLoaders[languageId]; }; LazyLanguageLoader.prototype.whenLoaded = function () { return this._lazyLoadPromise; }; LazyLanguageLoader.prototype.load = function () { var _this = this; if (!this._loadingTriggered) { this._loadingTriggered = true; languageDefinitions[this._languageId].loader().then(function (mod) { return _this._lazyLoadPromiseResolve(mod); }, function (err) { return _this._lazyLoadPromiseReject(err); }); } return this._lazyLoadPromise; }; return LazyLanguageLoader; }()); function loadLanguage(languageId) { return LazyLanguageLoader.getOrCreate(languageId).load(); } function registerLanguage(def) { var languageId = def.id; languageDefinitions[languageId] = def; _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__/* .languages */ .Mj.register(def); var lazyLanguageLoader = LazyLanguageLoader.getOrCreate(languageId); _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__/* .languages */ .Mj.setMonarchTokensProvider(languageId, lazyLanguageLoader.whenLoaded().then(function (mod) { return mod.language; })); _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__/* .languages */ .Mj.onLanguage(languageId, function () { lazyLanguageLoader.load().then(function (mod) { _fillers_monaco_editor_core_js__WEBPACK_IMPORTED_MODULE_0__/* .languages */ .Mj.setLanguageConfiguration(languageId, mod.conf); }); }); } /***/ }), /***/ 92973: /*!***********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/abap/abap.contribution.js ***! \***********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'abap', extensions: ['.abap'], aliases: ['abap', 'ABAP'], loader: function () { return __webpack_require__.e(/*! import() */ 5434).then(__webpack_require__.bind(__webpack_require__, /*! ./abap.js */ 5434)); } }); /***/ }), /***/ 72773: /*!***********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/apex/apex.contribution.js ***! \***********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'apex', extensions: ['.cls'], aliases: ['Apex', 'apex'], mimetypes: ['text/x-apex-source', 'text/x-apex'], loader: function () { return __webpack_require__.e(/*! import() */ 92594).then(__webpack_require__.bind(__webpack_require__, /*! ./apex.js */ 92594)); } }); /***/ }), /***/ 30219: /*!*************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/azcli/azcli.contribution.js ***! \*************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'azcli', extensions: ['.azcli'], aliases: ['Azure CLI', 'azcli'], loader: function () { return __webpack_require__.e(/*! import() */ 87964).then(__webpack_require__.bind(__webpack_require__, /*! ./azcli.js */ 87964)); } }); /***/ }), /***/ 10755: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/bat/bat.contribution.js ***! \*********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'bat', extensions: ['.bat', '.cmd'], aliases: ['Batch', 'bat'], loader: function () { return __webpack_require__.e(/*! import() */ 29895).then(__webpack_require__.bind(__webpack_require__, /*! ./bat.js */ 29895)); } }); /***/ }), /***/ 74121: /*!*******************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/cameligo/cameligo.contribution.js ***! \*******************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'cameligo', extensions: ['.mligo'], aliases: ['Cameligo'], loader: function () { return __webpack_require__.e(/*! import() */ 72969).then(__webpack_require__.bind(__webpack_require__, /*! ./cameligo.js */ 72969)); } }); /***/ }), /***/ 77973: /*!*****************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/clojure/clojure.contribution.js ***! \*****************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'clojure', extensions: ['.clj', '.cljs', '.cljc', '.edn'], aliases: ['clojure', 'Clojure'], loader: function () { return __webpack_require__.e(/*! import() */ 9928).then(__webpack_require__.bind(__webpack_require__, /*! ./clojure.js */ 3568)); } }); /***/ }), /***/ 27246: /*!***************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/coffee/coffee.contribution.js ***! \***************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'coffeescript', extensions: ['.coffee'], aliases: ['CoffeeScript', 'coffeescript', 'coffee'], mimetypes: ['text/x-coffeescript', 'text/coffeescript'], loader: function () { return __webpack_require__.e(/*! import() */ 91274).then(__webpack_require__.bind(__webpack_require__, /*! ./coffee.js */ 91274)); } }); /***/ }), /***/ 82961: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/cpp/cpp.contribution.js ***! \*********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'c', extensions: ['.c', '.h'], aliases: ['C', 'c'], loader: function () { return __webpack_require__.e(/*! import() */ 49260).then(__webpack_require__.bind(__webpack_require__, /*! ./cpp.js */ 49260)); } }); (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'cpp', extensions: ['.cpp', '.cc', '.cxx', '.hpp', '.hh', '.hxx'], aliases: ['C++', 'Cpp', 'cpp'], loader: function () { return __webpack_require__.e(/*! import() */ 49260).then(__webpack_require__.bind(__webpack_require__, /*! ./cpp.js */ 49260)); } }); /***/ }), /***/ 19959: /*!***************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/csharp/csharp.contribution.js ***! \***************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'csharp', extensions: ['.cs', '.csx', '.cake'], aliases: ['C#', 'csharp'], loader: function () { return __webpack_require__.e(/*! import() */ 77084).then(__webpack_require__.bind(__webpack_require__, /*! ./csharp.js */ 77084)); } }); /***/ }), /***/ 23347: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/csp/csp.contribution.js ***! \*********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'csp', extensions: [], aliases: ['CSP', 'csp'], loader: function () { return __webpack_require__.e(/*! import() */ 47686).then(__webpack_require__.bind(__webpack_require__, /*! ./csp.js */ 47686)); } }); /***/ }), /***/ 17323: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/css/css.contribution.js ***! \*********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'css', extensions: ['.css'], aliases: ['CSS', 'css'], mimetypes: ['text/css'], loader: function () { return __webpack_require__.e(/*! import() */ 28920).then(__webpack_require__.bind(__webpack_require__, /*! ./css.js */ 28920)); } }); /***/ }), /***/ 90130: /*!***********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/dockerfile/dockerfile.contribution.js ***! \***********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'dockerfile', extensions: ['.dockerfile'], filenames: ['Dockerfile'], aliases: ['Dockerfile'], loader: function () { return __webpack_require__.e(/*! import() */ 67156).then(__webpack_require__.bind(__webpack_require__, /*! ./dockerfile.js */ 67156)); } }); /***/ }), /***/ 5359: /*!***************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/fillers/monaco-editor-core.js ***! \***************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Mj: function() { return /* reexport safe */ _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__.languages; } /* harmony export */ }); /* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.api.js */ 2550); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /***/ }), /***/ 72185: /*!***************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/fsharp/fsharp.contribution.js ***! \***************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'fsharp', extensions: ['.fs', '.fsi', '.ml', '.mli', '.fsx', '.fsscript'], aliases: ['F#', 'FSharp', 'fsharp'], loader: function () { return __webpack_require__.e(/*! import() */ 35354).then(__webpack_require__.bind(__webpack_require__, /*! ./fsharp.js */ 35354)); } }); /***/ }), /***/ 40882: /*!*******************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/go/go.contribution.js ***! \*******************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'go', extensions: ['.go'], aliases: ['Go'], loader: function () { return __webpack_require__.e(/*! import() */ 85764).then(__webpack_require__.bind(__webpack_require__, /*! ./go.js */ 85764)); } }); /***/ }), /***/ 14349: /*!*****************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/graphql/graphql.contribution.js ***! \*****************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'graphql', extensions: ['.graphql', '.gql'], aliases: ['GraphQL', 'graphql', 'gql'], mimetypes: ['application/graphql'], loader: function () { return __webpack_require__.e(/*! import() */ 33805).then(__webpack_require__.bind(__webpack_require__, /*! ./graphql.js */ 33805)); } }); /***/ }), /***/ 10715: /*!***********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/handlebars/handlebars.contribution.js ***! \***********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'handlebars', extensions: ['.handlebars', '.hbs'], aliases: ['Handlebars', 'handlebars', 'hbs'], mimetypes: ['text/x-handlebars-template'], loader: function () { return __webpack_require__.e(/*! import() */ 70671).then(__webpack_require__.bind(__webpack_require__, /*! ./handlebars.js */ 70671)); } }); /***/ }), /***/ 88756: /*!***********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/html/html.contribution.js ***! \***********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'html', extensions: ['.html', '.htm', '.shtml', '.xhtml', '.mdoc', '.jsp', '.asp', '.aspx', '.jshtm'], aliases: ['HTML', 'htm', 'html', 'xhtml'], mimetypes: ['text/html', 'text/x-jshtm', 'text/template', 'text/ng-template'], loader: function () { return __webpack_require__.e(/*! import() */ 29559).then(__webpack_require__.bind(__webpack_require__, /*! ./html.js */ 29559)); } }); /***/ }), /***/ 30141: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/ini/ini.contribution.js ***! \*********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'ini', extensions: ['.ini', '.properties', '.gitconfig'], filenames: ['config', '.gitattributes', '.gitconfig', '.editorconfig'], aliases: ['Ini', 'ini'], loader: function () { return __webpack_require__.e(/*! import() */ 53550).then(__webpack_require__.bind(__webpack_require__, /*! ./ini.js */ 53550)); } }); /***/ }), /***/ 44115: /*!***********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/java/java.contribution.js ***! \***********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'java', extensions: ['.java', '.jav'], aliases: ['Java', 'java'], mimetypes: ['text/x-java-source', 'text/x-java'], loader: function () { return __webpack_require__.e(/*! import() */ 34850).then(__webpack_require__.bind(__webpack_require__, /*! ./java.js */ 34850)); } }); /***/ }), /***/ 65588: /*!***********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.js ***! \***********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'javascript', extensions: ['.js', '.es6', '.jsx', '.mjs'], firstLine: '^#!.*\\bnode', filenames: ['jakefile'], aliases: ['JavaScript', 'javascript', 'js'], mimetypes: ['text/javascript'], loader: function () { return __webpack_require__.e(/*! import() */ 39950).then(__webpack_require__.bind(__webpack_require__, /*! ./javascript.js */ 39950)); } }); /***/ }), /***/ 83135: /*!***************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/kotlin/kotlin.contribution.js ***! \***************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'kotlin', extensions: ['.kt'], aliases: ['Kotlin', 'kotlin'], mimetypes: ['text/x-kotlin-source', 'text/x-kotlin'], loader: function () { return __webpack_require__.e(/*! import() */ 29968).then(__webpack_require__.bind(__webpack_require__, /*! ./kotlin.js */ 29968)); } }); /***/ }), /***/ 91067: /*!***********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/less/less.contribution.js ***! \***********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'less', extensions: ['.less'], aliases: ['Less', 'less'], mimetypes: ['text/x-less', 'text/less'], loader: function () { return __webpack_require__.e(/*! import() */ 58271).then(__webpack_require__.bind(__webpack_require__, /*! ./less.js */ 58271)); } }); /***/ }), /***/ 63886: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/lua/lua.contribution.js ***! \*********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'lua', extensions: ['.lua'], aliases: ['Lua', 'lua'], loader: function () { return __webpack_require__.e(/*! import() */ 4685).then(__webpack_require__.bind(__webpack_require__, /*! ./lua.js */ 4685)); } }); /***/ }), /***/ 44865: /*!*******************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/markdown/markdown.contribution.js ***! \*******************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'markdown', extensions: ['.md', '.markdown', '.mdown', '.mkdn', '.mkd', '.mdwn', '.mdtxt', '.mdtext'], aliases: ['Markdown', 'markdown'], loader: function () { return __webpack_require__.e(/*! import() */ 31154).then(__webpack_require__.bind(__webpack_require__, /*! ./markdown.js */ 31154)); } }); /***/ }), /***/ 41495: /*!***********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/mips/mips.contribution.js ***! \***********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'mips', extensions: ['.s'], aliases: ['MIPS', 'MIPS-V'], mimetypes: ['text/x-mips', 'text/mips', 'text/plaintext'], loader: function () { return __webpack_require__.e(/*! import() */ 63198).then(__webpack_require__.bind(__webpack_require__, /*! ./mips.js */ 63198)); } }); /***/ }), /***/ 12076: /*!*************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/msdax/msdax.contribution.js ***! \*************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'msdax', extensions: ['.dax', '.msdax'], aliases: ['DAX', 'MSDAX'], loader: function () { return __webpack_require__.e(/*! import() */ 57365).then(__webpack_require__.bind(__webpack_require__, /*! ./msdax.js */ 57365)); } }); /***/ }), /***/ 38516: /*!*************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/mysql/mysql.contribution.js ***! \*************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'mysql', extensions: [], aliases: ['MySQL', 'mysql'], loader: function () { return __webpack_require__.e(/*! import() */ 48776).then(__webpack_require__.bind(__webpack_require__, /*! ./mysql.js */ 48776)); } }); /***/ }), /***/ 18504: /*!*************************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/objective-c/objective-c.contribution.js ***! \*************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'objective-c', extensions: ['.m'], aliases: ['Objective-C'], loader: function () { return __webpack_require__.e(/*! import() */ 24797).then(__webpack_require__.bind(__webpack_require__, /*! ./objective-c.js */ 24797)); } }); /***/ }), /***/ 28593: /*!***************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/pascal/pascal.contribution.js ***! \***************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'pascal', extensions: ['.pas', '.p', '.pp'], aliases: ['Pascal', 'pas'], mimetypes: ['text/x-pascal-source', 'text/x-pascal'], loader: function () { return __webpack_require__.e(/*! import() */ 89554).then(__webpack_require__.bind(__webpack_require__, /*! ./pascal.js */ 89554)); } }); /***/ }), /***/ 43069: /*!*********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/pascaligo/pascaligo.contribution.js ***! \*********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'pascaligo', extensions: ['.ligo'], aliases: ['Pascaligo', 'ligo'], loader: function () { return __webpack_require__.e(/*! import() */ 2837).then(__webpack_require__.bind(__webpack_require__, /*! ./pascaligo.js */ 2837)); } }); /***/ }), /***/ 50185: /*!***********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/perl/perl.contribution.js ***! \***********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'perl', extensions: ['.pl'], aliases: ['Perl', 'pl'], loader: function () { return __webpack_require__.e(/*! import() */ 78737).then(__webpack_require__.bind(__webpack_require__, /*! ./perl.js */ 78737)); } }); /***/ }), /***/ 11745: /*!*************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/pgsql/pgsql.contribution.js ***! \*************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'pgsql', extensions: [], aliases: ['PostgreSQL', 'postgres', 'pg', 'postgre'], loader: function () { return __webpack_require__.e(/*! import() */ 28089).then(__webpack_require__.bind(__webpack_require__, /*! ./pgsql.js */ 28089)); } }); /***/ }), /***/ 96025: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/php/php.contribution.js ***! \*********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'php', extensions: ['.php', '.php4', '.php5', '.phtml', '.ctp'], aliases: ['PHP', 'php'], mimetypes: ['application/x-php'], loader: function () { return __webpack_require__.e(/*! import() */ 24628).then(__webpack_require__.bind(__webpack_require__, /*! ./php.js */ 24628)); } }); /***/ }), /***/ 85713: /*!*******************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/postiats/postiats.contribution.js ***! \*******************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'postiats', extensions: ['.dats', '.sats', '.hats'], aliases: ['ATS', 'ATS/Postiats'], loader: function () { return __webpack_require__.e(/*! import() */ 65876).then(__webpack_require__.bind(__webpack_require__, /*! ./postiats.js */ 65876)); } }); /***/ }), /***/ 98836: /*!***********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/powerquery/powerquery.contribution.js ***! \***********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'powerquery', extensions: ['.pq', '.pqm'], aliases: ['PQ', 'M', 'Power Query', 'Power Query M'], loader: function () { return __webpack_require__.e(/*! import() */ 86045).then(__webpack_require__.bind(__webpack_require__, /*! ./powerquery.js */ 86045)); } }); /***/ }), /***/ 18625: /*!***********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/powershell/powershell.contribution.js ***! \***********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'powershell', extensions: ['.ps1', '.psm1', '.psd1'], aliases: ['PowerShell', 'powershell', 'ps', 'ps1'], loader: function () { return __webpack_require__.e(/*! import() */ 72011).then(__webpack_require__.bind(__webpack_require__, /*! ./powershell.js */ 72011)); } }); /***/ }), /***/ 25167: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/pug/pug.contribution.js ***! \*********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'pug', extensions: ['.jade', '.pug'], aliases: ['Pug', 'Jade', 'jade'], loader: function () { return __webpack_require__.e(/*! import() */ 90316).then(__webpack_require__.bind(__webpack_require__, /*! ./pug.js */ 90316)); } }); /***/ }), /***/ 5512: /*!***************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/python/python.contribution.js ***! \***************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'python', extensions: ['.py', '.rpy', '.pyw', '.cpy', '.gyp', '.gypi'], aliases: ['Python', 'py'], firstLine: '^#!/.*\\bpython[0-9.-]*\\b', loader: function () { return __webpack_require__.e(/*! import() */ 2249).then(__webpack_require__.bind(__webpack_require__, /*! ./python.js */ 2249)); } }); /***/ }), /***/ 59066: /*!*****************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/r/r.contribution.js ***! \*****************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'r', extensions: ['.r', '.rhistory', '.rmd', '.rprofile', '.rt'], aliases: ['R', 'r'], loader: function () { return __webpack_require__.e(/*! import() */ 68842).then(__webpack_require__.bind(__webpack_require__, /*! ./r.js */ 68842)); } }); /***/ }), /***/ 73363: /*!*************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/razor/razor.contribution.js ***! \*************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'razor', extensions: ['.cshtml'], aliases: ['Razor', 'razor'], mimetypes: ['text/x-cshtml'], loader: function () { return __webpack_require__.e(/*! import() */ 18898).then(__webpack_require__.bind(__webpack_require__, /*! ./razor.js */ 18898)); } }); /***/ }), /***/ 5769: /*!*************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/redis/redis.contribution.js ***! \*************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'redis', extensions: ['.redis'], aliases: ['redis'], loader: function () { return __webpack_require__.e(/*! import() */ 18350).then(__webpack_require__.bind(__webpack_require__, /*! ./redis.js */ 18350)); } }); /***/ }), /***/ 95630: /*!*******************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/redshift/redshift.contribution.js ***! \*******************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'redshift', extensions: [], aliases: ['Redshift', 'redshift'], loader: function () { return __webpack_require__.e(/*! import() */ 34790).then(__webpack_require__.bind(__webpack_require__, /*! ./redshift.js */ 34790)); } }); /***/ }), /***/ 12189: /*!***********************************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/restructuredtext/restructuredtext.contribution.js ***! \***********************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'restructuredtext', extensions: ['.rst'], aliases: ['reStructuredText', 'restructuredtext'], loader: function () { return __webpack_require__.e(/*! import() */ 53697).then(__webpack_require__.bind(__webpack_require__, /*! ./restructuredtext.js */ 53697)); } }); /***/ }), /***/ 78605: /*!***********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/ruby/ruby.contribution.js ***! \***********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'ruby', extensions: ['.rb', '.rbx', '.rjs', '.gemspec', '.pp'], filenames: ['rakefile', 'Gemfile'], aliases: ['Ruby', 'rb'], loader: function () { return __webpack_require__.e(/*! import() */ 28561).then(__webpack_require__.bind(__webpack_require__, /*! ./ruby.js */ 28561)); } }); /***/ }), /***/ 17728: /*!***********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/rust/rust.contribution.js ***! \***********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'rust', extensions: ['.rs', '.rlib'], aliases: ['Rust', 'rust'], loader: function () { return __webpack_require__.e(/*! import() */ 26126).then(__webpack_require__.bind(__webpack_require__, /*! ./rust.js */ 26126)); } }); /***/ }), /***/ 94503: /*!*******************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/sb/sb.contribution.js ***! \*******************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'sb', extensions: ['.sb'], aliases: ['Small Basic', 'sb'], loader: function () { return __webpack_require__.e(/*! import() */ 51144).then(__webpack_require__.bind(__webpack_require__, /*! ./sb.js */ 51144)); } }); /***/ }), /***/ 35550: /*!*************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/scala/scala.contribution.js ***! \*************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'scala', extensions: ['.scala', '.sc', '.sbt'], aliases: ['Scala', 'scala', 'SBT', 'Sbt', 'sbt', 'Dotty', 'dotty'], mimetypes: ['text/x-scala-source', 'text/x-scala', 'text/x-sbt', 'text/x-dotty'], loader: function () { return __webpack_require__.e(/*! import() */ 53777).then(__webpack_require__.bind(__webpack_require__, /*! ./scala.js */ 53777)); } }); /***/ }), /***/ 66857: /*!***************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/scheme/scheme.contribution.js ***! \***************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'scheme', extensions: ['.scm', '.ss', '.sch', '.rkt'], aliases: ['scheme', 'Scheme'], loader: function () { return __webpack_require__.e(/*! import() */ 44354).then(__webpack_require__.bind(__webpack_require__, /*! ./scheme.js */ 44354)); } }); /***/ }), /***/ 38341: /*!***********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/scss/scss.contribution.js ***! \***********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'scss', extensions: ['.scss'], aliases: ['Sass', 'sass', 'scss'], mimetypes: ['text/x-scss', 'text/scss'], loader: function () { return __webpack_require__.e(/*! import() */ 35060).then(__webpack_require__.bind(__webpack_require__, /*! ./scss.js */ 35060)); } }); /***/ }), /***/ 61010: /*!*************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/shell/shell.contribution.js ***! \*************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'shell', extensions: ['.sh', '.bash'], aliases: ['Shell', 'sh'], loader: function () { return __webpack_require__.e(/*! import() */ 97591).then(__webpack_require__.bind(__webpack_require__, /*! ./shell.js */ 97591)); } }); /***/ }), /***/ 1099: /*!*******************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/solidity/solidity.contribution.js ***! \*******************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'sol', extensions: ['.sol'], aliases: ['sol', 'solidity', 'Solidity'], loader: function () { return __webpack_require__.e(/*! import() */ 44360).then(__webpack_require__.bind(__webpack_require__, /*! ./solidity.js */ 44360)); } }); /***/ }), /***/ 46794: /*!***************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/sophia/sophia.contribution.js ***! \***************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'aes', extensions: ['.aes'], aliases: ['aes', 'sophia', 'Sophia'], loader: function () { return __webpack_require__.e(/*! import() */ 3885).then(__webpack_require__.bind(__webpack_require__, /*! ./sophia.js */ 3885)); } }); /***/ }), /***/ 32985: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/sql/sql.contribution.js ***! \*********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'sql', extensions: ['.sql'], aliases: ['SQL'], loader: function () { return __webpack_require__.e(/*! import() */ 10354).then(__webpack_require__.bind(__webpack_require__, /*! ./sql.js */ 10354)); } }); /***/ }), /***/ 72088: /*!*******************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/st/st.contribution.js ***! \*******************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'st', extensions: ['.st', '.iecst', '.iecplc', '.lc3lib'], aliases: ['StructuredText', 'scl', 'stl'], loader: function () { return __webpack_require__.e(/*! import() */ 6378).then(__webpack_require__.bind(__webpack_require__, /*! ./st.js */ 6378)); } }); /***/ }), /***/ 69746: /*!*************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/swift/swift.contribution.js ***! \*************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'swift', aliases: ['Swift', 'swift'], extensions: ['.swift'], mimetypes: ['text/swift'], loader: function () { return __webpack_require__.e(/*! import() */ 35416).then(__webpack_require__.bind(__webpack_require__, /*! ./swift.js */ 35416)); } }); /***/ }), /***/ 94912: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/tcl/tcl.contribution.js ***! \*********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'tcl', extensions: ['.tcl'], aliases: ['tcl', 'Tcl', 'tcltk', 'TclTk', 'tcl/tk', 'Tcl/Tk'], loader: function () { return __webpack_require__.e(/*! import() */ 99104).then(__webpack_require__.bind(__webpack_require__, /*! ./tcl.js */ 99104)); } }); /***/ }), /***/ 60032: /*!***********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/twig/twig.contribution.js ***! \***********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'twig', extensions: ['.twig'], aliases: ['Twig', 'twig'], mimetypes: ['text/x-twig'], loader: function () { return __webpack_require__.e(/*! import() */ 92538).then(__webpack_require__.bind(__webpack_require__, /*! ./twig.js */ 92538)); } }); /***/ }), /***/ 24571: /*!***********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution.js ***! \***********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'typescript', extensions: ['.ts', '.tsx'], aliases: ['TypeScript', 'ts', 'typescript'], mimetypes: ['text/typescript'], loader: function () { return __webpack_require__.e(/*! import() */ 75321).then(__webpack_require__.bind(__webpack_require__, /*! ./typescript.js */ 75321)); } }); /***/ }), /***/ 77777: /*!*******************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/vb/vb.contribution.js ***! \*******************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'vb', extensions: ['.vb'], aliases: ['Visual Basic', 'vb'], loader: function () { return __webpack_require__.e(/*! import() */ 28161).then(__webpack_require__.bind(__webpack_require__, /*! ./vb.js */ 28161)); } }); /***/ }), /***/ 39393: /*!*********************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/basic-languages/xml/xml.contribution.js ***! \*********************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _contribution_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_.contribution.js */ 98909); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ (0,_contribution_js__WEBPACK_IMPORTED_MODULE_0__/* .registerLanguage */ .H)({ id: 'xml', extensions: [ '.xml', '.dtd', '.ascx', '.csproj', '.config', '.wxi', '.wxl', '.wxs', '.xaml', '.svg', '.svgz', '.opf', '.xsl' ], firstLine: '(\\<\\?xml.*)|(\\ this._values[id]); } } function clearAllFontInfos() { CSSBasedConfiguration.INSTANCE.clearCache(); } class CSSBasedConfiguration extends lifecycle/* Disposable */.JT { constructor() { super(); this._onDidChange = this._register(new common_event/* Emitter */.Q5()); this.onDidChange = this._onDidChange.event; this._cache = new CSSBasedConfigurationCache(); this._evictUntrustedReadingsTimeout = -1; } dispose() { if (this._evictUntrustedReadingsTimeout !== -1) { clearTimeout(this._evictUntrustedReadingsTimeout); this._evictUntrustedReadingsTimeout = -1; } super.dispose(); } clearCache() { this._cache = new CSSBasedConfigurationCache(); this._onDidChange.fire(); } _writeToCache(item, value) { this._cache.put(item, value); if (!value.isTrusted && this._evictUntrustedReadingsTimeout === -1) { // Try reading again after some time this._evictUntrustedReadingsTimeout = setTimeout(() => { this._evictUntrustedReadingsTimeout = -1; this._evictUntrustedReadings(); }, 5000); } } _evictUntrustedReadings() { const values = this._cache.getValues(); let somethingRemoved = false; for (const item of values) { if (!item.isTrusted) { somethingRemoved = true; this._cache.remove(item); } } if (somethingRemoved) { this._onDidChange.fire(); } } readConfiguration(bareFontInfo) { if (!this._cache.has(bareFontInfo)) { let readConfig = CSSBasedConfiguration._actualReadConfiguration(bareFontInfo); if (readConfig.typicalHalfwidthCharacterWidth <= 2 || readConfig.typicalFullwidthCharacterWidth <= 2 || readConfig.spaceWidth <= 2 || readConfig.maxDigitWidth <= 2) { // Hey, it's Bug 14341 ... we couldn't read readConfig = new fontInfo/* FontInfo */.pR({ zoomLevel: browser/* getZoomLevel */.px(), pixelRatio: browser/* getPixelRatio */.mX(), fontFamily: readConfig.fontFamily, fontWeight: readConfig.fontWeight, fontSize: readConfig.fontSize, fontFeatureSettings: readConfig.fontFeatureSettings, lineHeight: readConfig.lineHeight, letterSpacing: readConfig.letterSpacing, isMonospace: readConfig.isMonospace, typicalHalfwidthCharacterWidth: Math.max(readConfig.typicalHalfwidthCharacterWidth, 5), typicalFullwidthCharacterWidth: Math.max(readConfig.typicalFullwidthCharacterWidth, 5), canUseHalfwidthRightwardsArrow: readConfig.canUseHalfwidthRightwardsArrow, spaceWidth: Math.max(readConfig.spaceWidth, 5), middotWidth: Math.max(readConfig.middotWidth, 5), wsmiddotWidth: Math.max(readConfig.wsmiddotWidth, 5), maxDigitWidth: Math.max(readConfig.maxDigitWidth, 5), }, false); } this._writeToCache(bareFontInfo, readConfig); } return this._cache.get(bareFontInfo); } static createRequest(chr, type, all, monospace) { const result = new CharWidthRequest(chr, type); all.push(result); if (monospace) { monospace.push(result); } return result; } static _actualReadConfiguration(bareFontInfo) { const all = []; const monospace = []; const typicalHalfwidthCharacter = this.createRequest('n', 0 /* Regular */, all, monospace); const typicalFullwidthCharacter = this.createRequest('\uff4d', 0 /* Regular */, all, null); const space = this.createRequest(' ', 0 /* Regular */, all, monospace); const digit0 = this.createRequest('0', 0 /* Regular */, all, monospace); const digit1 = this.createRequest('1', 0 /* Regular */, all, monospace); const digit2 = this.createRequest('2', 0 /* Regular */, all, monospace); const digit3 = this.createRequest('3', 0 /* Regular */, all, monospace); const digit4 = this.createRequest('4', 0 /* Regular */, all, monospace); const digit5 = this.createRequest('5', 0 /* Regular */, all, monospace); const digit6 = this.createRequest('6', 0 /* Regular */, all, monospace); const digit7 = this.createRequest('7', 0 /* Regular */, all, monospace); const digit8 = this.createRequest('8', 0 /* Regular */, all, monospace); const digit9 = this.createRequest('9', 0 /* Regular */, all, monospace); // monospace test: used for whitespace rendering const rightwardsArrow = this.createRequest('→', 0 /* Regular */, all, monospace); const halfwidthRightwardsArrow = this.createRequest('→', 0 /* Regular */, all, null); // U+00B7 - MIDDLE DOT const middot = this.createRequest('·', 0 /* Regular */, all, monospace); // U+2E31 - WORD SEPARATOR MIDDLE DOT const wsmiddotWidth = this.createRequest(String.fromCharCode(0x2E31), 0 /* Regular */, all, null); // monospace test: some characters const monospaceTestChars = '|/-_ilm%'; for (let i = 0, len = monospaceTestChars.length; i < len; i++) { this.createRequest(monospaceTestChars.charAt(i), 0 /* Regular */, all, monospace); this.createRequest(monospaceTestChars.charAt(i), 1 /* Italic */, all, monospace); this.createRequest(monospaceTestChars.charAt(i), 2 /* Bold */, all, monospace); } readCharWidths(bareFontInfo, all); const maxDigitWidth = Math.max(digit0.width, digit1.width, digit2.width, digit3.width, digit4.width, digit5.width, digit6.width, digit7.width, digit8.width, digit9.width); let isMonospace = (bareFontInfo.fontFeatureSettings === editorOptions/* EditorFontLigatures */.n0.OFF); const referenceWidth = monospace[0].width; for (let i = 1, len = monospace.length; isMonospace && i < len; i++) { const diff = referenceWidth - monospace[i].width; if (diff < -0.001 || diff > 0.001) { isMonospace = false; break; } } let canUseHalfwidthRightwardsArrow = true; if (isMonospace && halfwidthRightwardsArrow.width !== referenceWidth) { // using a halfwidth rightwards arrow would break monospace... canUseHalfwidthRightwardsArrow = false; } if (halfwidthRightwardsArrow.width > rightwardsArrow.width) { // using a halfwidth rightwards arrow would paint a larger arrow than a regular rightwards arrow canUseHalfwidthRightwardsArrow = false; } // let's trust the zoom level only 2s after it was changed. const canTrustBrowserZoomLevel = (browser/* getTimeSinceLastZoomLevelChanged */.WP() > 2000); return new fontInfo/* FontInfo */.pR({ zoomLevel: browser/* getZoomLevel */.px(), pixelRatio: browser/* getPixelRatio */.mX(), fontFamily: bareFontInfo.fontFamily, fontWeight: bareFontInfo.fontWeight, fontSize: bareFontInfo.fontSize, fontFeatureSettings: bareFontInfo.fontFeatureSettings, lineHeight: bareFontInfo.lineHeight, letterSpacing: bareFontInfo.letterSpacing, isMonospace: isMonospace, typicalHalfwidthCharacterWidth: typicalHalfwidthCharacter.width, typicalFullwidthCharacterWidth: typicalFullwidthCharacter.width, canUseHalfwidthRightwardsArrow: canUseHalfwidthRightwardsArrow, spaceWidth: space.width, middotWidth: middot.width, wsmiddotWidth: wsmiddotWidth.width, maxDigitWidth: maxDigitWidth }, canTrustBrowserZoomLevel); } } CSSBasedConfiguration.INSTANCE = new CSSBasedConfiguration(); class Configuration extends commonEditorConfig/* CommonEditorConfiguration */.fv { constructor(isSimpleWidget, options, referenceDomElement = null, accessibilityService) { super(isSimpleWidget, options); this.accessibilityService = accessibilityService; this._elementSizeObserver = this._register(new elementSizeObserver/* ElementSizeObserver */.I(referenceDomElement, options.dimension, () => this._recomputeOptions())); this._register(CSSBasedConfiguration.INSTANCE.onDidChange(() => this._recomputeOptions())); if (this._validatedOptions.get(10 /* automaticLayout */)) { this._elementSizeObserver.startObserving(); } this._register(browser/* onDidChangeZoomLevel */.fX(_ => this._recomputeOptions())); this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(() => this._recomputeOptions())); this._recomputeOptions(); } static applyFontInfoSlow(domNode, fontInfo) { domNode.style.fontFamily = fontInfo.getMassagedFontFamily(browser/* isSafari */.G6 ? editorOptions/* EDITOR_FONT_DEFAULTS */.hL.fontFamily : null); domNode.style.fontWeight = fontInfo.fontWeight; domNode.style.fontSize = fontInfo.fontSize + 'px'; domNode.style.fontFeatureSettings = fontInfo.fontFeatureSettings; domNode.style.lineHeight = fontInfo.lineHeight + 'px'; domNode.style.letterSpacing = fontInfo.letterSpacing + 'px'; } static applyFontInfo(domNode, fontInfo) { domNode.setFontFamily(fontInfo.getMassagedFontFamily(browser/* isSafari */.G6 ? editorOptions/* EDITOR_FONT_DEFAULTS */.hL.fontFamily : null)); domNode.setFontWeight(fontInfo.fontWeight); domNode.setFontSize(fontInfo.fontSize); domNode.setFontFeatureSettings(fontInfo.fontFeatureSettings); domNode.setLineHeight(fontInfo.lineHeight); domNode.setLetterSpacing(fontInfo.letterSpacing); } observeReferenceElement(dimension) { this._elementSizeObserver.observe(dimension); } updatePixelRatio() { this._recomputeOptions(); } static _getExtraEditorClassName() { let extra = ''; if (!browser/* isSafari */.G6 && !browser/* isWebkitWebView */.MG) { // Use user-select: none in all browsers except Safari and native macOS WebView extra += 'no-user-select '; } if (browser/* isSafari */.G6) { // See https://github.com/microsoft/vscode/issues/108822 extra += 'no-minimap-shadow '; } if (platform/* isMacintosh */.dz) { extra += 'mac '; } return extra; } _getEnvConfiguration() { return { extraEditorClassName: Configuration._getExtraEditorClassName(), outerWidth: this._elementSizeObserver.getWidth(), outerHeight: this._elementSizeObserver.getHeight(), emptySelectionClipboard: browser/* isWebKit */.Pf || browser/* isFirefox */.vU, pixelRatio: browser/* getPixelRatio */.mX(), zoomLevel: browser/* getZoomLevel */.px(), accessibilitySupport: (this.accessibilityService.isScreenReaderOptimized() ? 2 /* Enabled */ : this.accessibilityService.getAccessibilitySupport()) }; } readConfiguration(bareFontInfo) { return CSSBasedConfiguration.INSTANCE.readConfiguration(bareFontInfo); } } /***/ }), /***/ 34002: /*!**************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/config/elementSizeObserver.js ***! \**************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ I: function() { return /* binding */ ElementSizeObserver; } /* harmony export */ }); /* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ 69323); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class ElementSizeObserver extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_0__/* .Disposable */ .JT { constructor(referenceDomElement, dimension, changeCallback) { super(); this.referenceDomElement = referenceDomElement; this.changeCallback = changeCallback; this.width = -1; this.height = -1; this.resizeObserver = null; this.measureReferenceDomElementToken = -1; this.measureReferenceDomElement(false, dimension); } dispose() { this.stopObserving(); super.dispose(); } getWidth() { return this.width; } getHeight() { return this.height; } startObserving() { if (typeof ResizeObserver !== 'undefined') { if (!this.resizeObserver && this.referenceDomElement) { this.resizeObserver = new ResizeObserver((entries) => { if (entries && entries[0] && entries[0].contentRect) { this.observe({ width: entries[0].contentRect.width, height: entries[0].contentRect.height }); } else { this.observe(); } }); this.resizeObserver.observe(this.referenceDomElement); } } else { if (this.measureReferenceDomElementToken === -1) { // setInterval type defaults to NodeJS.Timeout instead of number, so specify it as a number this.measureReferenceDomElementToken = setInterval(() => this.observe(), 100); } } } stopObserving() { if (this.resizeObserver) { this.resizeObserver.disconnect(); this.resizeObserver = null; } if (this.measureReferenceDomElementToken !== -1) { clearInterval(this.measureReferenceDomElementToken); this.measureReferenceDomElementToken = -1; } } observe(dimension) { this.measureReferenceDomElement(true, dimension); } measureReferenceDomElement(callChangeCallback, dimension) { let observedWidth = 0; let observedHeight = 0; if (dimension) { observedWidth = dimension.width; observedHeight = dimension.height; } else if (this.referenceDomElement) { observedWidth = this.referenceDomElement.clientWidth; observedHeight = this.referenceDomElement.clientHeight; } observedWidth = Math.max(5, observedWidth); observedHeight = Math.max(5, observedHeight); if (this.width !== observedWidth || this.height !== observedHeight) { this.width = observedWidth; this.height = observedHeight; if (callChangeCallback) { this.changeCallback(); } } } } /***/ }), /***/ 46343: /*!***********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/controller/coreCommands.js + 1 modules ***! \***********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { CoreEditingCommands: function() { return /* binding */ CoreEditingCommands; }, CoreEditorCommand: function() { return /* binding */ CoreEditorCommand; }, CoreNavigationCommands: function() { return /* binding */ CoreNavigationCommands; }, EditorScroll_: function() { return /* binding */ EditorScroll_; }, RevealLine_: function() { return /* binding */ RevealLine_; } }); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/nls.js var nls = __webpack_require__(13268); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/browser.js var browser = __webpack_require__(87783); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/types.js var types = __webpack_require__(72999); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/ui/aria/aria.js + 1 modules var aria = __webpack_require__(96297); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/editorExtensions.js var editorExtensions = __webpack_require__(4514); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/services/codeEditorService.js var codeEditorService = __webpack_require__(70827); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/controller/cursorCommon.js var cursorCommon = __webpack_require__(69025); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/core/position.js var position = __webpack_require__(72146); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/core/range.js var core_range = __webpack_require__(17373); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/controller/cursorColumnSelection.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class ColumnSelection { static columnSelect(config, model, fromLineNumber, fromVisibleColumn, toLineNumber, toVisibleColumn) { let lineCount = Math.abs(toLineNumber - fromLineNumber) + 1; let reversed = (fromLineNumber > toLineNumber); let isRTL = (fromVisibleColumn > toVisibleColumn); let isLTR = (fromVisibleColumn < toVisibleColumn); let result = []; // console.log(`fromVisibleColumn: ${fromVisibleColumn}, toVisibleColumn: ${toVisibleColumn}`); for (let i = 0; i < lineCount; i++) { let lineNumber = fromLineNumber + (reversed ? -i : i); let startColumn = cursorCommon/* CursorColumns */.io.columnFromVisibleColumn2(config, model, lineNumber, fromVisibleColumn); let endColumn = cursorCommon/* CursorColumns */.io.columnFromVisibleColumn2(config, model, lineNumber, toVisibleColumn); let visibleStartColumn = cursorCommon/* CursorColumns */.io.visibleColumnFromColumn2(config, model, new position/* Position */.L(lineNumber, startColumn)); let visibleEndColumn = cursorCommon/* CursorColumns */.io.visibleColumnFromColumn2(config, model, new position/* Position */.L(lineNumber, endColumn)); // console.log(`lineNumber: ${lineNumber}: visibleStartColumn: ${visibleStartColumn}, visibleEndColumn: ${visibleEndColumn}`); if (isLTR) { if (visibleStartColumn > toVisibleColumn) { continue; } if (visibleEndColumn < fromVisibleColumn) { continue; } } if (isRTL) { if (visibleEndColumn > fromVisibleColumn) { continue; } if (visibleStartColumn < toVisibleColumn) { continue; } } result.push(new cursorCommon/* SingleCursorState */.rS(new core_range/* Range */.e(lineNumber, startColumn, lineNumber, startColumn), 0, new position/* Position */.L(lineNumber, endColumn), 0)); } if (result.length === 0) { // We are after all the lines, so add cursor at the end of each line for (let i = 0; i < lineCount; i++) { const lineNumber = fromLineNumber + (reversed ? -i : i); const maxColumn = model.getLineMaxColumn(lineNumber); result.push(new cursorCommon/* SingleCursorState */.rS(new core_range/* Range */.e(lineNumber, maxColumn, lineNumber, maxColumn), 0, new position/* Position */.L(lineNumber, maxColumn), 0)); } } return { viewStates: result, reversed: reversed, fromLineNumber: fromLineNumber, fromVisualColumn: fromVisibleColumn, toLineNumber: toLineNumber, toVisualColumn: toVisibleColumn }; } static columnSelectLeft(config, model, prevColumnSelectData) { let toViewVisualColumn = prevColumnSelectData.toViewVisualColumn; if (toViewVisualColumn > 0) { toViewVisualColumn--; } return ColumnSelection.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, prevColumnSelectData.toViewLineNumber, toViewVisualColumn); } static columnSelectRight(config, model, prevColumnSelectData) { let maxVisualViewColumn = 0; const minViewLineNumber = Math.min(prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.toViewLineNumber); const maxViewLineNumber = Math.max(prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.toViewLineNumber); for (let lineNumber = minViewLineNumber; lineNumber <= maxViewLineNumber; lineNumber++) { const lineMaxViewColumn = model.getLineMaxColumn(lineNumber); const lineMaxVisualViewColumn = cursorCommon/* CursorColumns */.io.visibleColumnFromColumn2(config, model, new position/* Position */.L(lineNumber, lineMaxViewColumn)); maxVisualViewColumn = Math.max(maxVisualViewColumn, lineMaxVisualViewColumn); } let toViewVisualColumn = prevColumnSelectData.toViewVisualColumn; if (toViewVisualColumn < maxVisualViewColumn) { toViewVisualColumn++; } return this.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, prevColumnSelectData.toViewLineNumber, toViewVisualColumn); } static columnSelectUp(config, model, prevColumnSelectData, isPaged) { const linesCount = isPaged ? config.pageSize : 1; const toViewLineNumber = Math.max(1, prevColumnSelectData.toViewLineNumber - linesCount); return this.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, toViewLineNumber, prevColumnSelectData.toViewVisualColumn); } static columnSelectDown(config, model, prevColumnSelectData, isPaged) { const linesCount = isPaged ? config.pageSize : 1; const toViewLineNumber = Math.min(model.getLineCount(), prevColumnSelectData.toViewLineNumber + linesCount); return this.columnSelect(config, model, prevColumnSelectData.fromViewLineNumber, prevColumnSelectData.fromViewVisualColumn, toViewLineNumber, prevColumnSelectData.toViewVisualColumn); } } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/controller/cursorDeleteOperations.js var cursorDeleteOperations = __webpack_require__(75805); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/controller/cursorMoveCommands.js var cursorMoveCommands = __webpack_require__(43361); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/controller/cursorTypeOperations.js + 1 modules var cursorTypeOperations = __webpack_require__(74502); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/editorContextKeys.js var editorContextKeys = __webpack_require__(68987); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/contextkey/common/contextkey.js var contextkey = __webpack_require__(90689); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js var keybindingsRegistry = __webpack_require__(86414); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/controller/coreCommands.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const CORE_WEIGHT = 0 /* EditorCore */; class CoreEditorCommand extends editorExtensions/* EditorCommand */._l { runEditorCommand(accessor, editor, args) { const viewModel = editor._getViewModel(); if (!viewModel) { // the editor has no view => has no cursors return; } this.runCoreEditorCommand(viewModel, args || {}); } } var EditorScroll_; (function (EditorScroll_) { const isEditorScrollArgs = function (arg) { if (!types/* isObject */.Kn(arg)) { return false; } const scrollArg = arg; if (!types/* isString */.HD(scrollArg.to)) { return false; } if (!types/* isUndefined */.o8(scrollArg.by) && !types/* isString */.HD(scrollArg.by)) { return false; } if (!types/* isUndefined */.o8(scrollArg.value) && !types/* isNumber */.hj(scrollArg.value)) { return false; } if (!types/* isUndefined */.o8(scrollArg.revealCursor) && !types/* isBoolean */.jn(scrollArg.revealCursor)) { return false; } return true; }; EditorScroll_.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: * 'to': A mandatory direction value. \`\`\` 'up', 'down' \`\`\` * 'by': Unit to move. Default is computed based on 'to' value. \`\`\` 'line', 'wrappedLine', 'page', 'halfPage' \`\`\` * 'value': Number of units to move. Default is '1'. * 'revealCursor': If 'true' reveals the cursor if it is outside view port. `, constraint: isEditorScrollArgs, schema: { 'type': 'object', 'required': ['to'], 'properties': { 'to': { 'type': 'string', 'enum': ['up', 'down'] }, 'by': { 'type': 'string', 'enum': ['line', 'wrappedLine', 'page', 'halfPage'] }, 'value': { 'type': 'number', 'default': 1 }, 'revealCursor': { 'type': 'boolean', } } } } ] }; /** * Directions in the view for editor scroll command. */ EditorScroll_.RawDirection = { Up: 'up', Down: 'down', }; /** * Units for editor scroll 'by' argument */ EditorScroll_.RawUnit = { Line: 'line', WrappedLine: 'wrappedLine', Page: 'page', HalfPage: 'halfPage' }; function parse(args) { let direction; switch (args.to) { case EditorScroll_.RawDirection.Up: direction = 1 /* Up */; break; case EditorScroll_.RawDirection.Down: direction = 2 /* Down */; break; default: // Illegal arguments return null; } let unit; switch (args.by) { case EditorScroll_.RawUnit.Line: unit = 1 /* Line */; break; case EditorScroll_.RawUnit.WrappedLine: unit = 2 /* WrappedLine */; break; case EditorScroll_.RawUnit.Page: unit = 3 /* Page */; break; case EditorScroll_.RawUnit.HalfPage: unit = 4 /* HalfPage */; break; default: unit = 2 /* WrappedLine */; } const value = Math.floor(args.value || 1); const revealCursor = !!args.revealCursor; return { direction: direction, unit: unit, value: value, revealCursor: revealCursor, select: (!!args.select) }; } EditorScroll_.parse = parse; })(EditorScroll_ || (EditorScroll_ = {})); var RevealLine_; (function (RevealLine_) { const isRevealLineArgs = function (arg) { if (!types/* isObject */.Kn(arg)) { return false; } const reveaLineArg = arg; if (!types/* isNumber */.hj(reveaLineArg.lineNumber) && !types/* isString */.HD(reveaLineArg.lineNumber)) { return false; } if (!types/* isUndefined */.o8(reveaLineArg.at) && !types/* isString */.HD(reveaLineArg.at)) { return false; } return true; }; RevealLine_.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: * 'lineNumber': A mandatory line number value. * 'at': Logical position at which line has to be revealed. \`\`\` 'top', 'center', 'bottom' \`\`\` `, constraint: isRevealLineArgs, schema: { 'type': 'object', 'required': ['lineNumber'], 'properties': { 'lineNumber': { 'type': ['number', 'string'], }, 'at': { 'type': 'string', 'enum': ['top', 'center', 'bottom'] } } } } ] }; /** * Values for reveal line 'at' argument */ RevealLine_.RawAtArgument = { Top: 'top', Center: 'center', Bottom: 'bottom' }; })(RevealLine_ || (RevealLine_ = {})); class EditorOrNativeTextInputCommand { constructor(target) { // 1. handle case when focus is in editor. target.addImplementation(10000, 'code-editor', (accessor, args) => { // Only if editor text focus (i.e. not if editor has widget focus). const focusedEditor = accessor.get(codeEditorService/* ICodeEditorService */.$).getFocusedCodeEditor(); if (focusedEditor && focusedEditor.hasTextFocus()) { return this._runEditorCommand(accessor, focusedEditor, args); } return false; }); // 2. handle case when focus is in some other `input` / `textarea`. target.addImplementation(1000, 'generic-dom-input-textarea', (accessor, args) => { // Only if focused on an element that allows for entering text const activeElement = document.activeElement; if (activeElement && ['input', 'textarea'].indexOf(activeElement.tagName.toLowerCase()) >= 0) { this.runDOMCommand(); return true; } return false; }); // 3. (default) handle case when focus is somewhere else. target.addImplementation(0, 'generic-dom', (accessor, args) => { // Redirecting to active editor const activeEditor = accessor.get(codeEditorService/* ICodeEditorService */.$).getActiveCodeEditor(); if (activeEditor) { activeEditor.focus(); return this._runEditorCommand(accessor, activeEditor, args); } return false; }); } _runEditorCommand(accessor, editor, args) { const result = this.runEditorCommand(accessor, editor, args); if (result) { return result; } return true; } } var CoreNavigationCommands; (function (CoreNavigationCommands) { class BaseMoveToCommand extends CoreEditorCommand { constructor(opts) { super(opts); this._inSelectionMode = opts.inSelectionMode; } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, [ cursorMoveCommands/* CursorMoveCommands */.P.moveTo(viewModel, viewModel.getPrimaryCursorState(), this._inSelectionMode, args.position, args.viewPosition) ]); viewModel.revealPrimaryCursor(args.source, true); } } CoreNavigationCommands.MoveTo = (0,editorExtensions/* registerEditorCommand */.fK)(new BaseMoveToCommand({ id: '_moveTo', inSelectionMode: false, precondition: undefined })); CoreNavigationCommands.MoveToSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new BaseMoveToCommand({ id: '_moveToSelect', inSelectionMode: true, precondition: undefined })); class ColumnSelectCommand extends CoreEditorCommand { runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); const result = this._getColumnSelectResult(viewModel, viewModel.getPrimaryCursorState(), viewModel.getCursorColumnSelectData(), args); viewModel.setCursorStates(args.source, 3 /* Explicit */, result.viewStates.map((viewState) => cursorCommon/* CursorState */.Vi.fromViewState(viewState))); viewModel.setCursorColumnSelectData({ isReal: true, fromViewLineNumber: result.fromLineNumber, fromViewVisualColumn: result.fromVisualColumn, toViewLineNumber: result.toLineNumber, toViewVisualColumn: result.toVisualColumn }); if (result.reversed) { viewModel.revealTopMostCursor(args.source); } else { viewModel.revealBottomMostCursor(args.source); } } } CoreNavigationCommands.ColumnSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends ColumnSelectCommand { constructor() { super({ id: 'columnSelect', precondition: undefined }); } _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { // validate `args` const validatedPosition = viewModel.model.validatePosition(args.position); const validatedViewPosition = viewModel.coordinatesConverter.validateViewPosition(new position/* Position */.L(args.viewPosition.lineNumber, args.viewPosition.column), validatedPosition); let fromViewLineNumber = args.doColumnSelect ? prevColumnSelectData.fromViewLineNumber : validatedViewPosition.lineNumber; let fromViewVisualColumn = args.doColumnSelect ? prevColumnSelectData.fromViewVisualColumn : args.mouseColumn - 1; return ColumnSelection.columnSelect(viewModel.cursorConfig, viewModel, fromViewLineNumber, fromViewVisualColumn, validatedViewPosition.lineNumber, args.mouseColumn - 1); } }); CoreNavigationCommands.CursorColumnSelectLeft = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends ColumnSelectCommand { constructor() { super({ id: 'cursorColumnSelectLeft', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 512 /* Alt */ | 15 /* LeftArrow */, linux: { primary: 0 } } }); } _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { return ColumnSelection.columnSelectLeft(viewModel.cursorConfig, viewModel, prevColumnSelectData); } }); CoreNavigationCommands.CursorColumnSelectRight = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends ColumnSelectCommand { constructor() { super({ id: 'cursorColumnSelectRight', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 512 /* Alt */ | 17 /* RightArrow */, linux: { primary: 0 } } }); } _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { return ColumnSelection.columnSelectRight(viewModel.cursorConfig, viewModel, prevColumnSelectData); } }); class ColumnSelectUpCommand extends ColumnSelectCommand { constructor(opts) { super(opts); this._isPaged = opts.isPaged; } _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { return ColumnSelection.columnSelectUp(viewModel.cursorConfig, viewModel, prevColumnSelectData, this._isPaged); } } CoreNavigationCommands.CursorColumnSelectUp = (0,editorExtensions/* registerEditorCommand */.fK)(new ColumnSelectUpCommand({ isPaged: false, id: 'cursorColumnSelectUp', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 512 /* Alt */ | 16 /* UpArrow */, linux: { primary: 0 } } })); CoreNavigationCommands.CursorColumnSelectPageUp = (0,editorExtensions/* registerEditorCommand */.fK)(new ColumnSelectUpCommand({ isPaged: true, id: 'cursorColumnSelectPageUp', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 512 /* Alt */ | 11 /* PageUp */, linux: { primary: 0 } } })); class ColumnSelectDownCommand extends ColumnSelectCommand { constructor(opts) { super(opts); this._isPaged = opts.isPaged; } _getColumnSelectResult(viewModel, primary, prevColumnSelectData, args) { return ColumnSelection.columnSelectDown(viewModel.cursorConfig, viewModel, prevColumnSelectData, this._isPaged); } } CoreNavigationCommands.CursorColumnSelectDown = (0,editorExtensions/* registerEditorCommand */.fK)(new ColumnSelectDownCommand({ isPaged: false, id: 'cursorColumnSelectDown', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 512 /* Alt */ | 18 /* DownArrow */, linux: { primary: 0 } } })); CoreNavigationCommands.CursorColumnSelectPageDown = (0,editorExtensions/* registerEditorCommand */.fK)(new ColumnSelectDownCommand({ isPaged: true, id: 'cursorColumnSelectPageDown', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 512 /* Alt */ | 12 /* PageDown */, linux: { primary: 0 } } })); class CursorMoveImpl extends CoreEditorCommand { constructor() { super({ id: 'cursorMove', precondition: undefined, description: cursorMoveCommands/* CursorMove */.N.description }); } runCoreEditorCommand(viewModel, args) { const parsed = cursorMoveCommands/* CursorMove */.N.parse(args); if (!parsed) { // illegal arguments return; } this._runCursorMove(viewModel, args.source, parsed); } _runCursorMove(viewModel, source, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(source, 3 /* Explicit */, CursorMoveImpl._move(viewModel, viewModel.getCursorStates(), args)); viewModel.revealPrimaryCursor(source, true); } static _move(viewModel, cursors, args) { const inSelectionMode = args.select; const value = args.value; switch (args.direction) { case 0 /* Left */: case 1 /* Right */: case 2 /* Up */: case 3 /* Down */: case 4 /* PrevBlankLine */: case 5 /* NextBlankLine */: case 6 /* WrappedLineStart */: case 7 /* WrappedLineFirstNonWhitespaceCharacter */: case 8 /* WrappedLineColumnCenter */: case 9 /* WrappedLineEnd */: case 10 /* WrappedLineLastNonWhitespaceCharacter */: return cursorMoveCommands/* CursorMoveCommands */.P.simpleMove(viewModel, cursors, args.direction, inSelectionMode, value, args.unit); case 11 /* ViewPortTop */: case 13 /* ViewPortBottom */: case 12 /* ViewPortCenter */: case 14 /* ViewPortIfOutside */: return cursorMoveCommands/* CursorMoveCommands */.P.viewportMove(viewModel, cursors, args.direction, inSelectionMode, value); default: return null; } } } CoreNavigationCommands.CursorMoveImpl = CursorMoveImpl; CoreNavigationCommands.CursorMove = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveImpl()); class CursorMoveBasedCommand extends CoreEditorCommand { constructor(opts) { super(opts); this._staticArgs = opts.args; } runCoreEditorCommand(viewModel, dynamicArgs) { let args = this._staticArgs; if (this._staticArgs.value === -1 /* PAGE_SIZE_MARKER */) { // -1 is a marker for page size args = { direction: this._staticArgs.direction, unit: this._staticArgs.unit, select: this._staticArgs.select, value: viewModel.cursorConfig.pageSize }; } viewModel.model.pushStackElement(); viewModel.setCursorStates(dynamicArgs.source, 3 /* Explicit */, cursorMoveCommands/* CursorMoveCommands */.P.simpleMove(viewModel, viewModel.getCursorStates(), args.direction, args.select, args.value, args.unit)); viewModel.revealPrimaryCursor(dynamicArgs.source, true); } } CoreNavigationCommands.CursorLeft = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveBasedCommand({ args: { direction: 0 /* Left */, unit: 0 /* None */, select: false, value: 1 }, id: 'cursorLeft', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 15 /* LeftArrow */, mac: { primary: 15 /* LeftArrow */, secondary: [256 /* WinCtrl */ | 32 /* KeyB */] } } })); CoreNavigationCommands.CursorLeftSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveBasedCommand({ args: { direction: 0 /* Left */, unit: 0 /* None */, select: true, value: 1 }, id: 'cursorLeftSelect', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 1024 /* Shift */ | 15 /* LeftArrow */ } })); CoreNavigationCommands.CursorRight = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveBasedCommand({ args: { direction: 1 /* Right */, unit: 0 /* None */, select: false, value: 1 }, id: 'cursorRight', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 17 /* RightArrow */, mac: { primary: 17 /* RightArrow */, secondary: [256 /* WinCtrl */ | 36 /* KeyF */] } } })); CoreNavigationCommands.CursorRightSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveBasedCommand({ args: { direction: 1 /* Right */, unit: 0 /* None */, select: true, value: 1 }, id: 'cursorRightSelect', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 1024 /* Shift */ | 17 /* RightArrow */ } })); CoreNavigationCommands.CursorUp = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveBasedCommand({ args: { direction: 2 /* Up */, unit: 2 /* WrappedLine */, select: false, value: 1 }, id: 'cursorUp', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 16 /* UpArrow */, mac: { primary: 16 /* UpArrow */, secondary: [256 /* WinCtrl */ | 46 /* KeyP */] } } })); CoreNavigationCommands.CursorUpSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveBasedCommand({ args: { direction: 2 /* Up */, unit: 2 /* WrappedLine */, select: true, value: 1 }, id: 'cursorUpSelect', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 1024 /* Shift */ | 16 /* UpArrow */, secondary: [2048 /* CtrlCmd */ | 1024 /* Shift */ | 16 /* UpArrow */], mac: { primary: 1024 /* Shift */ | 16 /* UpArrow */ }, linux: { primary: 1024 /* Shift */ | 16 /* UpArrow */ } } })); CoreNavigationCommands.CursorPageUp = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveBasedCommand({ args: { direction: 2 /* Up */, unit: 2 /* WrappedLine */, select: false, value: -1 /* PAGE_SIZE_MARKER */ }, id: 'cursorPageUp', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 11 /* PageUp */ } })); CoreNavigationCommands.CursorPageUpSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveBasedCommand({ args: { direction: 2 /* Up */, unit: 2 /* WrappedLine */, select: true, value: -1 /* PAGE_SIZE_MARKER */ }, id: 'cursorPageUpSelect', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 1024 /* Shift */ | 11 /* PageUp */ } })); CoreNavigationCommands.CursorDown = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveBasedCommand({ args: { direction: 3 /* Down */, unit: 2 /* WrappedLine */, select: false, value: 1 }, id: 'cursorDown', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 18 /* DownArrow */, mac: { primary: 18 /* DownArrow */, secondary: [256 /* WinCtrl */ | 44 /* KeyN */] } } })); CoreNavigationCommands.CursorDownSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveBasedCommand({ args: { direction: 3 /* Down */, unit: 2 /* WrappedLine */, select: true, value: 1 }, id: 'cursorDownSelect', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 1024 /* Shift */ | 18 /* DownArrow */, secondary: [2048 /* CtrlCmd */ | 1024 /* Shift */ | 18 /* DownArrow */], mac: { primary: 1024 /* Shift */ | 18 /* DownArrow */ }, linux: { primary: 1024 /* Shift */ | 18 /* DownArrow */ } } })); CoreNavigationCommands.CursorPageDown = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveBasedCommand({ args: { direction: 3 /* Down */, unit: 2 /* WrappedLine */, select: false, value: -1 /* PAGE_SIZE_MARKER */ }, id: 'cursorPageDown', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 12 /* PageDown */ } })); CoreNavigationCommands.CursorPageDownSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new CursorMoveBasedCommand({ args: { direction: 3 /* Down */, unit: 2 /* WrappedLine */, select: true, value: -1 /* PAGE_SIZE_MARKER */ }, id: 'cursorPageDownSelect', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 1024 /* Shift */ | 12 /* PageDown */ } })); CoreNavigationCommands.CreateCursor = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditorCommand { constructor() { super({ id: 'createCursor', precondition: undefined }); } runCoreEditorCommand(viewModel, args) { let newState; if (args.wholeLine) { newState = cursorMoveCommands/* CursorMoveCommands */.P.line(viewModel, viewModel.getPrimaryCursorState(), false, args.position, args.viewPosition); } else { newState = cursorMoveCommands/* CursorMoveCommands */.P.moveTo(viewModel, viewModel.getPrimaryCursorState(), false, args.position, args.viewPosition); } const states = viewModel.getCursorStates(); // Check if we should remove a cursor (sort of like a toggle) if (states.length > 1) { const newModelPosition = (newState.modelState ? newState.modelState.position : null); const newViewPosition = (newState.viewState ? newState.viewState.position : null); for (let i = 0, len = states.length; i < len; i++) { const state = states[i]; if (newModelPosition && !state.modelState.selection.containsPosition(newModelPosition)) { continue; } if (newViewPosition && !state.viewState.selection.containsPosition(newViewPosition)) { continue; } // => Remove the cursor states.splice(i, 1); viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, states); return; } } // => Add the new cursor states.push(newState); viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, states); } }); CoreNavigationCommands.LastCursorMoveToSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditorCommand { constructor() { super({ id: '_lastCursorMoveToSelect', precondition: undefined }); } runCoreEditorCommand(viewModel, args) { const lastAddedCursorIndex = viewModel.getLastAddedCursorIndex(); const states = viewModel.getCursorStates(); const newStates = states.slice(0); newStates[lastAddedCursorIndex] = cursorMoveCommands/* CursorMoveCommands */.P.moveTo(viewModel, states[lastAddedCursorIndex], true, args.position, args.viewPosition); viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, newStates); } }); class HomeCommand extends CoreEditorCommand { constructor(opts) { super(opts); this._inSelectionMode = opts.inSelectionMode; } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, cursorMoveCommands/* CursorMoveCommands */.P.moveToBeginningOfLine(viewModel, viewModel.getCursorStates(), this._inSelectionMode)); viewModel.revealPrimaryCursor(args.source, true); } } CoreNavigationCommands.CursorHome = (0,editorExtensions/* registerEditorCommand */.fK)(new HomeCommand({ inSelectionMode: false, id: 'cursorHome', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 14 /* Home */, mac: { primary: 14 /* Home */, secondary: [2048 /* CtrlCmd */ | 15 /* LeftArrow */] } } })); CoreNavigationCommands.CursorHomeSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new HomeCommand({ inSelectionMode: true, id: 'cursorHomeSelect', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 1024 /* Shift */ | 14 /* Home */, mac: { primary: 1024 /* Shift */ | 14 /* Home */, secondary: [2048 /* CtrlCmd */ | 1024 /* Shift */ | 15 /* LeftArrow */] } } })); class LineStartCommand extends CoreEditorCommand { constructor(opts) { super(opts); this._inSelectionMode = opts.inSelectionMode; } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, this._exec(viewModel.getCursorStates())); viewModel.revealPrimaryCursor(args.source, true); } _exec(cursors) { const result = []; for (let i = 0, len = cursors.length; i < len; i++) { const cursor = cursors[i]; const lineNumber = cursor.modelState.position.lineNumber; result[i] = cursorCommon/* CursorState */.Vi.fromModelState(cursor.modelState.move(this._inSelectionMode, lineNumber, 1, 0)); } return result; } } CoreNavigationCommands.CursorLineStart = (0,editorExtensions/* registerEditorCommand */.fK)(new LineStartCommand({ inSelectionMode: false, id: 'cursorLineStart', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 0, mac: { primary: 256 /* WinCtrl */ | 31 /* KeyA */ } } })); CoreNavigationCommands.CursorLineStartSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new LineStartCommand({ inSelectionMode: true, id: 'cursorLineStartSelect', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 0, mac: { primary: 256 /* WinCtrl */ | 1024 /* Shift */ | 31 /* KeyA */ } } })); class EndCommand extends CoreEditorCommand { constructor(opts) { super(opts); this._inSelectionMode = opts.inSelectionMode; } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, cursorMoveCommands/* CursorMoveCommands */.P.moveToEndOfLine(viewModel, viewModel.getCursorStates(), this._inSelectionMode, args.sticky || false)); viewModel.revealPrimaryCursor(args.source, true); } } CoreNavigationCommands.CursorEnd = (0,editorExtensions/* registerEditorCommand */.fK)(new EndCommand({ inSelectionMode: false, id: 'cursorEnd', precondition: undefined, kbOpts: { args: { sticky: false }, weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 13 /* End */, mac: { primary: 13 /* End */, secondary: [2048 /* CtrlCmd */ | 17 /* RightArrow */] } }, description: { description: `Go to End`, args: [{ name: 'args', schema: { type: 'object', properties: { 'sticky': { description: nls/* localize */.N('stickydesc', "Stick to the end even when going to longer lines"), type: 'boolean', default: false } } } }] } })); CoreNavigationCommands.CursorEndSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new EndCommand({ inSelectionMode: true, id: 'cursorEndSelect', precondition: undefined, kbOpts: { args: { sticky: false }, weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 1024 /* Shift */ | 13 /* End */, mac: { primary: 1024 /* Shift */ | 13 /* End */, secondary: [2048 /* CtrlCmd */ | 1024 /* Shift */ | 17 /* RightArrow */] } }, description: { description: `Select to End`, args: [{ name: 'args', schema: { type: 'object', properties: { 'sticky': { description: nls/* localize */.N('stickydesc', "Stick to the end even when going to longer lines"), type: 'boolean', default: false } } } }] } })); class LineEndCommand extends CoreEditorCommand { constructor(opts) { super(opts); this._inSelectionMode = opts.inSelectionMode; } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, this._exec(viewModel, viewModel.getCursorStates())); viewModel.revealPrimaryCursor(args.source, true); } _exec(viewModel, cursors) { const result = []; for (let i = 0, len = cursors.length; i < len; i++) { const cursor = cursors[i]; const lineNumber = cursor.modelState.position.lineNumber; const maxColumn = viewModel.model.getLineMaxColumn(lineNumber); result[i] = cursorCommon/* CursorState */.Vi.fromModelState(cursor.modelState.move(this._inSelectionMode, lineNumber, maxColumn, 0)); } return result; } } CoreNavigationCommands.CursorLineEnd = (0,editorExtensions/* registerEditorCommand */.fK)(new LineEndCommand({ inSelectionMode: false, id: 'cursorLineEnd', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 0, mac: { primary: 256 /* WinCtrl */ | 35 /* KeyE */ } } })); CoreNavigationCommands.CursorLineEndSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new LineEndCommand({ inSelectionMode: true, id: 'cursorLineEndSelect', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 0, mac: { primary: 256 /* WinCtrl */ | 1024 /* Shift */ | 35 /* KeyE */ } } })); class TopCommand extends CoreEditorCommand { constructor(opts) { super(opts); this._inSelectionMode = opts.inSelectionMode; } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, cursorMoveCommands/* CursorMoveCommands */.P.moveToBeginningOfBuffer(viewModel, viewModel.getCursorStates(), this._inSelectionMode)); viewModel.revealPrimaryCursor(args.source, true); } } CoreNavigationCommands.CursorTop = (0,editorExtensions/* registerEditorCommand */.fK)(new TopCommand({ inSelectionMode: false, id: 'cursorTop', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 14 /* Home */, mac: { primary: 2048 /* CtrlCmd */ | 16 /* UpArrow */ } } })); CoreNavigationCommands.CursorTopSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new TopCommand({ inSelectionMode: true, id: 'cursorTopSelect', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 14 /* Home */, mac: { primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 16 /* UpArrow */ } } })); class BottomCommand extends CoreEditorCommand { constructor(opts) { super(opts); this._inSelectionMode = opts.inSelectionMode; } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, cursorMoveCommands/* CursorMoveCommands */.P.moveToEndOfBuffer(viewModel, viewModel.getCursorStates(), this._inSelectionMode)); viewModel.revealPrimaryCursor(args.source, true); } } CoreNavigationCommands.CursorBottom = (0,editorExtensions/* registerEditorCommand */.fK)(new BottomCommand({ inSelectionMode: false, id: 'cursorBottom', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 13 /* End */, mac: { primary: 2048 /* CtrlCmd */ | 18 /* DownArrow */ } } })); CoreNavigationCommands.CursorBottomSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new BottomCommand({ inSelectionMode: true, id: 'cursorBottomSelect', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 13 /* End */, mac: { primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 18 /* DownArrow */ } } })); class EditorScrollImpl extends CoreEditorCommand { constructor() { super({ id: 'editorScroll', precondition: undefined, description: EditorScroll_.description }); } runCoreEditorCommand(viewModel, args) { const parsed = EditorScroll_.parse(args); if (!parsed) { // illegal arguments return; } this._runEditorScroll(viewModel, args.source, parsed); } _runEditorScroll(viewModel, source, args) { const desiredScrollTop = this._computeDesiredScrollTop(viewModel, args); if (args.revealCursor) { // must ensure cursor is in new visible range const desiredVisibleViewRange = viewModel.getCompletelyVisibleViewRangeAtScrollTop(desiredScrollTop); viewModel.setCursorStates(source, 3 /* Explicit */, [ cursorMoveCommands/* CursorMoveCommands */.P.findPositionInViewportIfOutside(viewModel, viewModel.getPrimaryCursorState(), desiredVisibleViewRange, args.select) ]); } viewModel.setScrollTop(desiredScrollTop, 0 /* Smooth */); } _computeDesiredScrollTop(viewModel, args) { if (args.unit === 1 /* Line */) { // scrolling by model lines const visibleViewRange = viewModel.getCompletelyVisibleViewRange(); const visibleModelRange = viewModel.coordinatesConverter.convertViewRangeToModelRange(visibleViewRange); let desiredTopModelLineNumber; if (args.direction === 1 /* Up */) { // must go x model lines up desiredTopModelLineNumber = Math.max(1, visibleModelRange.startLineNumber - args.value); } else { // must go x model lines down desiredTopModelLineNumber = Math.min(viewModel.model.getLineCount(), visibleModelRange.startLineNumber + args.value); } const viewPosition = viewModel.coordinatesConverter.convertModelPositionToViewPosition(new position/* Position */.L(desiredTopModelLineNumber, 1)); return viewModel.getVerticalOffsetForLineNumber(viewPosition.lineNumber); } let noOfLines; if (args.unit === 3 /* Page */) { noOfLines = viewModel.cursorConfig.pageSize * args.value; } else if (args.unit === 4 /* HalfPage */) { noOfLines = Math.round(viewModel.cursorConfig.pageSize / 2) * args.value; } else { noOfLines = args.value; } const deltaLines = (args.direction === 1 /* Up */ ? -1 : 1) * noOfLines; return viewModel.getScrollTop() + deltaLines * viewModel.cursorConfig.lineHeight; } } CoreNavigationCommands.EditorScrollImpl = EditorScrollImpl; CoreNavigationCommands.EditorScroll = (0,editorExtensions/* registerEditorCommand */.fK)(new EditorScrollImpl()); CoreNavigationCommands.ScrollLineUp = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditorCommand { constructor() { super({ id: 'scrollLineUp', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 16 /* UpArrow */, mac: { primary: 256 /* WinCtrl */ | 11 /* PageUp */ } } }); } runCoreEditorCommand(viewModel, args) { CoreNavigationCommands.EditorScroll._runEditorScroll(viewModel, args.source, { direction: 1 /* Up */, unit: 2 /* WrappedLine */, value: 1, revealCursor: false, select: false }); } }); CoreNavigationCommands.ScrollPageUp = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditorCommand { constructor() { super({ id: 'scrollPageUp', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 11 /* PageUp */, win: { primary: 512 /* Alt */ | 11 /* PageUp */ }, linux: { primary: 512 /* Alt */ | 11 /* PageUp */ } } }); } runCoreEditorCommand(viewModel, args) { CoreNavigationCommands.EditorScroll._runEditorScroll(viewModel, args.source, { direction: 1 /* Up */, unit: 3 /* Page */, value: 1, revealCursor: false, select: false }); } }); CoreNavigationCommands.ScrollLineDown = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditorCommand { constructor() { super({ id: 'scrollLineDown', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 18 /* DownArrow */, mac: { primary: 256 /* WinCtrl */ | 12 /* PageDown */ } } }); } runCoreEditorCommand(viewModel, args) { CoreNavigationCommands.EditorScroll._runEditorScroll(viewModel, args.source, { direction: 2 /* Down */, unit: 2 /* WrappedLine */, value: 1, revealCursor: false, select: false }); } }); CoreNavigationCommands.ScrollPageDown = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditorCommand { constructor() { super({ id: 'scrollPageDown', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 12 /* PageDown */, win: { primary: 512 /* Alt */ | 12 /* PageDown */ }, linux: { primary: 512 /* Alt */ | 12 /* PageDown */ } } }); } runCoreEditorCommand(viewModel, args) { CoreNavigationCommands.EditorScroll._runEditorScroll(viewModel, args.source, { direction: 2 /* Down */, unit: 3 /* Page */, value: 1, revealCursor: false, select: false }); } }); class WordCommand extends CoreEditorCommand { constructor(opts) { super(opts); this._inSelectionMode = opts.inSelectionMode; } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, [ cursorMoveCommands/* CursorMoveCommands */.P.word(viewModel, viewModel.getPrimaryCursorState(), this._inSelectionMode, args.position) ]); viewModel.revealPrimaryCursor(args.source, true); } } CoreNavigationCommands.WordSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new WordCommand({ inSelectionMode: false, id: '_wordSelect', precondition: undefined })); CoreNavigationCommands.WordSelectDrag = (0,editorExtensions/* registerEditorCommand */.fK)(new WordCommand({ inSelectionMode: true, id: '_wordSelectDrag', precondition: undefined })); CoreNavigationCommands.LastCursorWordSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditorCommand { constructor() { super({ id: 'lastCursorWordSelect', precondition: undefined }); } runCoreEditorCommand(viewModel, args) { const lastAddedCursorIndex = viewModel.getLastAddedCursorIndex(); const states = viewModel.getCursorStates(); const newStates = states.slice(0); const lastAddedState = states[lastAddedCursorIndex]; newStates[lastAddedCursorIndex] = cursorMoveCommands/* CursorMoveCommands */.P.word(viewModel, lastAddedState, lastAddedState.modelState.hasSelection(), args.position); viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, newStates); } }); class LineCommand extends CoreEditorCommand { constructor(opts) { super(opts); this._inSelectionMode = opts.inSelectionMode; } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, [ cursorMoveCommands/* CursorMoveCommands */.P.line(viewModel, viewModel.getPrimaryCursorState(), this._inSelectionMode, args.position, args.viewPosition) ]); viewModel.revealPrimaryCursor(args.source, false); } } CoreNavigationCommands.LineSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new LineCommand({ inSelectionMode: false, id: '_lineSelect', precondition: undefined })); CoreNavigationCommands.LineSelectDrag = (0,editorExtensions/* registerEditorCommand */.fK)(new LineCommand({ inSelectionMode: true, id: '_lineSelectDrag', precondition: undefined })); class LastCursorLineCommand extends CoreEditorCommand { constructor(opts) { super(opts); this._inSelectionMode = opts.inSelectionMode; } runCoreEditorCommand(viewModel, args) { const lastAddedCursorIndex = viewModel.getLastAddedCursorIndex(); const states = viewModel.getCursorStates(); const newStates = states.slice(0); newStates[lastAddedCursorIndex] = cursorMoveCommands/* CursorMoveCommands */.P.line(viewModel, states[lastAddedCursorIndex], this._inSelectionMode, args.position, args.viewPosition); viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, newStates); } } CoreNavigationCommands.LastCursorLineSelect = (0,editorExtensions/* registerEditorCommand */.fK)(new LastCursorLineCommand({ inSelectionMode: false, id: 'lastCursorLineSelect', precondition: undefined })); CoreNavigationCommands.LastCursorLineSelectDrag = (0,editorExtensions/* registerEditorCommand */.fK)(new LastCursorLineCommand({ inSelectionMode: true, id: 'lastCursorLineSelectDrag', precondition: undefined })); CoreNavigationCommands.ExpandLineSelection = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditorCommand { constructor() { super({ id: 'expandLineSelection', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 2048 /* CtrlCmd */ | 42 /* KeyL */ } }); } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, cursorMoveCommands/* CursorMoveCommands */.P.expandLineSelection(viewModel, viewModel.getCursorStates())); viewModel.revealPrimaryCursor(args.source, true); } }); CoreNavigationCommands.CancelSelection = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditorCommand { constructor() { super({ id: 'cancelSelection', precondition: editorContextKeys/* EditorContextKeys */.u.hasNonEmptySelection, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 9 /* Escape */, secondary: [1024 /* Shift */ | 9 /* Escape */] } }); } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, [ cursorMoveCommands/* CursorMoveCommands */.P.cancelSelection(viewModel, viewModel.getPrimaryCursorState()) ]); viewModel.revealPrimaryCursor(args.source, true); } }); CoreNavigationCommands.RemoveSecondaryCursors = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditorCommand { constructor() { super({ id: 'removeSecondaryCursors', precondition: editorContextKeys/* EditorContextKeys */.u.hasMultipleSelections, kbOpts: { weight: CORE_WEIGHT + 1, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 9 /* Escape */, secondary: [1024 /* Shift */ | 9 /* Escape */] } }); } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, [ viewModel.getPrimaryCursorState() ]); viewModel.revealPrimaryCursor(args.source, true); (0,aria/* status */.i7)(nls/* localize */.N('removedCursor', "Removed secondary cursors")); } }); CoreNavigationCommands.RevealLine = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditorCommand { constructor() { super({ id: 'revealLine', precondition: undefined, description: RevealLine_.description }); } runCoreEditorCommand(viewModel, args) { const revealLineArg = args; const lineNumberArg = revealLineArg.lineNumber || 0; let lineNumber = typeof lineNumberArg === 'number' ? (lineNumberArg + 1) : (parseInt(lineNumberArg) + 1); if (lineNumber < 1) { lineNumber = 1; } const lineCount = viewModel.model.getLineCount(); if (lineNumber > lineCount) { lineNumber = lineCount; } const range = new core_range/* Range */.e(lineNumber, 1, lineNumber, viewModel.model.getLineMaxColumn(lineNumber)); let revealAt = 0 /* Simple */; if (revealLineArg.at) { switch (revealLineArg.at) { case RevealLine_.RawAtArgument.Top: revealAt = 3 /* Top */; break; case RevealLine_.RawAtArgument.Center: revealAt = 1 /* Center */; break; case RevealLine_.RawAtArgument.Bottom: revealAt = 4 /* Bottom */; break; default: break; } } const viewRange = viewModel.coordinatesConverter.convertModelRangeToViewRange(range); viewModel.revealRange(args.source, false, viewRange, revealAt, 0 /* Smooth */); } }); CoreNavigationCommands.SelectAll = new class extends EditorOrNativeTextInputCommand { constructor() { super(editorExtensions/* SelectAllCommand */.Sq); } runDOMCommand() { if (browser/* isFirefox */.vU) { document.activeElement.focus(); document.activeElement.select(); } document.execCommand('selectAll'); } runEditorCommand(accessor, editor, args) { const viewModel = editor._getViewModel(); if (!viewModel) { // the editor has no view => has no cursors return; } this.runCoreEditorCommand(viewModel, args); } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates('keyboard', 3 /* Explicit */, [ cursorMoveCommands/* CursorMoveCommands */.P.selectAll(viewModel, viewModel.getPrimaryCursorState()) ]); } }(); CoreNavigationCommands.SetSelection = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditorCommand { constructor() { super({ id: 'setSelection', precondition: undefined }); } runCoreEditorCommand(viewModel, args) { viewModel.model.pushStackElement(); viewModel.setCursorStates(args.source, 3 /* Explicit */, [ cursorCommon/* CursorState */.Vi.fromModelSelection(args.selection) ]); } }); })(CoreNavigationCommands || (CoreNavigationCommands = {})); const columnSelectionCondition = contextkey/* ContextKeyExpr */.Ao.and(editorContextKeys/* EditorContextKeys */.u.textInputFocus, editorContextKeys/* EditorContextKeys */.u.columnSelection); function registerColumnSelection(id, keybinding) { keybindingsRegistry/* KeybindingsRegistry */.W.registerKeybindingRule({ id: id, primary: keybinding, when: columnSelectionCondition, weight: CORE_WEIGHT + 1 }); } registerColumnSelection(CoreNavigationCommands.CursorColumnSelectLeft.id, 1024 /* Shift */ | 15 /* LeftArrow */); registerColumnSelection(CoreNavigationCommands.CursorColumnSelectRight.id, 1024 /* Shift */ | 17 /* RightArrow */); registerColumnSelection(CoreNavigationCommands.CursorColumnSelectUp.id, 1024 /* Shift */ | 16 /* UpArrow */); registerColumnSelection(CoreNavigationCommands.CursorColumnSelectPageUp.id, 1024 /* Shift */ | 11 /* PageUp */); registerColumnSelection(CoreNavigationCommands.CursorColumnSelectDown.id, 1024 /* Shift */ | 18 /* DownArrow */); registerColumnSelection(CoreNavigationCommands.CursorColumnSelectPageDown.id, 1024 /* Shift */ | 12 /* PageDown */); function registerCommand(command) { command.register(); return command; } var CoreEditingCommands; (function (CoreEditingCommands) { class CoreEditingCommand extends editorExtensions/* EditorCommand */._l { runEditorCommand(accessor, editor, args) { const viewModel = editor._getViewModel(); if (!viewModel) { // the editor has no view => has no cursors return; } this.runCoreEditingCommand(editor, viewModel, args || {}); } } CoreEditingCommands.CoreEditingCommand = CoreEditingCommand; CoreEditingCommands.LineBreakInsert = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditingCommand { constructor() { super({ id: 'lineBreakInsert', precondition: editorContextKeys/* EditorContextKeys */.u.writable, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 0, mac: { primary: 256 /* WinCtrl */ | 45 /* KeyO */ } } }); } runCoreEditingCommand(editor, viewModel, args) { editor.pushUndoStop(); editor.executeCommands(this.id, cursorTypeOperations/* TypeOperations */.u.lineBreakInsert(viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection))); } }); CoreEditingCommands.Outdent = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditingCommand { constructor() { super({ id: 'outdent', precondition: editorContextKeys/* EditorContextKeys */.u.writable, kbOpts: { weight: CORE_WEIGHT, kbExpr: contextkey/* ContextKeyExpr */.Ao.and(editorContextKeys/* EditorContextKeys */.u.editorTextFocus, editorContextKeys/* EditorContextKeys */.u.tabDoesNotMoveFocus), primary: 1024 /* Shift */ | 2 /* Tab */ } }); } runCoreEditingCommand(editor, viewModel, args) { editor.pushUndoStop(); editor.executeCommands(this.id, cursorTypeOperations/* TypeOperations */.u.outdent(viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection))); editor.pushUndoStop(); } }); CoreEditingCommands.Tab = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditingCommand { constructor() { super({ id: 'tab', precondition: editorContextKeys/* EditorContextKeys */.u.writable, kbOpts: { weight: CORE_WEIGHT, kbExpr: contextkey/* ContextKeyExpr */.Ao.and(editorContextKeys/* EditorContextKeys */.u.editorTextFocus, editorContextKeys/* EditorContextKeys */.u.tabDoesNotMoveFocus), primary: 2 /* Tab */ } }); } runCoreEditingCommand(editor, viewModel, args) { editor.pushUndoStop(); editor.executeCommands(this.id, cursorTypeOperations/* TypeOperations */.u.tab(viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection))); editor.pushUndoStop(); } }); CoreEditingCommands.DeleteLeft = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditingCommand { constructor() { super({ id: 'deleteLeft', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 1 /* Backspace */, secondary: [1024 /* Shift */ | 1 /* Backspace */], mac: { primary: 1 /* Backspace */, secondary: [1024 /* Shift */ | 1 /* Backspace */, 256 /* WinCtrl */ | 38 /* KeyH */, 256 /* WinCtrl */ | 1 /* Backspace */] } } }); } runCoreEditingCommand(editor, viewModel, args) { const [shouldPushStackElementBefore, commands] = cursorDeleteOperations/* DeleteOperations */.A.deleteLeft(viewModel.getPrevEditOperationType(), viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection), viewModel.getCursorAutoClosedCharacters()); if (shouldPushStackElementBefore) { editor.pushUndoStop(); } editor.executeCommands(this.id, commands); viewModel.setPrevEditOperationType(2 /* DeletingLeft */); } }); CoreEditingCommands.DeleteRight = (0,editorExtensions/* registerEditorCommand */.fK)(new class extends CoreEditingCommand { constructor() { super({ id: 'deleteRight', precondition: undefined, kbOpts: { weight: CORE_WEIGHT, kbExpr: editorContextKeys/* EditorContextKeys */.u.textInputFocus, primary: 20 /* Delete */, mac: { primary: 20 /* Delete */, secondary: [256 /* WinCtrl */ | 34 /* KeyD */, 256 /* WinCtrl */ | 20 /* Delete */] } } }); } runCoreEditingCommand(editor, viewModel, args) { const [shouldPushStackElementBefore, commands] = cursorDeleteOperations/* DeleteOperations */.A.deleteRight(viewModel.getPrevEditOperationType(), viewModel.cursorConfig, viewModel.model, viewModel.getCursorStates().map(s => s.modelState.selection)); if (shouldPushStackElementBefore) { editor.pushUndoStop(); } editor.executeCommands(this.id, commands); viewModel.setPrevEditOperationType(3 /* DeletingRight */); } }); CoreEditingCommands.Undo = new class extends EditorOrNativeTextInputCommand { constructor() { super(editorExtensions/* UndoCommand */.n_); } runDOMCommand() { document.execCommand('undo'); } runEditorCommand(accessor, editor, args) { if (!editor.hasModel() || editor.getOption(80 /* readOnly */) === true) { return; } return editor.getModel().undo(); } }(); CoreEditingCommands.Redo = new class extends EditorOrNativeTextInputCommand { constructor() { super(editorExtensions/* RedoCommand */.kz); } runDOMCommand() { document.execCommand('redo'); } runEditorCommand(accessor, editor, args) { if (!editor.hasModel() || editor.getOption(80 /* readOnly */) === true) { return; } return editor.getModel().redo(); } }(); })(CoreEditingCommands || (CoreEditingCommands = {})); /** * A command that will invoke a command on the focused editor. */ class EditorHandlerCommand extends editorExtensions/* Command */.mY { constructor(id, handlerId, description) { super({ id: id, precondition: undefined, description: description }); this._handlerId = handlerId; } runCommand(accessor, args) { const editor = accessor.get(codeEditorService/* ICodeEditorService */.$).getFocusedCodeEditor(); if (!editor) { return; } editor.trigger('keyboard', this._handlerId, args); } } function registerOverwritableCommand(handlerId, description) { registerCommand(new EditorHandlerCommand('default:' + handlerId, handlerId)); registerCommand(new EditorHandlerCommand(handlerId, handlerId, description)); } registerOverwritableCommand("type" /* Type */, { description: `Type`, args: [{ name: 'args', schema: { 'type': 'object', 'required': ['text'], 'properties': { 'text': { 'type': 'string' } }, } }] }); registerOverwritableCommand("replacePreviousChar" /* ReplacePreviousChar */); registerOverwritableCommand("compositionType" /* CompositionType */); registerOverwritableCommand("compositionStart" /* CompositionStart */); registerOverwritableCommand("compositionEnd" /* CompositionEnd */); registerOverwritableCommand("paste" /* Paste */); registerOverwritableCommand("cut" /* Cut */); /***/ }), /***/ 79193: /*!************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/controller/textAreaInput.js ***! \************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Fz: function() { return /* binding */ TextAreaInput; }, /* harmony export */ Nl: function() { return /* binding */ InMemoryClipboardMetadataManager; }, /* harmony export */ RA: function() { return /* binding */ CopyOptions; }, /* harmony export */ pd: function() { return /* binding */ TextAreaSyntethicEvents; } /* harmony export */ }); /* harmony import */ var _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/browser/browser.js */ 87783); /* harmony import */ var _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/browser/dom.js */ 69454); /* harmony import */ var _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/async.js */ 50431); /* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/event.js */ 4348); /* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ 69323); /* harmony import */ var _base_common_mime_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/mime.js */ 8473); /* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../base/common/platform.js */ 23345); /* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../base/common/strings.js */ 82983); /* harmony import */ var _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./textAreaState.js */ 56842); /* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/core/position.js */ 72146); /* harmony import */ var _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/core/selection.js */ 17551); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var TextAreaSyntethicEvents; (function (TextAreaSyntethicEvents) { TextAreaSyntethicEvents.Tap = '-monaco-textarea-synthetic-tap'; })(TextAreaSyntethicEvents || (TextAreaSyntethicEvents = {})); const CopyOptions = { forceCopyWithSyntaxHighlighting: false }; /** * Every time we write to the clipboard, we record a bit of extra metadata here. * Every time we read from the cipboard, if the text matches our last written text, * we can fetch the previous metadata. */ class InMemoryClipboardMetadataManager { constructor() { this._lastState = null; } set(lastCopiedValue, data) { this._lastState = { lastCopiedValue, data }; } get(pastedText) { if (this._lastState && this._lastState.lastCopiedValue === pastedText) { // match! return this._lastState.data; } this._lastState = null; return null; } } InMemoryClipboardMetadataManager.INSTANCE = new InMemoryClipboardMetadataManager(); /** * Writes screen reader content to the textarea and is able to analyze its input events to generate: * - onCut * - onPaste * - onType * * Composition events are generated for presentation purposes (composition input is reflected in onType). */ class TextAreaInput extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__/* .Disposable */ .JT { constructor(host, textArea) { super(); this.textArea = textArea; this._onFocus = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__/* .Emitter */ .Q5()); this.onFocus = this._onFocus.event; this._onBlur = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__/* .Emitter */ .Q5()); this.onBlur = this._onBlur.event; this._onKeyDown = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__/* .Emitter */ .Q5()); this.onKeyDown = this._onKeyDown.event; this._onKeyUp = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__/* .Emitter */ .Q5()); this.onKeyUp = this._onKeyUp.event; this._onCut = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__/* .Emitter */ .Q5()); this.onCut = this._onCut.event; this._onPaste = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__/* .Emitter */ .Q5()); this.onPaste = this._onPaste.event; this._onType = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__/* .Emitter */ .Q5()); this.onType = this._onType.event; this._onCompositionStart = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__/* .Emitter */ .Q5()); this.onCompositionStart = this._onCompositionStart.event; this._onCompositionUpdate = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__/* .Emitter */ .Q5()); this.onCompositionUpdate = this._onCompositionUpdate.event; this._onCompositionEnd = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__/* .Emitter */ .Q5()); this.onCompositionEnd = this._onCompositionEnd.event; this._onSelectionChangeRequest = this._register(new _base_common_event_js__WEBPACK_IMPORTED_MODULE_3__/* .Emitter */ .Q5()); this.onSelectionChangeRequest = this._onSelectionChangeRequest.event; this._host = host; this._textArea = this._register(new TextAreaWrapper(textArea)); this._asyncTriggerCut = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__/* .RunOnceScheduler */ .pY(() => this._onCut.fire(), 0)); this._asyncFocusGainWriteScreenReaderContent = this._register(new _base_common_async_js__WEBPACK_IMPORTED_MODULE_2__/* .RunOnceScheduler */ .pY(() => this.writeScreenReaderContent('asyncFocusGain'), 0)); this._textAreaState = _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* .TextAreaState */ .un.EMPTY; this._selectionChangeListener = null; this.writeScreenReaderContent('ctor'); this._hasFocus = false; this._isDoingComposition = false; this._nextCommand = 0 /* Type */; let lastKeyDown = null; this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addStandardDisposableListener */ .mu(textArea.domNode, 'keydown', (e) => { if (e.keyCode === 109 /* KEY_IN_COMPOSITION */ || (this._isDoingComposition && e.keyCode === 1 /* Backspace */)) { // Stop propagation for keyDown events if the IME is processing key input e.stopPropagation(); } if (e.equals(9 /* Escape */)) { // Prevent default always for `Esc`, otherwise it will generate a keypress // See https://msdn.microsoft.com/en-us/library/ie/ms536939(v=vs.85).aspx e.preventDefault(); } lastKeyDown = e; this._onKeyDown.fire(e); })); this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addStandardDisposableListener */ .mu(textArea.domNode, 'keyup', (e) => { this._onKeyUp.fire(e); })); this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addDisposableListener */ .nm(textArea.domNode, 'compositionstart', (e) => { if (_textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* ._debugComposition */ .al) { console.log(`[compositionstart]`, e); } if (this._isDoingComposition) { return; } this._isDoingComposition = true; if (_base_common_platform_js__WEBPACK_IMPORTED_MODULE_6__/* .isMacintosh */ .dz && this._textAreaState.selectionStart === this._textAreaState.selectionEnd && this._textAreaState.selectionStart > 0 && this._textAreaState.value.substr(this._textAreaState.selectionStart - 1, 1) === e.data) { const isArrowKey = (lastKeyDown && lastKeyDown.equals(109 /* KEY_IN_COMPOSITION */) && (lastKeyDown.code === 'ArrowRight' || lastKeyDown.code === 'ArrowLeft')); if (isArrowKey || _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isFirefox */ .vU) { // Handling long press case on Chromium/Safari macOS + arrow key => pretend the character was selected // or long press case on Firefox on macOS if (_textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* ._debugComposition */ .al) { console.log(`[compositionstart] Handling long press case on macOS + arrow key or Firefox`, e); } this._textAreaState = new _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* .TextAreaState */ .un(this._textAreaState.value, this._textAreaState.selectionStart - 1, this._textAreaState.selectionEnd, this._textAreaState.selectionStartPosition ? new _common_core_position_js__WEBPACK_IMPORTED_MODULE_9__/* .Position */ .L(this._textAreaState.selectionStartPosition.lineNumber, this._textAreaState.selectionStartPosition.column - 1) : null, this._textAreaState.selectionEndPosition); this._onCompositionStart.fire({ revealDeltaColumns: -1 }); return; } } if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isAndroid */ .Dt) { // when tapping on the editor, Android enters composition mode to edit the current word // so we cannot clear the textarea on Android and we must pretend the current word was selected this._onCompositionStart.fire({ revealDeltaColumns: -this._textAreaState.selectionStart }); return; } this._setAndWriteTextAreaState('compositionstart', _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* .TextAreaState */ .un.EMPTY); this._onCompositionStart.fire({ revealDeltaColumns: 0 }); })); /** * Deduce the typed input from a text area's value and the last observed state. */ const deduceInputFromTextAreaValue = (couldBeEmojiInput) => { const oldState = this._textAreaState; const newState = _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* .TextAreaState */ .un.readFromTextArea(this._textArea); return [newState, _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* .TextAreaState */ .un.deduceInput(oldState, newState, couldBeEmojiInput)]; }; const deduceAndroidCompositionInput = () => { const oldState = this._textAreaState; const newState = _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* .TextAreaState */ .un.readFromTextArea(this._textArea); return [newState, _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* .TextAreaState */ .un.deduceAndroidCompositionInput(oldState, newState)]; }; /** * Deduce the composition input from a string. */ const deduceComposition = (text) => { const oldState = this._textAreaState; const newState = _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* .TextAreaState */ .un.selectedText(text); const typeInput = { text: newState.value, replacePrevCharCnt: oldState.selectionEnd - oldState.selectionStart, replaceNextCharCnt: 0, positionDelta: 0 }; return [newState, typeInput]; }; this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addDisposableListener */ .nm(textArea.domNode, 'compositionupdate', (e) => { if (_textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* ._debugComposition */ .al) { console.log(`[compositionupdate]`, e); } if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isAndroid */ .Dt) { // On Android, the data sent with the composition update event is unusable. // For example, if the cursor is in the middle of a word like Mic|osoft // and Microsoft is chosen from the keyboard's suggestions, the e.data will contain "Microsoft". // This is not really usable because it doesn't tell us where the edit began and where it ended. const [newState, typeInput] = deduceAndroidCompositionInput(); this._textAreaState = newState; this._onType.fire(typeInput); this._onCompositionUpdate.fire(e); return; } const [newState, typeInput] = deduceComposition(e.data || ''); this._textAreaState = newState; this._onType.fire(typeInput); this._onCompositionUpdate.fire(e); })); this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addDisposableListener */ .nm(textArea.domNode, 'compositionend', (e) => { if (_textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* ._debugComposition */ .al) { console.log(`[compositionend]`, e); } // https://github.com/microsoft/monaco-editor/issues/1663 // On iOS 13.2, Chinese system IME randomly trigger an additional compositionend event with empty data if (!this._isDoingComposition) { return; } this._isDoingComposition = false; if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isAndroid */ .Dt) { // On Android, the data sent with the composition update event is unusable. // For example, if the cursor is in the middle of a word like Mic|osoft // and Microsoft is chosen from the keyboard's suggestions, the e.data will contain "Microsoft". // This is not really usable because it doesn't tell us where the edit began and where it ended. const [newState, typeInput] = deduceAndroidCompositionInput(); this._textAreaState = newState; this._onType.fire(typeInput); this._onCompositionEnd.fire(); return; } const [newState, typeInput] = deduceComposition(e.data || ''); this._textAreaState = newState; this._onType.fire(typeInput); // isChrome: the textarea is not updated correctly when composition ends // isFirefox: the textarea is not updated correctly after inserting emojis // => we cannot assume the text at the end consists only of the composited text if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isChrome */ .i7 || _base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isFirefox */ .vU) { this._textAreaState = _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* .TextAreaState */ .un.readFromTextArea(this._textArea); } this._onCompositionEnd.fire(); })); this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addDisposableListener */ .nm(textArea.domNode, 'input', () => { // Pretend here we touched the text area, as the `input` event will most likely // result in a `selectionchange` event which we want to ignore this._textArea.setIgnoreSelectionChangeTime('received input event'); if (this._isDoingComposition) { return; } const [newState, typeInput] = deduceInputFromTextAreaValue(/*couldBeEmojiInput*/ _base_common_platform_js__WEBPACK_IMPORTED_MODULE_6__/* .isMacintosh */ .dz); if (typeInput.replacePrevCharCnt === 0 && typeInput.text.length === 1 && _base_common_strings_js__WEBPACK_IMPORTED_MODULE_7__/* .isHighSurrogate */ .ZG(typeInput.text.charCodeAt(0))) { // Ignore invalid input but keep it around for next time return; } this._textAreaState = newState; if (this._nextCommand === 0 /* Type */) { if (typeInput.text !== '' || typeInput.replacePrevCharCnt !== 0) { this._onType.fire(typeInput); } } else { if (typeInput.text !== '' || typeInput.replacePrevCharCnt !== 0) { this._firePaste(typeInput.text, null); } this._nextCommand = 0 /* Type */; } })); // --- Clipboard operations this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addDisposableListener */ .nm(textArea.domNode, 'cut', (e) => { // Pretend here we touched the text area, as the `cut` event will most likely // result in a `selectionchange` event which we want to ignore this._textArea.setIgnoreSelectionChangeTime('received cut event'); this._ensureClipboardGetsEditorSelection(e); this._asyncTriggerCut.schedule(); })); this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addDisposableListener */ .nm(textArea.domNode, 'copy', (e) => { this._ensureClipboardGetsEditorSelection(e); })); this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addDisposableListener */ .nm(textArea.domNode, 'paste', (e) => { // Pretend here we touched the text area, as the `paste` event will most likely // result in a `selectionchange` event which we want to ignore this._textArea.setIgnoreSelectionChangeTime('received paste event'); if (ClipboardEventUtils.canUseTextData(e)) { const [pastePlainText, metadata] = ClipboardEventUtils.getTextData(e); if (pastePlainText !== '') { this._firePaste(pastePlainText, metadata); } } else { if (this._textArea.getSelectionStart() !== this._textArea.getSelectionEnd()) { // Clean up the textarea, to get a clean paste this._setAndWriteTextAreaState('paste', _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* .TextAreaState */ .un.EMPTY); } this._nextCommand = 1 /* Paste */; } })); this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addDisposableListener */ .nm(textArea.domNode, 'focus', () => { const hadFocus = this._hasFocus; this._setHasFocus(true); if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isSafari */ .G6 && !hadFocus && this._hasFocus) { // When "tabbing into" the textarea, immediately after dispatching the 'focus' event, // Safari will always move the selection at offset 0 in the textarea this._asyncFocusGainWriteScreenReaderContent.schedule(); } })); this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addDisposableListener */ .nm(textArea.domNode, 'blur', () => { if (this._isDoingComposition) { // See https://github.com/microsoft/vscode/issues/112621 // where compositionend is not triggered when the editor // is taken off-dom during a composition // Clear the flag to be able to write to the textarea this._isDoingComposition = false; // Clear the textarea to avoid an unwanted cursor type this.writeScreenReaderContent('blurWithoutCompositionEnd'); // Fire artificial composition end this._onCompositionEnd.fire(); } this._setHasFocus(false); })); this._register(_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addDisposableListener */ .nm(textArea.domNode, TextAreaSyntethicEvents.Tap, () => { if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isAndroid */ .Dt && this._isDoingComposition) { // on Android, tapping does not cancel the current composition, so the // textarea is stuck showing the old composition // Clear the flag to be able to write to the textarea this._isDoingComposition = false; // Clear the textarea to avoid an unwanted cursor type this.writeScreenReaderContent('tapWithoutCompositionEnd'); // Fire artificial composition end this._onCompositionEnd.fire(); } })); } _installSelectionChangeListener() { // See https://github.com/microsoft/vscode/issues/27216 and https://github.com/microsoft/vscode/issues/98256 // When using a Braille display, it is possible for users to reposition the // system caret. This is reflected in Chrome as a `selectionchange` event. // // The `selectionchange` event appears to be emitted under numerous other circumstances, // so it is quite a challenge to distinguish a `selectionchange` coming in from a user // using a Braille display from all the other cases. // // The problems with the `selectionchange` event are: // * the event is emitted when the textarea is focused programmatically -- textarea.focus() // * the event is emitted when the selection is changed in the textarea programmatically -- textarea.setSelectionRange(...) // * the event is emitted when the value of the textarea is changed programmatically -- textarea.value = '...' // * the event is emitted when tabbing into the textarea // * the event is emitted asynchronously (sometimes with a delay as high as a few tens of ms) // * the event sometimes comes in bursts for a single logical textarea operation // `selectionchange` events often come multiple times for a single logical change // so throttle multiple `selectionchange` events that burst in a short period of time. let previousSelectionChangeEventTime = 0; return _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .addDisposableListener */ .nm(document, 'selectionchange', (e) => { if (!this._hasFocus) { return; } if (this._isDoingComposition) { return; } if (!_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isChrome */ .i7) { // Support only for Chrome until testing happens on other browsers return; } const now = Date.now(); const delta1 = now - previousSelectionChangeEventTime; previousSelectionChangeEventTime = now; if (delta1 < 5) { // received another `selectionchange` event within 5ms of the previous `selectionchange` event // => ignore it return; } const delta2 = now - this._textArea.getIgnoreSelectionChangeTime(); this._textArea.resetSelectionChangeTime(); if (delta2 < 100) { // received a `selectionchange` event within 100ms since we touched the textarea // => ignore it, since we caused it return; } if (!this._textAreaState.selectionStartPosition || !this._textAreaState.selectionEndPosition) { // Cannot correlate a position in the textarea with a position in the editor... return; } const newValue = this._textArea.getValue(); if (this._textAreaState.value !== newValue) { // Cannot correlate a position in the textarea with a position in the editor... return; } const newSelectionStart = this._textArea.getSelectionStart(); const newSelectionEnd = this._textArea.getSelectionEnd(); if (this._textAreaState.selectionStart === newSelectionStart && this._textAreaState.selectionEnd === newSelectionEnd) { // Nothing to do... return; } const _newSelectionStartPosition = this._textAreaState.deduceEditorPosition(newSelectionStart); const newSelectionStartPosition = this._host.deduceModelPosition(_newSelectionStartPosition[0], _newSelectionStartPosition[1], _newSelectionStartPosition[2]); const _newSelectionEndPosition = this._textAreaState.deduceEditorPosition(newSelectionEnd); const newSelectionEndPosition = this._host.deduceModelPosition(_newSelectionEndPosition[0], _newSelectionEndPosition[1], _newSelectionEndPosition[2]); const newSelection = new _common_core_selection_js__WEBPACK_IMPORTED_MODULE_10__/* .Selection */ .Y(newSelectionStartPosition.lineNumber, newSelectionStartPosition.column, newSelectionEndPosition.lineNumber, newSelectionEndPosition.column); this._onSelectionChangeRequest.fire(newSelection); }); } dispose() { super.dispose(); if (this._selectionChangeListener) { this._selectionChangeListener.dispose(); this._selectionChangeListener = null; } } focusTextArea() { // Setting this._hasFocus and writing the screen reader content // will result in a focus() and setSelectionRange() in the textarea this._setHasFocus(true); // If the editor is off DOM, focus cannot be really set, so let's double check that we have managed to set the focus this.refreshFocusState(); } isFocused() { return this._hasFocus; } refreshFocusState() { const shadowRoot = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .getShadowRoot */ .Ay(this.textArea.domNode); if (shadowRoot) { this._setHasFocus(shadowRoot.activeElement === this.textArea.domNode); } else if (_base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .isInDOM */ .Uw(this.textArea.domNode)) { this._setHasFocus(document.activeElement === this.textArea.domNode); } else { this._setHasFocus(false); } } _setHasFocus(newHasFocus) { if (this._hasFocus === newHasFocus) { // no change return; } this._hasFocus = newHasFocus; if (this._selectionChangeListener) { this._selectionChangeListener.dispose(); this._selectionChangeListener = null; } if (this._hasFocus) { this._selectionChangeListener = this._installSelectionChangeListener(); } if (this._hasFocus) { this.writeScreenReaderContent('focusgain'); } if (this._hasFocus) { this._onFocus.fire(); } else { this._onBlur.fire(); } } _setAndWriteTextAreaState(reason, textAreaState) { if (!this._hasFocus) { textAreaState = textAreaState.collapseSelection(); } textAreaState.writeToTextArea(reason, this._textArea, this._hasFocus); this._textAreaState = textAreaState; } writeScreenReaderContent(reason) { if (this._isDoingComposition) { // Do not write to the text area when doing composition return; } this._setAndWriteTextAreaState(reason, this._host.getScreenReaderContent(this._textAreaState)); } _ensureClipboardGetsEditorSelection(e) { const dataToCopy = this._host.getDataToCopy(ClipboardEventUtils.canUseTextData(e)); const storedMetadata = { version: 1, isFromEmptySelection: dataToCopy.isFromEmptySelection, multicursorText: dataToCopy.multicursorText, mode: dataToCopy.mode }; InMemoryClipboardMetadataManager.INSTANCE.set( // When writing "LINE\r\n" to the clipboard and then pasting, // Firefox pastes "LINE\n", so let's work around this quirk (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isFirefox */ .vU ? dataToCopy.text.replace(/\r\n/g, '\n') : dataToCopy.text), storedMetadata); if (!ClipboardEventUtils.canUseTextData(e)) { // Looks like an old browser. The strategy is to place the text // we'd like to be copied to the clipboard in the textarea and select it. this._setAndWriteTextAreaState('copy or cut', _textAreaState_js__WEBPACK_IMPORTED_MODULE_8__/* .TextAreaState */ .un.selectedText(dataToCopy.text)); return; } ClipboardEventUtils.setTextData(e, dataToCopy.text, dataToCopy.html, storedMetadata); } _firePaste(text, metadata) { if (!metadata) { // try the in-memory store metadata = InMemoryClipboardMetadataManager.INSTANCE.get(text); } this._onPaste.fire({ text: text, metadata: metadata }); } } class ClipboardEventUtils { static canUseTextData(e) { if (e.clipboardData) { return true; } return false; } static getTextData(e) { if (e.clipboardData) { e.preventDefault(); const text = e.clipboardData.getData(_base_common_mime_js__WEBPACK_IMPORTED_MODULE_5__/* .Mimes */ .vW.text); let metadata = null; const rawmetadata = e.clipboardData.getData('vscode-editor-data'); if (typeof rawmetadata === 'string') { try { metadata = JSON.parse(rawmetadata); if (metadata.version !== 1) { metadata = null; } } catch (err) { // no problem! } } return [text, metadata]; } throw new Error('ClipboardEventUtils.getTextData: Cannot use text data!'); } static setTextData(e, text, html, metadata) { if (e.clipboardData) { e.clipboardData.setData(_base_common_mime_js__WEBPACK_IMPORTED_MODULE_5__/* .Mimes */ .vW.text, text); if (typeof html === 'string') { e.clipboardData.setData('text/html', html); } e.clipboardData.setData('vscode-editor-data', JSON.stringify(metadata)); e.preventDefault(); return; } throw new Error('ClipboardEventUtils.setTextData: Cannot use text data!'); } } class TextAreaWrapper extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__/* .Disposable */ .JT { constructor(_textArea) { super(); this._actual = _textArea; this._ignoreSelectionChangeTime = 0; } setIgnoreSelectionChangeTime(reason) { this._ignoreSelectionChangeTime = Date.now(); } getIgnoreSelectionChangeTime() { return this._ignoreSelectionChangeTime; } resetSelectionChangeTime() { this._ignoreSelectionChangeTime = 0; } getValue() { // console.log('current value: ' + this._textArea.value); return this._actual.domNode.value; } setValue(reason, value) { const textArea = this._actual.domNode; if (textArea.value === value) { // No change return; } // console.log('reason: ' + reason + ', current value: ' + textArea.value + ' => new value: ' + value); this.setIgnoreSelectionChangeTime('setValue'); textArea.value = value; } getSelectionStart() { return this._actual.domNode.selectionDirection === 'backward' ? this._actual.domNode.selectionEnd : this._actual.domNode.selectionStart; } getSelectionEnd() { return this._actual.domNode.selectionDirection === 'backward' ? this._actual.domNode.selectionStart : this._actual.domNode.selectionEnd; } setSelectionRange(reason, selectionStart, selectionEnd) { const textArea = this._actual.domNode; let activeElement = null; const shadowRoot = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .getShadowRoot */ .Ay(textArea); if (shadowRoot) { activeElement = shadowRoot.activeElement; } else { activeElement = document.activeElement; } const currentIsFocused = (activeElement === textArea); const currentSelectionStart = textArea.selectionStart; const currentSelectionEnd = textArea.selectionEnd; if (currentIsFocused && currentSelectionStart === selectionStart && currentSelectionEnd === selectionEnd) { // No change // Firefox iframe bug https://github.com/microsoft/monaco-editor/issues/643#issuecomment-367871377 if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isFirefox */ .vU && window.parent !== window) { textArea.focus(); } return; } // console.log('reason: ' + reason + ', setSelectionRange: ' + selectionStart + ' -> ' + selectionEnd); if (currentIsFocused) { // No need to focus, only need to change the selection range this.setIgnoreSelectionChangeTime('setSelectionRange'); textArea.setSelectionRange(selectionStart, selectionEnd); if (_base_browser_browser_js__WEBPACK_IMPORTED_MODULE_0__/* .isFirefox */ .vU && window.parent !== window) { textArea.focus(); } return; } // If the focus is outside the textarea, browsers will try really hard to reveal the textarea. // Here, we try to undo the browser's desperate reveal. try { const scrollState = _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .saveParentsScrollTop */ .vL(textArea); this.setIgnoreSelectionChangeTime('setSelectionRange'); textArea.focus(); textArea.setSelectionRange(selectionStart, selectionEnd); _base_browser_dom_js__WEBPACK_IMPORTED_MODULE_1__/* .restoreParentsScrollTop */ ._0(textArea, scrollState); } catch (e) { // Sometimes IE throws when setting selection (e.g. textarea is off-DOM) } } } /***/ }), /***/ 56842: /*!************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/controller/textAreaState.js ***! \************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ al: function() { return /* binding */ _debugComposition; }, /* harmony export */ ee: function() { return /* binding */ PagedScreenReaderStrategy; }, /* harmony export */ un: function() { return /* binding */ TextAreaState; } /* harmony export */ }); /* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/strings.js */ 82983); /* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/core/position.js */ 72146); /* harmony import */ var _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/core/range.js */ 17373); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const _debugComposition = false; class TextAreaState { constructor(value, selectionStart, selectionEnd, selectionStartPosition, selectionEndPosition) { this.value = value; this.selectionStart = selectionStart; this.selectionEnd = selectionEnd; this.selectionStartPosition = selectionStartPosition; this.selectionEndPosition = selectionEndPosition; } toString() { return '[ <' + this.value + '>, selectionStart: ' + this.selectionStart + ', selectionEnd: ' + this.selectionEnd + ']'; } static readFromTextArea(textArea) { return new TextAreaState(textArea.getValue(), textArea.getSelectionStart(), textArea.getSelectionEnd(), null, null); } collapseSelection() { return new TextAreaState(this.value, this.value.length, this.value.length, null, null); } writeToTextArea(reason, textArea, select) { if (_debugComposition) { console.log('writeToTextArea ' + reason + ': ' + this.toString()); } textArea.setValue(reason, this.value); if (select) { textArea.setSelectionRange(reason, this.selectionStart, this.selectionEnd); } } deduceEditorPosition(offset) { if (offset <= this.selectionStart) { const str = this.value.substring(offset, this.selectionStart); return this._finishDeduceEditorPosition(this.selectionStartPosition, str, -1); } if (offset >= this.selectionEnd) { const str = this.value.substring(this.selectionEnd, offset); return this._finishDeduceEditorPosition(this.selectionEndPosition, str, 1); } const str1 = this.value.substring(this.selectionStart, offset); if (str1.indexOf(String.fromCharCode(8230)) === -1) { return this._finishDeduceEditorPosition(this.selectionStartPosition, str1, 1); } const str2 = this.value.substring(offset, this.selectionEnd); return this._finishDeduceEditorPosition(this.selectionEndPosition, str2, -1); } _finishDeduceEditorPosition(anchor, deltaText, signum) { let lineFeedCnt = 0; let lastLineFeedIndex = -1; while ((lastLineFeedIndex = deltaText.indexOf('\n', lastLineFeedIndex + 1)) !== -1) { lineFeedCnt++; } return [anchor, signum * deltaText.length, lineFeedCnt]; } static selectedText(text) { return new TextAreaState(text, 0, text.length, null, null); } static deduceInput(previousState, currentState, couldBeEmojiInput) { if (!previousState) { // This is the EMPTY state return { text: '', replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: 0 }; } if (_debugComposition) { console.log('------------------------deduceInput'); console.log('PREVIOUS STATE: ' + previousState.toString()); console.log('CURRENT STATE: ' + currentState.toString()); } let previousValue = previousState.value; let previousSelectionStart = previousState.selectionStart; let previousSelectionEnd = previousState.selectionEnd; let currentValue = currentState.value; let currentSelectionStart = currentState.selectionStart; let currentSelectionEnd = currentState.selectionEnd; // Strip the previous suffix from the value (without interfering with the current selection) const previousSuffix = previousValue.substring(previousSelectionEnd); const currentSuffix = currentValue.substring(currentSelectionEnd); const suffixLength = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .commonSuffixLength */ .P1(previousSuffix, currentSuffix); currentValue = currentValue.substring(0, currentValue.length - suffixLength); previousValue = previousValue.substring(0, previousValue.length - suffixLength); const previousPrefix = previousValue.substring(0, previousSelectionStart); const currentPrefix = currentValue.substring(0, currentSelectionStart); const prefixLength = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .commonPrefixLength */ .Mh(previousPrefix, currentPrefix); currentValue = currentValue.substring(prefixLength); previousValue = previousValue.substring(prefixLength); currentSelectionStart -= prefixLength; previousSelectionStart -= prefixLength; currentSelectionEnd -= prefixLength; previousSelectionEnd -= prefixLength; if (_debugComposition) { console.log('AFTER DIFFING PREVIOUS STATE: <' + previousValue + '>, selectionStart: ' + previousSelectionStart + ', selectionEnd: ' + previousSelectionEnd); console.log('AFTER DIFFING CURRENT STATE: <' + currentValue + '>, selectionStart: ' + currentSelectionStart + ', selectionEnd: ' + currentSelectionEnd); } if (couldBeEmojiInput && currentSelectionStart === currentSelectionEnd && previousValue.length > 0) { // on OSX, emojis from the emoji picker are inserted at random locations // the only hints we can use is that the selection is immediately after the inserted emoji // and that none of the old text has been deleted let potentialEmojiInput = null; if (currentSelectionStart === currentValue.length) { // emoji potentially inserted "somewhere" after the previous selection => it should appear at the end of `currentValue` if (currentValue.startsWith(previousValue)) { // only if all of the old text is accounted for potentialEmojiInput = currentValue.substring(previousValue.length); } } else { // emoji potentially inserted "somewhere" before the previous selection => it should appear at the start of `currentValue` if (currentValue.endsWith(previousValue)) { // only if all of the old text is accounted for potentialEmojiInput = currentValue.substring(0, currentValue.length - previousValue.length); } } if (potentialEmojiInput !== null && potentialEmojiInput.length > 0) { // now we check that this is indeed an emoji // emojis can grow quite long, so a length check is of no help // e.g. 1F3F4 E0067 E0062 E0065 E006E E0067 E007F ; fully-qualified # 🏴󠁧󠁢󠁥󠁮󠁧󠁿 England // Oftentimes, emojis use Variation Selector-16 (U+FE0F), so that is a good hint // http://emojipedia.org/variation-selector-16/ // > An invisible codepoint which specifies that the preceding character // > should be displayed with emoji presentation. Only required if the // > preceding character defaults to text presentation. if (/\uFE0F/.test(potentialEmojiInput) || _base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .containsEmoji */ .RP(potentialEmojiInput)) { return { text: potentialEmojiInput, replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: 0 }; } } } if (currentSelectionStart === currentSelectionEnd) { // composition accept case (noticed in FF + Japanese) // [blahblah] => blahblah| if (previousValue === currentValue && previousSelectionStart === 0 && previousSelectionEnd === previousValue.length && currentSelectionStart === currentValue.length && currentValue.indexOf('\n') === -1) { if (_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .containsFullWidthCharacter */ .xe(currentValue)) { return { text: '', replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: 0 }; } } // no current selection const replacePreviousCharacters = (previousPrefix.length - prefixLength); if (_debugComposition) { console.log('REMOVE PREVIOUS: ' + (previousPrefix.length - prefixLength) + ' chars'); } return { text: currentValue, replacePrevCharCnt: replacePreviousCharacters, replaceNextCharCnt: 0, positionDelta: 0 }; } // there is a current selection => composition case const replacePreviousCharacters = previousSelectionEnd - previousSelectionStart; return { text: currentValue, replacePrevCharCnt: replacePreviousCharacters, replaceNextCharCnt: 0, positionDelta: 0 }; } static deduceAndroidCompositionInput(previousState, currentState) { if (!previousState) { // This is the EMPTY state return { text: '', replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: 0 }; } if (_debugComposition) { console.log('------------------------deduceAndroidCompositionInput'); console.log('PREVIOUS STATE: ' + previousState.toString()); console.log('CURRENT STATE: ' + currentState.toString()); } if (previousState.value === currentState.value) { return { text: '', replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: currentState.selectionEnd - previousState.selectionEnd }; } const prefixLength = Math.min(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .commonPrefixLength */ .Mh(previousState.value, currentState.value), previousState.selectionEnd); const suffixLength = Math.min(_base_common_strings_js__WEBPACK_IMPORTED_MODULE_0__/* .commonSuffixLength */ .P1(previousState.value, currentState.value), previousState.value.length - previousState.selectionEnd); const previousValue = previousState.value.substring(prefixLength, previousState.value.length - suffixLength); const currentValue = currentState.value.substring(prefixLength, currentState.value.length - suffixLength); const previousSelectionStart = previousState.selectionStart - prefixLength; const previousSelectionEnd = previousState.selectionEnd - prefixLength; const currentSelectionStart = currentState.selectionStart - prefixLength; const currentSelectionEnd = currentState.selectionEnd - prefixLength; if (_debugComposition) { console.log('AFTER DIFFING PREVIOUS STATE: <' + previousValue + '>, selectionStart: ' + previousSelectionStart + ', selectionEnd: ' + previousSelectionEnd); console.log('AFTER DIFFING CURRENT STATE: <' + currentValue + '>, selectionStart: ' + currentSelectionStart + ', selectionEnd: ' + currentSelectionEnd); } return { text: currentValue, replacePrevCharCnt: previousSelectionEnd, replaceNextCharCnt: previousValue.length - previousSelectionEnd, positionDelta: currentSelectionEnd - currentValue.length }; } } TextAreaState.EMPTY = new TextAreaState('', 0, 0, null, null); class PagedScreenReaderStrategy { static _getPageOfLine(lineNumber, linesPerPage) { return Math.floor((lineNumber - 1) / linesPerPage); } static _getRangeForPage(page, linesPerPage) { const offset = page * linesPerPage; const startLineNumber = offset + 1; const endLineNumber = offset + linesPerPage; return new _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__/* .Range */ .e(startLineNumber, 1, endLineNumber + 1, 1); } static fromEditorSelection(previousState, model, selection, linesPerPage, trimLongText) { const selectionStartPage = PagedScreenReaderStrategy._getPageOfLine(selection.startLineNumber, linesPerPage); const selectionStartPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionStartPage, linesPerPage); const selectionEndPage = PagedScreenReaderStrategy._getPageOfLine(selection.endLineNumber, linesPerPage); const selectionEndPageRange = PagedScreenReaderStrategy._getRangeForPage(selectionEndPage, linesPerPage); const pretextRange = selectionStartPageRange.intersectRanges(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__/* .Range */ .e(1, 1, selection.startLineNumber, selection.startColumn)); let pretext = model.getValueInRange(pretextRange, 1 /* LF */); const lastLine = model.getLineCount(); const lastLineMaxColumn = model.getLineMaxColumn(lastLine); const posttextRange = selectionEndPageRange.intersectRanges(new _common_core_range_js__WEBPACK_IMPORTED_MODULE_1__/* .Range */ .e(selection.endLineNumber, selection.endColumn, lastLine, lastLineMaxColumn)); let posttext = model.getValueInRange(posttextRange, 1 /* LF */); let text; if (selectionStartPage === selectionEndPage || selectionStartPage + 1 === selectionEndPage) { // take full selection text = model.getValueInRange(selection, 1 /* LF */); } else { const selectionRange1 = selectionStartPageRange.intersectRanges(selection); const selectionRange2 = selectionEndPageRange.intersectRanges(selection); text = (model.getValueInRange(selectionRange1, 1 /* LF */) + String.fromCharCode(8230) + model.getValueInRange(selectionRange2, 1 /* LF */)); } // Chromium handles very poorly text even of a few thousand chars // Cut text to avoid stalling the entire UI if (trimLongText) { const LIMIT_CHARS = 500; if (pretext.length > LIMIT_CHARS) { pretext = pretext.substring(pretext.length - LIMIT_CHARS, pretext.length); } if (posttext.length > LIMIT_CHARS) { posttext = posttext.substring(0, LIMIT_CHARS); } if (text.length > 2 * LIMIT_CHARS) { text = text.substring(0, LIMIT_CHARS) + String.fromCharCode(8230) + text.substring(text.length - LIMIT_CHARS, text.length); } } return new TextAreaState(pretext + text + posttext, pretext.length, pretext.length + text.length, new _common_core_position_js__WEBPACK_IMPORTED_MODULE_2__/* .Position */ .L(selection.startLineNumber, selection.startColumn), new _common_core_position_js__WEBPACK_IMPORTED_MODULE_2__/* .Position */ .L(selection.endLineNumber, selection.endColumn)); } } /***/ }), /***/ 39528: /*!****************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/core/editorState.js + 1 modules ***! \****************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { yy: function() { return /* binding */ EditorState; }, Dl: function() { return /* binding */ EditorStateCancellationTokenSource; }, ZF: function() { return /* binding */ StableEditorScrollState; }, YQ: function() { return /* binding */ TextModelCancellationTokenSource; } }); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/strings.js var strings = __webpack_require__(82983); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/core/range.js var core_range = __webpack_require__(17373); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/cancellation.js var cancellation = __webpack_require__(96283); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/lifecycle.js var lifecycle = __webpack_require__(69323); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/editorExtensions.js var editorExtensions = __webpack_require__(4514); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/contextkey/common/contextkey.js var contextkey = __webpack_require__(90689); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/linkedList.js var linkedList = __webpack_require__(34502); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/instantiation/common/instantiation.js var instantiation = __webpack_require__(16925); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/instantiation/common/extensions.js var extensions = __webpack_require__(7335); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/nls.js var nls = __webpack_require__(13268); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/core/keybindingCancellation.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const IEditorCancellationTokens = (0,instantiation/* createDecorator */.yh)('IEditorCancelService'); const ctxCancellableOperation = new contextkey/* RawContextKey */.uy('cancellableOperation', false, (0,nls/* localize */.N)('cancellableOperation', 'Whether the editor runs a cancellable operation, e.g. like \'Peek References\'')); (0,extensions/* registerSingleton */.z)(IEditorCancellationTokens, class { constructor() { this._tokens = new WeakMap(); } add(editor, cts) { let data = this._tokens.get(editor); if (!data) { data = editor.invokeWithinContext(accessor => { const key = ctxCancellableOperation.bindTo(accessor.get(contextkey/* IContextKeyService */.i6)); const tokens = new linkedList/* LinkedList */.S(); return { key, tokens }; }); this._tokens.set(editor, data); } let removeFn; data.key.set(true); removeFn = data.tokens.push(cts); return () => { // remove w/o cancellation if (removeFn) { removeFn(); data.key.set(!data.tokens.isEmpty()); removeFn = undefined; } }; } cancel(editor) { const data = this._tokens.get(editor); if (!data) { return; } // remove with cancellation const cts = data.tokens.pop(); if (cts) { cts.cancel(); data.key.set(!data.tokens.isEmpty()); } } }, true); class EditorKeybindingCancellationTokenSource extends cancellation/* CancellationTokenSource */.A { constructor(editor, parent) { super(parent); this.editor = editor; this._unregister = editor.invokeWithinContext(accessor => accessor.get(IEditorCancellationTokens).add(editor, this)); } dispose() { this._unregister(); super.dispose(); } } (0,editorExtensions/* registerEditorCommand */.fK)(new class extends editorExtensions/* EditorCommand */._l { constructor() { super({ id: 'editor.cancelOperation', kbOpts: { weight: 100 /* EditorContrib */, primary: 9 /* Escape */ }, precondition: ctxCancellableOperation }); } runEditorCommand(accessor, editor) { accessor.get(IEditorCancellationTokens).cancel(editor); } }); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/core/editorState.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class EditorState { constructor(editor, flags) { this.flags = flags; if ((this.flags & 1 /* Value */) !== 0) { const model = editor.getModel(); this.modelVersionId = model ? strings/* format */.WU('{0}#{1}', model.uri.toString(), model.getVersionId()) : null; } else { this.modelVersionId = null; } if ((this.flags & 4 /* Position */) !== 0) { this.position = editor.getPosition(); } else { this.position = null; } if ((this.flags & 2 /* Selection */) !== 0) { this.selection = editor.getSelection(); } else { this.selection = null; } if ((this.flags & 8 /* Scroll */) !== 0) { this.scrollLeft = editor.getScrollLeft(); this.scrollTop = editor.getScrollTop(); } else { this.scrollLeft = -1; this.scrollTop = -1; } } _equals(other) { if (!(other instanceof EditorState)) { return false; } const state = other; if (this.modelVersionId !== state.modelVersionId) { return false; } if (this.scrollLeft !== state.scrollLeft || this.scrollTop !== state.scrollTop) { return false; } if (!this.position && state.position || this.position && !state.position || this.position && state.position && !this.position.equals(state.position)) { return false; } if (!this.selection && state.selection || this.selection && !state.selection || this.selection && state.selection && !this.selection.equalsRange(state.selection)) { return false; } return true; } validate(editor) { return this._equals(new EditorState(editor, this.flags)); } } /** * A cancellation token source that cancels when the editor changes as expressed * by the provided flags * @param range If provided, changes in position and selection within this range will not trigger cancellation */ class EditorStateCancellationTokenSource extends EditorKeybindingCancellationTokenSource { constructor(editor, flags, range, parent) { super(editor, parent); this._listener = new lifecycle/* DisposableStore */.SL(); if (flags & 4 /* Position */) { this._listener.add(editor.onDidChangeCursorPosition(e => { if (!range || !core_range/* Range */.e.containsPosition(range, e.position)) { this.cancel(); } })); } if (flags & 2 /* Selection */) { this._listener.add(editor.onDidChangeCursorSelection(e => { if (!range || !core_range/* Range */.e.containsRange(range, e.selection)) { this.cancel(); } })); } if (flags & 8 /* Scroll */) { this._listener.add(editor.onDidScrollChange(_ => this.cancel())); } if (flags & 1 /* Value */) { this._listener.add(editor.onDidChangeModel(_ => this.cancel())); this._listener.add(editor.onDidChangeModelContent(_ => this.cancel())); } } dispose() { this._listener.dispose(); super.dispose(); } } /** * A cancellation token source that cancels when the provided model changes */ class TextModelCancellationTokenSource extends cancellation/* CancellationTokenSource */.A { constructor(model, parent) { super(parent); this._listener = model.onDidChangeContent(() => this.cancel()); } dispose() { this._listener.dispose(); super.dispose(); } } class StableEditorScrollState { constructor(_visiblePosition, _visiblePositionScrollDelta, _cursorPosition) { this._visiblePosition = _visiblePosition; this._visiblePositionScrollDelta = _visiblePositionScrollDelta; this._cursorPosition = _cursorPosition; } static capture(editor) { let visiblePosition = null; let visiblePositionScrollDelta = 0; if (editor.getScrollTop() !== 0) { const visibleRanges = editor.getVisibleRanges(); if (visibleRanges.length > 0) { visiblePosition = visibleRanges[0].getStartPosition(); const visiblePositionScrollTop = editor.getTopForPosition(visiblePosition.lineNumber, visiblePosition.column); visiblePositionScrollDelta = editor.getScrollTop() - visiblePositionScrollTop; } } return new StableEditorScrollState(visiblePosition, visiblePositionScrollDelta, editor.getPosition()); } restore(editor) { if (this._visiblePosition) { const visiblePositionScrollTop = editor.getTopForPosition(this._visiblePosition.lineNumber, this._visiblePosition.column); editor.setScrollTop(visiblePositionScrollTop + this._visiblePositionScrollDelta); } } restoreRelativeVerticalPositionOfCursor(editor) { const currentCursorPosition = editor.getPosition(); if (!this._cursorPosition || !currentCursorPosition) { return; } const offset = editor.getTopForLineNumber(currentCursorPosition.lineNumber) - editor.getTopForLineNumber(this._cursorPosition.lineNumber); editor.setScrollTop(editor.getScrollTop() + offset); } } /***/ }), /***/ 56327: /*!*********************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/core/markdownRenderer.js + 2 modules ***! \*********************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { $: function() { return /* binding */ MarkdownRenderer; } }); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dom.js var dom = __webpack_require__(69454); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dompurify/dompurify.js /*! @license DOMPurify 2.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.1/LICENSE */ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var dompurify_hasOwnProperty = Object.hasOwnProperty, setPrototypeOf = Object.setPrototypeOf, isFrozen = Object.isFrozen, getPrototypeOf = Object.getPrototypeOf, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var freeze = Object.freeze, seal = Object.seal, create = Object.create; // eslint-disable-line import/no-mutable-exports var _ref = typeof Reflect !== 'undefined' && Reflect, apply = _ref.apply, construct = _ref.construct; if (!apply) { apply = function apply(fun, thisValue, args) { return fun.apply(thisValue, args); }; } if (!freeze) { freeze = function freeze(x) { return x; }; } if (!seal) { seal = function seal(x) { return x; }; } if (!construct) { construct = function construct(Func, args) { return new (Function.prototype.bind.apply(Func, [null].concat(_toConsumableArray(args))))(); }; } var arrayForEach = unapply(Array.prototype.forEach); var arrayPop = unapply(Array.prototype.pop); var arrayPush = unapply(Array.prototype.push); var stringToLowerCase = unapply(String.prototype.toLowerCase); var stringMatch = unapply(String.prototype.match); var stringReplace = unapply(String.prototype.replace); var stringIndexOf = unapply(String.prototype.indexOf); var stringTrim = unapply(String.prototype.trim); var regExpTest = unapply(RegExp.prototype.test); var typeErrorCreate = unconstruct(TypeError); function unapply(func) { return function (thisArg) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } return apply(func, thisArg, args); }; } function unconstruct(func) { return function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return construct(func, args); }; } /* Add properties to a lookup table */ function addToSet(set, array) { if (setPrototypeOf) { // Make 'in' and truthy checks like Boolean(set.constructor) // independent of any properties defined on Object.prototype. // Prevent prototype setters from intercepting set as a this value. setPrototypeOf(set, null); } var l = array.length; while (l--) { var element = array[l]; if (typeof element === 'string') { var lcElement = stringToLowerCase(element); if (lcElement !== element) { // Config presets (e.g. tags.js, attrs.js) are immutable. if (!isFrozen(array)) { array[l] = lcElement; } element = lcElement; } } set[element] = true; } return set; } /* Shallow clone an object */ function clone(object) { var newObject = create(null); var property = void 0; for (property in object) { if (apply(dompurify_hasOwnProperty, object, [property])) { newObject[property] = object[property]; } } return newObject; } /* IE10 doesn't support __lookupGetter__ so lets' * simulate it. It also automatically checks * if the prop is function or getter and behaves * accordingly. */ function lookupGetter(object, prop) { while (object !== null) { var desc = getOwnPropertyDescriptor(object, prop); if (desc) { if (desc.get) { return unapply(desc.get); } if (typeof desc.value === 'function') { return unapply(desc.value); } } object = getPrototypeOf(object); } function fallbackValue(element) { console.warn('fallback value for', element); return null; } return fallbackValue; } var html = freeze(['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']); // SVG var svg = freeze(['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']); var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); // List of SVG elements that are disallowed by default. // We still need to know them so that we can do namespace // checks properly in case one wants to add them to // allow-list. var svgDisallowed = freeze(['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']); var mathMl = freeze(['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']); // Similarly to SVG, we want to know all MathML elements, // even those that we disallow by default. var mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']); var dompurify_text = freeze(['#text']); var html$1 = freeze(['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']); var svg$1 = freeze(['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']); var mathMl$1 = freeze(['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']); var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']); // eslint-disable-next-line unicorn/better-regex var MUSTACHE_EXPR = seal(/\{\{[\s\S]*|[\s\S]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode var ERB_EXPR = seal(/<%[\s\S]*|[\s\S]*%>/gm); var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape var ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape ); var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex ); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; function _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var getGlobal = function getGlobal() { return typeof window === 'undefined' ? null : window; }; /** * Creates a no-op policy for internal use only. * Don't export this function outside this module! * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory. * @param {Document} document The document object (to determine policy name suffix) * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types * are not supported). */ var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) { if ((typeof trustedTypes === 'undefined' ? 'undefined' : _typeof(trustedTypes)) !== 'object' || typeof trustedTypes.createPolicy !== 'function') { return null; } // Allow the callers to control the unique policy name // by adding a data-tt-policy-suffix to the script element with the DOMPurify. // Policy creation with duplicate names throws in Trusted Types. var suffix = null; var ATTR_NAME = 'data-tt-policy-suffix'; if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) { suffix = document.currentScript.getAttribute(ATTR_NAME); } var policyName = 'dompurify' + (suffix ? '#' + suffix : ''); try { return trustedTypes.createPolicy(policyName, { createHTML: function createHTML(html$$1) { return html$$1; } }); } catch (_) { // Policy creation failed (most likely another DOMPurify script has // already run). Skip creating the policy, as this will only cause errors // if TT are enforced. console.warn('TrustedTypes policy ' + policyName + ' could not be created.'); return null; } }; function createDOMPurify() { var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal(); var DOMPurify = function DOMPurify(root) { return createDOMPurify(root); }; /** * Version label, exposed for easier checks * if DOMPurify is up to date or not */ DOMPurify.version = '2.3.1'; /** * Array of elements that DOMPurify removed during sanitation. * Empty if nothing was removed. */ DOMPurify.removed = []; if (!window || !window.document || window.document.nodeType !== 9) { // Not running in a browser, provide a factory function // so that you can pass your own Window DOMPurify.isSupported = false; return DOMPurify; } var originalDocument = window.document; var document = window.document; var DocumentFragment = window.DocumentFragment, HTMLTemplateElement = window.HTMLTemplateElement, Node = window.Node, Element = window.Element, NodeFilter = window.NodeFilter, _window$NamedNodeMap = window.NamedNodeMap, NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap, Text = window.Text, Comment = window.Comment, DOMParser = window.DOMParser, trustedTypes = window.trustedTypes; var ElementPrototype = Element.prototype; var cloneNode = lookupGetter(ElementPrototype, 'cloneNode'); var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling'); var getChildNodes = lookupGetter(ElementPrototype, 'childNodes'); var getParentNode = lookupGetter(ElementPrototype, 'parentNode'); // As per issue #47, the web-components registry is inherited by a // new document created via createHTMLDocument. As per the spec // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries) // a new empty registry is used when creating a template contents owner // document, so we use that as our parent document to ensure nothing // is inherited. if (typeof HTMLTemplateElement === 'function') { var template = document.createElement('template'); if (template.content && template.content.ownerDocument) { document = template.content.ownerDocument; } } var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument); var emptyHTML = trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML('') : ''; var _document = document, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName; var importNode = originalDocument.importNode; var documentMode = {}; try { documentMode = clone(document).documentMode ? document.documentMode : {}; } catch (_) {} var hooks = {}; /** * Expose whether this browser supports running the full DOMPurify. */ DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined' && documentMode !== 9; var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR, ERB_EXPR$$1 = ERB_EXPR, DATA_ATTR$$1 = DATA_ATTR, ARIA_ATTR$$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$$1 = ATTR_WHITESPACE; var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI; /** * We consider the elements and attributes below to be safe. Ideally * don't add any new ones but feel free to remove unwanted ones. */ /* allowed element names */ var ALLOWED_TAGS = null; var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(html), _toConsumableArray$1(svg), _toConsumableArray$1(svgFilters), _toConsumableArray$1(mathMl), _toConsumableArray$1(dompurify_text))); /* Allowed attribute names */ var ALLOWED_ATTR = null; var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray$1(html$1), _toConsumableArray$1(svg$1), _toConsumableArray$1(mathMl$1), _toConsumableArray$1(xml))); /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */ var FORBID_TAGS = null; /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */ var FORBID_ATTR = null; /* Decide if ARIA attributes are okay */ var ALLOW_ARIA_ATTR = true; /* Decide if custom data attributes are okay */ var ALLOW_DATA_ATTR = true; /* Decide if unknown protocols are okay */ var ALLOW_UNKNOWN_PROTOCOLS = false; /* Output should be safe for common template engines. * This means, DOMPurify removes data attributes, mustaches and ERB */ var SAFE_FOR_TEMPLATES = false; /* Decide if document with ... should be returned */ var WHOLE_DOCUMENT = false; /* Track whether config is already set on this instance of DOMPurify. */ var SET_CONFIG = false; /* Decide if all elements (e.g. style, script) must be children of * document.body. By default, browsers might move them to document.head */ var FORCE_BODY = false; /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html * string (or a TrustedHTML object if Trusted Types are supported). * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead */ var RETURN_DOM = false; /* Decide if a DOM `DocumentFragment` should be returned, instead of a html * string (or a TrustedHTML object if Trusted Types are supported) */ var RETURN_DOM_FRAGMENT = false; /* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM * `Node` is imported into the current `Document`. If this flag is not enabled the * `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by * DOMPurify. * * This defaults to `true` starting DOMPurify 2.2.0. Note that setting it to `false` * might cause XSS from attacks hidden in closed shadowroots in case the browser * supports Declarative Shadow: DOM https://web.dev/declarative-shadow-dom/ */ var RETURN_DOM_IMPORT = true; /* Try to return a Trusted Type object instead of a string, return a string in * case Trusted Types are not supported */ var RETURN_TRUSTED_TYPE = false; /* Output should be free from DOM clobbering attacks? */ var SANITIZE_DOM = true; /* Keep element content when removing element? */ var KEEP_CONTENT = true; /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead * of importing it into a new Document and returning a sanitized copy */ var IN_PLACE = false; /* Allow usage of profiles like html, svg and mathMl */ var USE_PROFILES = {}; /* Tags to ignore content of when KEEP_CONTENT is true */ var FORBID_CONTENTS = null; var DEFAULT_FORBID_CONTENTS = addToSet({}, ['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']); /* Tags that are safe for data: URIs */ var DATA_URI_TAGS = null; var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']); /* Attributes safe for values like "javascript:" */ var URI_SAFE_ATTRIBUTES = null; var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']); var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; /* Document namespace */ var NAMESPACE = HTML_NAMESPACE; var IS_EMPTY_INPUT = false; /* Keep a reference to config to pass to hooks */ var CONFIG = null; /* Ideally, do not touch anything below this line */ /* ______________________________________________ */ var formElement = document.createElement('form'); /** * _parseConfig * * @param {Object} cfg optional config literal */ // eslint-disable-next-line complexity var _parseConfig = function _parseConfig(cfg) { if (CONFIG && CONFIG === cfg) { return; } /* Shield configuration object from tampering */ if (!cfg || (typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') { cfg = {}; } /* Shield configuration object from prototype pollution */ cfg = clone(cfg); /* Set configuration parameters */ ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS; ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR; URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES; DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS; FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS) : DEFAULT_FORBID_CONTENTS; FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {}; FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {}; USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false; ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false RETURN_DOM = cfg.RETURN_DOM || false; // Default false RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT !== false; // Default true RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false FORCE_BODY = cfg.FORCE_BODY || false; // Default false SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true IN_PLACE = cfg.IN_PLACE || false; // Default false IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1; NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE; if (SAFE_FOR_TEMPLATES) { ALLOW_DATA_ATTR = false; } if (RETURN_DOM_FRAGMENT) { RETURN_DOM = true; } /* Parse profile info */ if (USE_PROFILES) { ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(dompurify_text))); ALLOWED_ATTR = []; if (USE_PROFILES.html === true) { addToSet(ALLOWED_TAGS, html); addToSet(ALLOWED_ATTR, html$1); } if (USE_PROFILES.svg === true) { addToSet(ALLOWED_TAGS, svg); addToSet(ALLOWED_ATTR, svg$1); addToSet(ALLOWED_ATTR, xml); } if (USE_PROFILES.svgFilters === true) { addToSet(ALLOWED_TAGS, svgFilters); addToSet(ALLOWED_ATTR, svg$1); addToSet(ALLOWED_ATTR, xml); } if (USE_PROFILES.mathMl === true) { addToSet(ALLOWED_TAGS, mathMl); addToSet(ALLOWED_ATTR, mathMl$1); addToSet(ALLOWED_ATTR, xml); } } /* Merge configuration parameters */ if (cfg.ADD_TAGS) { if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { ALLOWED_TAGS = clone(ALLOWED_TAGS); } addToSet(ALLOWED_TAGS, cfg.ADD_TAGS); } if (cfg.ADD_ATTR) { if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { ALLOWED_ATTR = clone(ALLOWED_ATTR); } addToSet(ALLOWED_ATTR, cfg.ADD_ATTR); } if (cfg.ADD_URI_SAFE_ATTR) { addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR); } if (cfg.FORBID_CONTENTS) { if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { FORBID_CONTENTS = clone(FORBID_CONTENTS); } addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS); } /* Add #text in case KEEP_CONTENT is set to true */ if (KEEP_CONTENT) { ALLOWED_TAGS['#text'] = true; } /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */ if (WHOLE_DOCUMENT) { addToSet(ALLOWED_TAGS, ['html', 'head', 'body']); } /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */ if (ALLOWED_TAGS.table) { addToSet(ALLOWED_TAGS, ['tbody']); delete FORBID_TAGS.tbody; } // Prevent further manipulation of configuration. // Not available in IE8, Safari 5, etc. if (freeze) { freeze(cfg); } CONFIG = cfg; }; var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']); var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']); /* Keep track of all possible SVG and MathML tags * so that we can perform the namespace checks * correctly. */ var ALL_SVG_TAGS = addToSet({}, svg); addToSet(ALL_SVG_TAGS, svgFilters); addToSet(ALL_SVG_TAGS, svgDisallowed); var ALL_MATHML_TAGS = addToSet({}, mathMl); addToSet(ALL_MATHML_TAGS, mathMlDisallowed); /** * * * @param {Element} element a DOM element whose namespace is being checked * @returns {boolean} Return false if the element has a * namespace that a spec-compliant parser would never * return. Return true otherwise. */ var _checkValidNamespace = function _checkValidNamespace(element) { var parent = getParentNode(element); // In JSDOM, if we're inside shadow DOM, then parentNode // can be null. We just simulate parent in this case. if (!parent || !parent.tagName) { parent = { namespaceURI: HTML_NAMESPACE, tagName: 'template' }; } var tagName = stringToLowerCase(element.tagName); var parentTagName = stringToLowerCase(parent.tagName); if (element.namespaceURI === SVG_NAMESPACE) { // The only way to switch from HTML namespace to SVG // is via . If it happens via any other tag, then // it should be killed. if (parent.namespaceURI === HTML_NAMESPACE) { return tagName === 'svg'; } // The only way to switch from MathML to SVG is via // svg if parent is either or MathML // text integration points. if (parent.namespaceURI === MATHML_NAMESPACE) { return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); } // We only allow elements that are defined in SVG // spec. All others are disallowed in SVG namespace. return Boolean(ALL_SVG_TAGS[tagName]); } if (element.namespaceURI === MATHML_NAMESPACE) { // The only way to switch from HTML namespace to MathML // is via . If it happens via any other tag, then // it should be killed. if (parent.namespaceURI === HTML_NAMESPACE) { return tagName === 'math'; } // The only way to switch from SVG to MathML is via // and HTML integration points if (parent.namespaceURI === SVG_NAMESPACE) { return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName]; } // We only allow elements that are defined in MathML // spec. All others are disallowed in MathML namespace. return Boolean(ALL_MATHML_TAGS[tagName]); } if (element.namespaceURI === HTML_NAMESPACE) { // The only way to switch from SVG to HTML is via // HTML integration points, and from MathML to HTML // is via MathML text integration points if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { return false; } if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { return false; } // Certain elements are allowed in both SVG and HTML // namespace. We need to specify them explicitly // so that they don't get erronously deleted from // HTML namespace. var commonSvgAndHTMLElements = addToSet({}, ['title', 'style', 'font', 'a', 'script']); // We disallow tags that are specific for MathML // or SVG and should never appear in HTML namespace return !ALL_MATHML_TAGS[tagName] && (commonSvgAndHTMLElements[tagName] || !ALL_SVG_TAGS[tagName]); } // The code should never reach this place (this means // that the element somehow got namespace that is not // HTML, SVG or MathML). Return false just in case. return false; }; /** * _forceRemove * * @param {Node} node a DOM node */ var _forceRemove = function _forceRemove(node) { arrayPush(DOMPurify.removed, { element: node }); try { // eslint-disable-next-line unicorn/prefer-dom-node-remove node.parentNode.removeChild(node); } catch (_) { try { node.outerHTML = emptyHTML; } catch (_) { node.remove(); } } }; /** * _removeAttribute * * @param {String} name an Attribute name * @param {Node} node a DOM node */ var _removeAttribute = function _removeAttribute(name, node) { try { arrayPush(DOMPurify.removed, { attribute: node.getAttributeNode(name), from: node }); } catch (_) { arrayPush(DOMPurify.removed, { attribute: null, from: node }); } node.removeAttribute(name); // We void attribute values for unremovable "is"" attributes if (name === 'is' && !ALLOWED_ATTR[name]) { if (RETURN_DOM || RETURN_DOM_FRAGMENT) { try { _forceRemove(node); } catch (_) {} } else { try { node.setAttribute(name, ''); } catch (_) {} } } }; /** * _initDocument * * @param {String} dirty a string of dirty markup * @return {Document} a DOM, filled with the dirty markup */ var _initDocument = function _initDocument(dirty) { /* Create a HTML document */ var doc = void 0; var leadingWhitespace = void 0; if (FORCE_BODY) { dirty = '' + dirty; } else { /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */ var matches = stringMatch(dirty, /^[\r\n\t ]+/); leadingWhitespace = matches && matches[0]; } var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; /* * Use the DOMParser API by default, fallback later if needs be * DOMParser not work for svg when has multiple root element. */ if (NAMESPACE === HTML_NAMESPACE) { try { doc = new DOMParser().parseFromString(dirtyPayload, 'text/html'); } catch (_) {} } /* Use createHTMLDocument in case DOMParser is not available */ if (!doc || !doc.documentElement) { doc = implementation.createDocument(NAMESPACE, 'template', null); try { doc.documentElement.innerHTML = IS_EMPTY_INPUT ? '' : dirtyPayload; } catch (_) { // Syntax error if dirtyPayload is invalid xml } } var body = doc.body || doc.documentElement; if (dirty && leadingWhitespace) { body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null); } /* Work on whole document or just its body */ if (NAMESPACE === HTML_NAMESPACE) { return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0]; } return WHOLE_DOCUMENT ? doc.documentElement : body; }; /** * _createIterator * * @param {Document} root document/fragment to create iterator for * @return {Iterator} iterator instance */ var _createIterator = function _createIterator(root) { return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false); }; /** * _isClobbered * * @param {Node} elm element to check for clobbering attacks * @return {Boolean} true if clobbered, false if safe */ var _isClobbered = function _isClobbered(elm) { if (elm instanceof Text || elm instanceof Comment) { return false; } if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function') { return true; } return false; }; /** * _isNode * * @param {Node} obj object to check whether it's a DOM node * @return {Boolean} true is object is a DOM node */ var _isNode = function _isNode(object) { return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? object instanceof Node : object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'; }; /** * _executeHook * Execute user configurable hooks * * @param {String} entryPoint Name of the hook's entry point * @param {Node} currentNode node to work on with the hook * @param {Object} data additional hook parameters */ var _executeHook = function _executeHook(entryPoint, currentNode, data) { if (!hooks[entryPoint]) { return; } arrayForEach(hooks[entryPoint], function (hook) { hook.call(DOMPurify, currentNode, data, CONFIG); }); }; /** * _sanitizeElements * * @protect nodeName * @protect textContent * @protect removeChild * * @param {Node} currentNode to check for permission to exist * @return {Boolean} true if node was killed, false if left alive */ var _sanitizeElements = function _sanitizeElements(currentNode) { var content = void 0; /* Execute a hook if present */ _executeHook('beforeSanitizeElements', currentNode, null); /* Check if element is clobbered or can clobber */ if (_isClobbered(currentNode)) { _forceRemove(currentNode); return true; } /* Check if tagname contains Unicode */ if (stringMatch(currentNode.nodeName, /[\u0080-\uFFFF]/)) { _forceRemove(currentNode); return true; } /* Now let's check the element's type and name */ var tagName = stringToLowerCase(currentNode.nodeName); /* Execute a hook if present */ _executeHook('uponSanitizeElement', currentNode, { tagName: tagName, allowedTags: ALLOWED_TAGS }); /* Detect mXSS attempts abusing namespace confusion */ if (!_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) { _forceRemove(currentNode); return true; } /* Mitigate a problem with templates inside select */ if (tagName === 'select' && regExpTest(/'; }; renderer.link = (href, title, text) => { // Remove markdown escapes. Workaround for https://github.com/chjj/marked/issues/829 if (href === text) { // raw link case text = (0,htmlContent/* removeMarkdownEscapes */.oR)(text); } href = _href(href, false); if (options.baseUrl) { const hasScheme = /^\w[\w\d+.-]*:/.test(href); if (!hasScheme) { href = (0,resources/* resolvePath */.i3)(options.baseUrl, href).toString(); } } title = (0,htmlContent/* removeMarkdownEscapes */.oR)(title); href = (0,htmlContent/* removeMarkdownEscapes */.oR)(href); if (!href || href.match(/^data:|javascript:/i) || (href.match(/^command:/i) && !markdown.isTrusted) || href.match(/^command:(\/\/\/)?_workbench\.downloadResource/i)) { // drop the link return text; } else { // HTML Encode href href = href.replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, '''); return `
    ${text}`; } }; renderer.paragraph = (text) => { return `

    ${text}

    `; }; if (options.codeBlockRenderer) { renderer.code = (code, lang) => { const value = options.codeBlockRenderer(lang, code); // when code-block rendering is async we return sync // but update the node with the real result later. const id = idGenerator/* defaultGenerator */.a.nextId(); (0,common_async/* raceCancellation */.eP)(Promise.all([value, withInnerHTML]), cts.token).then(values => { var _a; if (!isDisposed && values) { const span = element.querySelector(`div[data-code="${id}"]`); if (span) { dom/* reset */.mc(span, values[0]); } (_a = options.asyncRenderCallback) === null || _a === void 0 ? void 0 : _a.call(options); } }).catch(() => { // ignore }); return `
    ${(0,strings/* escape */.YU)(code)}
    `; }; } if (options.actionHandler) { const onClick = options.actionHandler.disposables.add(new browser_event/* DomEmitter */.Y(element, 'click')); const onAuxClick = options.actionHandler.disposables.add(new browser_event/* DomEmitter */.Y(element, 'auxclick')); options.actionHandler.disposables.add(common_event/* Event */.ju.any(onClick.event, onAuxClick.event)(e => { const mouseEvent = new browser_mouseEvent/* StandardMouseEvent */.n(e); if (!mouseEvent.leftButton && !mouseEvent.middleButton) { return; } let target = mouseEvent.target; if (target.tagName !== 'A') { target = target.parentElement; if (!target || target.tagName !== 'A') { return; } } try { const href = target.dataset['href']; if (href) { options.actionHandler.callback(href, mouseEvent); } } catch (err) { (0,errors/* onUnexpectedError */.dL)(err); } finally { mouseEvent.preventDefault(); } })); } if (!markdown.supportHtml) { // TODO: Can we deprecated this in favor of 'supportHtml'? // Use our own sanitizer so that we can let through only spans. // Otherwise, we'd be letting all html be rendered. // If we want to allow markdown permitted tags, then we can delete sanitizer and sanitize. // We always pass the output through dompurify after this so that we don't rely on // marked for sanitization. markedOptions.sanitizer = (html) => { const match = markdown.isTrusted ? html.match(/^(]+>)|(<\/\s*span>)$/) : undefined; return match ? html : ''; }; markedOptions.sanitize = true; markedOptions.silent = true; } markedOptions.renderer = renderer; // values that are too long will freeze the UI let value = (_a = markdown.value) !== null && _a !== void 0 ? _a : ''; if (value.length > 100000) { value = `${value.substr(0, 100000)}…`; } // escape theme icons if (markdown.supportThemeIcons) { value = (0,common_iconLabels/* markdownEscapeEscapedIcons */.f$)(value); } let renderedMarkdown = marked/* parse */.Qc(value, markedOptions); // Rewrite theme icons if (markdown.supportThemeIcons) { const elements = (0,iconLabels/* renderLabelWithIcons */.T)(renderedMarkdown); renderedMarkdown = elements.map(e => typeof e === 'string' ? e : e.outerHTML).join(''); } element.innerHTML = sanitizeRenderedMarkdown(markdown, renderedMarkdown); // signal that async code blocks can be now be inserted signalInnerHTML(); // signal size changes for image tags if (options.asyncRenderCallback) { for (const img of element.getElementsByTagName('img')) { const listener = disposables.add(dom/* addDisposableListener */.nm(img, 'load', () => { listener.dispose(); options.asyncRenderCallback(); })); } } return { element, dispose: () => { isDisposed = true; cts.cancel(); disposables.dispose(); } }; } function sanitizeRenderedMarkdown(options, renderedMarkdown) { const { config, allowedSchemes } = getSanitizerOptions(options); addHook('uponSanitizeAttribute', (element, e) => { if (e.attrName === 'style' || e.attrName === 'class') { if (element.tagName === 'SPAN') { if (e.attrName === 'style') { e.keepAttr = /^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/.test(e.attrValue); return; } else if (e.attrName === 'class') { e.keepAttr = /^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(e.attrValue); return; } } e.keepAttr = false; return; } }); // build an anchor to map URLs to const anchor = document.createElement('a'); // https://github.com/cure53/DOMPurify/blob/main/demos/hooks-scheme-allowlist.html addHook('afterSanitizeAttributes', (node) => { // check all href/src attributes for validity for (const attr of ['href', 'src']) { if (node.hasAttribute(attr)) { anchor.href = node.getAttribute(attr); if (!allowedSchemes.includes(anchor.protocol.replace(/:$/, ''))) { node.removeAttribute(attr); } } } }); try { return sanitize(renderedMarkdown, Object.assign(Object.assign({}, config), { RETURN_TRUSTED_TYPE: true })); } finally { removeHook('uponSanitizeAttribute'); removeHook('afterSanitizeAttributes'); } } function getSanitizerOptions(options) { const allowedSchemes = [ network/* Schemas */.lg.http, network/* Schemas */.lg.https, network/* Schemas */.lg.mailto, network/* Schemas */.lg.data, network/* Schemas */.lg.file, network/* Schemas */.lg.vscodeFileResource, network/* Schemas */.lg.vscodeRemote, network/* Schemas */.lg.vscodeRemoteResource, ]; if (options.isTrusted) { allowedSchemes.push(network/* Schemas */.lg.command); } return { config: { // allowedTags should included everything that markdown renders to. // Since we have our own sanitize function for marked, it's possible we missed some tag so let dompurify make sure. // HTML tags that can result from markdown are from reading https://spec.commonmark.org/0.29/ // HTML table tags that can result from markdown are from https://github.github.com/gfm/#tables-extension- ALLOWED_TAGS: ['ul', 'li', 'p', 'b', 'i', 'code', 'blockquote', 'ol', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'em', 'pre', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'div', 'del', 'a', 'strong', 'br', 'img', 'span'], ALLOWED_ATTR: ['href', 'data-href', 'target', 'title', 'src', 'alt', 'class', 'style', 'data-code', 'width', 'height', 'align'], ALLOW_UNKNOWN_PROTOCOLS: true, }, allowedSchemes }; } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/opener/common/opener.js var common_opener = __webpack_require__(271); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/services/modeService.js var modeService = __webpack_require__(64992); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/modes/textToHtmlTokenizer.js var textToHtmlTokenizer = __webpack_require__(5972); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/modes.js + 1 modules var modes = __webpack_require__(27347); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/config/configuration.js + 1 modules var configuration = __webpack_require__(84571); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/core/markdownRenderer.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var _a; /** * Markdown renderer that can render codeblocks with the editor mechanics. This * renderer should always be preferred. */ let MarkdownRenderer = class MarkdownRenderer { constructor(_options, _modeService, _openerService) { this._options = _options; this._modeService = _modeService; this._openerService = _openerService; this._onDidRenderAsync = new common_event/* Emitter */.Q5(); this.onDidRenderAsync = this._onDidRenderAsync.event; } dispose() { this._onDidRenderAsync.dispose(); } render(markdown, options, markedOptions) { if (!markdown) { const element = document.createElement('span'); return { element, dispose: () => { } }; } const disposables = new lifecycle/* DisposableStore */.SL(); const rendered = disposables.add(renderMarkdown(markdown, Object.assign(Object.assign({}, this._getRenderOptions(markdown, disposables)), options), markedOptions)); return { element: rendered.element, dispose: () => disposables.dispose() }; } _getRenderOptions(markdown, disposeables) { return { baseUrl: this._options.baseUrl, codeBlockRenderer: (languageAlias, value) => __awaiter(this, void 0, void 0, function* () { var _a, _b, _c, _d; // In markdown, // it is possible that we stumble upon language aliases (e.g.js instead of javascript) // it is possible no alias is given in which case we fall back to the current editor lang let languageId; if (languageAlias) { languageId = this._modeService.getModeIdForLanguageName(languageAlias); } else if (this._options.editor) { languageId = (_a = this._options.editor.getModel()) === null || _a === void 0 ? void 0 : _a.getLanguageId(); } if (!languageId) { languageId = 'plaintext'; } this._modeService.triggerMode(languageId); const tokenization = (_b = yield modes/* TokenizationRegistry */.RW.getPromise(languageId)) !== null && _b !== void 0 ? _b : undefined; const element = document.createElement('span'); element.innerHTML = ((_d = (_c = MarkdownRenderer._ttpTokenizer) === null || _c === void 0 ? void 0 : _c.createHTML(value, this._modeService.languageIdCodec, tokenization)) !== null && _d !== void 0 ? _d : (0,textToHtmlTokenizer/* tokenizeToString */.C)(value, this._modeService.languageIdCodec, tokenization)); // use "good" font if (this._options.editor) { const fontInfo = this._options.editor.getOption(43 /* fontInfo */); configuration/* Configuration */.V.applyFontInfoSlow(element, fontInfo); } else if (this._options.codeBlockFontFamily) { element.style.fontFamily = this._options.codeBlockFontFamily; } return element; }), asyncRenderCallback: () => this._onDidRenderAsync.fire(), actionHandler: { callback: (content) => this._openerService.open(content, { fromUserGesture: true, allowContributedOpeners: true, allowCommands: markdown.isTrusted }).catch(errors/* onUnexpectedError */.dL), disposables: disposeables } }; } }; MarkdownRenderer._ttpTokenizer = (_a = window.trustedTypes) === null || _a === void 0 ? void 0 : _a.createPolicy('tokenizeToString', { createHTML(value, languageIdCodec, tokenizer) { return (0,textToHtmlTokenizer/* tokenizeToString */.C)(value, languageIdCodec, tokenizer); } }); MarkdownRenderer = __decorate([ __param(1, modeService/* IModeService */.h), __param(2, common_opener/* IOpenerService */.v4) ], MarkdownRenderer); /***/ }), /***/ 44525: /*!*************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/editorBrowser.js ***! \*************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CL: function() { return /* binding */ isCodeEditor; }, /* harmony export */ Pi: function() { return /* binding */ getCodeEditor; }, /* harmony export */ QI: function() { return /* binding */ isDiffEditor; } /* harmony export */ }); /* harmony import */ var _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/editorCommon.js */ 91676); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** *@internal */ function isCodeEditor(thing) { if (thing && typeof thing.getEditorType === 'function') { return thing.getEditorType() === _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_0__/* .EditorType */ .g.ICodeEditor; } else { return false; } } /** *@internal */ function isDiffEditor(thing) { if (thing && typeof thing.getEditorType === 'function') { return thing.getEditorType() === _common_editorCommon_js__WEBPACK_IMPORTED_MODULE_0__/* .EditorType */ .g.IDiffEditor; } else { return false; } } /** *@internal */ function getCodeEditor(thing) { if (isCodeEditor(thing)) { return thing; } if (isDiffEditor(thing)) { return thing.getModifiedEditor(); } return null; } /***/ }), /***/ 4514: /*!****************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/editorExtensions.js ***! \****************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AJ: function() { return /* binding */ MultiCommand; }, /* harmony export */ QG: function() { return /* binding */ registerInstantiatedEditorAction; }, /* harmony export */ Qr: function() { return /* binding */ registerEditorAction; }, /* harmony export */ R6: function() { return /* binding */ EditorAction; }, /* harmony export */ Sq: function() { return /* binding */ SelectAllCommand; }, /* harmony export */ Uc: function() { return /* binding */ EditorExtensionsRegistry; }, /* harmony export */ _K: function() { return /* binding */ registerEditorContribution; }, /* harmony export */ _l: function() { return /* binding */ EditorCommand; }, /* harmony export */ f: function() { return /* binding */ registerModelCommand; }, /* harmony export */ fK: function() { return /* binding */ registerEditorCommand; }, /* harmony export */ jY: function() { return /* binding */ MultiEditorAction; }, /* harmony export */ kz: function() { return /* binding */ RedoCommand; }, /* harmony export */ mY: function() { return /* binding */ Command; }, /* harmony export */ n_: function() { return /* binding */ UndoCommand; }, /* harmony export */ rn: function() { return /* binding */ registerMultiEditorAction; }, /* harmony export */ sb: function() { return /* binding */ registerModelAndPositionCommand; } /* harmony export */ }); /* unused harmony export ProxyCommand */ /* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../nls.js */ 13268); /* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../base/common/uri.js */ 5472); /* harmony import */ var _services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./services/codeEditorService.js */ 70827); /* harmony import */ var _common_core_position_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../common/core/position.js */ 72146); /* harmony import */ var _common_services_modelService_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/services/modelService.js */ 12027); /* harmony import */ var _common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/services/resolverService.js */ 16862); /* harmony import */ var _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../platform/actions/common/actions.js */ 96236); /* harmony import */ var _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../platform/commands/common/commands.js */ 35884); /* harmony import */ var _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../platform/contextkey/common/contextkey.js */ 90689); /* harmony import */ var _platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../platform/keybinding/common/keybindingsRegistry.js */ 86414); /* harmony import */ var _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../platform/registry/common/platform.js */ 44650); /* harmony import */ var _platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../platform/telemetry/common/telemetry.js */ 14347); /* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../base/common/types.js */ 72999); /* harmony import */ var _platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../platform/log/common/log.js */ 44182); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class Command { constructor(opts) { this.id = opts.id; this.precondition = opts.precondition; this._kbOpts = opts.kbOpts; this._menuOpts = opts.menuOpts; this._description = opts.description; } register() { if (Array.isArray(this._menuOpts)) { this._menuOpts.forEach(this._registerMenuItem, this); } else if (this._menuOpts) { this._registerMenuItem(this._menuOpts); } if (this._kbOpts) { const kbOptsArr = Array.isArray(this._kbOpts) ? this._kbOpts : [this._kbOpts]; for (const kbOpts of kbOptsArr) { let kbWhen = kbOpts.kbExpr; if (this.precondition) { if (kbWhen) { kbWhen = _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__/* .ContextKeyExpr */ .Ao.and(kbWhen, this.precondition); } else { kbWhen = this.precondition; } } const desc = { id: this.id, weight: kbOpts.weight, args: kbOpts.args, when: kbWhen, primary: kbOpts.primary, secondary: kbOpts.secondary, win: kbOpts.win, linux: kbOpts.linux, mac: kbOpts.mac, }; _platform_keybinding_common_keybindingsRegistry_js__WEBPACK_IMPORTED_MODULE_7__/* .KeybindingsRegistry */ .W.registerKeybindingRule(desc); } } _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_5__/* .CommandsRegistry */ .P.registerCommand({ id: this.id, handler: (accessor, args) => this.runCommand(accessor, args), description: this._description }); } _registerMenuItem(item) { _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_4__/* .MenuRegistry */ .BH.appendMenuItem(item.menuId, { group: item.group, command: { id: this.id, title: item.title, icon: item.icon, precondition: this.precondition }, when: item.when, order: item.order }); } } class MultiCommand extends Command { constructor() { super(...arguments); this._implementations = []; } /** * A higher priority gets to be looked at first */ addImplementation(priority, name, implementation) { this._implementations.push({ priority, name, implementation }); this._implementations.sort((a, b) => b.priority - a.priority); return { dispose: () => { for (let i = 0; i < this._implementations.length; i++) { if (this._implementations[i].implementation === implementation) { this._implementations.splice(i, 1); return; } } } }; } runCommand(accessor, args) { const logService = accessor.get(_platform_log_common_log_js__WEBPACK_IMPORTED_MODULE_10__/* .ILogService */ .VZ); logService.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`); for (const impl of this._implementations) { const result = impl.implementation(accessor, args); if (result) { logService.trace(`Command '${this.id}' was handled by '${impl.name}'.`); if (typeof result === 'boolean') { return; } return result; } } logService.trace(`The Command '${this.id}' was not handled by any implementation.`); } } //#endregion /** * A command that delegates to another command's implementation. * * This lets different commands be registered but share the same implementation */ class ProxyCommand extends Command { constructor(command, opts) { super(opts); this.command = command; } runCommand(accessor, args) { return this.command.runCommand(accessor, args); } } class EditorCommand extends Command { /** * Create a command class that is bound to a certain editor contribution. */ static bindToContribution(controllerGetter) { return class EditorControllerCommandImpl extends EditorCommand { constructor(opts) { super(opts); this._callback = opts.handler; } runEditorCommand(accessor, editor, args) { const controller = controllerGetter(editor); if (controller) { this._callback(controllerGetter(editor), args); } } }; } runCommand(accessor, args) { const codeEditorService = accessor.get(_services_codeEditorService_js__WEBPACK_IMPORTED_MODULE_1__/* .ICodeEditorService */ .$); // Find the editor with text focus or active const editor = codeEditorService.getFocusedCodeEditor() || codeEditorService.getActiveCodeEditor(); if (!editor) { // well, at least we tried... return; } return editor.invokeWithinContext((editorAccessor) => { const kbService = editorAccessor.get(_platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__/* .IContextKeyService */ .i6); if (!kbService.contextMatchesRules((0,_base_common_types_js__WEBPACK_IMPORTED_MODULE_11__/* .withNullAsUndefined */ .f6)(this.precondition))) { // precondition does not hold return; } return this.runEditorCommand(editorAccessor, editor, args); }); } } class EditorAction extends EditorCommand { constructor(opts) { super(EditorAction.convertOptions(opts)); this.label = opts.label; this.alias = opts.alias; } static convertOptions(opts) { let menuOpts; if (Array.isArray(opts.menuOpts)) { menuOpts = opts.menuOpts; } else if (opts.menuOpts) { menuOpts = [opts.menuOpts]; } else { menuOpts = []; } function withDefaults(item) { if (!item.menuId) { item.menuId = _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_4__/* .MenuId */ .eH.EditorContext; } if (!item.title) { item.title = opts.label; } item.when = _platform_contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_6__/* .ContextKeyExpr */ .Ao.and(opts.precondition, item.when); return item; } if (Array.isArray(opts.contextMenuOpts)) { menuOpts.push(...opts.contextMenuOpts.map(withDefaults)); } else if (opts.contextMenuOpts) { menuOpts.push(withDefaults(opts.contextMenuOpts)); } opts.menuOpts = menuOpts; return opts; } runEditorCommand(accessor, editor, args) { this.reportTelemetry(accessor, editor); return this.run(accessor, editor, args || {}); } reportTelemetry(accessor, editor) { accessor.get(_platform_telemetry_common_telemetry_js__WEBPACK_IMPORTED_MODULE_9__/* .ITelemetryService */ .b).publicLog2('editorActionInvoked', { name: this.label, id: this.id }); } } class MultiEditorAction extends EditorAction { constructor() { super(...arguments); this._implementations = []; } /** * A higher priority gets to be looked at first */ addImplementation(priority, implementation) { this._implementations.push([priority, implementation]); this._implementations.sort((a, b) => b[0] - a[0]); return { dispose: () => { for (let i = 0; i < this._implementations.length; i++) { if (this._implementations[i][1] === implementation) { this._implementations.splice(i, 1); return; } } } }; } run(accessor, editor, args) { for (const impl of this._implementations) { const result = impl[1](accessor, editor, args); if (result) { if (typeof result === 'boolean') { return; } return result; } } } } //#endregion // --- Registration of commands and actions function registerModelAndPositionCommand(id, handler) { _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_5__/* .CommandsRegistry */ .P.registerCommand(id, function (accessor, ...args) { const [resource, position] = args; (0,_base_common_types_js__WEBPACK_IMPORTED_MODULE_11__/* .assertType */ .p_)(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__/* .URI */ .o.isUri(resource)); (0,_base_common_types_js__WEBPACK_IMPORTED_MODULE_11__/* .assertType */ .p_)(_common_core_position_js__WEBPACK_IMPORTED_MODULE_12__/* .Position */ .L.isIPosition(position)); const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_2__/* .IModelService */ .q).getModel(resource); if (model) { const editorPosition = _common_core_position_js__WEBPACK_IMPORTED_MODULE_12__/* .Position */ .L.lift(position); return handler(model, editorPosition, ...args.slice(2)); } return accessor.get(_common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_3__/* .ITextModelService */ .S).createModelReference(resource).then(reference => { return new Promise((resolve, reject) => { try { const result = handler(reference.object.textEditorModel, _common_core_position_js__WEBPACK_IMPORTED_MODULE_12__/* .Position */ .L.lift(position), args.slice(2)); resolve(result); } catch (err) { reject(err); } }).finally(() => { reference.dispose(); }); }); }); } function registerModelCommand(id, handler) { _platform_commands_common_commands_js__WEBPACK_IMPORTED_MODULE_5__/* .CommandsRegistry */ .P.registerCommand(id, function (accessor, ...args) { const [resource] = args; (0,_base_common_types_js__WEBPACK_IMPORTED_MODULE_11__/* .assertType */ .p_)(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_0__/* .URI */ .o.isUri(resource)); const model = accessor.get(_common_services_modelService_js__WEBPACK_IMPORTED_MODULE_2__/* .IModelService */ .q).getModel(resource); if (model) { return handler(model, ...args.slice(1)); } return accessor.get(_common_services_resolverService_js__WEBPACK_IMPORTED_MODULE_3__/* .ITextModelService */ .S).createModelReference(resource).then(reference => { return new Promise((resolve, reject) => { try { const result = handler(reference.object.textEditorModel, args.slice(1)); resolve(result); } catch (err) { reject(err); } }).finally(() => { reference.dispose(); }); }); }); } function registerEditorCommand(editorCommand) { EditorContributionRegistry.INSTANCE.registerEditorCommand(editorCommand); return editorCommand; } function registerEditorAction(ctor) { const action = new ctor(); EditorContributionRegistry.INSTANCE.registerEditorAction(action); return action; } function registerMultiEditorAction(action) { EditorContributionRegistry.INSTANCE.registerEditorAction(action); return action; } function registerInstantiatedEditorAction(editorAction) { EditorContributionRegistry.INSTANCE.registerEditorAction(editorAction); } function registerEditorContribution(id, ctor) { EditorContributionRegistry.INSTANCE.registerEditorContribution(id, ctor); } var EditorExtensionsRegistry; (function (EditorExtensionsRegistry) { function getEditorCommand(commandId) { return EditorContributionRegistry.INSTANCE.getEditorCommand(commandId); } EditorExtensionsRegistry.getEditorCommand = getEditorCommand; function getEditorActions() { return EditorContributionRegistry.INSTANCE.getEditorActions(); } EditorExtensionsRegistry.getEditorActions = getEditorActions; function getEditorContributions() { return EditorContributionRegistry.INSTANCE.getEditorContributions(); } EditorExtensionsRegistry.getEditorContributions = getEditorContributions; function getSomeEditorContributions(ids) { return EditorContributionRegistry.INSTANCE.getEditorContributions().filter(c => ids.indexOf(c.id) >= 0); } EditorExtensionsRegistry.getSomeEditorContributions = getSomeEditorContributions; function getDiffEditorContributions() { return EditorContributionRegistry.INSTANCE.getDiffEditorContributions(); } EditorExtensionsRegistry.getDiffEditorContributions = getDiffEditorContributions; })(EditorExtensionsRegistry || (EditorExtensionsRegistry = {})); // Editor extension points const Extensions = { EditorCommonContributions: 'editor.contributions' }; class EditorContributionRegistry { constructor() { this.editorContributions = []; this.diffEditorContributions = []; this.editorActions = []; this.editorCommands = Object.create(null); } registerEditorContribution(id, ctor) { this.editorContributions.push({ id, ctor: ctor }); } getEditorContributions() { return this.editorContributions.slice(0); } getDiffEditorContributions() { return this.diffEditorContributions.slice(0); } registerEditorAction(action) { action.register(); this.editorActions.push(action); } getEditorActions() { return this.editorActions.slice(0); } registerEditorCommand(editorCommand) { editorCommand.register(); this.editorCommands[editorCommand.id] = editorCommand; } getEditorCommand(commandId) { return (this.editorCommands[commandId] || null); } } EditorContributionRegistry.INSTANCE = new EditorContributionRegistry(); _platform_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_8__/* .Registry */ .B.add(Extensions.EditorCommonContributions, EditorContributionRegistry.INSTANCE); function registerCommand(command) { command.register(); return command; } const UndoCommand = registerCommand(new MultiCommand({ id: 'undo', precondition: undefined, kbOpts: { weight: 0 /* EditorCore */, primary: 2048 /* CtrlCmd */ | 56 /* KeyZ */ }, menuOpts: [{ menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_4__/* .MenuId */ .eH.MenubarEditMenu, group: '1_do', title: _nls_js__WEBPACK_IMPORTED_MODULE_13__/* .localize */ .N({ key: 'miUndo', comment: ['&& denotes a mnemonic'] }, "&&Undo"), order: 1 }, { menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_4__/* .MenuId */ .eH.CommandPalette, group: '', title: _nls_js__WEBPACK_IMPORTED_MODULE_13__/* .localize */ .N('undo', "Undo"), order: 1 }] })); registerCommand(new ProxyCommand(UndoCommand, { id: 'default:undo', precondition: undefined })); const RedoCommand = registerCommand(new MultiCommand({ id: 'redo', precondition: undefined, kbOpts: { weight: 0 /* EditorCore */, primary: 2048 /* CtrlCmd */ | 55 /* KeyY */, secondary: [2048 /* CtrlCmd */ | 1024 /* Shift */ | 56 /* KeyZ */], mac: { primary: 2048 /* CtrlCmd */ | 1024 /* Shift */ | 56 /* KeyZ */ } }, menuOpts: [{ menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_4__/* .MenuId */ .eH.MenubarEditMenu, group: '1_do', title: _nls_js__WEBPACK_IMPORTED_MODULE_13__/* .localize */ .N({ key: 'miRedo', comment: ['&& denotes a mnemonic'] }, "&&Redo"), order: 2 }, { menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_4__/* .MenuId */ .eH.CommandPalette, group: '', title: _nls_js__WEBPACK_IMPORTED_MODULE_13__/* .localize */ .N('redo', "Redo"), order: 1 }] })); registerCommand(new ProxyCommand(RedoCommand, { id: 'default:redo', precondition: undefined })); const SelectAllCommand = registerCommand(new MultiCommand({ id: 'editor.action.selectAll', precondition: undefined, kbOpts: { weight: 0 /* EditorCore */, kbExpr: null, primary: 2048 /* CtrlCmd */ | 31 /* KeyA */ }, menuOpts: [{ menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_4__/* .MenuId */ .eH.MenubarSelectionMenu, group: '1_basic', title: _nls_js__WEBPACK_IMPORTED_MODULE_13__/* .localize */ .N({ key: 'miSelectAll', comment: ['&& denotes a mnemonic'] }, "&&Select All"), order: 1 }, { menuId: _platform_actions_common_actions_js__WEBPACK_IMPORTED_MODULE_4__/* .MenuId */ .eH.CommandPalette, group: '', title: _nls_js__WEBPACK_IMPORTED_MODULE_13__/* .localize */ .N('selectAll', "Select All"), order: 1 }] })); /***/ }), /***/ 97705: /*!************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/services/bulkEditService.js ***! \************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Gl: function() { return /* binding */ ResourceTextEdit; }, /* harmony export */ fo: function() { return /* binding */ ResourceEdit; }, /* harmony export */ vu: function() { return /* binding */ IBulkEditService; } /* harmony export */ }); /* unused harmony export ResourceFileEdit */ /* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ 16925); /* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/uri.js */ 5472); /* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/types.js */ 72999); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const IBulkEditService = (0,_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__/* .createDecorator */ .yh)('IWorkspaceEditService'); function isWorkspaceFileEdit(thing) { return (0,_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__/* .isObject */ .Kn)(thing) && (Boolean(thing.newUri) || Boolean(thing.oldUri)); } function isWorkspaceTextEdit(thing) { return (0,_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__/* .isObject */ .Kn)(thing) && _base_common_uri_js__WEBPACK_IMPORTED_MODULE_1__/* .URI */ .o.isUri(thing.resource) && (0,_base_common_types_js__WEBPACK_IMPORTED_MODULE_2__/* .isObject */ .Kn)(thing.edit); } class ResourceEdit { constructor(metadata) { this.metadata = metadata; } static convert(edit) { return edit.edits.map(edit => { if (isWorkspaceTextEdit(edit)) { return new ResourceTextEdit(edit.resource, edit.edit, edit.modelVersionId, edit.metadata); } if (isWorkspaceFileEdit(edit)) { return new ResourceFileEdit(edit.oldUri, edit.newUri, edit.options, edit.metadata); } throw new Error('Unsupported edit'); }); } } class ResourceTextEdit extends ResourceEdit { constructor(resource, textEdit, versionId, metadata) { super(metadata); this.resource = resource; this.textEdit = textEdit; this.versionId = versionId; } } class ResourceFileEdit extends ResourceEdit { constructor(oldResource, newResource, options, metadata) { super(metadata); this.oldResource = oldResource; this.newResource = newResource; this.options = options; } } /***/ }), /***/ 70827: /*!**************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/services/codeEditorService.js ***! \**************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $: function() { return /* binding */ ICodeEditorService; } /* harmony export */ }); /* harmony import */ var _platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../platform/instantiation/common/instantiation.js */ 16925); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const ICodeEditorService = (0,_platform_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_0__/* .createDecorator */ .yh)('codeEditorService'); /***/ }), /***/ 87840: /*!************************************************************************************************************************!*\ !*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js + 74 modules ***! \************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { Gm: function() { return /* binding */ CodeEditorWidget; } }); // UNUSED EXPORTS: BooleanEventEmitter, EditorModeContext // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/services/markersDecorationService.js var markersDecorationService = __webpack_require__(49178); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/editorExtensions.js var editorExtensions = __webpack_require__(4514); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/services/markerDecorations.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; let MarkerDecorationsContribution = class MarkerDecorationsContribution { constructor(_editor, _markerDecorationsService) { // Doesn't do anything, just requires `IMarkerDecorationsService` to make sure it gets instantiated } dispose() { } }; MarkerDecorationsContribution.ID = 'editor.contrib.markerDecorations'; MarkerDecorationsContribution = __decorate([ __param(1, markersDecorationService/* IMarkerDecorationsService */.i) ], MarkerDecorationsContribution); (0,editorExtensions/* registerEditorContribution */._K)(MarkerDecorationsContribution.ID, MarkerDecorationsContribution); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/widget/media/editor.css // extracted by mini-css-extract-plugin // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/nls.js var nls = __webpack_require__(13268); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/dom.js var dom = __webpack_require__(69454); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/errors.js var errors = __webpack_require__(79881); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/event.js var common_event = __webpack_require__(4348); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/lifecycle.js var lifecycle = __webpack_require__(69323); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/network.js var network = __webpack_require__(66657); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/config/configuration.js + 1 modules var configuration = __webpack_require__(84571); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/services/codeEditorService.js var codeEditorService = __webpack_require__(70827); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/browser.js var browser = __webpack_require__(87783); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/core/selection.js var core_selection = __webpack_require__(17551); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/fastDomNode.js var fastDomNode = __webpack_require__(32635); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/platform.js var platform = __webpack_require__(23345); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/touch.js var touch = __webpack_require__(60537); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/mouseEvent.js var mouseEvent = __webpack_require__(52390); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/async.js var common_async = __webpack_require__(50431); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/globalMouseMoveMonitor.js var globalMouseMoveMonitor = __webpack_require__(2395); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/editorDom.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** * Coordinates relative to the whole document (e.g. mouse event's pageX and pageY) */ class PageCoordinates { constructor(x, y) { this.x = x; this.y = y; this._pageCoordinatesBrand = undefined; } toClientCoordinates() { return new ClientCoordinates(this.x - dom/* StandardWindow */.DI.scrollX, this.y - dom/* StandardWindow */.DI.scrollY); } } /** * Coordinates within the application's client area (i.e. origin is document's scroll position). * * For example, clicking in the top-left corner of the client area will * always result in a mouse event with a client.x value of 0, regardless * of whether the page is scrolled horizontally. */ class ClientCoordinates { constructor(clientX, clientY) { this.clientX = clientX; this.clientY = clientY; this._clientCoordinatesBrand = undefined; } toPageCoordinates() { return new PageCoordinates(this.clientX + dom/* StandardWindow */.DI.scrollX, this.clientY + dom/* StandardWindow */.DI.scrollY); } } /** * The position of the editor in the page. */ class EditorPagePosition { constructor(x, y, width, height) { this.x = x; this.y = y; this.width = width; this.height = height; this._editorPagePositionBrand = undefined; } } function createEditorPagePosition(editorViewDomNode) { const editorPos = dom/* getDomNodePagePosition */.i(editorViewDomNode); return new EditorPagePosition(editorPos.left, editorPos.top, editorPos.width, editorPos.height); } class EditorMouseEvent extends mouseEvent/* StandardMouseEvent */.n { constructor(e, editorViewDomNode) { super(e); this._editorMouseEventBrand = undefined; this.pos = new PageCoordinates(this.posx, this.posy); this.editorPos = createEditorPagePosition(editorViewDomNode); } } class EditorMouseEventFactory { constructor(editorViewDomNode) { this._editorViewDomNode = editorViewDomNode; } _create(e) { return new EditorMouseEvent(e, this._editorViewDomNode); } onContextMenu(target, callback) { return dom/* addDisposableListener */.nm(target, 'contextmenu', (e) => { callback(this._create(e)); }); } onMouseUp(target, callback) { return dom/* addDisposableListener */.nm(target, 'mouseup', (e) => { callback(this._create(e)); }); } onMouseDown(target, callback) { return dom/* addDisposableListener */.nm(target, 'mousedown', (e) => { callback(this._create(e)); }); } onMouseLeave(target, callback) { return dom/* addDisposableNonBubblingMouseOutListener */.j_(target, (e) => { callback(this._create(e)); }); } onMouseMoveThrottled(target, callback, merger, minimumTimeMs) { const myMerger = (lastEvent, currentEvent) => { return merger(lastEvent, this._create(currentEvent)); }; return dom/* addDisposableThrottledListener */.Y_(target, 'mousemove', callback, myMerger, minimumTimeMs); } } class EditorPointerEventFactory { constructor(editorViewDomNode) { this._editorViewDomNode = editorViewDomNode; } _create(e) { return new EditorMouseEvent(e, this._editorViewDomNode); } onPointerUp(target, callback) { return dom/* addDisposableListener */.nm(target, 'pointerup', (e) => { callback(this._create(e)); }); } onPointerDown(target, callback) { return dom/* addDisposableListener */.nm(target, 'pointerdown', (e) => { callback(this._create(e)); }); } onPointerLeave(target, callback) { return dom/* addDisposableNonBubblingPointerOutListener */.RE(target, (e) => { callback(this._create(e)); }); } onPointerMoveThrottled(target, callback, merger, minimumTimeMs) { const myMerger = (lastEvent, currentEvent) => { return merger(lastEvent, this._create(currentEvent)); }; return dom/* addDisposableThrottledListener */.Y_(target, 'pointermove', callback, myMerger, minimumTimeMs); } } class GlobalEditorMouseMoveMonitor extends lifecycle/* Disposable */.JT { constructor(editorViewDomNode) { super(); this._editorViewDomNode = editorViewDomNode; this._globalMouseMoveMonitor = this._register(new globalMouseMoveMonitor/* GlobalMouseMoveMonitor */.Z()); this._keydownListener = null; } startMonitoring(initialElement, initialButtons, merger, mouseMoveCallback, onStopCallback) { // Add a <> keydown event listener that will cancel the monitoring // if something other than a modifier key is pressed this._keydownListener = dom/* addStandardDisposableListener */.mu(document, 'keydown', (e) => { const kb = e.toKeybinding(); if (kb.isModifierKey()) { // Allow modifier keys return; } this._globalMouseMoveMonitor.stopMonitoring(true, e.browserEvent); }, true); const myMerger = (lastEvent, currentEvent) => { return merger(lastEvent, new EditorMouseEvent(currentEvent, this._editorViewDomNode)); }; this._globalMouseMoveMonitor.startMonitoring(initialElement, initialButtons, myMerger, mouseMoveCallback, (e) => { this._keydownListener.dispose(); onStopCallback(e); }); } stopMonitoring() { this._globalMouseMoveMonitor.stopMonitoring(true); } } ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/viewModel/viewEventHandler.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class ViewEventHandler extends lifecycle/* Disposable */.JT { constructor() { super(); this._shouldRender = true; } shouldRender() { return this._shouldRender; } forceShouldRender() { this._shouldRender = true; } setShouldRender() { this._shouldRender = true; } onDidRender() { this._shouldRender = false; } // --- begin event handlers onCompositionStart(e) { return false; } onCompositionEnd(e) { return false; } onConfigurationChanged(e) { return false; } onCursorStateChanged(e) { return false; } onDecorationsChanged(e) { return false; } onFlushed(e) { return false; } onFocusChanged(e) { return false; } onLanguageConfigurationChanged(e) { return false; } onLineMappingChanged(e) { return false; } onLinesChanged(e) { return false; } onLinesDeleted(e) { return false; } onLinesInserted(e) { return false; } onRevealRangeRequest(e) { return false; } onScrollChanged(e) { return false; } onThemeChanged(e) { return false; } onTokensChanged(e) { return false; } onTokensColorsChanged(e) { return false; } onZonesChanged(e) { return false; } // --- end event handlers handleEvents(events) { let shouldRender = false; for (let i = 0, len = events.length; i < len; i++) { let e = events[i]; switch (e.type) { case 0 /* ViewCompositionStart */: if (this.onCompositionStart(e)) { shouldRender = true; } break; case 1 /* ViewCompositionEnd */: if (this.onCompositionEnd(e)) { shouldRender = true; } break; case 2 /* ViewConfigurationChanged */: if (this.onConfigurationChanged(e)) { shouldRender = true; } break; case 3 /* ViewCursorStateChanged */: if (this.onCursorStateChanged(e)) { shouldRender = true; } break; case 4 /* ViewDecorationsChanged */: if (this.onDecorationsChanged(e)) { shouldRender = true; } break; case 5 /* ViewFlushed */: if (this.onFlushed(e)) { shouldRender = true; } break; case 6 /* ViewFocusChanged */: if (this.onFocusChanged(e)) { shouldRender = true; } break; case 7 /* ViewLanguageConfigurationChanged */: if (this.onLanguageConfigurationChanged(e)) { shouldRender = true; } break; case 8 /* ViewLineMappingChanged */: if (this.onLineMappingChanged(e)) { shouldRender = true; } break; case 9 /* ViewLinesChanged */: if (this.onLinesChanged(e)) { shouldRender = true; } break; case 10 /* ViewLinesDeleted */: if (this.onLinesDeleted(e)) { shouldRender = true; } break; case 11 /* ViewLinesInserted */: if (this.onLinesInserted(e)) { shouldRender = true; } break; case 12 /* ViewRevealRangeRequest */: if (this.onRevealRangeRequest(e)) { shouldRender = true; } break; case 13 /* ViewScrollChanged */: if (this.onScrollChanged(e)) { shouldRender = true; } break; case 15 /* ViewTokensChanged */: if (this.onTokensChanged(e)) { shouldRender = true; } break; case 14 /* ViewThemeChanged */: if (this.onThemeChanged(e)) { shouldRender = true; } break; case 16 /* ViewTokensColorsChanged */: if (this.onTokensColorsChanged(e)) { shouldRender = true; } break; case 17 /* ViewZonesChanged */: if (this.onZonesChanged(e)) { shouldRender = true; } break; default: console.info('View received unknown event: '); console.info(e); } } if (shouldRender) { this._shouldRender = true; } } } ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/view/viewPart.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class ViewPart extends ViewEventHandler { constructor(context) { super(); this._context = context; this._context.addEventHandler(this); } dispose() { this._context.removeEventHandler(this); super.dispose(); } } class PartFingerprints { static write(target, partId) { if (target instanceof fastDomNode/* FastDomNode */.Z) { target.setAttribute('data-mprt', String(partId)); } else { target.setAttribute('data-mprt', String(partId)); } } static read(target) { const r = target.getAttribute('data-mprt'); if (r === null) { return 0 /* None */; } return parseInt(r, 10); } static collect(child, stopAt) { let result = [], resultLen = 0; while (child && child !== document.body) { if (child === stopAt) { break; } if (child.nodeType === child.ELEMENT_NODE) { result[resultLen++] = this.read(child); } child = child.parentElement; } const r = new Uint8Array(resultLen); for (let i = 0; i < resultLen; i++) { r[i] = result[resultLen - i - 1]; } return r; } } ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/view/renderingContext.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class RestrictedRenderingContext { constructor(viewLayout, viewportData) { this._restrictedRenderingContextBrand = undefined; this._viewLayout = viewLayout; this.viewportData = viewportData; this.scrollWidth = this._viewLayout.getScrollWidth(); this.scrollHeight = this._viewLayout.getScrollHeight(); this.visibleRange = this.viewportData.visibleRange; this.bigNumbersDelta = this.viewportData.bigNumbersDelta; const vInfo = this._viewLayout.getCurrentViewport(); this.scrollTop = vInfo.top; this.scrollLeft = vInfo.left; this.viewportWidth = vInfo.width; this.viewportHeight = vInfo.height; } getScrolledTopFromAbsoluteTop(absoluteTop) { return absoluteTop - this.scrollTop; } getVerticalOffsetForLineNumber(lineNumber) { return this._viewLayout.getVerticalOffsetForLineNumber(lineNumber); } getDecorationsInViewport() { return this.viewportData.getDecorationsInViewport(); } } class RenderingContext extends RestrictedRenderingContext { constructor(viewLayout, viewportData, viewLines) { super(viewLayout, viewportData); this._renderingContextBrand = undefined; this._viewLines = viewLines; } linesVisibleRangesForRange(range, includeNewLines) { return this._viewLines.linesVisibleRangesForRange(range, includeNewLines); } visibleRangeForPosition(position) { return this._viewLines.visibleRangeForPosition(position); } } class LineVisibleRanges { constructor(outsideRenderedLine, lineNumber, ranges) { this.outsideRenderedLine = outsideRenderedLine; this.lineNumber = lineNumber; this.ranges = ranges; } } class HorizontalRange { constructor(left, width) { this._horizontalRangeBrand = undefined; this.left = Math.round(left); this.width = Math.round(width); } static from(ranges) { const result = new Array(ranges.length); for (let i = 0, len = ranges.length; i < len; i++) { const range = ranges[i]; result[i] = new HorizontalRange(range.left, range.width); } return result; } toString() { return `[${this.left},${this.width}]`; } } class FloatHorizontalRange { constructor(left, width) { this._floatHorizontalRangeBrand = undefined; this.left = left; this.width = width; } toString() { return `[${this.left},${this.width}]`; } static compare(a, b) { return a.left - b.left; } } class HorizontalPosition { constructor(outsideRenderedLine, left) { this.outsideRenderedLine = outsideRenderedLine; this.originalLeft = left; this.left = Math.round(this.originalLeft); } } class VisibleRanges { constructor(outsideRenderedLine, ranges) { this.outsideRenderedLine = outsideRenderedLine; this.ranges = ranges; } } ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/viewParts/lines/rangeUtil.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class RangeUtil { static _createRange() { if (!this._handyReadyRange) { this._handyReadyRange = document.createRange(); } return this._handyReadyRange; } static _detachRange(range, endNode) { // Move range out of the span node, IE doesn't like having many ranges in // the same spot and will act badly for lines containing dashes ('-') range.selectNodeContents(endNode); } static _readClientRects(startElement, startOffset, endElement, endOffset, endNode) { const range = this._createRange(); try { range.setStart(startElement, startOffset); range.setEnd(endElement, endOffset); return range.getClientRects(); } catch (e) { // This is life ... return null; } finally { this._detachRange(range, endNode); } } static _mergeAdjacentRanges(ranges) { if (ranges.length === 1) { // There is nothing to merge return ranges; } ranges.sort(FloatHorizontalRange.compare); let result = [], resultLen = 0; let prev = ranges[0]; for (let i = 1, len = ranges.length; i < len; i++) { const range = ranges[i]; if (prev.left + prev.width + 0.9 /* account for browser's rounding errors*/ >= range.left) { prev.width = Math.max(prev.width, range.left + range.width - prev.left); } else { result[resultLen++] = prev; prev = range; } } result[resultLen++] = prev; return result; } static _createHorizontalRangesFromClientRects(clientRects, clientRectDeltaLeft) { if (!clientRects || clientRects.length === 0) { return null; } // We go through FloatHorizontalRange because it has been observed in bi-di text // that the clientRects are not coming in sorted from the browser const result = []; for (let i = 0, len = clientRects.length; i < len; i++) { const clientRect = clientRects[i]; result[i] = new FloatHorizontalRange(Math.max(0, clientRect.left - clientRectDeltaLeft), clientRect.width); } return this._mergeAdjacentRanges(result); } static readHorizontalRanges(domNode, startChildIndex, startOffset, endChildIndex, endOffset, clientRectDeltaLeft, endNode) { // Panic check const min = 0; const max = domNode.children.length - 1; if (min > max) { return null; } startChildIndex = Math.min(max, Math.max(min, startChildIndex)); endChildIndex = Math.min(max, Math.max(min, endChildIndex)); if (startChildIndex === endChildIndex && startOffset === endOffset && startOffset === 0 && !domNode.children[startChildIndex].firstChild) { // We must find the position at the beginning of a // To cover cases of empty s, avoid using a range and use the 's bounding box const clientRects = domNode.children[startChildIndex].getClientRects(); return this._createHorizontalRangesFromClientRects(clientRects, clientRectDeltaLeft); } // If crossing over to a span only to select offset 0, then use the previous span's maximum offset // Chrome is buggy and doesn't handle 0 offsets well sometimes. if (startChildIndex !== endChildIndex) { if (endChildIndex > 0 && endOffset === 0) { endChildIndex--; endOffset = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; } } let startElement = domNode.children[startChildIndex].firstChild; let endElement = domNode.children[endChildIndex].firstChild; if (!startElement || !endElement) { // When having an empty (without any text content), try to move to the previous if (!startElement && startOffset === 0 && startChildIndex > 0) { startElement = domNode.children[startChildIndex - 1].firstChild; startOffset = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; } if (!endElement && endOffset === 0 && endChildIndex > 0) { endElement = domNode.children[endChildIndex - 1].firstChild; endOffset = 1073741824 /* MAX_SAFE_SMALL_INTEGER */; } } if (!startElement || !endElement) { return null; } startOffset = Math.min(startElement.textContent.length, Math.max(0, startOffset)); endOffset = Math.min(endElement.textContent.length, Math.max(0, endOffset)); const clientRects = this._readClientRects(startElement, startOffset, endElement, endOffset, endNode); return this._createHorizontalRangesFromClientRects(clientRects, clientRectDeltaLeft); } } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/viewLayout/lineDecorations.js var lineDecorations = __webpack_require__(81112); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/viewLayout/viewLineRenderer.js var viewLineRenderer = __webpack_require__(28750); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/theme/common/theme.js var theme = __webpack_require__(66213); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/config/editorOptions.js var editorOptions = __webpack_require__(97199); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/viewParts/lines/viewLine.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ const canUseFastRenderedViewLine = (function () { if (platform/* isNative */.tY) { // In VSCode we know very well when the zoom level changes return true; } if (platform/* isLinux */.IJ || browser/* isFirefox */.vU || browser/* isSafari */.G6) { // On Linux, it appears that zooming affects char widths (in pixels), which is unexpected. // -- // Even though we read character widths correctly, having read them at a specific zoom level // does not mean they are the same at the current zoom level. // -- // This could be improved if we ever figure out how to get an event when browsers zoom, // but until then we have to stick with reading client rects. // -- // The same has been observed with Firefox on Windows7 // -- // The same has been oversved with Safari return false; } return true; })(); let monospaceAssumptionsAreValid = true; class DomReadingContext { constructor(domNode, endNode) { this._domNode = domNode; this._clientRectDeltaLeft = 0; this._clientRectDeltaLeftRead = false; this.endNode = endNode; } get clientRectDeltaLeft() { if (!this._clientRectDeltaLeftRead) { this._clientRectDeltaLeftRead = true; this._clientRectDeltaLeft = this._domNode.getBoundingClientRect().left; } return this._clientRectDeltaLeft; } } class ViewLineOptions { constructor(config, themeType) { this.themeType = themeType; const options = config.options; const fontInfo = options.get(43 /* fontInfo */); this.renderWhitespace = options.get(87 /* renderWhitespace */); this.renderControlCharacters = options.get(82 /* renderControlCharacters */); this.spaceWidth = fontInfo.spaceWidth; this.middotWidth = fontInfo.middotWidth; this.wsmiddotWidth = fontInfo.wsmiddotWidth; this.useMonospaceOptimizations = (fontInfo.isMonospace && !options.get(29 /* disableMonospaceOptimizations */)); this.canUseHalfwidthRightwardsArrow = fontInfo.canUseHalfwidthRightwardsArrow; this.lineHeight = options.get(58 /* lineHeight */); this.stopRenderingLineAfter = options.get(104 /* stopRenderingLineAfter */); this.fontLigatures = options.get(44 /* fontLigatures */); } equals(other) { return (this.themeType === other.themeType && this.renderWhitespace === other.renderWhitespace && this.renderControlCharacters === other.renderControlCharacters && this.spaceWidth === other.spaceWidth && this.middotWidth === other.middotWidth && this.wsmiddotWidth === other.wsmiddotWidth && this.useMonospaceOptimizations === other.useMonospaceOptimizations && this.canUseHalfwidthRightwardsArrow === other.canUseHalfwidthRightwardsArrow && this.lineHeight === other.lineHeight && this.stopRenderingLineAfter === other.stopRenderingLineAfter && this.fontLigatures === other.fontLigatures); } } class ViewLine { constructor(options) { this._options = options; this._isMaybeInvalid = true; this._renderedViewLine = null; } // --- begin IVisibleLineData getDomNode() { if (this._renderedViewLine && this._renderedViewLine.domNode) { return this._renderedViewLine.domNode.domNode; } return null; } setDomNode(domNode) { if (this._renderedViewLine) { this._renderedViewLine.domNode = (0,fastDomNode/* createFastDomNode */.X)(domNode); } else { throw new Error('I have no rendered view line to set the dom node to...'); } } onContentChanged() { this._isMaybeInvalid = true; } onTokensChanged() { this._isMaybeInvalid = true; } onDecorationsChanged() { this._isMaybeInvalid = true; } onOptionsChanged(newOptions) { this._isMaybeInvalid = true; this._options = newOptions; } onSelectionChanged() { if (this._options.themeType === theme/* ColorScheme */.e.HIGH_CONTRAST || this._options.renderWhitespace === 'selection') { this._isMaybeInvalid = true; return true; } return false; } renderLine(lineNumber, deltaTop, viewportData, sb) { if (this._isMaybeInvalid === false) { // it appears that nothing relevant has changed return false; } this._isMaybeInvalid = false; const lineData = viewportData.getViewLineRenderingData(lineNumber); const options = this._options; const actualInlineDecorations = lineDecorations/* LineDecoration */.Kp.filter(lineData.inlineDecorations, lineNumber, lineData.minColumn, lineData.maxColumn); // Only send selection information when needed for rendering whitespace let selectionsOnLine = null; if (options.themeType === theme/* ColorScheme */.e.HIGH_CONTRAST || this._options.renderWhitespace === 'selection') { const selections = viewportData.selections; for (const selection of selections) { if (selection.endLineNumber < lineNumber || selection.startLineNumber > lineNumber) { // Selection does not intersect line continue; } const startColumn = (selection.startLineNumber === lineNumber ? selection.startColumn : lineData.minColumn); const endColumn = (selection.endLineNumber === lineNumber ? selection.endColumn : lineData.maxColumn); if (startColumn < endColumn) { if (options.themeType === theme/* ColorScheme */.e.HIGH_CONTRAST || this._options.renderWhitespace !== 'selection') { actualInlineDecorations.push(new lineDecorations/* LineDecoration */.Kp(startColumn, endColumn, 'inline-selected-text', 0 /* Regular */)); } else { if (!selectionsOnLine) { selectionsOnLine = []; } selectionsOnLine.push(new viewLineRenderer/* LineRange */.zG(startColumn - 1, endColumn - 1)); } } } } const renderLineInput = new viewLineRenderer/* RenderLineInput */.IJ(options.useMonospaceOptimizations, options.canUseHalfwidthRightwardsArrow, lineData.content, lineData.continuesWithWrappedLine, lineData.isBasicASCII, lineData.containsRTL, lineData.minColumn - 1, lineData.tokens, actualInlineDecorations, lineData.tabSize, lineData.startVisibleColumn, options.spaceWidth, options.middotWidth, options.wsmiddotWidth, options.stopRenderingLineAfter, options.renderWhitespace, options.renderControlCharacters, options.fontLigatures !== editorOptions/* EditorFontLigatures */.n0.OFF, selectionsOnLine); if (this._renderedViewLine && this._renderedViewLine.input.equals(renderLineInput)) { // no need to do anything, we have the same render input return false; } sb.appendASCIIString('
    '); const output = (0,viewLineRenderer/* renderViewLine */.d1)(renderLineInput, sb); sb.appendASCIIString('
    '); let renderedViewLine = null; if (monospaceAssumptionsAreValid && canUseFastRenderedViewLine && lineData.isBasicASCII && options.useMonospaceOptimizations && output.containsForeignElements === 0 /* None */) { if (lineData.content.length < 300 && renderLineInput.lineTokens.getCount() < 100) { // Browser rounding errors have been observed in Chrome and IE, so using the fast // view line only for short lines. Please test before removing the length check... // --- // Another rounding error has been observed on Linux in VSCode, where width // rounding errors add up to an observable large number... // --- // Also see another example of rounding errors on Windows in // https://github.com/microsoft/vscode/issues/33178 renderedViewLine = new FastRenderedViewLine(this._renderedViewLine ? this._renderedViewLine.domNode : null, renderLineInput, output.characterMapping); } } if (!renderedViewLine) { renderedViewLine = createRenderedLine(this._renderedViewLine ? this._renderedViewLine.domNode : null, renderLineInput, output.characterMapping, output.containsRTL, output.containsForeignElements); } this._renderedViewLine = renderedViewLine; return true; } layoutLine(lineNumber, deltaTop) { if (this._renderedViewLine && this._renderedViewLine.domNode) { this._renderedViewLine.domNode.setTop(deltaTop); this._renderedViewLine.domNode.setHeight(this._options.lineHeight); } } // --- end IVisibleLineData getWidth() { if (!this._renderedViewLine) { return 0; } return this._renderedViewLine.getWidth(); } getWidthIsFast() { if (!this._renderedViewLine) { return true; } return this._renderedViewLine.getWidthIsFast(); } needsMonospaceFontCheck() { if (!this._renderedViewLine) { return false; } return (this._renderedViewLine instanceof FastRenderedViewLine); } monospaceAssumptionsAreValid() { if (!this._renderedViewLine) { return monospaceAssumptionsAreValid; } if (this._renderedViewLine instanceof FastRenderedViewLine) { return this._renderedViewLine.monospaceAssumptionsAreValid(); } return monospaceAssumptionsAreValid; } onMonospaceAssumptionsInvalidated() { if (this._renderedViewLine && this._renderedViewLine instanceof FastRenderedViewLine) { this._renderedViewLine = this._renderedViewLine.toSlowRenderedLine(); } } getVisibleRangesForRange(lineNumber, startColumn, endColumn, context) { if (!this._renderedViewLine) { return null; } startColumn = startColumn | 0; // @perf endColumn = endColumn | 0; // @perf startColumn = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, startColumn)); endColumn = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, endColumn)); const stopRenderingLineAfter = this._renderedViewLine.input.stopRenderingLineAfter | 0; // @perf let outsideRenderedLine = false; if (stopRenderingLineAfter !== -1 && startColumn > stopRenderingLineAfter + 1 && endColumn > stopRenderingLineAfter + 1) { // This range is obviously not visible outsideRenderedLine = true; } if (stopRenderingLineAfter !== -1 && startColumn > stopRenderingLineAfter + 1) { startColumn = stopRenderingLineAfter + 1; } if (stopRenderingLineAfter !== -1 && endColumn > stopRenderingLineAfter + 1) { endColumn = stopRenderingLineAfter + 1; } const horizontalRanges = this._renderedViewLine.getVisibleRangesForRange(lineNumber, startColumn, endColumn, context); if (horizontalRanges && horizontalRanges.length > 0) { return new VisibleRanges(outsideRenderedLine, horizontalRanges); } return null; } getColumnOfNodeOffset(lineNumber, spanNode, offset) { if (!this._renderedViewLine) { return 1; } return this._renderedViewLine.getColumnOfNodeOffset(lineNumber, spanNode, offset); } } ViewLine.CLASS_NAME = 'view-line'; /** * A rendered line which is guaranteed to contain only regular ASCII and is rendered with a monospace font. */ class FastRenderedViewLine { constructor(domNode, renderLineInput, characterMapping) { this.domNode = domNode; this.input = renderLineInput; this._characterMapping = characterMapping; this._charWidth = renderLineInput.spaceWidth; } getWidth() { return Math.round(this._getCharPosition(this._characterMapping.length)); } getWidthIsFast() { return true; } monospaceAssumptionsAreValid() { if (!this.domNode) { return monospaceAssumptionsAreValid; } const expectedWidth = this.getWidth(); const actualWidth = this.domNode.domNode.firstChild.offsetWidth; if (Math.abs(expectedWidth - actualWidth) >= 2) { // more than 2px off console.warn(`monospace assumptions have been violated, therefore disabling monospace optimizations!`); monospaceAssumptionsAreValid = false; } return monospaceAssumptionsAreValid; } toSlowRenderedLine() { return createRenderedLine(this.domNode, this.input, this._characterMapping, false, 0 /* None */); } getVisibleRangesForRange(lineNumber, startColumn, endColumn, context) { const startPosition = this._getCharPosition(startColumn); const endPosition = this._getCharPosition(endColumn); return [new FloatHorizontalRange(startPosition, endPosition - startPosition)]; } _getCharPosition(column) { const charOffset = this._characterMapping.getAbsoluteOffset(column); return this._charWidth * charOffset; } getColumnOfNodeOffset(lineNumber, spanNode, offset) { const spanNodeTextContentLength = spanNode.textContent.length; let spanIndex = -1; while (spanNode) { spanNode = spanNode.previousSibling; spanIndex++; } return this._characterMapping.getColumn(new viewLineRenderer/* DomPosition */.Nd(spanIndex, offset), spanNodeTextContentLength); } } /** * Every time we render a line, we save what we have rendered in an instance of this class. */ class RenderedViewLine { constructor(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements) { this.domNode = domNode; this.input = renderLineInput; this._characterMapping = characterMapping; this._isWhitespaceOnly = /^\s*$/.test(renderLineInput.lineContent); this._containsForeignElements = containsForeignElements; this._cachedWidth = -1; this._pixelOffsetCache = null; if (!containsRTL || this._characterMapping.length === 0 /* the line is empty */) { this._pixelOffsetCache = new Float32Array(Math.max(2, this._characterMapping.length + 1)); for (let column = 0, len = this._characterMapping.length; column <= len; column++) { this._pixelOffsetCache[column] = -1; } } } // --- Reading from the DOM methods _getReadingTarget(myDomNode) { return myDomNode.domNode.firstChild; } /** * Width of the line in pixels */ getWidth() { if (!this.domNode) { return 0; } if (this._cachedWidth === -1) { this._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth; } return this._cachedWidth; } getWidthIsFast() { if (this._cachedWidth === -1) { return false; } return true; } /** * Visible ranges for a model range */ getVisibleRangesForRange(lineNumber, startColumn, endColumn, context) { if (!this.domNode) { return null; } if (this._pixelOffsetCache !== null) { // the text is LTR const startOffset = this._readPixelOffset(this.domNode, lineNumber, startColumn, context); if (startOffset === -1) { return null; } const endOffset = this._readPixelOffset(this.domNode, lineNumber, endColumn, context); if (endOffset === -1) { return null; } return [new FloatHorizontalRange(startOffset, endOffset - startOffset)]; } return this._readVisibleRangesForRange(this.domNode, lineNumber, startColumn, endColumn, context); } _readVisibleRangesForRange(domNode, lineNumber, startColumn, endColumn, context) { if (startColumn === endColumn) { const pixelOffset = this._readPixelOffset(domNode, lineNumber, startColumn, context); if (pixelOffset === -1) { return null; } else { return [new FloatHorizontalRange(pixelOffset, 0)]; } } else { return this._readRawVisibleRangesForRange(domNode, startColumn, endColumn, context); } } _readPixelOffset(domNode, lineNumber, column, context) { if (this._characterMapping.length === 0) { // This line has no content if (this._containsForeignElements === 0 /* None */) { // We can assume the line is really empty return 0; } if (this._containsForeignElements === 2 /* After */) { // We have foreign elements after the (empty) line return 0; } if (this._containsForeignElements === 1 /* Before */) { // We have foreign elements before the (empty) line return this.getWidth(); } // We have foreign elements before & after the (empty) line const readingTarget = this._getReadingTarget(domNode); if (readingTarget.firstChild) { return readingTarget.firstChild.offsetWidth; } else { return 0; } } if (this._pixelOffsetCache !== null) { // the text is LTR const cachedPixelOffset = this._pixelOffsetCache[column]; if (cachedPixelOffset !== -1) { return cachedPixelOffset; } const result = this._actualReadPixelOffset(domNode, lineNumber, column, context); this._pixelOffsetCache[column] = result; return result; } return this._actualReadPixelOffset(domNode, lineNumber, column, context); } _actualReadPixelOffset(domNode, lineNumber, column, context) { if (this._characterMapping.length === 0) { // This line has no content const r = RangeUtil.readHorizontalRanges(this._getReadingTarget(domNode), 0, 0, 0, 0, context.clientRectDeltaLeft, context.endNode); if (!r || r.length === 0) { return -1; } return r[0].left; } if (column === this._characterMapping.length && this._isWhitespaceOnly && this._containsForeignElements === 0 /* None */) { // This branch helps in the case of whitespace only lines which have a width set return this.getWidth(); } const domPosition = this._characterMapping.getDomPosition(column); const r = RangeUtil.readHorizontalRanges(this._getReadingTarget(domNode), domPosition.partIndex, domPosition.charIndex, domPosition.partIndex, domPosition.charIndex, context.clientRectDeltaLeft, context.endNode); if (!r || r.length === 0) { return -1; } const result = r[0].left; if (this.input.isBasicASCII) { const charOffset = this._characterMapping.getAbsoluteOffset(column); const expectedResult = Math.round(this.input.spaceWidth * charOffset); if (Math.abs(expectedResult - result) <= 1) { return expectedResult; } } return result; } _readRawVisibleRangesForRange(domNode, startColumn, endColumn, context) { if (startColumn === 1 && endColumn === this._characterMapping.length) { // This branch helps IE with bidi text & gives a performance boost to other browsers when reading visible ranges for an entire line return [new FloatHorizontalRange(0, this.getWidth())]; } const startDomPosition = this._characterMapping.getDomPosition(startColumn); const endDomPosition = this._characterMapping.getDomPosition(endColumn); return RangeUtil.readHorizontalRanges(this._getReadingTarget(domNode), startDomPosition.partIndex, startDomPosition.charIndex, endDomPosition.partIndex, endDomPosition.charIndex, context.clientRectDeltaLeft, context.endNode); } /** * Returns the column for the text found at a specific offset inside a rendered dom node */ getColumnOfNodeOffset(lineNumber, spanNode, offset) { const spanNodeTextContentLength = spanNode.textContent.length; let spanIndex = -1; while (spanNode) { spanNode = spanNode.previousSibling; spanIndex++; } return this._characterMapping.getColumn(new viewLineRenderer/* DomPosition */.Nd(spanIndex, offset), spanNodeTextContentLength); } } class WebKitRenderedViewLine extends RenderedViewLine { _readVisibleRangesForRange(domNode, lineNumber, startColumn, endColumn, context) { const output = super._readVisibleRangesForRange(domNode, lineNumber, startColumn, endColumn, context); if (!output || output.length === 0 || startColumn === endColumn || (startColumn === 1 && endColumn === this._characterMapping.length)) { return output; } // WebKit is buggy and returns an expanded range (to contain words in some cases) // The last client rect is enlarged (I think) if (!this.input.containsRTL) { // This is an attempt to patch things up // Find position of last column const endPixelOffset = this._readPixelOffset(domNode, lineNumber, endColumn, context); if (endPixelOffset !== -1) { const lastRange = output[output.length - 1]; if (lastRange.left < endPixelOffset) { // Trim down the width of the last visible range to not go after the last column's position lastRange.width = endPixelOffset - lastRange.left; } } } return output; } } const createRenderedLine = (function () { if (browser/* isWebKit */.Pf) { return createWebKitRenderedLine; } return createNormalRenderedLine; })(); function createWebKitRenderedLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements) { return new WebKitRenderedViewLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements); } function createNormalRenderedLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements) { return new RenderedViewLine(domNode, renderLineInput, characterMapping, containsRTL, containsForeignElements); } // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/core/position.js var core_position = __webpack_require__(72146); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/core/range.js var core_range = __webpack_require__(17373); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/controller/cursorCommon.js var cursorCommon = __webpack_require__(69025); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/controller/cursorAtomicMoveOperations.js var cursorAtomicMoveOperations = __webpack_require__(59671); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ class UnknownHitTestResult { constructor(hitTarget = null) { this.hitTarget = hitTarget; this.type = 0 /* Unknown */; } } class ContentHitTestResult { constructor(position, spanNode, injectedText) { this.position = position; this.spanNode = spanNode; this.injectedText = injectedText; this.type = 1 /* Content */; } } var HitTestResult; (function (HitTestResult) { function createFromDOMInfo(ctx, spanNode, offset) { const position = ctx.getPositionFromDOMInfo(spanNode, offset); if (position) { return new ContentHitTestResult(position, spanNode, null); } return new UnknownHitTestResult(spanNode); } HitTestResult.createFromDOMInfo = createFromDOMInfo; })(HitTestResult || (HitTestResult = {})); class PointerHandlerLastRenderData { constructor(lastViewCursorsRenderData, lastTextareaPosition) { this.lastViewCursorsRenderData = lastViewCursorsRenderData; this.lastTextareaPosition = lastTextareaPosition; } } class MouseTarget { constructor(element, type, mouseColumn = 0, position = null, range = null, detail = null) { this.element = element; this.type = type; this.mouseColumn = mouseColumn; this.position = position; if (!range && position) { range = new core_range/* Range */.e(position.lineNumber, position.column, position.lineNumber, position.column); } this.range = range; this.detail = detail; } static _typeToString(type) { if (type === 1 /* TEXTAREA */) { return 'TEXTAREA'; } if (type === 2 /* GUTTER_GLYPH_MARGIN */) { return 'GUTTER_GLYPH_MARGIN'; } if (type === 3 /* GUTTER_LINE_NUMBERS */) { return 'GUTTER_LINE_NUMBERS'; } if (type === 4 /* GUTTER_LINE_DECORATIONS */) { return 'GUTTER_LINE_DECORATIONS'; } if (type === 5 /* GUTTER_VIEW_ZONE */) { return 'GUTTER_VIEW_ZONE'; } if (type === 6 /* CONTENT_TEXT */) { return 'CONTENT_TEXT'; } if (type === 7 /* CONTENT_EMPTY */) { return 'CONTENT_EMPTY'; } if (type === 8 /* CONTENT_VIEW_ZONE */) { return 'CONTENT_VIEW_ZONE'; } if (type === 9 /* CONTENT_WIDGET */) { return 'CONTENT_WIDGET'; } if (type === 10 /* OVERVIEW_RULER */) { return 'OVERVIEW_RULER'; } if (type === 11 /* SCROLLBAR */) { return 'SCROLLBAR'; } if (type === 12 /* OVERLAY_WIDGET */) { return 'OVERLAY_WIDGET'; } return 'UNKNOWN'; } static toString(target) { return this._typeToString(target.type) + ': ' + target.position + ' - ' + target.range + ' - ' + target.detail; } toString() { return MouseTarget.toString(this); } } class ElementPath { static isTextArea(path) { return (path.length === 2 && path[0] === 3 /* OverflowGuard */ && path[1] === 6 /* TextArea */); } static isChildOfViewLines(path) { return (path.length >= 4 && path[0] === 3 /* OverflowGuard */ && path[3] === 7 /* ViewLines */); } static isStrictChildOfViewLines(path) { return (path.length > 4 && path[0] === 3 /* OverflowGuard */ && path[3] === 7 /* ViewLines */); } static isChildOfScrollableElement(path) { return (path.length >= 2 && path[0] === 3 /* OverflowGuard */ && path[1] === 5 /* ScrollableElement */); } static isChildOfMinimap(path) { return (path.length >= 2 && path[0] === 3 /* OverflowGuard */ && path[1] === 8 /* Minimap */); } static isChildOfContentWidgets(path) { return (path.length >= 4 && path[0] === 3 /* OverflowGuard */ && path[3] === 1 /* ContentWidgets */); } static isChildOfOverflowingContentWidgets(path) { return (path.length >= 1 && path[0] === 2 /* OverflowingContentWidgets */); } static isChildOfOverlayWidgets(path) { return (path.length >= 2 && path[0] === 3 /* OverflowGuard */ && path[1] === 4 /* OverlayWidgets */); } } class HitTestContext { constructor(context, viewHelper, lastRenderData) { this.model = context.model; const options = context.configuration.options; this.layoutInfo = options.get(129 /* layoutInfo */); this.viewDomNode = viewHelper.viewDomNode; this.lineHeight = options.get(58 /* lineHeight */); this.stickyTabStops = options.get(103 /* stickyTabStops */); this.typicalHalfwidthCharacterWidth = options.get(43 /* fontInfo */).typicalHalfwidthCharacterWidth; this.lastRenderData = lastRenderData; this._context = context; this._viewHelper = viewHelper; } getZoneAtCoord(mouseVerticalOffset) { return HitTestContext.getZoneAtCoord(this._context, mouseVerticalOffset); } static getZoneAtCoord(context, mouseVerticalOffset) { // The target is either a view zone or the empty space after the last view-line const viewZoneWhitespace = context.viewLayout.getWhitespaceAtVerticalOffset(mouseVerticalOffset); if (viewZoneWhitespace) { const viewZoneMiddle = viewZoneWhitespace.verticalOffset + viewZoneWhitespace.height / 2; const lineCount = context.model.getLineCount(); let positionBefore = null; let position; let positionAfter = null; if (viewZoneWhitespace.afterLineNumber !== lineCount) { // There are more lines after this view zone positionAfter = new core_position/* Position */.L(viewZoneWhitespace.afterLineNumber + 1, 1); } if (viewZoneWhitespace.afterLineNumber > 0) { // There are more lines above this view zone positionBefore = new core_position/* Position */.L(viewZoneWhitespace.afterLineNumber, context.model.getLineMaxColumn(viewZoneWhitespace.afterLineNumber)); } if (positionAfter === null) { position = positionBefore; } else if (positionBefore === null) { position = positionAfter; } else if (mouseVerticalOffset < viewZoneMiddle) { position = positionBefore; } else { position = positionAfter; } return { viewZoneId: viewZoneWhitespace.id, afterLineNumber: viewZoneWhitespace.afterLineNumber, positionBefore: positionBefore, positionAfter: positionAfter, position: position }; } return null; } getFullLineRangeAtCoord(mouseVerticalOffset) { if (this._context.viewLayout.isAfterLines(mouseVerticalOffset)) { // Below the last line const lineNumber = this._context.model.getLineCount(); const maxLineColumn = this._context.model.getLineMaxColumn(lineNumber); return { range: new core_range/* Range */.e(lineNumber, maxLineColumn, lineNumber, maxLineColumn), isAfterLines: true }; } const lineNumber = this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset); const maxLineColumn = this._context.model.getLineMaxColumn(lineNumber); return { range: new core_range/* Range */.e(lineNumber, 1, lineNumber, maxLineColumn), isAfterLines: false }; } getLineNumberAtVerticalOffset(mouseVerticalOffset) { return this._context.viewLayout.getLineNumberAtVerticalOffset(mouseVerticalOffset); } isAfterLines(mouseVerticalOffset) { return this._context.viewLayout.isAfterLines(mouseVerticalOffset); } isInTopPadding(mouseVerticalOffset) { return this._context.viewLayout.isInTopPadding(mouseVerticalOffset); } isInBottomPadding(mouseVerticalOffset) { return this._context.viewLayout.isInBottomPadding(mouseVerticalOffset); } getVerticalOffsetForLineNumber(lineNumber) { return this._context.viewLayout.getVerticalOffsetForLineNumber(lineNumber); } findAttribute(element, attr) { return HitTestContext._findAttribute(element, attr, this._viewHelper.viewDomNode); } static _findAttribute(element, attr, stopAt) { while (element && element !== document.body) { if (element.hasAttribute && element.hasAttribute(attr)) { return element.getAttribute(attr); } if (element === stopAt) { return null; } element = element.parentNode; } return null; } getLineWidth(lineNumber) { return this._viewHelper.getLineWidth(lineNumber); } visibleRangeForPosition(lineNumber, column) { return this._viewHelper.visibleRangeForPosition(lineNumber, column); } getPositionFromDOMInfo(spanNode, offset) { return this._viewHelper.getPositionFromDOMInfo(spanNode, offset); } getCurrentScrollTop() { return this._context.viewLayout.getCurrentScrollTop(); } getCurrentScrollLeft() { return this._context.viewLayout.getCurrentScrollLeft(); } } class BareHitTestRequest { constructor(ctx, editorPos, pos) { this.editorPos = editorPos; this.pos = pos; this.mouseVerticalOffset = Math.max(0, ctx.getCurrentScrollTop() + pos.y - editorPos.y); this.mouseContentHorizontalOffset = ctx.getCurrentScrollLeft() + pos.x - editorPos.x - ctx.layoutInfo.contentLeft; this.isInMarginArea = (pos.x - editorPos.x < ctx.layoutInfo.contentLeft && pos.x - editorPos.x >= ctx.layoutInfo.glyphMarginLeft); this.isInContentArea = !this.isInMarginArea; this.mouseColumn = Math.max(0, MouseTargetFactory._getMouseColumn(this.mouseContentHorizontalOffset, ctx.typicalHalfwidthCharacterWidth)); } } class HitTestRequest extends BareHitTestRequest { constructor(ctx, editorPos, pos, target) { super(ctx, editorPos, pos); this._ctx = ctx; if (target) { this.target = target; this.targetPath = PartFingerprints.collect(target, ctx.viewDomNode); } else { this.target = null; this.targetPath = new Uint8Array(0); } } toString() { return `pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target ? this.target.outerHTML : null}`; } // public fulfill(type: MouseTargetType.OVERVIEW_RULER, position?: Position | null, range?: EditorRange | null, detail?: any): MouseTarget; // public fulfill(type: MouseTargetType.OUTSIDE_EDITOR, position?: Position | null, range?: EditorRange | null, detail?: any): MouseTarget; fulfill(type, position = null, range = null, detail = null) { let mouseColumn = this.mouseColumn; if (position && position.column < this._ctx.model.getLineMaxColumn(position.lineNumber)) { // Most likely, the line contains foreign decorations... mouseColumn = cursorCommon/* CursorColumns */.io.visibleColumnFromColumn(this._ctx.model.getLineContent(position.lineNumber), position.column, this._ctx.model.getTextModelOptions().tabSize) + 1; } return new MouseTarget(this.target, type, mouseColumn, position, range, detail); } withTarget(target) { return new HitTestRequest(this._ctx, this.editorPos, this.pos, target); } } const EMPTY_CONTENT_AFTER_LINES = { isAfterLines: true }; function createEmptyContentDataInLines(horizontalDistanceToText) { return { isAfterLines: false, horizontalDistanceToText: horizontalDistanceToText }; } class MouseTargetFactory { constructor(context, viewHelper) { this._context = context; this._viewHelper = viewHelper; } mouseTargetIsWidget(e) { const t = e.target; const path = PartFingerprints.collect(t, this._viewHelper.viewDomNode); // Is it a content widget? if (ElementPath.isChildOfContentWidgets(path) || ElementPath.isChildOfOverflowingContentWidgets(path)) { return true; } // Is it an overlay widget? if (ElementPath.isChildOfOverlayWidgets(path)) { return true; } return false; } createMouseTarget(lastRenderData, editorPos, pos, target) { const ctx = new HitTestContext(this._context, this._viewHelper, lastRenderData); const request = new HitTestRequest(ctx, editorPos, pos, target); try { const r = MouseTargetFactory._createMouseTarget(ctx, request, false); // console.log(r.toString()); return r; } catch (err) { // console.log(err); return request.fulfill(0 /* UNKNOWN */); } } static _createMouseTarget(ctx, request, domHitTestExecuted) { // console.log(`${domHitTestExecuted ? '=>' : ''}CAME IN REQUEST: ${request}`); // First ensure the request has a target if (request.target === null) { if (domHitTestExecuted) { // Still no target... and we have already executed hit test... return request.fulfill(0 /* UNKNOWN */); } const hitTestResult = MouseTargetFactory._doHitTest(ctx, request); if (hitTestResult.type === 1 /* Content */) { return MouseTargetFactory.createMouseTargetFromHitTestPosition(ctx, request, hitTestResult.spanNode, hitTestResult.position, hitTestResult.injectedText); } return this._createMouseTarget(ctx, request.withTarget(hitTestResult.hitTarget), true); } // we know for a fact that request.target is not null const resolvedRequest = request; let result = null; result = result || MouseTargetFactory._hitTestContentWidget(ctx, resolvedRequest); result = result || MouseTargetFactory._hitTestOverlayWidget(ctx, resolvedRequest); result = result || MouseTargetFactory._hitTestMinimap(ctx, resolvedRequest); result = result || MouseTargetFactory._hitTestScrollbarSlider(ctx, resolvedRequest); result = result || MouseTargetFactory._hitTestViewZone(ctx, resolvedRequest); result = result || MouseTargetFactory._hitTestMargin(ctx, resolvedRequest); result = result || MouseTargetFactory._hitTestViewCursor(ctx, resolvedRequest); result = result || MouseTargetFactory._hitTestTextArea(ctx, resolvedRequest); result = result || MouseTargetFactory._hitTestViewLines(ctx, resolvedRequest, domHitTestExecuted); result = result || MouseTargetFactory._hitTestScrollbar(ctx, resolvedRequest); return (result || request.fulfill(0 /* UNKNOWN */)); } static _hitTestContentWidget(ctx, request) { // Is it a content widget? if (ElementPath.isChildOfContentWidgets(request.targetPath) || ElementPath.isChildOfOverflowingContentWidgets(request.targetPath)) { const widgetId = ctx.findAttribute(request.target, 'widgetId'); if (widgetId) { return request.fulfill(9 /* CONTENT_WIDGET */, null, null, widgetId); } else { return request.fulfill(0 /* UNKNOWN */); } } return null; } static _hitTestOverlayWidget(ctx, request) { // Is it an overlay widget? if (ElementPath.isChildOfOverlayWidgets(request.targetPath)) { const widgetId = ctx.findAttribute(request.target, 'widgetId'); if (widgetId) { return request.fulfill(12 /* OVERLAY_WIDGET */, null, null, widgetId); } else { return request.fulfill(0 /* UNKNOWN */); } } return null; } static _hitTestViewCursor(ctx, request) { if (request.target) { // Check if we've hit a painted cursor const lastViewCursorsRenderData = ctx.lastRenderData.lastViewCursorsRenderData; for (const d of lastViewCursorsRenderData) { if (request.target === d.domNode) { return request.fulfill(6 /* CONTENT_TEXT */, d.position, null, { mightBeForeignElement: false }); } } } if (request.isInContentArea) { // Edge has a bug when hit-testing the exact position of a cursor, // instead of returning the correct dom node, it returns the // first or last rendered view line dom node, therefore help it out // and first check if we are on top of a cursor const lastViewCursorsRenderData = ctx.lastRenderData.lastViewCursorsRenderData; const mouseContentHorizontalOffset = request.mouseContentHorizontalOffset; const mouseVerticalOffset = request.mouseVerticalOffset; for (const d of lastViewCursorsRenderData) { if (mouseContentHorizontalOffset < d.contentLeft) { // mouse position is to the left of the cursor continue; } if (mouseContentHorizontalOffset > d.contentLeft + d.width) { // mouse position is to the right of the cursor continue; } const cursorVerticalOffset = ctx.getVerticalOffsetForLineNumber(d.position.lineNumber); if (cursorVerticalOffset <= mouseVerticalOffset && mouseVerticalOffset <= cursorVerticalOffset + d.height) { return request.fulfill(6 /* CONTENT_TEXT */, d.position, null, { mightBeForeignElement: false }); } } } return null; } static _hitTestViewZone(ctx, request) { const viewZoneData = ctx.getZoneAtCoord(request.mouseVerticalOffset); if (viewZoneData) { const mouseTargetType = (request.isInContentArea ? 8 /* CONTENT_VIEW_ZONE */ : 5 /* GUTTER_VIEW_ZONE */); return request.fulfill(mouseTargetType, viewZoneData.position, null, viewZoneData); } return null; } static _hitTestTextArea(ctx, request) { // Is it the textarea? if (ElementPath.isTextArea(request.targetPath)) { if (ctx.lastRenderData.lastTextareaPosition) { return request.fulfill(6 /* CONTENT_TEXT */, ctx.lastRenderData.lastTextareaPosition, null, { mightBeForeignElement: false }); } return request.fulfill(1 /* TEXTAREA */, ctx.lastRenderData.lastTextareaPosition); } return null; } static _hitTestMargin(ctx, request) { if (request.isInMarginArea) { const res = ctx.getFullLineRangeAtCoord(request.mouseVerticalOffset); const pos = res.range.getStartPosition(); let offset = Math.abs(request.pos.x - request.editorPos.x); const detail = { isAfterLines: res.isAfterLines, glyphMarginLeft: ctx.layoutInfo.glyphMarginLeft, glyphMarginWidth: ctx.layoutInfo.glyphMarginWidth, lineNumbersWidth: ctx.layoutInfo.lineNumbersWidth, offsetX: offset }; offset -= ctx.layoutInfo.glyphMarginLeft; if (offset <= ctx.layoutInfo.glyphMarginWidth) { // On the glyph margin return request.fulfill(2 /* GUTTER_GLYPH_MARGIN */, pos, res.range, detail); } offset -= ctx.layoutInfo.glyphMarginWidth; if (offset <= ctx.layoutInfo.lineNumbersWidth) { // On the line numbers return request.fulfill(3 /* GUTTER_LINE_NUMBERS */, pos, res.range, detail); } offset -= ctx.layoutInfo.lineNumbersWidth; // On the line decorations return request.fulfill(4 /* GUTTER_LINE_DECORATIONS */, pos, res.range, detail); } return null; } static _hitTestViewLines(ctx, request, domHitTestExecuted) { if (!ElementPath.isChildOfViewLines(request.targetPath)) { return null; } if (ctx.isInTopPadding(request.mouseVerticalOffset)) { return request.fulfill(7 /* CONTENT_EMPTY */, new core_position/* Position */.L(1, 1), null, EMPTY_CONTENT_AFTER_LINES); } // Check if it is below any lines and any view zones if (ctx.isAfterLines(request.mouseVerticalOffset) || ctx.isInBottomPadding(request.mouseVerticalOffset)) { // This most likely indicates it happened after the last view-line const lineCount = ctx.model.getLineCount(); const maxLineColumn = ctx.model.getLineMaxColumn(lineCount); return request.fulfill(7 /* CONTENT_EMPTY */, new core_position/* Position */.L(lineCount, maxLineColumn), null, EMPTY_CONTENT_AFTER_LINES); } if (domHitTestExecuted) { // Check if we are hitting a view-line (can happen in the case of inline decorations on empty lines) // See https://github.com/microsoft/vscode/issues/46942 if (ElementPath.isStrictChildOfViewLines(request.targetPath)) { const lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset); if (ctx.model.getLineLength(lineNumber) === 0) { const lineWidth = ctx.getLineWidth(lineNumber); const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth); return request.fulfill(7 /* CONTENT_EMPTY */, new core_position/* Position */.L(lineNumber, 1), null, detail); } const lineWidth = ctx.getLineWidth(lineNumber); if (request.mouseContentHorizontalOffset >= lineWidth) { const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth); const pos = new core_position/* Position */.L(lineNumber, ctx.model.getLineMaxColumn(lineNumber)); return request.fulfill(7 /* CONTENT_EMPTY */, pos, null, detail); } } // We have already executed hit test... return request.fulfill(0 /* UNKNOWN */); } const hitTestResult = MouseTargetFactory._doHitTest(ctx, request); if (hitTestResult.type === 1 /* Content */) { return MouseTargetFactory.createMouseTargetFromHitTestPosition(ctx, request, hitTestResult.spanNode, hitTestResult.position, hitTestResult.injectedText); } return this._createMouseTarget(ctx, request.withTarget(hitTestResult.hitTarget), true); } static _hitTestMinimap(ctx, request) { if (ElementPath.isChildOfMinimap(request.targetPath)) { const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset); const maxColumn = ctx.model.getLineMaxColumn(possibleLineNumber); return request.fulfill(11 /* SCROLLBAR */, new core_position/* Position */.L(possibleLineNumber, maxColumn)); } return null; } static _hitTestScrollbarSlider(ctx, request) { if (ElementPath.isChildOfScrollableElement(request.targetPath)) { if (request.target && request.target.nodeType === 1) { const className = request.target.className; if (className && /\b(slider|scrollbar)\b/.test(className)) { const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset); const maxColumn = ctx.model.getLineMaxColumn(possibleLineNumber); return request.fulfill(11 /* SCROLLBAR */, new core_position/* Position */.L(possibleLineNumber, maxColumn)); } } } return null; } static _hitTestScrollbar(ctx, request) { // Is it the overview ruler? // Is it a child of the scrollable element? if (ElementPath.isChildOfScrollableElement(request.targetPath)) { const possibleLineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset); const maxColumn = ctx.model.getLineMaxColumn(possibleLineNumber); return request.fulfill(11 /* SCROLLBAR */, new core_position/* Position */.L(possibleLineNumber, maxColumn)); } return null; } getMouseColumn(editorPos, pos) { const options = this._context.configuration.options; const layoutInfo = options.get(129 /* layoutInfo */); const mouseContentHorizontalOffset = this._context.viewLayout.getCurrentScrollLeft() + pos.x - editorPos.x - layoutInfo.contentLeft; return MouseTargetFactory._getMouseColumn(mouseContentHorizontalOffset, options.get(43 /* fontInfo */).typicalHalfwidthCharacterWidth); } static _getMouseColumn(mouseContentHorizontalOffset, typicalHalfwidthCharacterWidth) { if (mouseContentHorizontalOffset < 0) { return 1; } const chars = Math.round(mouseContentHorizontalOffset / typicalHalfwidthCharacterWidth); return (chars + 1); } static createMouseTargetFromHitTestPosition(ctx, request, spanNode, pos, injectedText) { const lineNumber = pos.lineNumber; const column = pos.column; const lineWidth = ctx.getLineWidth(lineNumber); if (request.mouseContentHorizontalOffset > lineWidth) { const detail = createEmptyContentDataInLines(request.mouseContentHorizontalOffset - lineWidth); return request.fulfill(7 /* CONTENT_EMPTY */, pos, null, detail); } const visibleRange = ctx.visibleRangeForPosition(lineNumber, column); if (!visibleRange) { return request.fulfill(0 /* UNKNOWN */, pos); } const columnHorizontalOffset = visibleRange.left; if (request.mouseContentHorizontalOffset === columnHorizontalOffset) { return request.fulfill(6 /* CONTENT_TEXT */, pos, null, { mightBeForeignElement: !!injectedText }); } const points = []; points.push({ offset: visibleRange.left, column: column }); if (column > 1) { const visibleRange = ctx.visibleRangeForPosition(lineNumber, column - 1); if (visibleRange) { points.push({ offset: visibleRange.left, column: column - 1 }); } } const lineMaxColumn = ctx.model.getLineMaxColumn(lineNumber); if (column < lineMaxColumn) { const visibleRange = ctx.visibleRangeForPosition(lineNumber, column + 1); if (visibleRange) { points.push({ offset: visibleRange.left, column: column + 1 }); } } points.sort((a, b) => a.offset - b.offset); const mouseCoordinates = request.pos.toClientCoordinates(); const spanNodeClientRect = spanNode.getBoundingClientRect(); const mouseIsOverSpanNode = (spanNodeClientRect.left <= mouseCoordinates.clientX && mouseCoordinates.clientX <= spanNodeClientRect.right); for (let i = 1; i < points.length; i++) { const prev = points[i - 1]; const curr = points[i]; if (prev.offset <= request.mouseContentHorizontalOffset && request.mouseContentHorizontalOffset <= curr.offset) { const rng = new core_range/* Range */.e(lineNumber, prev.column, lineNumber, curr.column); return request.fulfill(6 /* CONTENT_TEXT */, pos, rng, { mightBeForeignElement: !mouseIsOverSpanNode || !!injectedText }); } } return request.fulfill(6 /* CONTENT_TEXT */, pos, null, { mightBeForeignElement: !mouseIsOverSpanNode || !!injectedText }); } /** * Most probably WebKit browsers and Edge */ static _doHitTestWithCaretRangeFromPoint(ctx, request) { // In Chrome, especially on Linux it is possible to click between lines, // so try to adjust the `hity` below so that it lands in the center of a line const lineNumber = ctx.getLineNumberAtVerticalOffset(request.mouseVerticalOffset); const lineVerticalOffset = ctx.getVerticalOffsetForLineNumber(lineNumber); const lineCenteredVerticalOffset = lineVerticalOffset + Math.floor(ctx.lineHeight / 2); let adjustedPageY = request.pos.y + (lineCenteredVerticalOffset - request.mouseVerticalOffset); if (adjustedPageY <= request.editorPos.y) { adjustedPageY = request.editorPos.y + 1; } if (adjustedPageY >= request.editorPos.y + ctx.layoutInfo.height) { adjustedPageY = request.editorPos.y + ctx.layoutInfo.height - 1; } const adjustedPage = new PageCoordinates(request.pos.x, adjustedPageY); const r = this._actualDoHitTestWithCaretRangeFromPoint(ctx, adjustedPage.toClientCoordinates()); if (r.type === 1 /* Content */) { return r; } // Also try to hit test without the adjustment (for the edge cases that we are near the top or bottom) return this._actualDoHitTestWithCaretRangeFromPoint(ctx, request.pos.toClientCoordinates()); } static _actualDoHitTestWithCaretRangeFromPoint(ctx, coords) { const shadowRoot = dom/* getShadowRoot */.Ay(ctx.viewDomNode); let range; if (shadowRoot) { if (typeof shadowRoot.caretRangeFromPoint === 'undefined') { range = shadowCaretRangeFromPoint(shadowRoot, coords.clientX, coords.clientY); } else { range = shadowRoot.caretRangeFromPoint(coords.clientX, coords.clientY); } } else { range = document.caretRangeFromPoint(coords.clientX, coords.clientY); } if (!range || !range.startContainer) { return new UnknownHitTestResult(); } // Chrome always hits a TEXT_NODE, while Edge sometimes hits a token span const startContainer = range.startContainer; if (startContainer.nodeType === startContainer.TEXT_NODE) { // startContainer is expected to be the token text const parent1 = startContainer.parentNode; // expected to be the token span const parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line container span const parent3 = parent2 ? parent2.parentNode : null; // expected to be the view line div const parent3ClassName = parent3 && parent3.nodeType === parent3.ELEMENT_NODE ? parent3.className : null; if (parent3ClassName === ViewLine.CLASS_NAME) { return HitTestResult.createFromDOMInfo(ctx, parent1, range.startOffset); } else { return new UnknownHitTestResult(startContainer.parentNode); } } else if (startContainer.nodeType === startContainer.ELEMENT_NODE) { // startContainer is expected to be the token span const parent1 = startContainer.parentNode; // expected to be the view line container span const parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line div const parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? parent2.className : null; if (parent2ClassName === ViewLine.CLASS_NAME) { return HitTestResult.createFromDOMInfo(ctx, startContainer, startContainer.textContent.length); } else { return new UnknownHitTestResult(startContainer); } } return new UnknownHitTestResult(); } /** * Most probably Gecko */ static _doHitTestWithCaretPositionFromPoint(ctx, coords) { const hitResult = document.caretPositionFromPoint(coords.clientX, coords.clientY); if (hitResult.offsetNode.nodeType === hitResult.offsetNode.TEXT_NODE) { // offsetNode is expected to be the token text const parent1 = hitResult.offsetNode.parentNode; // expected to be the token span const parent2 = parent1 ? parent1.parentNode : null; // expected to be the view line container span const parent3 = parent2 ? parent2.parentNode : null; // expected to be the view line div const parent3ClassName = parent3 && parent3.nodeType === parent3.ELEMENT_NODE ? parent3.className : null; if (parent3ClassName === ViewLine.CLASS_NAME) { return HitTestResult.createFromDOMInfo(ctx, hitResult.offsetNode.parentNode, hitResult.offset); } else { return new UnknownHitTestResult(hitResult.offsetNode.parentNode); } } // For inline decorations, Gecko sometimes returns the `` of the line and the offset is the `` with the inline decoration // Some other times, it returns the `` with the inline decoration if (hitResult.offsetNode.nodeType === hitResult.offsetNode.ELEMENT_NODE) { const parent1 = hitResult.offsetNode.parentNode; const parent1ClassName = parent1 && parent1.nodeType === parent1.ELEMENT_NODE ? parent1.className : null; const parent2 = parent1 ? parent1.parentNode : null; const parent2ClassName = parent2 && parent2.nodeType === parent2.ELEMENT_NODE ? parent2.className : null; if (parent1ClassName === ViewLine.CLASS_NAME) { // it returned the `` of the line and the offset is the `` with the inline decoration const tokenSpan = hitResult.offsetNode.childNodes[Math.min(hitResult.offset, hitResult.offsetNode.childNodes.length - 1)]; if (tokenSpan) { return HitTestResult.createFromDOMInfo(ctx, tokenSpan, 0); } } else if (parent2ClassName === ViewLine.CLASS_NAME) { // it returned the `` with the inline decoration return HitTestResult.createFromDOMInfo(ctx, hitResult.offsetNode, 0); } } return new UnknownHitTestResult(hitResult.offsetNode); } static _snapToSoftTabBoundary(position, viewModel) { const lineContent = viewModel.getLineContent(position.lineNumber); const { tabSize } = viewModel.getTextModelOptions(); const newPosition = cursorAtomicMoveOperations/* AtomicTabMoveOperations */.l.atomicPosition(lineContent, position.column - 1, tabSize, 2 /* Nearest */); if (newPosition !== -1) { return new core_position/* Position */.L(position.lineNumber, newPosition + 1); } return position; } static _doHitTest(ctx, request) { let result = new UnknownHitTestResult(); if (typeof document.caretRangeFromPoint === 'function') { result = this._doHitTestWithCaretRangeFromPoint(ctx, request); } else if (document.caretPositionFromPoint) { result = this._doHitTestWithCaretPositionFromPoint(ctx, request.pos.toClientCoordinates()); } if (result.type === 1 /* Content */) { const injectedText = ctx.model.getInjectedTextAt(result.position); const normalizedPosition = ctx.model.normalizePosition(result.position, 2 /* None */); if (injectedText || !normalizedPosition.equals(result.position)) { result = new ContentHitTestResult(normalizedPosition, result.spanNode, injectedText); } } // Snap to the nearest soft tab boundary if atomic soft tabs are enabled. if (result.type === 1 /* Content */ && ctx.stickyTabStops) { result = new ContentHitTestResult(this._snapToSoftTabBoundary(result.position, ctx.model), result.spanNode, result.injectedText); } return result; } } function shadowCaretRangeFromPoint(shadowRoot, x, y) { const range = document.createRange(); // Get the element under the point let el = shadowRoot.elementFromPoint(x, y); if (el !== null) { // Get the last child of the element until its firstChild is a text node // This assumes that the pointer is on the right of the line, out of the tokens // and that we want to get the offset of the last token of the line while (el && el.firstChild && el.firstChild.nodeType !== el.firstChild.TEXT_NODE && el.lastChild && el.lastChild.firstChild) { el = el.lastChild; } // Grab its rect const rect = el.getBoundingClientRect(); // And its font const font = window.getComputedStyle(el, null).getPropertyValue('font'); // And also its txt content const text = el.innerText; // Position the pixel cursor at the left of the element let pixelCursor = rect.left; let offset = 0; let step; // If the point is on the right of the box put the cursor after the last character if (x > rect.left + rect.width) { offset = text.length; } else { const charWidthReader = CharWidthReader.getInstance(); // Goes through all the characters of the innerText, and checks if the x of the point // belongs to the character. for (let i = 0; i < text.length + 1; i++) { // The step is half the width of the character step = charWidthReader.getCharWidth(text.charAt(i), font) / 2; // Move to the center of the character pixelCursor += step; // If the x of the point is smaller that the position of the cursor, the point is over that character if (x < pixelCursor) { offset = i; break; } // Move between the current character and the next pixelCursor += step; } } // Creates a range with the text node of the element and set the offset found range.setStart(el.firstChild, offset); range.setEnd(el.firstChild, offset); } return range; } class CharWidthReader { constructor() { this._cache = {}; this._canvas = document.createElement('canvas'); } static getInstance() { if (!CharWidthReader._INSTANCE) { CharWidthReader._INSTANCE = new CharWidthReader(); } return CharWidthReader._INSTANCE; } getCharWidth(char, font) { const cacheKey = char + font; if (this._cache[cacheKey]) { return this._cache[cacheKey]; } const context = this._canvas.getContext('2d'); context.font = font; const metrics = context.measureText(char); const width = metrics.width; this._cache[cacheKey] = width; return width; } } CharWidthReader._INSTANCE = null; // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/common/config/editorZoom.js var editorZoom = __webpack_require__(80724); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/controller/mouseHandler.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** * Merges mouse events when mouse move events are throttled */ function createMouseMoveEventMerger(mouseTargetFactory) { return function (lastEvent, currentEvent) { let targetIsWidget = false; if (mouseTargetFactory) { targetIsWidget = mouseTargetFactory.mouseTargetIsWidget(currentEvent); } if (!targetIsWidget) { currentEvent.preventDefault(); } return currentEvent; }; } class MouseHandler extends ViewEventHandler { constructor(context, viewController, viewHelper) { super(); this._context = context; this.viewController = viewController; this.viewHelper = viewHelper; this.mouseTargetFactory = new MouseTargetFactory(this._context, viewHelper); this._mouseDownOperation = this._register(new MouseDownOperation(this._context, this.viewController, this.viewHelper, (e, testEventTarget) => this._createMouseTarget(e, testEventTarget), (e) => this._getMouseColumn(e))); this.lastMouseLeaveTime = -1; this._height = this._context.configuration.options.get(129 /* layoutInfo */).height; const mouseEvents = new EditorMouseEventFactory(this.viewHelper.viewDomNode); this._register(mouseEvents.onContextMenu(this.viewHelper.viewDomNode, (e) => this._onContextMenu(e, true))); this._register(mouseEvents.onMouseMoveThrottled(this.viewHelper.viewDomNode, (e) => this._onMouseMove(e), createMouseMoveEventMerger(this.mouseTargetFactory), MouseHandler.MOUSE_MOVE_MINIMUM_TIME)); this._register(mouseEvents.onMouseUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e))); this._register(mouseEvents.onMouseLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e))); this._register(mouseEvents.onMouseDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e))); const onMouseWheel = (browserEvent) => { this.viewController.emitMouseWheel(browserEvent); if (!this._context.configuration.options.get(67 /* mouseWheelZoom */)) { return; } const e = new mouseEvent/* StandardWheelEvent */.q(browserEvent); const doMouseWheelZoom = (platform/* isMacintosh */.dz // on macOS we support cmd + two fingers scroll (`metaKey` set) // and also the two fingers pinch gesture (`ctrKey` set) ? ((browserEvent.metaKey || browserEvent.ctrlKey) && !browserEvent.shiftKey && !browserEvent.altKey) : (browserEvent.ctrlKey && !browserEvent.metaKey && !browserEvent.shiftKey && !browserEvent.altKey)); if (doMouseWheelZoom) { const zoomLevel = editorZoom/* EditorZoom */.C.getZoomLevel(); const delta = e.deltaY > 0 ? 1 : -1; editorZoom/* EditorZoom */.C.setZoomLevel(zoomLevel + delta); e.preventDefault(); e.stopPropagation(); } }; this._register(dom/* addDisposableListener */.nm(this.viewHelper.viewDomNode, dom/* EventType */.tw.MOUSE_WHEEL, onMouseWheel, { capture: true, passive: false })); this._context.addEventHandler(this); } dispose() { this._context.removeEventHandler(this); super.dispose(); } // --- begin event handlers onConfigurationChanged(e) { if (e.hasChanged(129 /* layoutInfo */)) { // layout change const height = this._context.configuration.options.get(129 /* layoutInfo */).height; if (this._height !== height) { this._height = height; this._mouseDownOperation.onHeightChanged(); } } return false; } onCursorStateChanged(e) { this._mouseDownOperation.onCursorStateChanged(e); return false; } onFocusChanged(e) { return false; } onScrollChanged(e) { this._mouseDownOperation.onScrollChanged(); return false; } // --- end event handlers getTargetAtClientPoint(clientX, clientY) { const clientPos = new ClientCoordinates(clientX, clientY); const pos = clientPos.toPageCoordinates(); const editorPos = createEditorPagePosition(this.viewHelper.viewDomNode); if (pos.y < editorPos.y || pos.y > editorPos.y + editorPos.height || pos.x < editorPos.x || pos.x > editorPos.x + editorPos.width) { return null; } return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), editorPos, pos, null); } _createMouseTarget(e, testEventTarget) { let target = e.target; if (!this.viewHelper.viewDomNode.contains(target)) { const shadowRoot = dom/* getShadowRoot */.Ay(this.viewHelper.viewDomNode); if (shadowRoot) { target = shadowRoot.elementsFromPoint(e.posx, e.posy).find((el) => this.viewHelper.viewDomNode.contains(el)); } } return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), e.editorPos, e.pos, testEventTarget ? target : null); } _getMouseColumn(e) { return this.mouseTargetFactory.getMouseColumn(e.editorPos, e.pos); } _onContextMenu(e, testEventTarget) { this.viewController.emitContextMenu({ event: e, target: this._createMouseTarget(e, testEventTarget) }); } _onMouseMove(e) { if (this._mouseDownOperation.isActive()) { // In selection/drag operation return; } const actualMouseMoveTime = e.timestamp; if (actualMouseMoveTime < this.lastMouseLeaveTime) { // Due to throttling, this event occurred before the mouse left the editor, therefore ignore it. return; } this.viewController.emitMouseMove({ event: e, target: this._createMouseTarget(e, true) }); } _onMouseLeave(e) { this.lastMouseLeaveTime = (new Date()).getTime(); this.viewController.emitMouseLeave({ event: e, target: null }); } _onMouseUp(e) { this.viewController.emitMouseUp({ event: e, target: this._createMouseTarget(e, true) }); } _onMouseDown(e) { const t = this._createMouseTarget(e, true); const targetIsContent = (t.type === 6 /* CONTENT_TEXT */ || t.type === 7 /* CONTENT_EMPTY */); const targetIsGutter = (t.type === 2 /* GUTTER_GLYPH_MARGIN */ || t.type === 3 /* GUTTER_LINE_NUMBERS */ || t.type === 4 /* GUTTER_LINE_DECORATIONS */); const targetIsLineNumbers = (t.type === 3 /* GUTTER_LINE_NUMBERS */); const selectOnLineNumbers = this._context.configuration.options.get(97 /* selectOnLineNumbers */); const targetIsViewZone = (t.type === 8 /* CONTENT_VIEW_ZONE */ || t.type === 5 /* GUTTER_VIEW_ZONE */); const targetIsWidget = (t.type === 9 /* CONTENT_WIDGET */); let shouldHandle = e.leftButton || e.middleButton; if (platform/* isMacintosh */.dz && e.leftButton && e.ctrlKey) { shouldHandle = false; } const focus = () => { e.preventDefault(); this.viewHelper.focusTextArea(); }; if (shouldHandle && (targetIsContent || (targetIsLineNumbers && selectOnLineNumbers))) { focus(); this._mouseDownOperation.start(t.type, e); } else if (targetIsGutter) { // Do not steal focus e.preventDefault(); } else if (targetIsViewZone) { const viewZoneData = t.detail; if (this.viewHelper.shouldSuppressMouseDownOnViewZone(viewZoneData.viewZoneId)) { focus(); this._mouseDownOperation.start(t.type, e); e.preventDefault(); } } else if (targetIsWidget && this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)) { focus(); e.preventDefault(); } this.viewController.emitMouseDown({ event: e, target: t }); } } MouseHandler.MOUSE_MOVE_MINIMUM_TIME = 100; // ms class MouseDownOperation extends lifecycle/* Disposable */.JT { constructor(context, viewController, viewHelper, createMouseTarget, getMouseColumn) { super(); this._context = context; this._viewController = viewController; this._viewHelper = viewHelper; this._createMouseTarget = createMouseTarget; this._getMouseColumn = getMouseColumn; this._mouseMoveMonitor = this._register(new GlobalEditorMouseMoveMonitor(this._viewHelper.viewDomNode)); this._onScrollTimeout = this._register(new common_async/* TimeoutTimer */._F()); this._mouseState = new MouseDownState(); this._currentSelection = new core_selection/* Selection */.Y(1, 1, 1, 1); this._isActive = false; this._lastMouseEvent = null; } dispose() { super.dispose(); } isActive() { return this._isActive; } _onMouseDownThenMove(e) { this._lastMouseEvent = e; this._mouseState.setModifiers(e); const position = this._findMousePosition(e, true); if (!position) { // Ignoring because position is unknown return; } if (this._mouseState.isDragAndDrop) { this._viewController.emitMouseDrag({ event: e, target: position }); } else { this._dispatchMouse(position, true); } } start(targetType, e) { this._lastMouseEvent = e; this._mouseState.setStartedOnLineNumbers(targetType === 3 /* GUTTER_LINE_NUMBERS */); this._mouseState.setStartButtons(e); this._mouseState.setModifiers(e); const position = this._findMousePosition(e, true); if (!position || !position.position) { // Ignoring because position is unknown return; } this._mouseState.trySetCount(e.detail, position.position); // Overwrite the detail of the MouseEvent, as it will be sent out in an event and contributions might rely on it. e.detail = this._mouseState.count; const options = this._context.configuration.options; if (!options.get(80 /* readOnly */) && options.get(31 /* dragAndDrop */) && !options.get(18 /* columnSelection */) && !this._mouseState.altKey // we don't support multiple mouse && e.detail < 2 // only single click on a selection can work && !this._isActive // the mouse is not down yet && !this._currentSelection.isEmpty() // we don't drag single cursor && (position.type === 6 /* CONTENT_TEXT */) // single click on text && position.position && this._currentSelection.containsPosition(position.position) // single click on a selection ) { this._mouseState.isDragAndDrop = true; this._isActive = true; this._mouseMoveMonitor.startMonitoring(e.target, e.buttons, createMouseMoveEventMerger(null), (e) => this._onMouseDownThenMove(e), (browserEvent) => { const position = this._findMousePosition(this._lastMouseEvent, true); if (browserEvent && browserEvent instanceof KeyboardEvent) { // cancel this._viewController.emitMouseDropCanceled(); } else { this._viewController.emitMouseDrop({ event: this._lastMouseEvent, target: (position ? this._createMouseTarget(this._lastMouseEvent, true) : null) // Ignoring because position is unknown, e.g., Content View Zone }); } this._stop(); }); return; } this._mouseState.isDragAndDrop = false; this._dispatchMouse(position, e.shiftKey); if (!this._isActive) { this._isActive = true; this._mouseMoveMonitor.startMonitoring(e.target, e.buttons, createMouseMoveEventMerger(null), (e) => this._onMouseDownThenMove(e), () => this._stop()); } } _stop() { this._isActive = false; this._onScrollTimeout.cancel(); } onHeightChanged() { this._mouseMoveMonitor.stopMonitoring(); } onScrollChanged() { if (!this._isActive) { return; } this._onScrollTimeout.setIfNotSet(() => { if (!this._lastMouseEvent) { return; } const position = this._findMousePosition(this._lastMouseEvent, false); if (!position) { // Ignoring because position is unknown return; } if (this._mouseState.isDragAndDrop) { // Ignoring because users are dragging the text return; } this._dispatchMouse(position, true); }, 10); } onCursorStateChanged(e) { this._currentSelection = e.selections[0]; } _getPositionOutsideEditor(e) { const editorContent = e.editorPos; const model = this._context.model; const viewLayout = this._context.viewLayout; const mouseColumn = this._getMouseColumn(e); if (e.posy < editorContent.y) { const verticalOffset = Math.max(viewLayout.getCurrentScrollTop() - (editorContent.y - e.posy), 0); const viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset); if (viewZoneData) { const newPosition = this._helpPositionJumpOverViewZone(viewZoneData); if (newPosition) { return new MouseTarget(null, 13 /* OUTSIDE_EDITOR */, mouseColumn, newPosition); } } const aboveLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset); return new MouseTarget(null, 13 /* OUTSIDE_EDITOR */, mouseColumn, new core_position/* Position */.L(aboveLineNumber, 1)); } if (e.posy > editorContent.y + editorContent.height) { const verticalOffset = viewLayout.getCurrentScrollTop() + (e.posy - editorContent.y); const viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset); if (viewZoneData) { const newPosition = this._helpPositionJumpOverViewZone(viewZoneData); if (newPosition) { return new MouseTarget(null, 13 /* OUTSIDE_EDITOR */, mouseColumn, newPosition); } } const belowLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset); return new MouseTarget(null, 13 /* OUTSIDE_EDITOR */, mouseColumn, new core_position/* Position */.L(belowLineNumber, model.getLineMaxColumn(belowLineNumber))); } const possibleLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getCurrentScrollTop() + (e.posy - editorContent.y)); if (e.posx < editorContent.x) { return new MouseTarget(null, 13 /* OUTSIDE_EDITOR */, mouseColumn, new core_position/* Position */.L(possibleLineNumber, 1)); } if (e.posx > editorContent.x + editorContent.width) { return new MouseTarget(null, 13 /* OUTSIDE_EDITOR */, mouseColumn, new core_position/* Position */.L(possibleLineNumber, model.getLineMaxColumn(possibleLineNumber))); } return null; } _findMousePosition(e, testEventTarget) { const positionOutsideEditor = this._getPositionOutsideEditor(e); if (positionOutsideEditor) { return positionOutsideEditor; } const t = this._createMouseTarget(e, testEventTarget); const hintedPosition = t.position; if (!hintedPosition) { return null; } if (t.type === 8 /* CONTENT_VIEW_ZONE */ || t.type === 5 /* GUTTER_VIEW_ZONE */) { const newPosition = this._helpPositionJumpOverViewZone(t.detail); if (newPosition) { return new MouseTarget(t.element, t.type, t.mouseColumn, newPosition, null, t.detail); } } return t; } _helpPositionJumpOverViewZone(viewZoneData) { // Force position on view zones to go above or below depending on where selection started from const selectionStart = new core_position/* Position */.L(this._currentSelection.selectionStartLineNumber, this._currentSelection.selectionStartColumn); const positionBefore = viewZoneData.positionBefore; const positionAfter = viewZoneData.positionAfter; if (positionBefore && positionAfter) { if (positionBefore.isBefore(selectionStart)) { return positionBefore; } else { return positionAfter; } } return null; } _dispatchMouse(position, inSelectionMode) { if (!position.position) { return; } this._viewController.dispatchMouse({ position: position.position, mouseColumn: position.mouseColumn, startedOnLineNumbers: this._mouseState.startedOnLineNumbers, inSelectionMode: inSelectionMode, 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, }); } } class MouseDownState { constructor() { this._altKey = false; this._ctrlKey = false; this._metaKey = false; this._shiftKey = false; this._leftButton = false; this._middleButton = false; this._startedOnLineNumbers = false; this._lastMouseDownPosition = null; this._lastMouseDownPositionEqualCount = 0; this._lastMouseDownCount = 0; this._lastSetMouseDownCountTime = 0; this.isDragAndDrop = false; } 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; } get count() { return this._lastMouseDownCount; } setModifiers(source) { this._altKey = source.altKey; this._ctrlKey = source.ctrlKey; this._metaKey = source.metaKey; this._shiftKey = source.shiftKey; } setStartButtons(source) { this._leftButton = source.leftButton; this._middleButton = source.middleButton; } setStartedOnLineNumbers(startedOnLineNumbers) { this._startedOnLineNumbers = startedOnLineNumbers; } trySetCount(setMouseDownCount, newMouseDownPosition) { // a. Invalidate multiple clicking if too much time has passed (will be hit by IE because the detail field of mouse events contains garbage in IE10) const currentTime = (new Date()).getTime(); if (currentTime - this._lastSetMouseDownCountTime > MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME) { setMouseDownCount = 1; } this._lastSetMouseDownCountTime = currentTime; // b. Ensure that we don't jump from single click to triple click in one go (will be hit by IE because the detail field of mouse events contains garbage in IE10) if (setMouseDownCount > this._lastMouseDownCount + 1) { setMouseDownCount = this._lastMouseDownCount + 1; } // c. Invalidate multiple clicking if the logical position is different if (this._lastMouseDownPosition && this._lastMouseDownPosition.equals(newMouseDownPosition)) { this._lastMouseDownPositionEqualCount++; } else { this._lastMouseDownPositionEqualCount = 1; } this._lastMouseDownPosition = newMouseDownPosition; // Finally set the lastMouseDownCount this._lastMouseDownCount = Math.min(setMouseDownCount, this._lastMouseDownPositionEqualCount); } } MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME = 400; // ms // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/browser/canIUse.js var canIUse = __webpack_require__(23725); // EXTERNAL MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/controller/textAreaInput.js var textAreaInput = __webpack_require__(79193); ;// CONCATENATED MODULE: ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/editor/browser/controller/pointerHandler.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** * Currently only tested on iOS 13/ iPadOS. */ class PointerEventHandler extends MouseHandler { constructor(context, viewController, viewHelper) { super(context, viewController, viewHelper); this._register(touch/* Gesture */.o.addTarget(this.viewHelper.linesContentDomNode)); this._register(dom/* addDisposableListener */.nm(this.viewHelper.linesContentDomNode, touch/* EventType */.t.Tap, (e) => this.onTap(e))); this._register(dom/* addDisposableListener */.nm(this.viewHelper.linesContentDomNode, touch/* EventType */.t.Change, (e) => this.onChange(e))); this._register(dom/* addDisposableListener */.nm(this.viewHelper.linesContentDomNode, touch/* EventType */.t.Contextmenu, (e) => this._onContextMenu(new EditorMouseEvent(e, this.viewHelper.viewDomNode), false))); this._lastPointerType = 'mouse'; this._register(dom/* addDisposableListener */.nm(this.viewHelper.linesContentDomNode, 'pointerdown', (e) => { const pointerType = e.pointerType; if (pointerType === 'mouse') { this._lastPointerType = 'mouse'; return; } else if (pointerType === 'touch') { this._lastPointerType = 'touch'; } else { this._lastPointerType = 'pen'; } })); // PonterEvents const pointerEvents = new EditorPointerEventFactory(this.viewHelper.viewDomNode); this._register(pointerEvents.onPointerMoveThrottled(this.viewHelper.viewDomNode, (e) => this._onMouseMove(e), createMouseMoveEventMerger(this.mouseTargetFactory), MouseHandler.MOUSE_MOVE_MINIMUM_TIME)); this._register(pointerEvents.onPointerUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e))); this._register(pointerEvents.onPointerLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e))); this._register(pointerEvents.onPointerDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e))); } onTap(event) { if (!event.initialTarget || !this.viewHelper.linesContentDomNode.contains(event.initialTarget)) { return; } event.preventDefault(); this.viewHelper.focusTextArea(); const target = this._createMouseTarget(new EditorMouseEvent(event, this.viewHelper.viewDomNode), false); if (target.position) { // this.viewController.moveTo(target.position); this.viewController.dispatchMouse({ position: target.position, mouseColumn: target.position.column, startedOnLineNumbers: false, mouseDownCount: event.tapCount, inSelectionMode: false, altKey: false, ctrlKey: false, metaKey: false, shiftKey: false, leftButton: false, middleButton: false, }); } } onChange(e) { if (this._lastPointerType === 'touch') { this._context.model.deltaScrollNow(-e.translationX, -e.translationY); } } _onMouseDown(e) { if (e.browserEvent.pointerType === 'touch') { return; } super._onMouseDown(e); } } class TouchHandler extends MouseHandler { constructor(context, viewController, viewHelper) { super(context, viewController, viewHelper); this._register(touch/* Gesture */.o.addTarget(this.viewHelper.linesContentDomNode)); this._register(dom/* addDisposableListener */.nm(this.viewHelper.linesContentDomNode, touch/* EventType */.t.Tap, (e) => this.onTap(e))); this._register(dom/* addDisposableListener */.nm(this.viewHelper.linesContentDomNode, touch/* EventType */.t.Change, (e) => this.onChange(e))); this._register(dom/* addDisposableListener */.nm(this.viewHelper.linesContentDomNode, touch/* EventType */.t.Contextmenu, (e) => this._onContextMenu(new EditorMouseEvent(e, this.viewHelper.viewDomNode), false))); } onTap(event) { event.preventDefault(); this.viewHelper.focusTextArea(); const target = this._createMouseTarget(new EditorMouseEvent(event, this.viewHelper.viewDomNode), false); if (target.position) { // Send the tap event also to the