import { m as Ln } from "./index-BpkhRblb.js";
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
var On = Object.defineProperty, Nn = Object.getOwnPropertyDescriptor, Rn = Object.getOwnPropertyNames, Mn = Object.prototype.hasOwnProperty, Dn = (e, r, i, t) => {
  if (r && typeof r == "object" || typeof r == "function")
    for (let n of Rn(r))
      !Mn.call(e, n) && n !== i && On(e, n, { get: () => r[n], enumerable: !(t = Nn(r, n)) || t.enumerable });
  return e;
}, Fn = (e, r, i) => (Dn(e, r, "default"), i), f = {};
Fn(f, Ln);
var Un = 2 * 60 * 1e3, Tn = class {
  constructor(e) {
    this._defaults = e, this._worker = null, this._client = null, this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 30 * 1e3), this._lastUsedTime = 0, this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker());
  }
  _stopWorker() {
    this._worker && (this._worker.dispose(), this._worker = null), this._client = null;
  }
  dispose() {
    clearInterval(this._idleCheckInterval), this._configChangeListener.dispose(), this._stopWorker();
  }
  _checkIfIdle() {
    if (!this._worker)
      return;
    Date.now() - this._lastUsedTime > Un && this._stopWorker();
  }
  _getClient() {
    return this._lastUsedTime = Date.now(), this._client || (this._worker = f.editor.createWebWorker({
      // module that exports the create() method and returns a `JSONWorker` instance
      moduleId: "vs/language/json/jsonWorker",
      label: this._defaults.languageId,
      // passed in to the create() method
      createData: {
        languageSettings: this._defaults.diagnosticsOptions,
        languageId: this._defaults.languageId,
        enableSchemaRequest: this._defaults.diagnosticsOptions.enableSchemaRequest
      }
    }), this._client = this._worker.getProxy()), this._client;
  }
  getLanguageServiceWorker(...e) {
    let r;
    return this._getClient().then((i) => {
      r = i;
    }).then((i) => {
      if (this._worker)
        return this._worker.withSyncedResources(e);
    }).then((i) => r);
  }
}, le;
(function(e) {
  function r(i) {
    return typeof i == "string";
  }
  e.is = r;
})(le || (le = {}));
var Q;
(function(e) {
  function r(i) {
    return typeof i == "string";
  }
  e.is = r;
})(Q || (Q = {}));
var fe;
(function(e) {
  e.MIN_VALUE = -2147483648, e.MAX_VALUE = 2147483647;
  function r(i) {
    return typeof i == "number" && e.MIN_VALUE <= i && i <= e.MAX_VALUE;
  }
  e.is = r;
})(fe || (fe = {}));
var W;
(function(e) {
  e.MIN_VALUE = 0, e.MAX_VALUE = 2147483647;
  function r(i) {
    return typeof i == "number" && e.MIN_VALUE <= i && i <= e.MAX_VALUE;
  }
  e.is = r;
})(W || (W = {}));
var O;
(function(e) {
  function r(t, n) {
    return t === Number.MAX_VALUE && (t = W.MAX_VALUE), n === Number.MAX_VALUE && (n = W.MAX_VALUE), { line: t, character: n };
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.objectLiteral(n) && a.uinteger(n.line) && a.uinteger(n.character);
  }
  e.is = i;
})(O || (O = {}));
var h;
(function(e) {
  function r(t, n, u, s) {
    if (a.uinteger(t) && a.uinteger(n) && a.uinteger(u) && a.uinteger(s))
      return { start: O.create(t, n), end: O.create(u, s) };
    if (O.is(t) && O.is(n))
      return { start: t, end: n };
    throw new Error(`Range#create called with invalid arguments[${t}, ${n}, ${u}, ${s}]`);
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.objectLiteral(n) && O.is(n.start) && O.is(n.end);
  }
  e.is = i;
})(h || (h = {}));
var H;
(function(e) {
  function r(t, n) {
    return { uri: t, range: n };
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.objectLiteral(n) && h.is(n.range) && (a.string(n.uri) || a.undefined(n.uri));
  }
  e.is = i;
})(H || (H = {}));
var de;
(function(e) {
  function r(t, n, u, s) {
    return { targetUri: t, targetRange: n, targetSelectionRange: u, originSelectionRange: s };
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.objectLiteral(n) && h.is(n.targetRange) && a.string(n.targetUri) && h.is(n.targetSelectionRange) && (h.is(n.originSelectionRange) || a.undefined(n.originSelectionRange));
  }
  e.is = i;
})(de || (de = {}));
var Y;
(function(e) {
  function r(t, n, u, s) {
    return {
      red: t,
      green: n,
      blue: u,
      alpha: s
    };
  }
  e.create = r;
  function i(t) {
    const n = t;
    return a.objectLiteral(n) && a.numberRange(n.red, 0, 1) && a.numberRange(n.green, 0, 1) && a.numberRange(n.blue, 0, 1) && a.numberRange(n.alpha, 0, 1);
  }
  e.is = i;
})(Y || (Y = {}));
var ge;
(function(e) {
  function r(t, n) {
    return {
      range: t,
      color: n
    };
  }
  e.create = r;
  function i(t) {
    const n = t;
    return a.objectLiteral(n) && h.is(n.range) && Y.is(n.color);
  }
  e.is = i;
})(ge || (ge = {}));
var pe;
(function(e) {
  function r(t, n, u) {
    return {
      label: t,
      textEdit: n,
      additionalTextEdits: u
    };
  }
  e.create = r;
  function i(t) {
    const n = t;
    return a.objectLiteral(n) && a.string(n.label) && (a.undefined(n.textEdit) || T.is(n)) && (a.undefined(n.additionalTextEdits) || a.typedArray(n.additionalTextEdits, T.is));
  }
  e.is = i;
})(pe || (pe = {}));
var P;
(function(e) {
  e.Comment = "comment", e.Imports = "imports", e.Region = "region";
})(P || (P = {}));
var me;
(function(e) {
  function r(t, n, u, s, o, g) {
    const c = {
      startLine: t,
      endLine: n
    };
    return a.defined(u) && (c.startCharacter = u), a.defined(s) && (c.endCharacter = s), a.defined(o) && (c.kind = o), a.defined(g) && (c.collapsedText = g), c;
  }
  e.create = r;
  function i(t) {
    const n = t;
    return a.objectLiteral(n) && a.uinteger(n.startLine) && a.uinteger(n.startLine) && (a.undefined(n.startCharacter) || a.uinteger(n.startCharacter)) && (a.undefined(n.endCharacter) || a.uinteger(n.endCharacter)) && (a.undefined(n.kind) || a.string(n.kind));
  }
  e.is = i;
})(me || (me = {}));
var G;
(function(e) {
  function r(t, n) {
    return {
      location: t,
      message: n
    };
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.defined(n) && H.is(n.location) && a.string(n.message);
  }
  e.is = i;
})(G || (G = {}));
var F;
(function(e) {
  e.Error = 1, e.Warning = 2, e.Information = 3, e.Hint = 4;
})(F || (F = {}));
var he;
(function(e) {
  e.Unnecessary = 1, e.Deprecated = 2;
})(he || (he = {}));
var ve;
(function(e) {
  function r(i) {
    const t = i;
    return a.objectLiteral(t) && a.string(t.href);
  }
  e.is = r;
})(ve || (ve = {}));
var z;
(function(e) {
  function r(t, n, u, s, o, g) {
    let c = { range: t, message: n };
    return a.defined(u) && (c.severity = u), a.defined(s) && (c.code = s), a.defined(o) && (c.source = o), a.defined(g) && (c.relatedInformation = g), c;
  }
  e.create = r;
  function i(t) {
    var n;
    let u = t;
    return a.defined(u) && h.is(u.range) && a.string(u.message) && (a.number(u.severity) || a.undefined(u.severity)) && (a.integer(u.code) || a.string(u.code) || a.undefined(u.code)) && (a.undefined(u.codeDescription) || a.string((n = u.codeDescription) === null || n === void 0 ? void 0 : n.href)) && (a.string(u.source) || a.undefined(u.source)) && (a.undefined(u.relatedInformation) || a.typedArray(u.relatedInformation, G.is));
  }
  e.is = i;
})(z || (z = {}));
var U;
(function(e) {
  function r(t, n, ...u) {
    let s = { title: t, command: n };
    return a.defined(u) && u.length > 0 && (s.arguments = u), s;
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.defined(n) && a.string(n.title) && a.string(n.command);
  }
  e.is = i;
})(U || (U = {}));
var T;
(function(e) {
  function r(u, s) {
    return { range: u, newText: s };
  }
  e.replace = r;
  function i(u, s) {
    return { range: { start: u, end: u }, newText: s };
  }
  e.insert = i;
  function t(u) {
    return { range: u, newText: "" };
  }
  e.del = t;
  function n(u) {
    const s = u;
    return a.objectLiteral(s) && a.string(s.newText) && h.is(s.range);
  }
  e.is = n;
})(T || (T = {}));
var Z;
(function(e) {
  function r(t, n, u) {
    const s = { label: t };
    return n !== void 0 && (s.needsConfirmation = n), u !== void 0 && (s.description = u), s;
  }
  e.create = r;
  function i(t) {
    const n = t;
    return a.objectLiteral(n) && a.string(n.label) && (a.boolean(n.needsConfirmation) || n.needsConfirmation === void 0) && (a.string(n.description) || n.description === void 0);
  }
  e.is = i;
})(Z || (Z = {}));
var j;
(function(e) {
  function r(i) {
    const t = i;
    return a.string(t);
  }
  e.is = r;
})(j || (j = {}));
var _e;
(function(e) {
  function r(u, s, o) {
    return { range: u, newText: s, annotationId: o };
  }
  e.replace = r;
  function i(u, s, o) {
    return { range: { start: u, end: u }, newText: s, annotationId: o };
  }
  e.insert = i;
  function t(u, s) {
    return { range: u, newText: "", annotationId: s };
  }
  e.del = t;
  function n(u) {
    const s = u;
    return T.is(s) && (Z.is(s.annotationId) || j.is(s.annotationId));
  }
  e.is = n;
})(_e || (_e = {}));
var K;
(function(e) {
  function r(t, n) {
    return { textDocument: t, edits: n };
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.defined(n) && re.is(n.textDocument) && Array.isArray(n.edits);
  }
  e.is = i;
})(K || (K = {}));
var C;
(function(e) {
  function r(t, n, u) {
    let s = {
      kind: "create",
      uri: t
    };
    return n !== void 0 && (n.overwrite !== void 0 || n.ignoreIfExists !== void 0) && (s.options = n), u !== void 0 && (s.annotationId = u), s;
  }
  e.create = r;
  function i(t) {
    let n = t;
    return n && n.kind === "create" && a.string(n.uri) && (n.options === void 0 || (n.options.overwrite === void 0 || a.boolean(n.options.overwrite)) && (n.options.ignoreIfExists === void 0 || a.boolean(n.options.ignoreIfExists))) && (n.annotationId === void 0 || j.is(n.annotationId));
  }
  e.is = i;
})(C || (C = {}));
var ee;
(function(e) {
  function r(t, n, u, s) {
    let o = {
      kind: "rename",
      oldUri: t,
      newUri: n
    };
    return u !== void 0 && (u.overwrite !== void 0 || u.ignoreIfExists !== void 0) && (o.options = u), s !== void 0 && (o.annotationId = s), o;
  }
  e.create = r;
  function i(t) {
    let n = t;
    return n && n.kind === "rename" && a.string(n.oldUri) && a.string(n.newUri) && (n.options === void 0 || (n.options.overwrite === void 0 || a.boolean(n.options.overwrite)) && (n.options.ignoreIfExists === void 0 || a.boolean(n.options.ignoreIfExists))) && (n.annotationId === void 0 || j.is(n.annotationId));
  }
  e.is = i;
})(ee || (ee = {}));
var ne;
(function(e) {
  function r(t, n, u) {
    let s = {
      kind: "delete",
      uri: t
    };
    return n !== void 0 && (n.recursive !== void 0 || n.ignoreIfNotExists !== void 0) && (s.options = n), u !== void 0 && (s.annotationId = u), s;
  }
  e.create = r;
  function i(t) {
    let n = t;
    return n && n.kind === "delete" && a.string(n.uri) && (n.options === void 0 || (n.options.recursive === void 0 || a.boolean(n.options.recursive)) && (n.options.ignoreIfNotExists === void 0 || a.boolean(n.options.ignoreIfNotExists))) && (n.annotationId === void 0 || j.is(n.annotationId));
  }
  e.is = i;
})(ne || (ne = {}));
var te;
(function(e) {
  function r(i) {
    let t = i;
    return t && (t.changes !== void 0 || t.documentChanges !== void 0) && (t.documentChanges === void 0 || t.documentChanges.every((n) => a.string(n.kind) ? C.is(n) || ee.is(n) || ne.is(n) : K.is(n)));
  }
  e.is = r;
})(te || (te = {}));
var ke;
(function(e) {
  function r(t) {
    return { uri: t };
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.defined(n) && a.string(n.uri);
  }
  e.is = i;
})(ke || (ke = {}));
var be;
(function(e) {
  function r(t, n) {
    return { uri: t, version: n };
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.defined(n) && a.string(n.uri) && a.integer(n.version);
  }
  e.is = i;
})(be || (be = {}));
var re;
(function(e) {
  function r(t, n) {
    return { uri: t, version: n };
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.defined(n) && a.string(n.uri) && (n.version === null || a.integer(n.version));
  }
  e.is = i;
})(re || (re = {}));
var we;
(function(e) {
  function r(t, n, u, s) {
    return { uri: t, languageId: n, version: u, text: s };
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.defined(n) && a.string(n.uri) && a.string(n.languageId) && a.integer(n.version) && a.string(n.text);
  }
  e.is = i;
})(we || (we = {}));
var ie;
(function(e) {
  e.PlainText = "plaintext", e.Markdown = "markdown";
  function r(i) {
    const t = i;
    return t === e.PlainText || t === e.Markdown;
  }
  e.is = r;
})(ie || (ie = {}));
var S;
(function(e) {
  function r(i) {
    const t = i;
    return a.objectLiteral(i) && ie.is(t.kind) && a.string(t.value);
  }
  e.is = r;
})(S || (S = {}));
var v;
(function(e) {
  e.Text = 1, e.Method = 2, e.Function = 3, e.Constructor = 4, e.Field = 5, e.Variable = 6, e.Class = 7, e.Interface = 8, e.Module = 9, e.Property = 10, e.Unit = 11, e.Value = 12, e.Enum = 13, e.Keyword = 14, e.Snippet = 15, e.Color = 16, e.File = 17, e.Reference = 18, e.Folder = 19, e.EnumMember = 20, e.Constant = 21, e.Struct = 22, e.Event = 23, e.Operator = 24, e.TypeParameter = 25;
})(v || (v = {}));
var ue;
(function(e) {
  e.PlainText = 1, e.Snippet = 2;
})(ue || (ue = {}));
var Ae;
(function(e) {
  e.Deprecated = 1;
})(Ae || (Ae = {}));
var Ie;
(function(e) {
  function r(t, n, u) {
    return { newText: t, insert: n, replace: u };
  }
  e.create = r;
  function i(t) {
    const n = t;
    return n && a.string(n.newText) && h.is(n.insert) && h.is(n.replace);
  }
  e.is = i;
})(Ie || (Ie = {}));
var Ee;
(function(e) {
  e.asIs = 1, e.adjustIndentation = 2;
})(Ee || (Ee = {}));
var Le;
(function(e) {
  function r(i) {
    const t = i;
    return t && (a.string(t.detail) || t.detail === void 0) && (a.string(t.description) || t.description === void 0);
  }
  e.is = r;
})(Le || (Le = {}));
var Oe;
(function(e) {
  function r(i) {
    return { label: i };
  }
  e.create = r;
})(Oe || (Oe = {}));
var Ne;
(function(e) {
  function r(i, t) {
    return { items: i || [], isIncomplete: !!t };
  }
  e.create = r;
})(Ne || (Ne = {}));
var X;
(function(e) {
  function r(t) {
    return t.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
  }
  e.fromPlainText = r;
  function i(t) {
    const n = t;
    return a.string(n) || a.objectLiteral(n) && a.string(n.language) && a.string(n.value);
  }
  e.is = i;
})(X || (X = {}));
var Re;
(function(e) {
  function r(i) {
    let t = i;
    return !!t && a.objectLiteral(t) && (S.is(t.contents) || X.is(t.contents) || a.typedArray(t.contents, X.is)) && (i.range === void 0 || h.is(i.range));
  }
  e.is = r;
})(Re || (Re = {}));
var Me;
(function(e) {
  function r(i, t) {
    return t ? { label: i, documentation: t } : { label: i };
  }
  e.create = r;
})(Me || (Me = {}));
var De;
(function(e) {
  function r(i, t, ...n) {
    let u = { label: i };
    return a.defined(t) && (u.documentation = t), a.defined(n) ? u.parameters = n : u.parameters = [], u;
  }
  e.create = r;
})(De || (De = {}));
var V;
(function(e) {
  e.Text = 1, e.Read = 2, e.Write = 3;
})(V || (V = {}));
var Fe;
(function(e) {
  function r(i, t) {
    let n = { range: i };
    return a.number(t) && (n.kind = t), n;
  }
  e.create = r;
})(Fe || (Fe = {}));
var _;
(function(e) {
  e.File = 1, e.Module = 2, e.Namespace = 3, e.Package = 4, e.Class = 5, e.Method = 6, e.Property = 7, e.Field = 8, e.Constructor = 9, e.Enum = 10, e.Interface = 11, e.Function = 12, e.Variable = 13, e.Constant = 14, e.String = 15, e.Number = 16, e.Boolean = 17, e.Array = 18, e.Object = 19, e.Key = 20, e.Null = 21, e.EnumMember = 22, e.Struct = 23, e.Event = 24, e.Operator = 25, e.TypeParameter = 26;
})(_ || (_ = {}));
var Ue;
(function(e) {
  e.Deprecated = 1;
})(Ue || (Ue = {}));
var Te;
(function(e) {
  function r(i, t, n, u, s) {
    let o = {
      name: i,
      kind: t,
      location: { uri: u, range: n }
    };
    return s && (o.containerName = s), o;
  }
  e.create = r;
})(Te || (Te = {}));
var je;
(function(e) {
  function r(i, t, n, u) {
    return u !== void 0 ? { name: i, kind: t, location: { uri: n, range: u } } : { name: i, kind: t, location: { uri: n } };
  }
  e.create = r;
})(je || (je = {}));
var xe;
(function(e) {
  function r(t, n, u, s, o, g) {
    let c = {
      name: t,
      detail: n,
      kind: u,
      range: s,
      selectionRange: o
    };
    return g !== void 0 && (c.children = g), c;
  }
  e.create = r;
  function i(t) {
    let n = t;
    return n && a.string(n.name) && a.number(n.kind) && h.is(n.range) && h.is(n.selectionRange) && (n.detail === void 0 || a.string(n.detail)) && (n.deprecated === void 0 || a.boolean(n.deprecated)) && (n.children === void 0 || Array.isArray(n.children)) && (n.tags === void 0 || Array.isArray(n.tags));
  }
  e.is = i;
})(xe || (xe = {}));
var ye;
(function(e) {
  e.Empty = "", e.QuickFix = "quickfix", e.Refactor = "refactor", e.RefactorExtract = "refactor.extract", e.RefactorInline = "refactor.inline", e.RefactorRewrite = "refactor.rewrite", e.Source = "source", e.SourceOrganizeImports = "source.organizeImports", e.SourceFixAll = "source.fixAll";
})(ye || (ye = {}));
var q;
(function(e) {
  e.Invoked = 1, e.Automatic = 2;
})(q || (q = {}));
var Pe;
(function(e) {
  function r(t, n, u) {
    let s = { diagnostics: t };
    return n != null && (s.only = n), u != null && (s.triggerKind = u), s;
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.defined(n) && a.typedArray(n.diagnostics, z.is) && (n.only === void 0 || a.typedArray(n.only, a.string)) && (n.triggerKind === void 0 || n.triggerKind === q.Invoked || n.triggerKind === q.Automatic);
  }
  e.is = i;
})(Pe || (Pe = {}));
var Ve;
(function(e) {
  function r(t, n, u) {
    let s = { title: t }, o = !0;
    return typeof n == "string" ? (o = !1, s.kind = n) : U.is(n) ? s.command = n : s.edit = n, o && u !== void 0 && (s.kind = u), s;
  }
  e.create = r;
  function i(t) {
    let n = t;
    return n && a.string(n.title) && (n.diagnostics === void 0 || a.typedArray(n.diagnostics, z.is)) && (n.kind === void 0 || a.string(n.kind)) && (n.edit !== void 0 || n.command !== void 0) && (n.command === void 0 || U.is(n.command)) && (n.isPreferred === void 0 || a.boolean(n.isPreferred)) && (n.edit === void 0 || te.is(n.edit));
  }
  e.is = i;
})(Ve || (Ve = {}));
var Se;
(function(e) {
  function r(t, n) {
    let u = { range: t };
    return a.defined(n) && (u.data = n), u;
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.defined(n) && h.is(n.range) && (a.undefined(n.command) || U.is(n.command));
  }
  e.is = i;
})(Se || (Se = {}));
var Be;
(function(e) {
  function r(t, n) {
    return { tabSize: t, insertSpaces: n };
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.defined(n) && a.uinteger(n.tabSize) && a.boolean(n.insertSpaces);
  }
  e.is = i;
})(Be || (Be = {}));
var We;
(function(e) {
  function r(t, n, u) {
    return { range: t, target: n, data: u };
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.defined(n) && h.is(n.range) && (a.undefined(n.target) || a.string(n.target));
  }
  e.is = i;
})(We || (We = {}));
var He;
(function(e) {
  function r(t, n) {
    return { range: t, parent: n };
  }
  e.create = r;
  function i(t) {
    let n = t;
    return a.objectLiteral(n) && h.is(n.range) && (n.parent === void 0 || e.is(n.parent));
  }
  e.is = i;
})(He || (He = {}));
var ze;
(function(e) {
  e.namespace = "namespace", e.type = "type", e.class = "class", e.enum = "enum", e.interface = "interface", e.struct = "struct", e.typeParameter = "typeParameter", e.parameter = "parameter", e.variable = "variable", e.property = "property", e.enumMember = "enumMember", e.event = "event", e.function = "function", e.method = "method", e.macro = "macro", e.keyword = "keyword", e.modifier = "modifier", e.comment = "comment", e.string = "string", e.number = "number", e.regexp = "regexp", e.operator = "operator", e.decorator = "decorator";
})(ze || (ze = {}));
var Xe;
(function(e) {
  e.declaration = "declaration", e.definition = "definition", e.readonly = "readonly", e.static = "static", e.deprecated = "deprecated", e.abstract = "abstract", e.async = "async", e.modification = "modification", e.documentation = "documentation", e.defaultLibrary = "defaultLibrary";
})(Xe || (Xe = {}));
var qe;
(function(e) {
  function r(i) {
    const t = i;
    return a.objectLiteral(t) && (t.resultId === void 0 || typeof t.resultId == "string") && Array.isArray(t.data) && (t.data.length === 0 || typeof t.data[0] == "number");
  }
  e.is = r;
})(qe || (qe = {}));
var Je;
(function(e) {
  function r(t, n) {
    return { range: t, text: n };
  }
  e.create = r;
  function i(t) {
    const n = t;
    return n != null && h.is(n.range) && a.string(n.text);
  }
  e.is = i;
})(Je || (Je = {}));
var $e;
(function(e) {
  function r(t, n, u) {
    return { range: t, variableName: n, caseSensitiveLookup: u };
  }
  e.create = r;
  function i(t) {
    const n = t;
    return n != null && h.is(n.range) && a.boolean(n.caseSensitiveLookup) && (a.string(n.variableName) || n.variableName === void 0);
  }
  e.is = i;
})($e || ($e = {}));
var Qe;
(function(e) {
  function r(t, n) {
    return { range: t, expression: n };
  }
  e.create = r;
  function i(t) {
    const n = t;
    return n != null && h.is(n.range) && (a.string(n.expression) || n.expression === void 0);
  }
  e.is = i;
})(Qe || (Qe = {}));
var Ye;
(function(e) {
  function r(t, n) {
    return { frameId: t, stoppedLocation: n };
  }
  e.create = r;
  function i(t) {
    const n = t;
    return a.defined(n) && h.is(t.stoppedLocation);
  }
  e.is = i;
})(Ye || (Ye = {}));
var se;
(function(e) {
  e.Type = 1, e.Parameter = 2;
  function r(i) {
    return i === 1 || i === 2;
  }
  e.is = r;
})(se || (se = {}));
var ae;
(function(e) {
  function r(t) {
    return { value: t };
  }
  e.create = r;
  function i(t) {
    const n = t;
    return a.objectLiteral(n) && (n.tooltip === void 0 || a.string(n.tooltip) || S.is(n.tooltip)) && (n.location === void 0 || H.is(n.location)) && (n.command === void 0 || U.is(n.command));
  }
  e.is = i;
})(ae || (ae = {}));
var Ge;
(function(e) {
  function r(t, n, u) {
    const s = { position: t, label: n };
    return u !== void 0 && (s.kind = u), s;
  }
  e.create = r;
  function i(t) {
    const n = t;
    return a.objectLiteral(n) && O.is(n.position) && (a.string(n.label) || a.typedArray(n.label, ae.is)) && (n.kind === void 0 || se.is(n.kind)) && n.textEdits === void 0 || a.typedArray(n.textEdits, T.is) && (n.tooltip === void 0 || a.string(n.tooltip) || S.is(n.tooltip)) && (n.paddingLeft === void 0 || a.boolean(n.paddingLeft)) && (n.paddingRight === void 0 || a.boolean(n.paddingRight));
  }
  e.is = i;
})(Ge || (Ge = {}));
var Ze;
(function(e) {
  function r(i) {
    return { kind: "snippet", value: i };
  }
  e.createSnippet = r;
})(Ze || (Ze = {}));
var Ke;
(function(e) {
  function r(i, t, n, u) {
    return { insertText: i, filterText: t, range: n, command: u };
  }
  e.create = r;
})(Ke || (Ke = {}));
var Ce;
(function(e) {
  function r(i) {
    return { items: i };
  }
  e.create = r;
})(Ce || (Ce = {}));
var en;
(function(e) {
  e.Invoked = 0, e.Automatic = 1;
})(en || (en = {}));
var nn;
(function(e) {
  function r(i, t) {
    return { range: i, text: t };
  }
  e.create = r;
})(nn || (nn = {}));
var tn;
(function(e) {
  function r(i, t) {
    return { triggerKind: i, selectedCompletionInfo: t };
  }
  e.create = r;
})(tn || (tn = {}));
var rn;
(function(e) {
  function r(i) {
    const t = i;
    return a.objectLiteral(t) && Q.is(t.uri) && a.string(t.name);
  }
  e.is = r;
})(rn || (rn = {}));
var un;
(function(e) {
  function r(u, s, o, g) {
    return new jn(u, s, o, g);
  }
  e.create = r;
  function i(u) {
    let s = u;
    return !!(a.defined(s) && a.string(s.uri) && (a.undefined(s.languageId) || a.string(s.languageId)) && a.uinteger(s.lineCount) && a.func(s.getText) && a.func(s.positionAt) && a.func(s.offsetAt));
  }
  e.is = i;
  function t(u, s) {
    let o = u.getText(), g = n(s, (m, d) => {
      let k = m.range.start.line - d.range.start.line;
      return k === 0 ? m.range.start.character - d.range.start.character : k;
    }), c = o.length;
    for (let m = g.length - 1; m >= 0; m--) {
      let d = g[m], k = u.offsetAt(d.range.start), p = u.offsetAt(d.range.end);
      if (p <= c)
        o = o.substring(0, k) + d.newText + o.substring(p, o.length);
      else
        throw new Error("Overlapping edit");
      c = k;
    }
    return o;
  }
  e.applyEdits = t;
  function n(u, s) {
    if (u.length <= 1)
      return u;
    const o = u.length / 2 | 0, g = u.slice(0, o), c = u.slice(o);
    n(g, s), n(c, s);
    let m = 0, d = 0, k = 0;
    for (; m < g.length && d < c.length; )
      s(g[m], c[d]) <= 0 ? u[k++] = g[m++] : u[k++] = c[d++];
    for (; m < g.length; )
      u[k++] = g[m++];
    for (; d < c.length; )
      u[k++] = c[d++];
    return u;
  }
})(un || (un = {}));
var jn = class {
  constructor(e, r, i, t) {
    this._uri = e, this._languageId = r, this._version = i, this._content = t, this._lineOffsets = void 0;
  }
  get uri() {
    return this._uri;
  }
  get languageId() {
    return this._languageId;
  }
  get version() {
    return this._version;
  }
  getText(e) {
    if (e) {
      let r = this.offsetAt(e.start), i = this.offsetAt(e.end);
      return this._content.substring(r, i);
    }
    return this._content;
  }
  update(e, r) {
    this._content = e.text, this._version = r, this._lineOffsets = void 0;
  }
  getLineOffsets() {
    if (this._lineOffsets === void 0) {
      let e = [], r = this._content, i = !0;
      for (let t = 0; t < r.length; t++) {
        i && (e.push(t), i = !1);
        let n = r.charAt(t);
        i = n === "\r" || n === `
`, n === "\r" && t + 1 < r.length && r.charAt(t + 1) === `
` && t++;
      }
      i && r.length > 0 && e.push(r.length), this._lineOffsets = e;
    }
    return this._lineOffsets;
  }
  positionAt(e) {
    e = Math.max(Math.min(e, this._content.length), 0);
    let r = this.getLineOffsets(), i = 0, t = r.length;
    if (t === 0)
      return O.create(0, e);
    for (; i < t; ) {
      let u = Math.floor((i + t) / 2);
      r[u] > e ? t = u : i = u + 1;
    }
    let n = i - 1;
    return O.create(n, e - r[n]);
  }
  offsetAt(e) {
    let r = this.getLineOffsets();
    if (e.line >= r.length)
      return this._content.length;
    if (e.line < 0)
      return 0;
    let i = r[e.line], t = e.line + 1 < r.length ? r[e.line + 1] : this._content.length;
    return Math.max(Math.min(i + e.character, t), i);
  }
  get lineCount() {
    return this.getLineOffsets().length;
  }
}, a;
(function(e) {
  const r = Object.prototype.toString;
  function i(p) {
    return typeof p < "u";
  }
  e.defined = i;
  function t(p) {
    return typeof p > "u";
  }
  e.undefined = t;
  function n(p) {
    return p === !0 || p === !1;
  }
  e.boolean = n;
  function u(p) {
    return r.call(p) === "[object String]";
  }
  e.string = u;
  function s(p) {
    return r.call(p) === "[object Number]";
  }
  e.number = s;
  function o(p, N, J) {
    return r.call(p) === "[object Number]" && N <= p && p <= J;
  }
  e.numberRange = o;
  function g(p) {
    return r.call(p) === "[object Number]" && -2147483648 <= p && p <= 2147483647;
  }
  e.integer = g;
  function c(p) {
    return r.call(p) === "[object Number]" && 0 <= p && p <= 2147483647;
  }
  e.uinteger = c;
  function m(p) {
    return r.call(p) === "[object Function]";
  }
  e.func = m;
  function d(p) {
    return p !== null && typeof p == "object";
  }
  e.objectLiteral = d;
  function k(p, N) {
    return Array.isArray(p) && p.every(N);
  }
  e.typedArray = k;
})(a || (a = {}));
var xn = class {
  constructor(e, r, i) {
    this._languageId = e, this._worker = r, this._disposables = [], this._listener = /* @__PURE__ */ Object.create(null);
    const t = (u) => {
      let s = u.getLanguageId();
      if (s !== this._languageId)
        return;
      let o;
      this._listener[u.uri.toString()] = u.onDidChangeContent(() => {
        window.clearTimeout(o), o = window.setTimeout(() => this._doValidate(u.uri, s), 500);
      }), this._doValidate(u.uri, s);
    }, n = (u) => {
      f.editor.setModelMarkers(u, this._languageId, []);
      let s = u.uri.toString(), o = this._listener[s];
      o && (o.dispose(), delete this._listener[s]);
    };
    this._disposables.push(f.editor.onDidCreateModel(t)), this._disposables.push(f.editor.onWillDisposeModel(n)), this._disposables.push(
      f.editor.onDidChangeModelLanguage((u) => {
        n(u.model), t(u.model);
      })
    ), this._disposables.push(
      i((u) => {
        f.editor.getModels().forEach((s) => {
          s.getLanguageId() === this._languageId && (n(s), t(s));
        });
      })
    ), this._disposables.push({
      dispose: () => {
        f.editor.getModels().forEach(n);
        for (let u in this._listener)
          this._listener[u].dispose();
      }
    }), f.editor.getModels().forEach(t);
  }
  dispose() {
    this._disposables.forEach((e) => e && e.dispose()), this._disposables.length = 0;
  }
  _doValidate(e, r) {
    this._worker(e).then((i) => i.doValidation(e.toString())).then((i) => {
      const t = i.map((u) => Pn(e, u));
      let n = f.editor.getModel(e);
      n && n.getLanguageId() === r && f.editor.setModelMarkers(n, r, t);
    }).then(void 0, (i) => {
      console.error(i);
    });
  }
};
function yn(e) {
  switch (e) {
    case F.Error:
      return f.MarkerSeverity.Error;
    case F.Warning:
      return f.MarkerSeverity.Warning;
    case F.Information:
      return f.MarkerSeverity.Info;
    case F.Hint:
      return f.MarkerSeverity.Hint;
    default:
      return f.MarkerSeverity.Info;
  }
}
function Pn(e, r) {
  let i = typeof r.code == "number" ? String(r.code) : r.code;
  return {
    severity: yn(r.severity),
    startLineNumber: r.range.start.line + 1,
    startColumn: r.range.start.character + 1,
    endLineNumber: r.range.end.line + 1,
    endColumn: r.range.end.character + 1,
    message: r.message,
    code: i,
    source: r.source
  };
}
var Vn = class {
  constructor(e, r) {
    this._worker = e, this._triggerCharacters = r;
  }
  get triggerCharacters() {
    return this._triggerCharacters;
  }
  provideCompletionItems(e, r, i, t) {
    const n = e.uri;
    return this._worker(n).then((u) => u.doComplete(n.toString(), R(r))).then((u) => {
      if (!u)
        return;
      const s = e.getWordUntilPosition(r), o = new f.Range(
        r.lineNumber,
        s.startColumn,
        r.lineNumber,
        s.endColumn
      ), g = u.items.map((c) => {
        const m = {
          label: c.label,
          insertText: c.insertText || c.label,
          sortText: c.sortText,
          filterText: c.filterText,
          documentation: c.documentation,
          detail: c.detail,
          command: Wn(c.command),
          range: o,
          kind: Bn(c.kind)
        };
        return c.textEdit && (Sn(c.textEdit) ? m.range = {
          insert: w(c.textEdit.insert),
          replace: w(c.textEdit.replace)
        } : m.range = w(c.textEdit.range), m.insertText = c.textEdit.newText), c.additionalTextEdits && (m.additionalTextEdits = c.additionalTextEdits.map(B)), c.insertTextFormat === ue.Snippet && (m.insertTextRules = f.languages.CompletionItemInsertTextRule.InsertAsSnippet), m;
      });
      return {
        isIncomplete: u.isIncomplete,
        suggestions: g
      };
    });
  }
};
function R(e) {
  if (e)
    return { character: e.column - 1, line: e.lineNumber - 1 };
}
function mn(e) {
  if (e)
    return {
      start: {
        line: e.startLineNumber - 1,
        character: e.startColumn - 1
      },
      end: { line: e.endLineNumber - 1, character: e.endColumn - 1 }
    };
}
function w(e) {
  if (e)
    return new f.Range(
      e.start.line + 1,
      e.start.character + 1,
      e.end.line + 1,
      e.end.character + 1
    );
}
function Sn(e) {
  return typeof e.insert < "u" && typeof e.replace < "u";
}
function Bn(e) {
  const r = f.languages.CompletionItemKind;
  switch (e) {
    case v.Text:
      return r.Text;
    case v.Method:
      return r.Method;
    case v.Function:
      return r.Function;
    case v.Constructor:
      return r.Constructor;
    case v.Field:
      return r.Field;
    case v.Variable:
      return r.Variable;
    case v.Class:
      return r.Class;
    case v.Interface:
      return r.Interface;
    case v.Module:
      return r.Module;
    case v.Property:
      return r.Property;
    case v.Unit:
      return r.Unit;
    case v.Value:
      return r.Value;
    case v.Enum:
      return r.Enum;
    case v.Keyword:
      return r.Keyword;
    case v.Snippet:
      return r.Snippet;
    case v.Color:
      return r.Color;
    case v.File:
      return r.File;
    case v.Reference:
      return r.Reference;
  }
  return r.Property;
}
function B(e) {
  if (e)
    return {
      range: w(e.range),
      text: e.newText
    };
}
function Wn(e) {
  return e && e.command === "editor.action.triggerSuggest" ? { id: e.command, title: e.title, arguments: e.arguments } : void 0;
}
var Hn = class {
  constructor(e) {
    this._worker = e;
  }
  provideHover(e, r, i) {
    let t = e.uri;
    return this._worker(t).then((n) => n.doHover(t.toString(), R(r))).then((n) => {
      if (n)
        return {
          range: w(n.range),
          contents: Xn(n.contents)
        };
    });
  }
};
function zn(e) {
  return e && typeof e == "object" && typeof e.kind == "string";
}
function sn(e) {
  return typeof e == "string" ? {
    value: e
  } : zn(e) ? e.kind === "plaintext" ? {
    value: e.value.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&")
  } : {
    value: e.value
  } : { value: "```" + e.language + `
` + e.value + "\n```\n" };
}
function Xn(e) {
  if (e)
    return Array.isArray(e) ? e.map(sn) : [sn(e)];
}
var vt = class {
  constructor(e) {
    this._worker = e;
  }
  provideDocumentHighlights(e, r, i) {
    const t = e.uri;
    return this._worker(t).then((n) => n.findDocumentHighlights(t.toString(), R(r))).then((n) => {
      if (n)
        return n.map((u) => ({
          range: w(u.range),
          kind: qn(u.kind)
        }));
    });
  }
};
function qn(e) {
  switch (e) {
    case V.Read:
      return f.languages.DocumentHighlightKind.Read;
    case V.Write:
      return f.languages.DocumentHighlightKind.Write;
    case V.Text:
      return f.languages.DocumentHighlightKind.Text;
  }
  return f.languages.DocumentHighlightKind.Text;
}
var _t = class {
  constructor(e) {
    this._worker = e;
  }
  provideDefinition(e, r, i) {
    const t = e.uri;
    return this._worker(t).then((n) => n.findDefinition(t.toString(), R(r))).then((n) => {
      if (n)
        return [hn(n)];
    });
  }
};
function hn(e) {
  return {
    uri: f.Uri.parse(e.uri),
    range: w(e.range)
  };
}
var kt = class {
  constructor(e) {
    this._worker = e;
  }
  provideReferences(e, r, i, t) {
    const n = e.uri;
    return this._worker(n).then((u) => u.findReferences(n.toString(), R(r))).then((u) => {
      if (u)
        return u.map(hn);
    });
  }
}, bt = class {
  constructor(e) {
    this._worker = e;
  }
  provideRenameEdits(e, r, i, t) {
    const n = e.uri;
    return this._worker(n).then((u) => u.doRename(n.toString(), R(r), i)).then((u) => Jn(u));
  }
};
function Jn(e) {
  if (!e || !e.changes)
    return;
  let r = [];
  for (let i in e.changes) {
    const t = f.Uri.parse(i);
    for (let n of e.changes[i])
      r.push({
        resource: t,
        versionId: void 0,
        textEdit: {
          range: w(n.range),
          text: n.newText
        }
      });
  }
  return {
    edits: r
  };
}
var $n = class {
  constructor(e) {
    this._worker = e;
  }
  provideDocumentSymbols(e, r) {
    const i = e.uri;
    return this._worker(i).then((t) => t.findDocumentSymbols(i.toString())).then((t) => {
      if (t)
        return t.map((n) => Qn(n) ? vn(n) : {
          name: n.name,
          detail: "",
          containerName: n.containerName,
          kind: _n(n.kind),
          range: w(n.location.range),
          selectionRange: w(n.location.range),
          tags: []
        });
    });
  }
};
function Qn(e) {
  return "children" in e;
}
function vn(e) {
  return {
    name: e.name,
    detail: e.detail ?? "",
    kind: _n(e.kind),
    range: w(e.range),
    selectionRange: w(e.selectionRange),
    tags: e.tags ?? [],
    children: (e.children ?? []).map((r) => vn(r))
  };
}
function _n(e) {
  let r = f.languages.SymbolKind;
  switch (e) {
    case _.File:
      return r.File;
    case _.Module:
      return r.Module;
    case _.Namespace:
      return r.Namespace;
    case _.Package:
      return r.Package;
    case _.Class:
      return r.Class;
    case _.Method:
      return r.Method;
    case _.Property:
      return r.Property;
    case _.Field:
      return r.Field;
    case _.Constructor:
      return r.Constructor;
    case _.Enum:
      return r.Enum;
    case _.Interface:
      return r.Interface;
    case _.Function:
      return r.Function;
    case _.Variable:
      return r.Variable;
    case _.Constant:
      return r.Constant;
    case _.String:
      return r.String;
    case _.Number:
      return r.Number;
    case _.Boolean:
      return r.Boolean;
    case _.Array:
      return r.Array;
  }
  return r.Function;
}
var wt = class {
  constructor(e) {
    this._worker = e;
  }
  provideLinks(e, r) {
    const i = e.uri;
    return this._worker(i).then((t) => t.findDocumentLinks(i.toString())).then((t) => {
      if (t)
        return {
          links: t.map((n) => ({
            range: w(n.range),
            url: n.target
          }))
        };
    });
  }
}, Yn = class {
  constructor(e) {
    this._worker = e;
  }
  provideDocumentFormattingEdits(e, r, i) {
    const t = e.uri;
    return this._worker(t).then((n) => n.format(t.toString(), null, kn(r)).then((u) => {
      if (!(!u || u.length === 0))
        return u.map(B);
    }));
  }
}, Gn = class {
  constructor(e) {
    this._worker = e, this.canFormatMultipleRanges = !1;
  }
  provideDocumentRangeFormattingEdits(e, r, i, t) {
    const n = e.uri;
    return this._worker(n).then((u) => u.format(n.toString(), mn(r), kn(i)).then((s) => {
      if (!(!s || s.length === 0))
        return s.map(B);
    }));
  }
};
function kn(e) {
  return {
    tabSize: e.tabSize,
    insertSpaces: e.insertSpaces
  };
}
var Zn = class {
  constructor(e) {
    this._worker = e;
  }
  provideDocumentColors(e, r) {
    const i = e.uri;
    return this._worker(i).then((t) => t.findDocumentColors(i.toString())).then((t) => {
      if (t)
        return t.map((n) => ({
          color: n.color,
          range: w(n.range)
        }));
    });
  }
  provideColorPresentations(e, r, i) {
    const t = e.uri;
    return this._worker(t).then(
      (n) => n.getColorPresentations(t.toString(), r.color, mn(r.range))
    ).then((n) => {
      if (n)
        return n.map((u) => {
          let s = {
            label: u.label
          };
          return u.textEdit && (s.textEdit = B(u.textEdit)), u.additionalTextEdits && (s.additionalTextEdits = u.additionalTextEdits.map(B)), s;
        });
    });
  }
}, Kn = class {
  constructor(e) {
    this._worker = e;
  }
  provideFoldingRanges(e, r, i) {
    const t = e.uri;
    return this._worker(t).then((n) => n.getFoldingRanges(t.toString(), r)).then((n) => {
      if (n)
        return n.map((u) => {
          const s = {
            start: u.startLine + 1,
            end: u.endLine + 1
          };
          return typeof u.kind < "u" && (s.kind = Cn(u.kind)), s;
        });
    });
  }
};
function Cn(e) {
  switch (e) {
    case P.Comment:
      return f.languages.FoldingRangeKind.Comment;
    case P.Imports:
      return f.languages.FoldingRangeKind.Imports;
    case P.Region:
      return f.languages.FoldingRangeKind.Region;
  }
}
var et = class {
  constructor(e) {
    this._worker = e;
  }
  provideSelectionRanges(e, r, i) {
    const t = e.uri;
    return this._worker(t).then(
      (n) => n.getSelectionRanges(
        t.toString(),
        r.map(R)
      )
    ).then((n) => {
      if (n)
        return n.map((u) => {
          const s = [];
          for (; u; )
            s.push({ range: w(u.range) }), u = u.parent;
          return s;
        });
    });
  }
};
function nt(e, r = !1) {
  const i = e.length;
  let t = 0, n = "", u = 0, s = 16, o = 0, g = 0, c = 0, m = 0, d = 0;
  function k(l, A) {
    let L = 0, I = 0;
    for (; L < l; ) {
      let b = e.charCodeAt(t);
      if (b >= 48 && b <= 57)
        I = I * 16 + b - 48;
      else if (b >= 65 && b <= 70)
        I = I * 16 + b - 65 + 10;
      else if (b >= 97 && b <= 102)
        I = I * 16 + b - 97 + 10;
      else
        break;
      t++, L++;
    }
    return L < l && (I = -1), I;
  }
  function p(l) {
    t = l, n = "", u = 0, s = 16, d = 0;
  }
  function N() {
    let l = t;
    if (e.charCodeAt(t) === 48)
      t++;
    else
      for (t++; t < e.length && M(e.charCodeAt(t)); )
        t++;
    if (t < e.length && e.charCodeAt(t) === 46)
      if (t++, t < e.length && M(e.charCodeAt(t)))
        for (t++; t < e.length && M(e.charCodeAt(t)); )
          t++;
      else
        return d = 3, e.substring(l, t);
    let A = t;
    if (t < e.length && (e.charCodeAt(t) === 69 || e.charCodeAt(t) === 101))
      if (t++, (t < e.length && e.charCodeAt(t) === 43 || e.charCodeAt(t) === 45) && t++, t < e.length && M(e.charCodeAt(t))) {
        for (t++; t < e.length && M(e.charCodeAt(t)); )
          t++;
        A = t;
      } else
        d = 3;
    return e.substring(l, A);
  }
  function J() {
    let l = "", A = t;
    for (; ; ) {
      if (t >= i) {
        l += e.substring(A, t), d = 2;
        break;
      }
      const L = e.charCodeAt(t);
      if (L === 34) {
        l += e.substring(A, t), t++;
        break;
      }
      if (L === 92) {
        if (l += e.substring(A, t), t++, t >= i) {
          d = 2;
          break;
        }
        switch (e.charCodeAt(t++)) {
          case 34:
            l += '"';
            break;
          case 92:
            l += "\\";
            break;
          case 47:
            l += "/";
            break;
          case 98:
            l += "\b";
            break;
          case 102:
            l += "\f";
            break;
          case 110:
            l += `
`;
            break;
          case 114:
            l += "\r";
            break;
          case 116:
            l += "	";
            break;
          case 117:
            const b = k(4);
            b >= 0 ? l += String.fromCharCode(b) : d = 4;
            break;
          default:
            d = 5;
        }
        A = t;
        continue;
      }
      if (L >= 0 && L <= 31)
        if (x(L)) {
          l += e.substring(A, t), d = 2;
          break;
        } else
          d = 6;
      t++;
    }
    return l;
  }
  function ce() {
    if (n = "", d = 0, u = t, g = o, m = c, t >= i)
      return u = i, s = 17;
    let l = e.charCodeAt(t);
    if ($(l)) {
      do
        t++, n += String.fromCharCode(l), l = e.charCodeAt(t);
      while ($(l));
      return s = 15;
    }
    if (x(l))
      return t++, n += String.fromCharCode(l), l === 13 && e.charCodeAt(t) === 10 && (t++, n += `
`), o++, c = t, s = 14;
    switch (l) {
      case 123:
        return t++, s = 1;
      case 125:
        return t++, s = 2;
      case 91:
        return t++, s = 3;
      case 93:
        return t++, s = 4;
      case 58:
        return t++, s = 6;
      case 44:
        return t++, s = 5;
      case 34:
        return t++, n = J(), s = 10;
      case 47:
        const A = t - 1;
        if (e.charCodeAt(t + 1) === 47) {
          for (t += 2; t < i && !x(e.charCodeAt(t)); )
            t++;
          return n = e.substring(A, t), s = 12;
        }
        if (e.charCodeAt(t + 1) === 42) {
          t += 2;
          const L = i - 1;
          let I = !1;
          for (; t < L; ) {
            const b = e.charCodeAt(t);
            if (b === 42 && e.charCodeAt(t + 1) === 47) {
              t += 2, I = !0;
              break;
            }
            t++, x(b) && (b === 13 && e.charCodeAt(t) === 10 && t++, o++, c = t);
          }
          return I || (t++, d = 1), n = e.substring(A, t), s = 13;
        }
        return n += String.fromCharCode(l), t++, s = 16;
      case 45:
        if (n += String.fromCharCode(l), t++, t === i || !M(e.charCodeAt(t)))
          return s = 16;
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
      case 57:
        return n += N(), s = 11;
      default:
        for (; t < i && In(l); )
          t++, l = e.charCodeAt(t);
        if (u !== t) {
          switch (n = e.substring(u, t), n) {
            case "true":
              return s = 8;
            case "false":
              return s = 9;
            case "null":
              return s = 7;
          }
          return s = 16;
        }
        return n += String.fromCharCode(l), t++, s = 16;
    }
  }
  function In(l) {
    if ($(l) || x(l))
      return !1;
    switch (l) {
      case 125:
      case 93:
      case 123:
      case 91:
      case 34:
      case 58:
      case 44:
      case 47:
        return !1;
    }
    return !0;
  }
  function En() {
    let l;
    do
      l = ce();
    while (l >= 12 && l <= 15);
    return l;
  }
  return {
    setPosition: p,
    getPosition: () => t,
    scan: r ? En : ce,
    getToken: () => s,
    getTokenValue: () => n,
    getTokenOffset: () => u,
    getTokenLength: () => t - u,
    getTokenStartLine: () => g,
    getTokenStartCharacter: () => u - m,
    getTokenError: () => d
  };
}
function $(e) {
  return e === 32 || e === 9;
}
function x(e) {
  return e === 10 || e === 13;
}
function M(e) {
  return e >= 48 && e <= 57;
}
var an;
(function(e) {
  e[e.lineFeed = 10] = "lineFeed", e[e.carriageReturn = 13] = "carriageReturn", e[e.space = 32] = "space", e[e._0 = 48] = "_0", e[e._1 = 49] = "_1", e[e._2 = 50] = "_2", e[e._3 = 51] = "_3", e[e._4 = 52] = "_4", e[e._5 = 53] = "_5", e[e._6 = 54] = "_6", e[e._7 = 55] = "_7", e[e._8 = 56] = "_8", e[e._9 = 57] = "_9", e[e.a = 97] = "a", e[e.b = 98] = "b", e[e.c = 99] = "c", e[e.d = 100] = "d", e[e.e = 101] = "e", e[e.f = 102] = "f", e[e.g = 103] = "g", e[e.h = 104] = "h", e[e.i = 105] = "i", e[e.j = 106] = "j", e[e.k = 107] = "k", e[e.l = 108] = "l", e[e.m = 109] = "m", e[e.n = 110] = "n", e[e.o = 111] = "o", e[e.p = 112] = "p", e[e.q = 113] = "q", e[e.r = 114] = "r", e[e.s = 115] = "s", e[e.t = 116] = "t", e[e.u = 117] = "u", e[e.v = 118] = "v", e[e.w = 119] = "w", e[e.x = 120] = "x", e[e.y = 121] = "y", e[e.z = 122] = "z", e[e.A = 65] = "A", e[e.B = 66] = "B", e[e.C = 67] = "C", e[e.D = 68] = "D", e[e.E = 69] = "E", e[e.F = 70] = "F", e[e.G = 71] = "G", e[e.H = 72] = "H", e[e.I = 73] = "I", e[e.J = 74] = "J", e[e.K = 75] = "K", e[e.L = 76] = "L", e[e.M = 77] = "M", e[e.N = 78] = "N", e[e.O = 79] = "O", e[e.P = 80] = "P", e[e.Q = 81] = "Q", e[e.R = 82] = "R", e[e.S = 83] = "S", e[e.T = 84] = "T", e[e.U = 85] = "U", e[e.V = 86] = "V", e[e.W = 87] = "W", e[e.X = 88] = "X", e[e.Y = 89] = "Y", e[e.Z = 90] = "Z", e[e.asterisk = 42] = "asterisk", e[e.backslash = 92] = "backslash", e[e.closeBrace = 125] = "closeBrace", e[e.closeBracket = 93] = "closeBracket", e[e.colon = 58] = "colon", e[e.comma = 44] = "comma", e[e.dot = 46] = "dot", e[e.doubleQuote = 34] = "doubleQuote", e[e.minus = 45] = "minus", e[e.openBrace = 123] = "openBrace", e[e.openBracket = 91] = "openBracket", e[e.plus = 43] = "plus", e[e.slash = 47] = "slash", e[e.formFeed = 12] = "formFeed", e[e.tab = 9] = "tab";
})(an || (an = {}));
new Array(20).fill(0).map((e, r) => " ".repeat(r));
var D = 200;
new Array(D).fill(0).map((e, r) => `
` + " ".repeat(r)), new Array(D).fill(0).map((e, r) => "\r" + " ".repeat(r)), new Array(D).fill(0).map((e, r) => `\r
` + " ".repeat(r)), new Array(D).fill(0).map((e, r) => `
` + "	".repeat(r)), new Array(D).fill(0).map((e, r) => "\r" + "	".repeat(r)), new Array(D).fill(0).map((e, r) => `\r
` + "	".repeat(r));
var on;
(function(e) {
  e.DEFAULT = {
    allowTrailingComma: !1
  };
})(on || (on = {}));
var tt = nt, cn;
(function(e) {
  e[e.None = 0] = "None", e[e.UnexpectedEndOfComment = 1] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 2] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 3] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 4] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 5] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 6] = "InvalidCharacter";
})(cn || (cn = {}));
var ln;
(function(e) {
  e[e.OpenBraceToken = 1] = "OpenBraceToken", e[e.CloseBraceToken = 2] = "CloseBraceToken", e[e.OpenBracketToken = 3] = "OpenBracketToken", e[e.CloseBracketToken = 4] = "CloseBracketToken", e[e.CommaToken = 5] = "CommaToken", e[e.ColonToken = 6] = "ColonToken", e[e.NullKeyword = 7] = "NullKeyword", e[e.TrueKeyword = 8] = "TrueKeyword", e[e.FalseKeyword = 9] = "FalseKeyword", e[e.StringLiteral = 10] = "StringLiteral", e[e.NumericLiteral = 11] = "NumericLiteral", e[e.LineCommentTrivia = 12] = "LineCommentTrivia", e[e.BlockCommentTrivia = 13] = "BlockCommentTrivia", e[e.LineBreakTrivia = 14] = "LineBreakTrivia", e[e.Trivia = 15] = "Trivia", e[e.Unknown = 16] = "Unknown", e[e.EOF = 17] = "EOF";
})(ln || (ln = {}));
var fn;
(function(e) {
  e[e.InvalidSymbol = 1] = "InvalidSymbol", e[e.InvalidNumberFormat = 2] = "InvalidNumberFormat", e[e.PropertyNameExpected = 3] = "PropertyNameExpected", e[e.ValueExpected = 4] = "ValueExpected", e[e.ColonExpected = 5] = "ColonExpected", e[e.CommaExpected = 6] = "CommaExpected", e[e.CloseBraceExpected = 7] = "CloseBraceExpected", e[e.CloseBracketExpected = 8] = "CloseBracketExpected", e[e.EndOfFileExpected = 9] = "EndOfFileExpected", e[e.InvalidCommentToken = 10] = "InvalidCommentToken", e[e.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 14] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 16] = "InvalidCharacter";
})(fn || (fn = {}));
function rt(e) {
  return {
    getInitialState: () => new wn(null, null, !1, null),
    tokenize: (r, i) => gt(e, r, i)
  };
}
var dn = "delimiter.bracket.json", gn = "delimiter.array.json", it = "delimiter.colon.json", ut = "delimiter.comma.json", st = "keyword.json", at = "keyword.json", ot = "string.value.json", ct = "number.json", lt = "string.key.json", ft = "comment.block.json", dt = "comment.line.json", y = class bn {
  constructor(r, i) {
    this.parent = r, this.type = i;
  }
  static pop(r) {
    return r ? r.parent : null;
  }
  static push(r, i) {
    return new bn(r, i);
  }
  static equals(r, i) {
    if (!r && !i)
      return !0;
    if (!r || !i)
      return !1;
    for (; r && i; ) {
      if (r === i)
        return !0;
      if (r.type !== i.type)
        return !1;
      r = r.parent, i = i.parent;
    }
    return !0;
  }
}, wn = class oe {
  constructor(r, i, t, n) {
    this._state = r, this.scanError = i, this.lastWasColon = t, this.parents = n;
  }
  clone() {
    return new oe(this._state, this.scanError, this.lastWasColon, this.parents);
  }
  equals(r) {
    return r === this ? !0 : !r || !(r instanceof oe) ? !1 : this.scanError === r.scanError && this.lastWasColon === r.lastWasColon && y.equals(this.parents, r.parents);
  }
  getStateData() {
    return this._state;
  }
  setStateData(r) {
    this._state = r;
  }
};
function gt(e, r, i, t = 0) {
  let n = 0, u = !1;
  switch (i.scanError) {
    case 2:
      r = '"' + r, n = 1;
      break;
    case 1:
      r = "/*" + r, n = 2;
      break;
  }
  const s = tt(r);
  let o = i.lastWasColon, g = i.parents;
  const c = {
    tokens: [],
    endState: i.clone()
  };
  for (; ; ) {
    let m = t + s.getPosition(), d = "";
    const k = s.scan();
    if (k === 17)
      break;
    if (m === t + s.getPosition())
      throw new Error(
        "Scanner did not advance, next 3 characters are: " + r.substr(s.getPosition(), 3)
      );
    switch (u && (m -= n), u = n > 0, k) {
      case 1:
        g = y.push(
          g,
          0
          /* Object */
        ), d = dn, o = !1;
        break;
      case 2:
        g = y.pop(g), d = dn, o = !1;
        break;
      case 3:
        g = y.push(
          g,
          1
          /* Array */
        ), d = gn, o = !1;
        break;
      case 4:
        g = y.pop(g), d = gn, o = !1;
        break;
      case 6:
        d = it, o = !0;
        break;
      case 5:
        d = ut, o = !1;
        break;
      case 8:
      case 9:
        d = st, o = !1;
        break;
      case 7:
        d = at, o = !1;
        break;
      case 10:
        const N = (g ? g.type : 0) === 1;
        d = o || N ? ot : lt, o = !1;
        break;
      case 11:
        d = ct, o = !1;
        break;
    }
    switch (k) {
      case 12:
        d = dt;
        break;
      case 13:
        d = ft;
        break;
    }
    c.endState = new wn(
      i.getStateData(),
      s.getTokenError(),
      o,
      g
    ), c.tokens.push({
      startIndex: m,
      scopes: d
    });
  }
  return c;
}
var E;
function At() {
  return new Promise((e, r) => {
    if (!E)
      return r("JSON not registered!");
    e(E);
  });
}
var pt = class extends xn {
  constructor(e, r, i) {
    super(e, r, i.onDidChange), this._disposables.push(
      f.editor.onWillDisposeModel((t) => {
        this._resetSchema(t.uri);
      })
    ), this._disposables.push(
      f.editor.onDidChangeModelLanguage((t) => {
        this._resetSchema(t.model.uri);
      })
    );
  }
  _resetSchema(e) {
    this._worker().then((r) => {
      r.resetSchema(e.toString());
    });
  }
};
function It(e) {
  const r = [], i = [], t = new Tn(e);
  r.push(t), E = (...s) => t.getLanguageServiceWorker(...s);
  function n() {
    const { languageId: s, modeConfiguration: o } = e;
    An(i), o.documentFormattingEdits && i.push(
      f.languages.registerDocumentFormattingEditProvider(
        s,
        new Yn(E)
      )
    ), o.documentRangeFormattingEdits && i.push(
      f.languages.registerDocumentRangeFormattingEditProvider(
        s,
        new Gn(E)
      )
    ), o.completionItems && i.push(
      f.languages.registerCompletionItemProvider(
        s,
        new Vn(E, [" ", ":", '"'])
      )
    ), o.hovers && i.push(
      f.languages.registerHoverProvider(s, new Hn(E))
    ), o.documentSymbols && i.push(
      f.languages.registerDocumentSymbolProvider(
        s,
        new $n(E)
      )
    ), o.tokens && i.push(f.languages.setTokensProvider(s, rt(!0))), o.colors && i.push(
      f.languages.registerColorProvider(
        s,
        new Zn(E)
      )
    ), o.foldingRanges && i.push(
      f.languages.registerFoldingRangeProvider(
        s,
        new Kn(E)
      )
    ), o.diagnostics && i.push(new pt(s, E, e)), o.selectionRanges && i.push(
      f.languages.registerSelectionRangeProvider(
        s,
        new et(E)
      )
    );
  }
  n(), r.push(f.languages.setLanguageConfiguration(e.languageId, mt));
  let u = e.modeConfiguration;
  return e.onDidChange((s) => {
    s.modeConfiguration !== u && (u = s.modeConfiguration, n());
  }), r.push(pn(i)), pn(r);
}
function pn(e) {
  return { dispose: () => An(e) };
}
function An(e) {
  for (; e.length; )
    e.pop().dispose();
}
var mt = {
  wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,
  comments: {
    lineComment: "//",
    blockComment: ["/*", "*/"]
  },
  brackets: [
    ["{", "}"],
    ["[", "]"]
  ],
  autoClosingPairs: [
    { open: "{", close: "}", notIn: ["string"] },
    { open: "[", close: "]", notIn: ["string"] },
    { open: '"', close: '"', notIn: ["string"] }
  ]
};
export {
  Vn as CompletionAdapter,
  _t as DefinitionAdapter,
  xn as DiagnosticsAdapter,
  Zn as DocumentColorAdapter,
  Yn as DocumentFormattingEditProvider,
  vt as DocumentHighlightAdapter,
  wt as DocumentLinkAdapter,
  Gn as DocumentRangeFormattingEditProvider,
  $n as DocumentSymbolAdapter,
  Kn as FoldingRangeAdapter,
  Hn as HoverAdapter,
  kt as ReferenceAdapter,
  bt as RenameAdapter,
  et as SelectionRangeAdapter,
  Tn as WorkerManager,
  R as fromPosition,
  mn as fromRange,
  At as getWorker,
  It as setupMode,
  w as toRange,
  B as toTextEdit
};
