antosdk-apps/MonacoCore/bundle/vendors-node_modules_monaco-editor_esm_vs_language_json_jsonMode_js.bundle.js
2022-06-03 19:30:11 +02:00

22 lines
88 KiB
JavaScript

"use strict";
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
(self["webpackChunkmonanco_wpack"] = self["webpackChunkmonanco_wpack"] || []).push([["vendors-node_modules_monaco-editor_esm_vs_language_json_jsonMode_js"],{
/***/ "./node_modules/monaco-editor/esm/vs/language/json/jsonMode.js":
/*!*********************************************************************!*\
!*** ./node_modules/monaco-editor/esm/vs/language/json/jsonMode.js ***!
\*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CompletionAdapter\": () => (/* binding */ CompletionAdapter),\n/* harmony export */ \"DefinitionAdapter\": () => (/* binding */ DefinitionAdapter),\n/* harmony export */ \"DiagnosticsAdapter\": () => (/* binding */ DiagnosticsAdapter),\n/* harmony export */ \"DocumentColorAdapter\": () => (/* binding */ DocumentColorAdapter),\n/* harmony export */ \"DocumentFormattingEditProvider\": () => (/* binding */ DocumentFormattingEditProvider),\n/* harmony export */ \"DocumentHighlightAdapter\": () => (/* binding */ DocumentHighlightAdapter),\n/* harmony export */ \"DocumentLinkAdapter\": () => (/* binding */ DocumentLinkAdapter),\n/* harmony export */ \"DocumentRangeFormattingEditProvider\": () => (/* binding */ DocumentRangeFormattingEditProvider),\n/* harmony export */ \"DocumentSymbolAdapter\": () => (/* binding */ DocumentSymbolAdapter),\n/* harmony export */ \"FoldingRangeAdapter\": () => (/* binding */ FoldingRangeAdapter),\n/* harmony export */ \"HoverAdapter\": () => (/* binding */ HoverAdapter),\n/* harmony export */ \"ReferenceAdapter\": () => (/* binding */ ReferenceAdapter),\n/* harmony export */ \"RenameAdapter\": () => (/* binding */ RenameAdapter),\n/* harmony export */ \"SelectionRangeAdapter\": () => (/* binding */ SelectionRangeAdapter),\n/* harmony export */ \"WorkerManager\": () => (/* binding */ WorkerManager),\n/* harmony export */ \"fromPosition\": () => (/* binding */ fromPosition),\n/* harmony export */ \"fromRange\": () => (/* binding */ fromRange),\n/* harmony export */ \"setupMode\": () => (/* binding */ setupMode),\n/* harmony export */ \"toRange\": () => (/* binding */ toRange),\n/* harmony export */ \"toTextEdit\": () => (/* binding */ toTextEdit)\n/* harmony export */ });\n/* harmony import */ var _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.api.js */ \"./node_modules/monaco-editor/esm/vs/editor/editor.api.js\");\n/*!-----------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4)\n * Released under the MIT license\n * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt\n *-----------------------------------------------------------------------------*/\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __reExport = (target, module, copyDefault, desc) => {\n if (module && typeof module === \"object\" || typeof module === \"function\") {\n for (let key of __getOwnPropNames(module))\n if (!__hasOwnProp.call(target, key) && (copyDefault || key !== \"default\"))\n __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });\n }\n return target;\n};\n\n// src/fillers/monaco-editor-core.ts\nvar monaco_editor_core_exports = {};\n__reExport(monaco_editor_core_exports, _editor_editor_api_js__WEBPACK_IMPORTED_MODULE_0__);\n\n\n// src/language/json/workerManager.ts\nvar STOP_WHEN_IDLE_FOR = 2 * 60 * 1e3;\nvar WorkerManager = class {\n _defaults;\n _idleCheckInterval;\n _lastUsedTime;\n _configChangeListener;\n _worker;\n _client;\n constructor(defaults) {\n this._defaults = defaults;\n this._worker = null;\n this._client = null;\n this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 30 * 1e3);\n this._lastUsedTime = 0;\n this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker());\n }\n _stopWorker() {\n if (this._worker) {\n this._worker.dispose();\n this._worker = null;\n }\n this._client = null;\n }\n dispose() {\n clearInterval(this._idleCheckInterval);\n this._configChangeListener.dispose();\n this._stopWorker();\n }\n _checkIfIdle() {\n if (!this._worker) {\n return;\n }\n let timePassedSinceLastUsed = Date.now() - this._lastUsedTime;\n if (timePassedSinceLastUsed > STOP_WHEN_IDLE_FOR) {\n this._stopWorker();\n }\n }\n _getClient() {\n this._lastUsedTime = Date.now();\n if (!this._client) {\n this._worker = monaco_editor_core_exports.editor.createWebWorker({\n moduleId: \"vs/language/json/jsonWorker\",\n label: this._defaults.languageId,\n createData: {\n languageSettings: this._defaults.diagnosticsOptions,\n languageId: this._defaults.languageId,\n enableSchemaRequest: this._defaults.diagnosticsOptions.enableSchemaRequest\n }\n });\n this._client = this._worker.getProxy();\n }\n return this._client;\n }\n getLanguageServiceWorker(...resources) {\n let _client;\n return this._getClient().then((client) => {\n _client = client;\n }).then((_) => {\n if (this._worker) {\n return this._worker.withSyncedResources(resources);\n }\n }).then((_) => _client);\n }\n};\n\n// node_modules/vscode-languageserver-types/lib/esm/main.js\nvar integer;\n(function(integer2) {\n integer2.MIN_VALUE = -2147483648;\n integer2.MAX_VALUE = 2147483647;\n})(integer || (integer = {}));\nvar uinteger;\n(function(uinteger2) {\n uinteger2.MIN_VALUE = 0;\n uinteger2.MAX_VALUE = 2147483647;\n})(uinteger || (uinteger = {}));\nvar Position;\n(function(Position3) {\n function create(line, character) {\n if (line === Number.MAX_VALUE) {\n line = uinteger.MAX_VALUE;\n }\n if (character === Number.MAX_VALUE) {\n character = uinteger.MAX_VALUE;\n }\n return { line, character };\n }\n Position3.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);\n }\n Position3.is = is;\n})(Position || (Position = {}));\nvar Range;\n(function(Range3) {\n function create(one, two, three, four) {\n if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {\n return { start: Position.create(one, two), end: Position.create(three, four) };\n } else if (Position.is(one) && Position.is(two)) {\n return { start: one, end: two };\n } else {\n throw new Error(\"Range#create called with invalid arguments[\" + one + \", \" + two + \", \" + three + \", \" + four + \"]\");\n }\n }\n Range3.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }\n Range3.is = is;\n})(Range || (Range = {}));\nvar Location;\n(function(Location2) {\n function create(uri, range) {\n return { uri, range };\n }\n Location2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));\n }\n Location2.is = is;\n})(Location || (Location = {}));\nvar LocationLink;\n(function(LocationLink2) {\n function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\n return { targetUri, targetRange, targetSelectionRange, originSelectionRange };\n }\n LocationLink2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));\n }\n LocationLink2.is = is;\n})(LocationLink || (LocationLink = {}));\nvar Color;\n(function(Color2) {\n function create(red, green, blue, alpha) {\n return {\n red,\n green,\n blue,\n alpha\n };\n }\n Color2.create = create;\n function is(value) {\n var candidate = value;\n return Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);\n }\n Color2.is = is;\n})(Color || (Color = {}));\nvar ColorInformation;\n(function(ColorInformation2) {\n function create(range, color) {\n return {\n range,\n color\n };\n }\n ColorInformation2.create = create;\n function is(value) {\n var candidate = value;\n return Range.is(candidate.range) && Color.is(candidate.color);\n }\n ColorInformation2.is = is;\n})(ColorInformation || (ColorInformation = {}));\nvar ColorPresentation;\n(function(ColorPresentation2) {\n function create(label, textEdit, additionalTextEdits) {\n return {\n label,\n textEdit,\n additionalTextEdits\n };\n }\n ColorPresentation2.create = create;\n function is(value) {\n var candidate = value;\n return Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));\n }\n ColorPresentation2.is = is;\n})(ColorPresentation || (ColorPresentation = {}));\nvar FoldingRangeKind;\n(function(FoldingRangeKind2) {\n FoldingRangeKind2[\"Comment\"] = \"comment\";\n FoldingRangeKind2[\"Imports\"] = \"imports\";\n FoldingRangeKind2[\"Region\"] = \"region\";\n})(FoldingRangeKind || (FoldingRangeKind = {}));\nvar FoldingRange;\n(function(FoldingRange2) {\n function create(startLine, endLine, startCharacter, endCharacter, kind) {\n var result = {\n startLine,\n endLine\n };\n if (Is.defined(startCharacter)) {\n result.startCharacter = startCharacter;\n }\n if (Is.defined(endCharacter)) {\n result.endCharacter = endCharacter;\n }\n if (Is.defined(kind)) {\n result.kind = kind;\n }\n return result;\n }\n FoldingRange2.create = create;\n function is(value) {\n var candidate = value;\n return Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind));\n }\n FoldingRange2.is = is;\n})(FoldingRange || (FoldingRange = {}));\nvar DiagnosticRelatedInformation;\n(function(DiagnosticRelatedInformation2) {\n function create(location, message) {\n return {\n location,\n message\n };\n }\n DiagnosticRelatedInformation2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);\n }\n DiagnosticRelatedInformation2.is = is;\n})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));\nvar DiagnosticSeverity;\n(function(DiagnosticSeverity2) {\n DiagnosticSeverity2.Error = 1;\n DiagnosticSeverity2.Warning = 2;\n DiagnosticSeverity2.Information = 3;\n DiagnosticSeverity2.Hint = 4;\n})(DiagnosticSeverity || (DiagnosticSeverity = {}));\nvar DiagnosticTag;\n(function(DiagnosticTag2) {\n DiagnosticTag2.Unnecessary = 1;\n DiagnosticTag2.Deprecated = 2;\n})(DiagnosticTag || (DiagnosticTag = {}));\nvar CodeDescription;\n(function(CodeDescription2) {\n function is(value) {\n var candidate = value;\n return candidate !== void 0 && candidate !== null && Is.string(candidate.href);\n }\n CodeDescription2.is = is;\n})(CodeDescription || (CodeDescription = {}));\nvar Diagnostic;\n(function(Diagnostic2) {\n function create(range, message, severity, code, source, relatedInformation) {\n var result = { range, message };\n if (Is.defined(severity)) {\n result.severity = severity;\n }\n if (Is.defined(code)) {\n result.code = code;\n }\n if (Is.defined(source)) {\n result.source = source;\n }\n if (Is.defined(relatedInformation)) {\n result.relatedInformation = relatedInformation;\n }\n return result;\n }\n Diagnostic2.create = create;\n function is(value) {\n var _a;\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));\n }\n Diagnostic2.is = is;\n})(Diagnostic || (Diagnostic = {}));\nvar Command;\n(function(Command2) {\n function create(title, command) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var result = { title, command };\n if (Is.defined(args) && args.length > 0) {\n result.arguments = args;\n }\n return result;\n }\n Command2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);\n }\n Command2.is = is;\n})(Command || (Command = {}));\nvar TextEdit;\n(function(TextEdit2) {\n function replace(range, newText) {\n return { range, newText };\n }\n TextEdit2.replace = replace;\n function insert(position, newText) {\n return { range: { start: position, end: position }, newText };\n }\n TextEdit2.insert = insert;\n function del(range) {\n return { range, newText: \"\" };\n }\n TextEdit2.del = del;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);\n }\n TextEdit2.is = is;\n})(TextEdit || (TextEdit = {}));\nvar ChangeAnnotation;\n(function(ChangeAnnotation2) {\n function create(label, needsConfirmation, description) {\n var result = { label };\n if (needsConfirmation !== void 0) {\n result.needsConfirmation = needsConfirmation;\n }\n if (description !== void 0) {\n result.description = description;\n }\n return result;\n }\n ChangeAnnotation2.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== void 0 && Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);\n }\n ChangeAnnotation2.is = is;\n})(ChangeAnnotation || (ChangeAnnotation = {}));\nvar ChangeAnnotationIdentifier;\n(function(ChangeAnnotationIdentifier2) {\n function is(value) {\n var candidate = value;\n return typeof candidate === \"string\";\n }\n ChangeAnnotationIdentifier2.is = is;\n})(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));\nvar AnnotatedTextEdit;\n(function(AnnotatedTextEdit2) {\n function replace(range, newText, annotation) {\n return { range, newText, annotationId: annotation };\n }\n AnnotatedTextEdit2.replace = replace;\n function insert(position, newText, annotation) {\n return { range: { start: position, end: position }, newText, annotationId: annotation };\n }\n AnnotatedTextEdit2.insert = insert;\n function del(range, annotation) {\n return { range, newText: \"\", annotationId: annotation };\n }\n AnnotatedTextEdit2.del = del;\n function is(value) {\n var candidate = value;\n return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n AnnotatedTextEdit2.is = is;\n})(AnnotatedTextEdit || (AnnotatedTextEdit = {}));\nvar TextDocumentEdit;\n(function(TextDocumentEdit2) {\n function create(textDocument, edits) {\n return { textDocument, edits };\n }\n TextDocumentEdit2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);\n }\n TextDocumentEdit2.is = is;\n})(TextDocumentEdit || (TextDocumentEdit = {}));\nvar CreateFile;\n(function(CreateFile2) {\n function create(uri, options, annotation) {\n var result = {\n kind: \"create\",\n uri\n };\n if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {\n result.options = options;\n }\n if (annotation !== void 0) {\n result.annotationId = annotation;\n }\n return result;\n }\n CreateFile2.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === \"create\" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n CreateFile2.is = is;\n})(CreateFile || (CreateFile = {}));\nvar RenameFile;\n(function(RenameFile2) {\n function create(oldUri, newUri, options, annotation) {\n var result = {\n kind: \"rename\",\n oldUri,\n newUri\n };\n if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {\n result.options = options;\n }\n if (annotation !== void 0) {\n result.annotationId = annotation;\n }\n return result;\n }\n RenameFile2.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === \"rename\" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n RenameFile2.is = is;\n})(RenameFile || (RenameFile = {}));\nvar DeleteFile;\n(function(DeleteFile2) {\n function create(uri, options, annotation) {\n var result = {\n kind: \"delete\",\n uri\n };\n if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {\n result.options = options;\n }\n if (annotation !== void 0) {\n result.annotationId = annotation;\n }\n return result;\n }\n DeleteFile2.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === \"delete\" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n DeleteFile2.is = is;\n})(DeleteFile || (DeleteFile = {}));\nvar WorkspaceEdit;\n(function(WorkspaceEdit2) {\n function is(value) {\n var candidate = value;\n return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every(function(change) {\n if (Is.string(change.kind)) {\n return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);\n } else {\n return TextDocumentEdit.is(change);\n }\n }));\n }\n WorkspaceEdit2.is = is;\n})(WorkspaceEdit || (WorkspaceEdit = {}));\nvar TextEditChangeImpl = function() {\n function TextEditChangeImpl2(edits, changeAnnotations) {\n this.edits = edits;\n this.changeAnnotations = changeAnnotations;\n }\n TextEditChangeImpl2.prototype.insert = function(position, newText, annotation) {\n var edit;\n var id;\n if (annotation === void 0) {\n edit = TextEdit.insert(position, newText);\n } else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.insert(position, newText, annotation);\n } else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.insert(position, newText, id);\n }\n this.edits.push(edit);\n if (id !== void 0) {\n return id;\n }\n };\n TextEditChangeImpl2.prototype.replace = function(range, newText, annotation) {\n var edit;\n var id;\n if (annotation === void 0) {\n edit = TextEdit.replace(range, newText);\n } else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.replace(range, newText, annotation);\n } else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.replace(range, newText, id);\n }\n this.edits.push(edit);\n if (id !== void 0) {\n return id;\n }\n };\n TextEditChangeImpl2.prototype.delete = function(range, annotation) {\n var edit;\n var id;\n if (annotation === void 0) {\n edit = TextEdit.del(range);\n } else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.del(range, annotation);\n } else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.del(range, id);\n }\n this.edits.push(edit);\n if (id !== void 0) {\n return id;\n }\n };\n TextEditChangeImpl2.prototype.add = function(edit) {\n this.edits.push(edit);\n };\n TextEditChangeImpl2.prototype.all = function() {\n return this.edits;\n };\n TextEditChangeImpl2.prototype.clear = function() {\n this.edits.splice(0, this.edits.length);\n };\n TextEditChangeImpl2.prototype.assertChangeAnnotations = function(value) {\n if (value === void 0) {\n throw new Error(\"Text edit change is not configured to manage change annotations.\");\n }\n };\n return TextEditChangeImpl2;\n}();\nvar ChangeAnnotations = function() {\n function ChangeAnnotations2(annotations) {\n this._annotations = annotations === void 0 ? /* @__PURE__ */ Object.create(null) : annotations;\n this._counter = 0;\n this._size = 0;\n }\n ChangeAnnotations2.prototype.all = function() {\n return this._annotations;\n };\n Object.defineProperty(ChangeAnnotations2.prototype, \"size\", {\n get: function() {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n ChangeAnnotations2.prototype.manage = function(idOrAnnotation, annotation) {\n var id;\n if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {\n id = idOrAnnotation;\n } else {\n id = this.nextId();\n annotation = idOrAnnotation;\n }\n if (this._annotations[id] !== void 0) {\n throw new Error(\"Id \" + id + \" is already in use.\");\n }\n if (annotation === void 0) {\n throw new Error(\"No annotation provided for id \" + id);\n }\n this._annotations[id] = annotation;\n this._size++;\n return id;\n };\n ChangeAnnotations2.prototype.nextId = function() {\n this._counter++;\n return this._counter.toString();\n };\n return ChangeAnnotations2;\n}();\nvar WorkspaceChange = function() {\n function WorkspaceChange2(workspaceEdit) {\n var _this = this;\n this._textEditChanges = /* @__PURE__ */ Object.create(null);\n if (workspaceEdit !== void 0) {\n this._workspaceEdit = workspaceEdit;\n if (workspaceEdit.documentChanges) {\n this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);\n workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n workspaceEdit.documentChanges.forEach(function(change) {\n if (TextDocumentEdit.is(change)) {\n var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);\n _this._textEditChanges[change.textDocument.uri] = textEditChange;\n }\n });\n } else if (workspaceEdit.changes) {\n Object.keys(workspaceEdit.changes).forEach(function(key) {\n var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);\n _this._textEditChanges[key] = textEditChange;\n });\n }\n } else {\n this._workspaceEdit = {};\n }\n }\n Object.defineProperty(WorkspaceChange2.prototype, \"edit\", {\n get: function() {\n this.initDocumentChanges();\n if (this._changeAnnotations !== void 0) {\n if (this._changeAnnotations.size === 0) {\n this._workspaceEdit.changeAnnotations = void 0;\n } else {\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n }\n return this._workspaceEdit;\n },\n enumerable: false,\n configurable: true\n });\n WorkspaceChange2.prototype.getTextEditChange = function(key) {\n if (OptionalVersionedTextDocumentIdentifier.is(key)) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === void 0) {\n throw new Error(\"Workspace edit is not configured for document changes.\");\n }\n var textDocument = { uri: key.uri, version: key.version };\n var result = this._textEditChanges[textDocument.uri];\n if (!result) {\n var edits = [];\n var textDocumentEdit = {\n textDocument,\n edits\n };\n this._workspaceEdit.documentChanges.push(textDocumentEdit);\n result = new TextEditChangeImpl(edits, this._changeAnnotations);\n this._textEditChanges[textDocument.uri] = result;\n }\n return result;\n } else {\n this.initChanges();\n if (this._workspaceEdit.changes === void 0) {\n throw new Error(\"Workspace edit is not configured for normal text edit changes.\");\n }\n var result = this._textEditChanges[key];\n if (!result) {\n var edits = [];\n this._workspaceEdit.changes[key] = edits;\n result = new TextEditChangeImpl(edits);\n this._textEditChanges[key] = result;\n }\n return result;\n }\n };\n WorkspaceChange2.prototype.initDocumentChanges = function() {\n if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {\n this._changeAnnotations = new ChangeAnnotations();\n this._workspaceEdit.documentChanges = [];\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n };\n WorkspaceChange2.prototype.initChanges = function() {\n if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {\n this._workspaceEdit.changes = /* @__PURE__ */ Object.create(null);\n }\n };\n WorkspaceChange2.prototype.createFile = function(uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === void 0) {\n throw new Error(\"Workspace edit is not configured for document changes.\");\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n } else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === void 0) {\n operation = CreateFile.create(uri, options);\n } else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = CreateFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== void 0) {\n return id;\n }\n };\n WorkspaceChange2.prototype.renameFile = function(oldUri, newUri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === void 0) {\n throw new Error(\"Workspace edit is not configured for document changes.\");\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n } else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === void 0) {\n operation = RenameFile.create(oldUri, newUri, options);\n } else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = RenameFile.create(oldUri, newUri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== void 0) {\n return id;\n }\n };\n WorkspaceChange2.prototype.deleteFile = function(uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === void 0) {\n throw new Error(\"Workspace edit is not configured for document changes.\");\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n } else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === void 0) {\n operation = DeleteFile.create(uri, options);\n } else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = DeleteFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== void 0) {\n return id;\n }\n };\n return WorkspaceChange2;\n}();\nvar TextDocumentIdentifier;\n(function(TextDocumentIdentifier2) {\n function create(uri) {\n return { uri };\n }\n TextDocumentIdentifier2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri);\n }\n TextDocumentIdentifier2.is = is;\n})(TextDocumentIdentifier || (TextDocumentIdentifier = {}));\nvar VersionedTextDocumentIdentifier;\n(function(VersionedTextDocumentIdentifier2) {\n function create(uri, version) {\n return { uri, version };\n }\n VersionedTextDocumentIdentifier2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);\n }\n VersionedTextDocumentIdentifier2.is = is;\n})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));\nvar OptionalVersionedTextDocumentIdentifier;\n(function(OptionalVersionedTextDocumentIdentifier2) {\n function create(uri, version) {\n return { uri, version };\n }\n OptionalVersionedTextDocumentIdentifier2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));\n }\n OptionalVersionedTextDocumentIdentifier2.is = is;\n})(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));\nvar TextDocumentItem;\n(function(TextDocumentItem2) {\n function create(uri, languageId, version, text) {\n return { uri, languageId, version, text };\n }\n TextDocumentItem2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);\n }\n TextDocumentItem2.is = is;\n})(TextDocumentItem || (TextDocumentItem = {}));\nvar MarkupKind;\n(function(MarkupKind2) {\n MarkupKind2.PlainText = \"plaintext\";\n MarkupKind2.Markdown = \"markdown\";\n})(MarkupKind || (MarkupKind = {}));\n(function(MarkupKind2) {\n function is(value) {\n var candidate = value;\n return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown;\n }\n MarkupKind2.is = is;\n})(MarkupKind || (MarkupKind = {}));\nvar MarkupContent;\n(function(MarkupContent2) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }\n MarkupContent2.is = is;\n})(MarkupContent || (MarkupContent = {}));\nvar CompletionItemKind;\n(function(CompletionItemKind2) {\n CompletionItemKind2.Text = 1;\n CompletionItemKind2.Method = 2;\n CompletionItemKind2.Function = 3;\n CompletionItemKind2.Constructor = 4;\n CompletionItemKind2.Field = 5;\n CompletionItemKind2.Variable = 6;\n CompletionItemKind2.Class = 7;\n CompletionItemKind2.Interface = 8;\n CompletionItemKind2.Module = 9;\n CompletionItemKind2.Property = 10;\n CompletionItemKind2.Unit = 11;\n CompletionItemKind2.Value = 12;\n CompletionItemKind2.Enum = 13;\n CompletionItemKind2.Keyword = 14;\n CompletionItemKind2.Snippet = 15;\n CompletionItemKind2.Color = 16;\n CompletionItemKind2.File = 17;\n CompletionItemKind2.Reference = 18;\n CompletionItemKind2.Folder = 19;\n CompletionItemKind2.EnumMember = 20;\n CompletionItemKind2.Constant = 21;\n CompletionItemKind2.Struct = 22;\n CompletionItemKind2.Event = 23;\n CompletionItemKind2.Operator = 24;\n CompletionItemKind2.TypeParameter = 25;\n})(CompletionItemKind || (CompletionItemKind = {}));\nvar InsertTextFormat;\n(function(InsertTextFormat2) {\n InsertTextFormat2.PlainText = 1;\n InsertTextFormat2.Snippet = 2;\n})(InsertTextFormat || (InsertTextFormat = {}));\nvar CompletionItemTag;\n(function(CompletionItemTag2) {\n CompletionItemTag2.Deprecated = 1;\n})(CompletionItemTag || (CompletionItemTag = {}));\nvar InsertReplaceEdit;\n(function(InsertReplaceEdit2) {\n function create(newText, insert, replace) {\n return { newText, insert, replace };\n }\n InsertReplaceEdit2.create = create;\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);\n }\n InsertReplaceEdit2.is = is;\n})(InsertReplaceEdit || (InsertReplaceEdit = {}));\nvar InsertTextMode;\n(function(InsertTextMode2) {\n InsertTextMode2.asIs = 1;\n InsertTextMode2.adjustIndentation = 2;\n})(InsertTextMode || (InsertTextMode = {}));\nvar CompletionItem;\n(function(CompletionItem2) {\n function create(label) {\n return { label };\n }\n CompletionItem2.create = create;\n})(CompletionItem || (CompletionItem = {}));\nvar CompletionList;\n(function(CompletionList2) {\n function create(items, isIncomplete) {\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\n }\n CompletionList2.create = create;\n})(CompletionList || (CompletionList = {}));\nvar MarkedString;\n(function(MarkedString2) {\n function fromPlainText(plainText) {\n return plainText.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, \"\\\\$&\");\n }\n MarkedString2.fromPlainText = fromPlainText;\n function is(value) {\n var candidate = value;\n return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);\n }\n MarkedString2.is = is;\n})(MarkedString || (MarkedString = {}));\nvar Hover;\n(function(Hover2) {\n function is(value) {\n var candidate = value;\n return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));\n }\n Hover2.is = is;\n})(Hover || (Hover = {}));\nvar ParameterInformation;\n(function(ParameterInformation2) {\n function create(label, documentation) {\n return documentation ? { label, documentation } : { label };\n }\n ParameterInformation2.create = create;\n})(ParameterInformation || (ParameterInformation = {}));\nvar SignatureInformation;\n(function(SignatureInformation2) {\n function create(label, documentation) {\n var parameters = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n parameters[_i - 2] = arguments[_i];\n }\n var result = { label };\n if (Is.defined(documentation)) {\n result.documentation = documentation;\n }\n if (Is.defined(parameters)) {\n result.parameters = parameters;\n } else {\n result.parameters = [];\n }\n return result;\n }\n SignatureInformation2.create = create;\n})(SignatureInformation || (SignatureInformation = {}));\nvar DocumentHighlightKind;\n(function(DocumentHighlightKind2) {\n DocumentHighlightKind2.Text = 1;\n DocumentHighlightKind2.Read = 2;\n DocumentHighlightKind2.Write = 3;\n})(DocumentHighlightKind || (DocumentHighlightKind = {}));\nvar DocumentHighlight;\n(function(DocumentHighlight2) {\n function create(range, kind) {\n var result = { range };\n if (Is.number(kind)) {\n result.kind = kind;\n }\n return result;\n }\n DocumentHighlight2.create = create;\n})(DocumentHighlight || (DocumentHighlight = {}));\nvar SymbolKind;\n(function(SymbolKind2) {\n SymbolKind2.File = 1;\n SymbolKind2.Module = 2;\n SymbolKind2.Namespace = 3;\n SymbolKind2.Package = 4;\n SymbolKind2.Class = 5;\n SymbolKind2.Method = 6;\n SymbolKind2.Property = 7;\n SymbolKind2.Field = 8;\n SymbolKind2.Constructor = 9;\n SymbolKind2.Enum = 10;\n SymbolKind2.Interface = 11;\n SymbolKind2.Function = 12;\n SymbolKind2.Variable = 13;\n SymbolKind2.Constant = 14;\n SymbolKind2.String = 15;\n SymbolKind2.Number = 16;\n SymbolKind2.Boolean = 17;\n SymbolKind2.Array = 18;\n SymbolKind2.Object = 19;\n SymbolKind2.Key = 20;\n SymbolKind2.Null = 21;\n SymbolKind2.EnumMember = 22;\n SymbolKind2.Struct = 23;\n SymbolKind2.Event = 24;\n SymbolKind2.Operator = 25;\n SymbolKind2.TypeParameter = 26;\n})(SymbolKind || (SymbolKind = {}));\nvar SymbolTag;\n(function(SymbolTag2) {\n SymbolTag2.Deprecated = 1;\n})(SymbolTag || (SymbolTag = {}));\nvar SymbolInformation;\n(function(SymbolInformation2) {\n function create(name, kind, range, uri, containerName) {\n var result = {\n name,\n kind,\n location: { uri, range }\n };\n if (containerName) {\n result.containerName = containerName;\n }\n return result;\n }\n SymbolInformation2.create = create;\n})(SymbolInformation || (SymbolInformation = {}));\nvar DocumentSymbol;\n(function(DocumentSymbol2) {\n function create(name, detail, kind, range, selectionRange, children) {\n var result = {\n name,\n detail,\n kind,\n range,\n selectionRange\n };\n if (children !== void 0) {\n result.children = children;\n }\n return result;\n }\n DocumentSymbol2.create = create;\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags));\n }\n DocumentSymbol2.is = is;\n})(DocumentSymbol || (DocumentSymbol = {}));\nvar CodeActionKind;\n(function(CodeActionKind2) {\n CodeActionKind2.Empty = \"\";\n CodeActionKind2.QuickFix = \"quickfix\";\n CodeActionKind2.Refactor = \"refactor\";\n CodeActionKind2.RefactorExtract = \"refactor.extract\";\n CodeActionKind2.RefactorInline = \"refactor.inline\";\n CodeActionKind2.RefactorRewrite = \"refactor.rewrite\";\n CodeActionKind2.Source = \"source\";\n CodeActionKind2.SourceOrganizeImports = \"source.organizeImports\";\n CodeActionKind2.SourceFixAll = \"source.fixAll\";\n})(CodeActionKind || (CodeActionKind = {}));\nvar CodeActionContext;\n(function(CodeActionContext2) {\n function create(diagnostics, only) {\n var result = { diagnostics };\n if (only !== void 0 && only !== null) {\n result.only = only;\n }\n return result;\n }\n CodeActionContext2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\n }\n CodeActionContext2.is = is;\n})(CodeActionContext || (CodeActionContext = {}));\nvar CodeAction;\n(function(CodeAction2) {\n function create(title, kindOrCommandOrEdit, kind) {\n var result = { title };\n var checkKind = true;\n if (typeof kindOrCommandOrEdit === \"string\") {\n checkKind = false;\n result.kind = kindOrCommandOrEdit;\n } else if (Command.is(kindOrCommandOrEdit)) {\n result.command = kindOrCommandOrEdit;\n } else {\n result.edit = kindOrCommandOrEdit;\n }\n if (checkKind && kind !== void 0) {\n result.kind = kind;\n }\n return result;\n }\n CodeAction2.create = create;\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));\n }\n CodeAction2.is = is;\n})(CodeAction || (CodeAction = {}));\nvar CodeLens;\n(function(CodeLens2) {\n function create(range, data) {\n var result = { range };\n if (Is.defined(data)) {\n result.data = data;\n }\n return result;\n }\n CodeLens2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));\n }\n CodeLens2.is = is;\n})(CodeLens || (CodeLens = {}));\nvar FormattingOptions;\n(function(FormattingOptions2) {\n function create(tabSize, insertSpaces) {\n return { tabSize, insertSpaces };\n }\n FormattingOptions2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);\n }\n FormattingOptions2.is = is;\n})(FormattingOptions || (FormattingOptions = {}));\nvar DocumentLink;\n(function(DocumentLink2) {\n function create(range, target, data) {\n return { range, target, data };\n }\n DocumentLink2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));\n }\n DocumentLink2.is = is;\n})(DocumentLink || (DocumentLink = {}));\nvar SelectionRange;\n(function(SelectionRange2) {\n function create(range, parent) {\n return { range, parent };\n }\n SelectionRange2.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== void 0 && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));\n }\n SelectionRange2.is = is;\n})(SelectionRange || (SelectionRange = {}));\nvar TextDocument;\n(function(TextDocument2) {\n function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }\n TextDocument2.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }\n TextDocument2.is = is;\n function applyEdits(document, edits) {\n var text = document.getText();\n var sortedEdits = mergeSort(edits, function(a, b) {\n var diff = a.range.start.line - b.range.start.line;\n if (diff === 0) {\n return a.range.start.character - b.range.start.character;\n }\n return diff;\n });\n var lastModifiedOffset = text.length;\n for (var i = sortedEdits.length - 1; i >= 0; i--) {\n var e = sortedEdits[i];\n var startOffset = document.offsetAt(e.range.start);\n var endOffset = document.offsetAt(e.range.end);\n if (endOffset <= lastModifiedOffset) {\n text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\n } else {\n throw new Error(\"Overlapping edit\");\n }\n lastModifiedOffset = startOffset;\n }\n return text;\n }\n TextDocument2.applyEdits = applyEdits;\n function mergeSort(data, compare) {\n if (data.length <= 1) {\n return data;\n }\n var p = data.length / 2 | 0;\n var left = data.slice(0, p);\n var right = data.slice(p);\n mergeSort(left, compare);\n mergeSort(right, compare);\n var leftIdx = 0;\n var rightIdx = 0;\n var i = 0;\n while (leftIdx < left.length && rightIdx < right.length) {\n var ret = compare(left[leftIdx], right[rightIdx]);\n if (ret <= 0) {\n data[i++] = left[leftIdx++];\n } else {\n data[i++] = right[rightIdx++];\n }\n }\n while (leftIdx < left.length) {\n data[i++] = left[leftIdx++];\n }\n while (rightIdx < right.length) {\n data[i++] = right[rightIdx++];\n }\n return data;\n }\n})(TextDocument || (TextDocument = {}));\nvar FullTextDocument = function() {\n function FullTextDocument2(uri, languageId, version, content) {\n this._uri = uri;\n this._languageId = languageId;\n this._version = version;\n this._content = content;\n this._lineOffsets = void 0;\n }\n Object.defineProperty(FullTextDocument2.prototype, \"uri\", {\n get: function() {\n return this._uri;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument2.prototype, \"languageId\", {\n get: function() {\n return this._languageId;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument2.prototype, \"version\", {\n get: function() {\n return this._version;\n },\n enumerable: false,\n configurable: true\n });\n FullTextDocument2.prototype.getText = function(range) {\n if (range) {\n var start = this.offsetAt(range.start);\n var end = this.offsetAt(range.end);\n return this._content.substring(start, end);\n }\n return this._content;\n };\n FullTextDocument2.prototype.update = function(event, version) {\n this._content = event.text;\n this._version = version;\n this._lineOffsets = void 0;\n };\n FullTextDocument2.prototype.getLineOffsets = function() {\n if (this._lineOffsets === void 0) {\n var lineOffsets = [];\n var text = this._content;\n var isLineStart = true;\n for (var i = 0; i < text.length; i++) {\n if (isLineStart) {\n lineOffsets.push(i);\n isLineStart = false;\n }\n var ch = text.charAt(i);\n isLineStart = ch === \"\\r\" || ch === \"\\n\";\n if (ch === \"\\r\" && i + 1 < text.length && text.charAt(i + 1) === \"\\n\") {\n i++;\n }\n }\n if (isLineStart && text.length > 0) {\n lineOffsets.push(text.length);\n }\n this._lineOffsets = lineOffsets;\n }\n return this._lineOffsets;\n };\n FullTextDocument2.prototype.positionAt = function(offset) {\n offset = Math.max(Math.min(offset, this._content.length), 0);\n var lineOffsets = this.getLineOffsets();\n var low = 0, high = lineOffsets.length;\n if (high === 0) {\n return Position.create(0, offset);\n }\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (lineOffsets[mid] > offset) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n var line = low - 1;\n return Position.create(line, offset - lineOffsets[line]);\n };\n FullTextDocument2.prototype.offsetAt = function(position) {\n var lineOffsets = this.getLineOffsets();\n if (position.line >= lineOffsets.length) {\n return this._content.length;\n } else if (position.line < 0) {\n return 0;\n }\n var lineOffset = lineOffsets[position.line];\n var nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;\n return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\n };\n Object.defineProperty(FullTextDocument2.prototype, \"lineCount\", {\n get: function() {\n return this.getLineOffsets().length;\n },\n enumerable: false,\n configurable: true\n });\n return FullTextDocument2;\n}();\nvar Is;\n(function(Is2) {\n var toString = Object.prototype.toString;\n function defined(value) {\n return typeof value !== \"undefined\";\n }\n Is2.defined = defined;\n function undefined2(value) {\n return typeof value === \"undefined\";\n }\n Is2.undefined = undefined2;\n function boolean(value) {\n return value === true || value === false;\n }\n Is2.boolean = boolean;\n function string(value) {\n return toString.call(value) === \"[object String]\";\n }\n Is2.string = string;\n function number(value) {\n return toString.call(value) === \"[object Number]\";\n }\n Is2.number = number;\n function numberRange(value, min, max) {\n return toString.call(value) === \"[object Number]\" && min <= value && value <= max;\n }\n Is2.numberRange = numberRange;\n function integer2(value) {\n return toString.call(value) === \"[object Number]\" && -2147483648 <= value && value <= 2147483647;\n }\n Is2.integer = integer2;\n function uinteger2(value) {\n return toString.call(value) === \"[object Number]\" && 0 <= value && value <= 2147483647;\n }\n Is2.uinteger = uinteger2;\n function func(value) {\n return toString.call(value) === \"[object Function]\";\n }\n Is2.func = func;\n function objectLiteral(value) {\n return value !== null && typeof value === \"object\";\n }\n Is2.objectLiteral = objectLiteral;\n function typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n }\n Is2.typedArray = typedArray;\n})(Is || (Is = {}));\n\n// src/language/common/lspLanguageFeatures.ts\nvar DiagnosticsAdapter = class {\n constructor(_languageId, _worker, configChangeEvent) {\n this._languageId = _languageId;\n this._worker = _worker;\n const onModelAdd = (model) => {\n let modeId = model.getLanguageId();\n if (modeId !== this._languageId) {\n return;\n }\n let handle;\n this._listener[model.uri.toString()] = model.onDidChangeContent(() => {\n window.clearTimeout(handle);\n handle = window.setTimeout(() => this._doValidate(model.uri, modeId), 500);\n });\n this._doValidate(model.uri, modeId);\n };\n const onModelRemoved = (model) => {\n monaco_editor_core_exports.editor.setModelMarkers(model, this._languageId, []);\n let uriStr = model.uri.toString();\n let listener = this._listener[uriStr];\n if (listener) {\n listener.dispose();\n delete this._listener[uriStr];\n }\n };\n this._disposables.push(monaco_editor_core_exports.editor.onDidCreateModel(onModelAdd));\n this._disposables.push(monaco_editor_core_exports.editor.onWillDisposeModel(onModelRemoved));\n this._disposables.push(monaco_editor_core_exports.editor.onDidChangeModelLanguage((event) => {\n onModelRemoved(event.model);\n onModelAdd(event.model);\n }));\n this._disposables.push(configChangeEvent((_) => {\n monaco_editor_core_exports.editor.getModels().forEach((model) => {\n if (model.getLanguageId() === this._languageId) {\n onModelRemoved(model);\n onModelAdd(model);\n }\n });\n }));\n this._disposables.push({\n dispose: () => {\n monaco_editor_core_exports.editor.getModels().forEach(onModelRemoved);\n for (let key in this._listener) {\n this._listener[key].dispose();\n }\n }\n });\n monaco_editor_core_exports.editor.getModels().forEach(onModelAdd);\n }\n _disposables = [];\n _listener = /* @__PURE__ */ Object.create(null);\n dispose() {\n this._disposables.forEach((d) => d && d.dispose());\n this._disposables.length = 0;\n }\n _doValidate(resource, languageId) {\n this._worker(resource).then((worker) => {\n return worker.doValidation(resource.toString());\n }).then((diagnostics) => {\n const markers = diagnostics.map((d) => toDiagnostics(resource, d));\n let model = monaco_editor_core_exports.editor.getModel(resource);\n if (model && model.getLanguageId() === languageId) {\n monaco_editor_core_exports.editor.setModelMarkers(model, languageId, markers);\n }\n }).then(void 0, (err) => {\n console.error(err);\n });\n }\n};\nfunction toSeverity(lsSeverity) {\n switch (lsSeverity) {\n case DiagnosticSeverity.Error:\n return monaco_editor_core_exports.MarkerSeverity.Error;\n case DiagnosticSeverity.Warning:\n return monaco_editor_core_exports.MarkerSeverity.Warning;\n case DiagnosticSeverity.Information:\n return monaco_editor_core_exports.MarkerSeverity.Info;\n case DiagnosticSeverity.Hint:\n return monaco_editor_core_exports.MarkerSeverity.Hint;\n default:\n return monaco_editor_core_exports.MarkerSeverity.Info;\n }\n}\nfunction toDiagnostics(resource, diag) {\n let code = typeof diag.code === \"number\" ? String(diag.code) : diag.code;\n return {\n severity: toSeverity(diag.severity),\n startLineNumber: diag.range.start.line + 1,\n startColumn: diag.range.start.character + 1,\n endLineNumber: diag.range.end.line + 1,\n endColumn: diag.range.end.character + 1,\n message: diag.message,\n code,\n source: diag.source\n };\n}\nvar CompletionAdapter = class {\n constructor(_worker, _triggerCharacters) {\n this._worker = _worker;\n this._triggerCharacters = _triggerCharacters;\n }\n get triggerCharacters() {\n return this._triggerCharacters;\n }\n provideCompletionItems(model, position, context, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => {\n return worker.doComplete(resource.toString(), fromPosition(position));\n }).then((info) => {\n if (!info) {\n return;\n }\n const wordInfo = model.getWordUntilPosition(position);\n const wordRange = new monaco_editor_core_exports.Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);\n const items = info.items.map((entry) => {\n const item = {\n label: entry.label,\n insertText: entry.insertText || entry.label,\n sortText: entry.sortText,\n filterText: entry.filterText,\n documentation: entry.documentation,\n detail: entry.detail,\n command: toCommand(entry.command),\n range: wordRange,\n kind: toCompletionItemKind(entry.kind)\n };\n if (entry.textEdit) {\n if (isInsertReplaceEdit(entry.textEdit)) {\n item.range = {\n insert: toRange(entry.textEdit.insert),\n replace: toRange(entry.textEdit.replace)\n };\n } else {\n item.range = toRange(entry.textEdit.range);\n }\n item.insertText = entry.textEdit.newText;\n }\n if (entry.additionalTextEdits) {\n item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit);\n }\n if (entry.insertTextFormat === InsertTextFormat.Snippet) {\n item.insertTextRules = monaco_editor_core_exports.languages.CompletionItemInsertTextRule.InsertAsSnippet;\n }\n return item;\n });\n return {\n isIncomplete: info.isIncomplete,\n suggestions: items\n };\n });\n }\n};\nfunction fromPosition(position) {\n if (!position) {\n return void 0;\n }\n return { character: position.column - 1, line: position.lineNumber - 1 };\n}\nfunction fromRange(range) {\n if (!range) {\n return void 0;\n }\n return {\n start: {\n line: range.startLineNumber - 1,\n character: range.startColumn - 1\n },\n end: { line: range.endLineNumber - 1, character: range.endColumn - 1 }\n };\n}\nfunction toRange(range) {\n if (!range) {\n return void 0;\n }\n return new monaco_editor_core_exports.Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1);\n}\nfunction isInsertReplaceEdit(edit) {\n return typeof edit.insert !== \"undefined\" && typeof edit.replace !== \"undefined\";\n}\nfunction toCompletionItemKind(kind) {\n const mItemKind = monaco_editor_core_exports.languages.CompletionItemKind;\n switch (kind) {\n case CompletionItemKind.Text:\n return mItemKind.Text;\n case CompletionItemKind.Method:\n return mItemKind.Method;\n case CompletionItemKind.Function:\n return mItemKind.Function;\n case CompletionItemKind.Constructor:\n return mItemKind.Constructor;\n case CompletionItemKind.Field:\n return mItemKind.Field;\n case CompletionItemKind.Variable:\n return mItemKind.Variable;\n case CompletionItemKind.Class:\n return mItemKind.Class;\n case CompletionItemKind.Interface:\n return mItemKind.Interface;\n case CompletionItemKind.Module:\n return mItemKind.Module;\n case CompletionItemKind.Property:\n return mItemKind.Property;\n case CompletionItemKind.Unit:\n return mItemKind.Unit;\n case CompletionItemKind.Value:\n return mItemKind.Value;\n case CompletionItemKind.Enum:\n return mItemKind.Enum;\n case CompletionItemKind.Keyword:\n return mItemKind.Keyword;\n case CompletionItemKind.Snippet:\n return mItemKind.Snippet;\n case CompletionItemKind.Color:\n return mItemKind.Color;\n case CompletionItemKind.File:\n return mItemKind.File;\n case CompletionItemKind.Reference:\n return mItemKind.Reference;\n }\n return mItemKind.Property;\n}\nfunction toTextEdit(textEdit) {\n if (!textEdit) {\n return void 0;\n }\n return {\n range: toRange(textEdit.range),\n text: textEdit.newText\n };\n}\nfunction toCommand(c) {\n return c && c.command === \"editor.action.triggerSuggest\" ? { id: c.command, title: c.title, arguments: c.arguments } : void 0;\n}\nvar HoverAdapter = class {\n constructor(_worker) {\n this._worker = _worker;\n }\n provideHover(model, position, token) {\n let resource = model.uri;\n return this._worker(resource).then((worker) => {\n return worker.doHover(resource.toString(), fromPosition(position));\n }).then((info) => {\n if (!info) {\n return;\n }\n return {\n range: toRange(info.range),\n contents: toMarkedStringArray(info.contents)\n };\n });\n }\n};\nfunction isMarkupContent(thing) {\n return thing && typeof thing === \"object\" && typeof thing.kind === \"string\";\n}\nfunction toMarkdownString(entry) {\n if (typeof entry === \"string\") {\n return {\n value: entry\n };\n }\n if (isMarkupContent(entry)) {\n if (entry.kind === \"plaintext\") {\n return {\n value: entry.value.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, \"\\\\$&\")\n };\n }\n return {\n value: entry.value\n };\n }\n return { value: \"```\" + entry.language + \"\\n\" + entry.value + \"\\n```\\n\" };\n}\nfunction toMarkedStringArray(contents) {\n if (!contents) {\n return void 0;\n }\n if (Array.isArray(contents)) {\n return contents.map(toMarkdownString);\n }\n return [toMarkdownString(contents)];\n}\nvar DocumentHighlightAdapter = class {\n constructor(_worker) {\n this._worker = _worker;\n }\n provideDocumentHighlights(model, position, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => worker.findDocumentHighlights(resource.toString(), fromPosition(position))).then((entries) => {\n if (!entries) {\n return;\n }\n return entries.map((entry) => {\n return {\n range: toRange(entry.range),\n kind: toDocumentHighlightKind(entry.kind)\n };\n });\n });\n }\n};\nfunction toDocumentHighlightKind(kind) {\n switch (kind) {\n case DocumentHighlightKind.Read:\n return monaco_editor_core_exports.languages.DocumentHighlightKind.Read;\n case DocumentHighlightKind.Write:\n return monaco_editor_core_exports.languages.DocumentHighlightKind.Write;\n case DocumentHighlightKind.Text:\n return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;\n }\n return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;\n}\nvar DefinitionAdapter = class {\n constructor(_worker) {\n this._worker = _worker;\n }\n provideDefinition(model, position, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => {\n return worker.findDefinition(resource.toString(), fromPosition(position));\n }).then((definition) => {\n if (!definition) {\n return;\n }\n return [toLocation(definition)];\n });\n }\n};\nfunction toLocation(location) {\n return {\n uri: monaco_editor_core_exports.Uri.parse(location.uri),\n range: toRange(location.range)\n };\n}\nvar ReferenceAdapter = class {\n constructor(_worker) {\n this._worker = _worker;\n }\n provideReferences(model, position, context, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => {\n return worker.findReferences(resource.toString(), fromPosition(position));\n }).then((entries) => {\n if (!entries) {\n return;\n }\n return entries.map(toLocation);\n });\n }\n};\nvar RenameAdapter = class {\n constructor(_worker) {\n this._worker = _worker;\n }\n provideRenameEdits(model, position, newName, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => {\n return worker.doRename(resource.toString(), fromPosition(position), newName);\n }).then((edit) => {\n return toWorkspaceEdit(edit);\n });\n }\n};\nfunction toWorkspaceEdit(edit) {\n if (!edit || !edit.changes) {\n return void 0;\n }\n let resourceEdits = [];\n for (let uri in edit.changes) {\n const _uri = monaco_editor_core_exports.Uri.parse(uri);\n for (let e of edit.changes[uri]) {\n resourceEdits.push({\n resource: _uri,\n edit: {\n range: toRange(e.range),\n text: e.newText\n }\n });\n }\n }\n return {\n edits: resourceEdits\n };\n}\nvar DocumentSymbolAdapter = class {\n constructor(_worker) {\n this._worker = _worker;\n }\n provideDocumentSymbols(model, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => worker.findDocumentSymbols(resource.toString())).then((items) => {\n if (!items) {\n return;\n }\n return items.map((item) => ({\n name: item.name,\n detail: \"\",\n containerName: item.containerName,\n kind: toSymbolKind(item.kind),\n range: toRange(item.location.range),\n selectionRange: toRange(item.location.range),\n tags: []\n }));\n });\n }\n};\nfunction toSymbolKind(kind) {\n let mKind = monaco_editor_core_exports.languages.SymbolKind;\n switch (kind) {\n case SymbolKind.File:\n return mKind.Array;\n case SymbolKind.Module:\n return mKind.Module;\n case SymbolKind.Namespace:\n return mKind.Namespace;\n case SymbolKind.Package:\n return mKind.Package;\n case SymbolKind.Class:\n return mKind.Class;\n case SymbolKind.Method:\n return mKind.Method;\n case SymbolKind.Property:\n return mKind.Property;\n case SymbolKind.Field:\n return mKind.Field;\n case SymbolKind.Constructor:\n return mKind.Constructor;\n case SymbolKind.Enum:\n return mKind.Enum;\n case SymbolKind.Interface:\n return mKind.Interface;\n case SymbolKind.Function:\n return mKind.Function;\n case SymbolKind.Variable:\n return mKind.Variable;\n case SymbolKind.Constant:\n return mKind.Constant;\n case SymbolKind.String:\n return mKind.String;\n case SymbolKind.Number:\n return mKind.Number;\n case SymbolKind.Boolean:\n return mKind.Boolean;\n case SymbolKind.Array:\n return mKind.Array;\n }\n return mKind.Function;\n}\nvar DocumentLinkAdapter = class {\n constructor(_worker) {\n this._worker = _worker;\n }\n provideLinks(model, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => worker.findDocumentLinks(resource.toString())).then((items) => {\n if (!items) {\n return;\n }\n return {\n links: items.map((item) => ({\n range: toRange(item.range),\n url: item.target\n }))\n };\n });\n }\n};\nvar DocumentFormattingEditProvider = class {\n constructor(_worker) {\n this._worker = _worker;\n }\n provideDocumentFormattingEdits(model, options, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => {\n return worker.format(resource.toString(), null, fromFormattingOptions(options)).then((edits) => {\n if (!edits || edits.length === 0) {\n return;\n }\n return edits.map(toTextEdit);\n });\n });\n }\n};\nvar DocumentRangeFormattingEditProvider = class {\n constructor(_worker) {\n this._worker = _worker;\n }\n provideDocumentRangeFormattingEdits(model, range, options, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => {\n return worker.format(resource.toString(), fromRange(range), fromFormattingOptions(options)).then((edits) => {\n if (!edits || edits.length === 0) {\n return;\n }\n return edits.map(toTextEdit);\n });\n });\n }\n};\nfunction fromFormattingOptions(options) {\n return {\n tabSize: options.tabSize,\n insertSpaces: options.insertSpaces\n };\n}\nvar DocumentColorAdapter = class {\n constructor(_worker) {\n this._worker = _worker;\n }\n provideDocumentColors(model, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => worker.findDocumentColors(resource.toString())).then((infos) => {\n if (!infos) {\n return;\n }\n return infos.map((item) => ({\n color: item.color,\n range: toRange(item.range)\n }));\n });\n }\n provideColorPresentations(model, info, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => worker.getColorPresentations(resource.toString(), info.color, fromRange(info.range))).then((presentations) => {\n if (!presentations) {\n return;\n }\n return presentations.map((presentation) => {\n let item = {\n label: presentation.label\n };\n if (presentation.textEdit) {\n item.textEdit = toTextEdit(presentation.textEdit);\n }\n if (presentation.additionalTextEdits) {\n item.additionalTextEdits = presentation.additionalTextEdits.map(toTextEdit);\n }\n return item;\n });\n });\n }\n};\nvar FoldingRangeAdapter = class {\n constructor(_worker) {\n this._worker = _worker;\n }\n provideFoldingRanges(model, context, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => worker.getFoldingRanges(resource.toString(), context)).then((ranges) => {\n if (!ranges) {\n return;\n }\n return ranges.map((range) => {\n const result = {\n start: range.startLine + 1,\n end: range.endLine + 1\n };\n if (typeof range.kind !== \"undefined\") {\n result.kind = toFoldingRangeKind(range.kind);\n }\n return result;\n });\n });\n }\n};\nfunction toFoldingRangeKind(kind) {\n switch (kind) {\n case FoldingRangeKind.Comment:\n return monaco_editor_core_exports.languages.FoldingRangeKind.Comment;\n case FoldingRangeKind.Imports:\n return monaco_editor_core_exports.languages.FoldingRangeKind.Imports;\n case FoldingRangeKind.Region:\n return monaco_editor_core_exports.languages.FoldingRangeKind.Region;\n }\n return void 0;\n}\nvar SelectionRangeAdapter = class {\n constructor(_worker) {\n this._worker = _worker;\n }\n provideSelectionRanges(model, positions, token) {\n const resource = model.uri;\n return this._worker(resource).then((worker) => worker.getSelectionRanges(resource.toString(), positions.map(fromPosition))).then((selectionRanges) => {\n if (!selectionRanges) {\n return;\n }\n return selectionRanges.map((selectionRange) => {\n const result = [];\n while (selectionRange) {\n result.push({ range: toRange(selectionRange.range) });\n selectionRange = selectionRange.parent;\n }\n return result;\n });\n });\n }\n};\n\n// node_modules/jsonc-parser/lib/esm/impl/scanner.js\nfunction createScanner(text, ignoreTrivia) {\n if (ignoreTrivia === void 0) {\n ignoreTrivia = false;\n }\n var len = text.length;\n var pos = 0, value = \"\", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;\n function scanHexDigits(count, exact) {\n var digits = 0;\n var value2 = 0;\n while (digits < count || !exact) {\n var ch = text.charCodeAt(pos);\n if (ch >= 48 && ch <= 57) {\n value2 = value2 * 16 + ch - 48;\n } else if (ch >= 65 && ch <= 70) {\n value2 = value2 * 16 + ch - 65 + 10;\n } else if (ch >= 97 && ch <= 102) {\n value2 = value2 * 16 + ch - 97 + 10;\n } else {\n break;\n }\n pos++;\n digits++;\n }\n if (digits < count) {\n value2 = -1;\n }\n return value2;\n }\n function setPosition(newPosition) {\n pos = newPosition;\n value = \"\";\n tokenOffset = 0;\n token = 16;\n scanError = 0;\n }\n function scanNumber() {\n var start = pos;\n if (text.charCodeAt(pos) === 48) {\n pos++;\n } else {\n pos++;\n while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n }\n }\n if (pos < text.length && text.charCodeAt(pos) === 46) {\n pos++;\n if (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n }\n } else {\n scanError = 3;\n return text.substring(start, pos);\n }\n }\n var end = pos;\n if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {\n pos++;\n if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {\n pos++;\n }\n if (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n }\n end = pos;\n } else {\n scanError = 3;\n }\n }\n return text.substring(start, end);\n }\n function scanString() {\n var result = \"\", start = pos;\n while (true) {\n if (pos >= len) {\n result += text.substring(start, pos);\n scanError = 2;\n break;\n }\n var ch = text.charCodeAt(pos);\n if (ch === 34) {\n result += text.substring(start, pos);\n pos++;\n break;\n }\n if (ch === 92) {\n result += text.substring(start, pos);\n pos++;\n if (pos >= len) {\n scanError = 2;\n break;\n }\n var ch2 = text.charCodeAt(pos++);\n switch (ch2) {\n case 34:\n result += '\"';\n break;\n case 92:\n result += \"\\\\\";\n break;\n case 47:\n result += \"/\";\n break;\n case 98:\n result += \"\\b\";\n break;\n case 102:\n result += \"\\f\";\n break;\n case 110:\n result += \"\\n\";\n break;\n case 114:\n result += \"\\r\";\n break;\n case 116:\n result += \"\t\";\n break;\n case 117:\n var ch3 = scanHexDigits(4, true);\n if (ch3 >= 0) {\n result += String.fromCharCode(ch3);\n } else {\n scanError = 4;\n }\n break;\n default:\n scanError = 5;\n }\n start = pos;\n continue;\n }\n if (ch >= 0 && ch <= 31) {\n if (isLineBreak(ch)) {\n result += text.substring(start, pos);\n scanError = 2;\n break;\n } else {\n scanError = 6;\n }\n }\n pos++;\n }\n return result;\n }\n function scanNext() {\n value = \"\";\n scanError = 0;\n tokenOffset = pos;\n lineStartOffset = lineNumber;\n prevTokenLineStartOffset = tokenLineStartOffset;\n if (pos >= len) {\n tokenOffset = len;\n return token = 17;\n }\n var code = text.charCodeAt(pos);\n if (isWhiteSpace(code)) {\n do {\n pos++;\n value += String.fromCharCode(code);\n code = text.charCodeAt(pos);\n } while (isWhiteSpace(code));\n return token = 15;\n }\n if (isLineBreak(code)) {\n pos++;\n value += String.fromCharCode(code);\n if (code === 13 && text.charCodeAt(pos) === 10) {\n pos++;\n value += \"\\n\";\n }\n lineNumber++;\n tokenLineStartOffset = pos;\n return token = 14;\n }\n switch (code) {\n case 123:\n pos++;\n return token = 1;\n case 125:\n pos++;\n return token = 2;\n case 91:\n pos++;\n return token = 3;\n case 93:\n pos++;\n return token = 4;\n case 58:\n pos++;\n return token = 6;\n case 44:\n pos++;\n return token = 5;\n case 34:\n pos++;\n value = scanString();\n return token = 10;\n case 47:\n var start = pos - 1;\n if (text.charCodeAt(pos + 1) === 47) {\n pos += 2;\n while (pos < len) {\n if (isLineBreak(text.charCodeAt(pos))) {\n break;\n }\n pos++;\n }\n value = text.substring(start, pos);\n return token = 12;\n }\n if (text.charCodeAt(pos + 1) === 42) {\n pos += 2;\n var safeLength = len - 1;\n var commentClosed = false;\n while (pos < safeLength) {\n var ch = text.charCodeAt(pos);\n if (ch === 42 && text.charCodeAt(pos + 1) === 47) {\n pos += 2;\n commentClosed = true;\n break;\n }\n pos++;\n if (isLineBreak(ch)) {\n if (ch === 13 && text.charCodeAt(pos) === 10) {\n pos++;\n }\n lineNumber++;\n tokenLineStartOffset = pos;\n }\n }\n if (!commentClosed) {\n pos++;\n scanError = 1;\n }\n value = text.substring(start, pos);\n return token = 13;\n }\n value += String.fromCharCode(code);\n pos++;\n return token = 16;\n case 45:\n value += String.fromCharCode(code);\n pos++;\n if (pos === len || !isDigit(text.charCodeAt(pos))) {\n return token = 16;\n }\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n value += scanNumber();\n return token = 11;\n default:\n while (pos < len && isUnknownContentCharacter(code)) {\n pos++;\n code = text.charCodeAt(pos);\n }\n if (tokenOffset !== pos) {\n value = text.substring(tokenOffset, pos);\n switch (value) {\n case \"true\":\n return token = 8;\n case \"false\":\n return token = 9;\n case \"null\":\n return token = 7;\n }\n return token = 16;\n }\n value += String.fromCharCode(code);\n pos++;\n return token = 16;\n }\n }\n function isUnknownContentCharacter(code) {\n if (isWhiteSpace(code) || isLineBreak(code)) {\n return false;\n }\n switch (code) {\n case 125:\n case 93:\n case 123:\n case 91:\n case 34:\n case 58:\n case 44:\n case 47:\n return false;\n }\n return true;\n }\n function scanNextNonTrivia() {\n var result;\n do {\n result = scanNext();\n } while (result >= 12 && result <= 15);\n return result;\n }\n return {\n setPosition,\n getPosition: function() {\n return pos;\n },\n scan: ignoreTrivia ? scanNextNonTrivia : scanNext,\n getToken: function() {\n return token;\n },\n getTokenValue: function() {\n return value;\n },\n getTokenOffset: function() {\n return tokenOffset;\n },\n getTokenLength: function() {\n return pos - tokenOffset;\n },\n getTokenStartLine: function() {\n return lineStartOffset;\n },\n getTokenStartCharacter: function() {\n return tokenOffset - prevTokenLineStartOffset;\n },\n getTokenError: function() {\n return scanError;\n }\n };\n}\nfunction isWhiteSpace(ch) {\n return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279;\n}\nfunction isLineBreak(ch) {\n return ch === 10 || ch === 13 || ch === 8232 || ch === 8233;\n}\nfunction isDigit(ch) {\n return ch >= 48 && ch <= 57;\n}\n\n// node_modules/jsonc-parser/lib/esm/impl/parser.js\nvar ParseOptions;\n(function(ParseOptions2) {\n ParseOptions2.DEFAULT = {\n allowTrailingComma: false\n };\n})(ParseOptions || (ParseOptions = {}));\n\n// node_modules/jsonc-parser/lib/esm/main.js\nvar createScanner2 = createScanner;\n\n// src/language/json/tokenization.ts\nfunction createTokenizationSupport(supportComments) {\n return {\n getInitialState: () => new JSONState(null, null, false, null),\n tokenize: (line, state) => tokenize(supportComments, line, state)\n };\n}\nvar TOKEN_DELIM_OBJECT = \"delimiter.bracket.json\";\nvar TOKEN_DELIM_ARRAY = \"delimiter.array.json\";\nvar TOKEN_DELIM_COLON = \"delimiter.colon.json\";\nvar TOKEN_DELIM_COMMA = \"delimiter.comma.json\";\nvar TOKEN_VALUE_BOOLEAN = \"keyword.json\";\nvar TOKEN_VALUE_NULL = \"keyword.json\";\nvar TOKEN_VALUE_STRING = \"string.value.json\";\nvar TOKEN_VALUE_NUMBER = \"number.json\";\nvar TOKEN_PROPERTY_NAME = \"string.key.json\";\nvar TOKEN_COMMENT_BLOCK = \"comment.block.json\";\nvar TOKEN_COMMENT_LINE = \"comment.line.json\";\nvar ParentsStack = class {\n constructor(parent, type) {\n this.parent = parent;\n this.type = type;\n }\n static pop(parents) {\n if (parents) {\n return parents.parent;\n }\n return null;\n }\n static push(parents, type) {\n return new ParentsStack(parents, type);\n }\n static equals(a, b) {\n if (!a && !b) {\n return true;\n }\n if (!a || !b) {\n return false;\n }\n while (a && b) {\n if (a === b) {\n return true;\n }\n if (a.type !== b.type) {\n return false;\n }\n a = a.parent;\n b = b.parent;\n }\n return true;\n }\n};\nvar JSONState = class {\n _state;\n scanError;\n lastWasColon;\n parents;\n constructor(state, scanError, lastWasColon, parents) {\n this._state = state;\n this.scanError = scanError;\n this.lastWasColon = lastWasColon;\n this.parents = parents;\n }\n clone() {\n return new JSONState(this._state, this.scanError, this.lastWasColon, this.parents);\n }\n equals(other) {\n if (other === this) {\n return true;\n }\n if (!other || !(other instanceof JSONState)) {\n return false;\n }\n return this.scanError === other.scanError && this.lastWasColon === other.lastWasColon && ParentsStack.equals(this.parents, other.parents);\n }\n getStateData() {\n return this._state;\n }\n setStateData(state) {\n this._state = state;\n }\n};\nfunction tokenize(comments, line, state, offsetDelta = 0) {\n let numberOfInsertedCharacters = 0;\n let adjustOffset = false;\n switch (state.scanError) {\n case 2 /* UnexpectedEndOfString */:\n line = '\"' + line;\n numberOfInsertedCharacters = 1;\n break;\n case 1 /* UnexpectedEndOfComment */:\n line = \"/*\" + line;\n numberOfInsertedCharacters = 2;\n break;\n }\n const scanner = createScanner2(line);\n let lastWasColon = state.lastWasColon;\n let parents = state.parents;\n const ret = {\n tokens: [],\n endState: state.clone()\n };\n while (true) {\n let offset = offsetDelta + scanner.getPosition();\n let type = \"\";\n const kind = scanner.scan();\n if (kind === 17 /* EOF */) {\n break;\n }\n if (offset === offsetDelta + scanner.getPosition()) {\n throw new Error(\"Scanner did not advance, next 3 characters are: \" + line.substr(scanner.getPosition(), 3));\n }\n if (adjustOffset) {\n offset -= numberOfInsertedCharacters;\n }\n adjustOffset = numberOfInsertedCharacters > 0;\n switch (kind) {\n case 1 /* OpenBraceToken */:\n parents = ParentsStack.push(parents, 0 /* Object */);\n type = TOKEN_DELIM_OBJECT;\n lastWasColon = false;\n break;\n case 2 /* CloseBraceToken */:\n parents = ParentsStack.pop(parents);\n type = TOKEN_DELIM_OBJECT;\n lastWasColon = false;\n break;\n case 3 /* OpenBracketToken */:\n parents = ParentsStack.push(parents, 1 /* Array */);\n type = TOKEN_DELIM_ARRAY;\n lastWasColon = false;\n break;\n case 4 /* CloseBracketToken */:\n parents = ParentsStack.pop(parents);\n type = TOKEN_DELIM_ARRAY;\n lastWasColon = false;\n break;\n case 6 /* ColonToken */:\n type = TOKEN_DELIM_COLON;\n lastWasColon = true;\n break;\n case 5 /* CommaToken */:\n type = TOKEN_DELIM_COMMA;\n lastWasColon = false;\n break;\n case 8 /* TrueKeyword */:\n case 9 /* FalseKeyword */:\n type = TOKEN_VALUE_BOOLEAN;\n lastWasColon = false;\n break;\n case 7 /* NullKeyword */:\n type = TOKEN_VALUE_NULL;\n lastWasColon = false;\n break;\n case 10 /* StringLiteral */:\n const currentParent = parents ? parents.type : 0 /* Object */;\n const inArray = currentParent === 1 /* Array */;\n type = lastWasColon || inArray ? TOKEN_VALUE_STRING : TOKEN_PROPERTY_NAME;\n lastWasColon = false;\n break;\n case 11 /* NumericLiteral */:\n type = TOKEN_VALUE_NUMBER;\n lastWasColon = false;\n break;\n }\n if (comments) {\n switch (kind) {\n case 12 /* LineCommentTrivia */:\n type = TOKEN_COMMENT_LINE;\n break;\n case 13 /* BlockCommentTrivia */:\n type = TOKEN_COMMENT_BLOCK;\n break;\n }\n }\n ret.endState = new JSONState(state.getStateData(), scanner.getTokenError(), lastWasColon, parents);\n ret.tokens.push({\n startIndex: offset,\n scopes: type\n });\n }\n return ret;\n}\n\n// src/language/json/jsonMode.ts\nvar JSONDiagnosticsAdapter = class extends DiagnosticsAdapter {\n constructor(languageId, worker, defaults) {\n super(languageId, worker, defaults.onDidChange);\n this._disposables.push(monaco_editor_core_exports.editor.onWillDisposeModel((model) => {\n this._resetSchema(model.uri);\n }));\n this._disposables.push(monaco_editor_core_exports.editor.onDidChangeModelLanguage((event) => {\n this._resetSchema(event.model.uri);\n }));\n }\n _resetSchema(resource) {\n this._worker().then((worker) => {\n worker.resetSchema(resource.toString());\n });\n }\n};\nfunction setupMode(defaults) {\n const disposables = [];\n const providers = [];\n const client = new WorkerManager(defaults);\n disposables.push(client);\n const worker = (...uris) => {\n return client.getLanguageServiceWorker(...uris);\n };\n function registerProviders() {\n const { languageId, modeConfiguration: modeConfiguration2 } = defaults;\n disposeAll(providers);\n if (modeConfiguration2.documentFormattingEdits) {\n providers.push(monaco_editor_core_exports.languages.registerDocumentFormattingEditProvider(languageId, new DocumentFormattingEditProvider(worker)));\n }\n if (modeConfiguration2.documentRangeFormattingEdits) {\n providers.push(monaco_editor_core_exports.languages.registerDocumentRangeFormattingEditProvider(languageId, new DocumentRangeFormattingEditProvider(worker)));\n }\n if (modeConfiguration2.completionItems) {\n providers.push(monaco_editor_core_exports.languages.registerCompletionItemProvider(languageId, new CompletionAdapter(worker, [\" \", \":\", '\"'])));\n }\n if (modeConfiguration2.hovers) {\n providers.push(monaco_editor_core_exports.languages.registerHoverProvider(languageId, new HoverAdapter(worker)));\n }\n if (modeConfiguration2.documentSymbols) {\n providers.push(monaco_editor_core_exports.languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker)));\n }\n if (modeConfiguration2.tokens) {\n providers.push(monaco_editor_core_exports.languages.setTokensProvider(languageId, createTokenizationSupport(true)));\n }\n if (modeConfiguration2.colors) {\n providers.push(monaco_editor_core_exports.languages.registerColorProvider(languageId, new DocumentColorAdapter(worker)));\n }\n if (modeConfiguration2.foldingRanges) {\n providers.push(monaco_editor_core_exports.languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker)));\n }\n if (modeConfiguration2.diagnostics) {\n providers.push(new JSONDiagnosticsAdapter(languageId, worker, defaults));\n }\n if (modeConfiguration2.selectionRanges) {\n providers.push(monaco_editor_core_exports.languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker)));\n }\n }\n registerProviders();\n disposables.push(monaco_editor_core_exports.languages.setLanguageConfiguration(defaults.languageId, richEditConfiguration));\n let modeConfiguration = defaults.modeConfiguration;\n defaults.onDidChange((newDefaults) => {\n if (newDefaults.modeConfiguration !== modeConfiguration) {\n modeConfiguration = newDefaults.modeConfiguration;\n registerProviders();\n }\n });\n disposables.push(asDisposable(providers));\n return asDisposable(disposables);\n}\nfunction asDisposable(disposables) {\n return { dispose: () => disposeAll(disposables) };\n}\nfunction disposeAll(disposables) {\n while (disposables.length) {\n disposables.pop().dispose();\n }\n}\nvar richEditConfiguration = {\n wordPattern: /(-?\\d*\\.\\d\\w*)|([^\\[\\{\\]\\}\\:\\\"\\,\\s]+)/g,\n comments: {\n lineComment: \"//\",\n blockComment: [\"/*\", \"*/\"]\n },\n brackets: [\n [\"{\", \"}\"],\n [\"[\", \"]\"]\n ],\n autoClosingPairs: [\n { open: \"{\", close: \"}\", notIn: [\"string\"] },\n { open: \"[\", close: \"]\", notIn: [\"string\"] },\n { open: '\"', close: '\"', notIn: [\"string\"] }\n ]\n};\n\n\n\n//# sourceURL=webpack://monanco_wpack/./node_modules/monaco-editor/esm/vs/language/json/jsonMode.js?");
/***/ })
}]);