use-monaco
Version:
[](https://npm.im/use-monaco)
5 lines • 118 kB
JavaScript
(()=>{var un=Object.create,Je=Object.defineProperty,fn=Object.getPrototypeOf,cn=Object.prototype.hasOwnProperty,ln=Object.getOwnPropertyNames,pn=Object.getOwnPropertyDescriptor,Kt=e=>Je(e,"__esModule",{value:!0}),qt=(e,t)=>()=>(t||(t={exports:{}},e(t.exports,t)),t.exports),hn=(e,t)=>{Kt(e);for(var n in t)Je(e,n,{get:t[n],enumerable:!0})},lt=(e,t,n)=>{if(Kt(e),t&&typeof t=="object"||typeof t=="function")for(let r of ln(t))!cn.call(e,r)&&r!=="default"&&Je(e,r,{get:()=>t[r],enumerable:!(n=pn(t,r))||n.enumerable});return e},Ce=e=>e&&e.__esModule?e:lt(Je(e!=null?un(fn(e)):{},"default",{value:e,enumerable:!0}),e),Ee=qt(gn=>{lt(gn,Ce(require("monaco-editor-core")))}),nn=qt(di=>{hn(di,{setupMode:()=>vi});var ae=Ce(Ee());function vi(e){var t=[],n=[],r=new Ht(e);t.push(r);var i=function(){for(var u=[],s=0;s<arguments.length;s++)u[s]=arguments[s];return r.getLanguageServiceWorker.apply(r,u)};function a(){var u=e.languageId,s=e.modeConfiguration;rn(n),s.documentFormattingEdits&&n.push(ae.languages.registerDocumentFormattingEditProvider(u,new Br(i))),s.documentRangeFormattingEdits&&n.push(ae.languages.registerDocumentRangeFormattingEditProvider(u,new Hr(i))),s.completionItems&&n.push(ae.languages.registerCompletionItemProvider(u,new Ur(i))),s.hovers&&n.push(ae.languages.registerHoverProvider(u,new Jr(i))),s.documentSymbols&&n.push(ae.languages.registerDocumentSymbolProvider(u,new Kr(i))),s.tokens&&n.push(ae.languages.setTokensProvider(u,Qr(!0))),s.colors&&n.push(ae.languages.registerColorProvider(u,new zr(i))),s.foldingRanges&&n.push(ae.languages.registerFoldingRangeProvider(u,new Gr(i))),s.diagnostics&&n.push(new $r(u,i,e)),s.selectionRanges&&n.push(ae.languages.registerSelectionRangeProvider(u,new Zr(i)))}a(),t.push(ae.languages.setLanguageConfiguration(e.languageId,mi));var o=e.modeConfiguration;return e.onDidChange(function(u){u.modeConfiguration!==o&&(o=u.modeConfiguration,a())}),t.push(tn(n)),tn(t)}function tn(e){return{dispose:function(){return rn(e)}}}function rn(e){for(;e.length;)e.pop().dispose()}var mi={wordPattern:/(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}]}}),Oe=Ce(Ee()),yi=function(){function e(t,n,r){this._onDidChange=new Oe.Emitter,this._languageId=t,this.setDiagnosticsOptions(n),this.setModeConfiguration(r)}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"diagnosticsOptions",{get:function(){return this._diagnosticsOptions},enumerable:!1,configurable:!0}),e.prototype.setDiagnosticsOptions=function(t){this._diagnosticsOptions=t||Object.create(null),this._onDidChange.fire(this)},e.prototype.setModeConfiguration=function(t){this._modeConfiguration=t||Object.create(null),this._onDidChange.fire(this)},e}(),bi={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1},Si={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},an=new yi("json",bi,Si);Oe.languages.json={jsonDefaults:an};var Bt=Ce(Ee()),dn=2*60*1e3,Ht=function(){function e(t){var n=this;this._defaults=t,this._worker=null,this._idleCheckInterval=setInterval(function(){return n._checkIfIdle()},30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(function(){return n._stopWorker()})}return e.prototype._stopWorker=function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null},e.prototype.dispose=function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()},e.prototype._checkIfIdle=function(){if(!this._worker)return;var t=Date.now()-this._lastUsedTime;t>dn&&this._stopWorker()},e.prototype._getClient=function(){return this._lastUsedTime=Date.now(),this._client||(this._worker=Bt.editor.createWebWorker({moduleId:"vs/language/json/jsonWorker",label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i;return this._getClient().then(function(a){i=a}).then(function(a){return t._worker.withSyncedResources(n)}).then(function(a){return i})},e}(),$=Ce(Ee());"use strict";function Te(e,t){t===void 0&&(t=!1);var n=e.length,r=0,i="",a=0,o=16,u=0,s=0,l=0,c=0,f=0;function p(g,k){for(var w=0,C=0;w<g||!k;){var A=e.charCodeAt(r);if(A>=48&&A<=57)C=C*16+A-48;else if(A>=65&&A<=70)C=C*16+A-65+10;else if(A>=97&&A<=102)C=C*16+A-97+10;else break;r++,w++}return w<g&&(C=-1),C}function d(g){r=g,i="",a=0,o=16,f=0}function m(){var g=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&we(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&we(e.charCodeAt(r)))for(r++;r<e.length&&we(e.charCodeAt(r));)r++;else return f=3,e.substring(g,r);var k=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&we(e.charCodeAt(r))){for(r++;r<e.length&&we(e.charCodeAt(r));)r++;k=r}else f=3;return e.substring(g,k)}function b(){for(var g="",k=r;;){if(r>=n){g+=e.substring(k,r),f=2;break}var w=e.charCodeAt(r);if(w===34){g+=e.substring(k,r),r++;break}if(w===92){if(g+=e.substring(k,r),r++,r>=n){f=2;break}var C=e.charCodeAt(r++);switch(C){case 34:g+='"';break;case 92:g+="\\";break;case 47:g+="/";break;case 98:g+="\b";break;case 102:g+="\f";break;case 110:g+=`
`;break;case 114:g+="\r";break;case 116:g+=" ";break;case 117:var A=p(4,!0);A>=0?g+=String.fromCharCode(A):f=4;break;default:f=5}k=r;continue}if(w>=0&&w<=31)if(Pe(w)){g+=e.substring(k,r),f=2;break}else f=6;r++}return g}function v(){if(i="",f=0,a=r,s=u,c=l,r>=n)return a=n,o=17;var g=e.charCodeAt(r);if(pt(g)){do r++,i+=String.fromCharCode(g),g=e.charCodeAt(r);while(pt(g));return o=15}if(Pe(g))return r++,i+=String.fromCharCode(g),g===13&&e.charCodeAt(r)===10&&(r++,i+=`
`),u++,l=r,o=14;switch(g){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=b(),o=10;case 47:var k=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!Pe(e.charCodeAt(r));)r++;return i=e.substring(k,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;for(var w=n-1,C=!1;r<w;){var A=e.charCodeAt(r);if(A===42&&e.charCodeAt(r+1)===47){r+=2,C=!0;break}r++,Pe(A)&&(A===13&&e.charCodeAt(r)===10&&r++,u++,l=r)}return C||(r++,f=1),i=e.substring(k,r),o=13}return i+=String.fromCharCode(g),r++,o=16;case 45:if(i+=String.fromCharCode(g),r++,r===n||!we(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&S(g);)r++,g=e.charCodeAt(r);if(a!==r){i=e.substring(a,r);switch(i){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return i+=String.fromCharCode(g),r++,o=16}}function S(g){if(pt(g)||Pe(g))return!1;switch(g){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function y(){var g;do g=v();while(g>=12&&g<=15);return g}return{setPosition:d,getPosition:function(){return r},scan:t?y:v,getToken:function(){return o},getTokenValue:function(){return i},getTokenOffset:function(){return a},getTokenLength:function(){return r-a},getTokenStartLine:function(){return s},getTokenStartCharacter:function(){return a-c},getTokenError:function(){return f}}}function pt(e){return e===32||e===9||e===11||e===12||e===160||e===5760||e>=8192&&e<=8203||e===8239||e===8287||e===12288||e===65279}function Pe(e){return e===10||e===13||e===8232||e===8233}function we(e){return e>=48&&e<=57}"use strict";"use strict";var Ne;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Ne||(Ne={}));function Gt(e,t){var n=[],r=new Object,i=void 0,a={value:{},offset:0,length:0,type:"object",parent:void 0},o=!1;function u(s,l,c,f){a.value=s,a.offset=l,a.length=c,a.type=f,a.colonOffset=void 0,i=a}try{Me(e,{onObjectBegin:function(s,l){if(t<=s)throw r;i=void 0,o=t>s,n.push("")},onObjectProperty:function(s,l,c){if(t<l)throw r;if(u(s,l,c,"property"),n[n.length-1]=s,t<=l+c)throw r},onObjectEnd:function(s,l){if(t<=s)throw r;i=void 0,n.pop()},onArrayBegin:function(s,l){if(t<=s)throw r;i=void 0,n.push(0)},onArrayEnd:function(s,l){if(t<=s)throw r;i=void 0,n.pop()},onLiteralValue:function(s,l,c){if(t<l)throw r;if(u(s,l,c,zt(s)),t<=l+c)throw r},onSeparator:function(s,l,c){if(t<=l)throw r;if(s===":"&&i&&i.type==="property")i.colonOffset=l,o=!1,i=void 0;else if(s===","){var f=n[n.length-1];typeof f=="number"?n[n.length-1]=f+1:(o=!0,n[n.length-1]=""),i=void 0}}})}catch(s){if(s!==r)throw s}return{path:n,previousNode:i,isAtPropertyKey:o,matches:function(s){for(var l=0,c=0;l<s.length&&c<n.length;c++)if(s[l]===n[c]||s[l]==="*")l++;else if(s[l]!=="**")return!1;return l===s.length}}}function Zt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=Ne.DEFAULT);var r=null,i=[],a=[];function o(s){Array.isArray(i)?i.push(s):r!==null&&(i[r]=s)}var u={onObjectBegin:function(){var s={};o(s),a.push(i),i=s,r=null},onObjectProperty:function(s){r=s},onObjectEnd:function(){i=a.pop()},onArrayBegin:function(){var s=[];o(s),a.push(i),i=s,r=null},onArrayEnd:function(){i=a.pop()},onLiteralValue:o,onError:function(s,l,c){t.push({error:s,offset:l,length:c})}};return Me(e,u,n),i[0]}function ht(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=Ne.DEFAULT);var r={type:"array",offset:-1,length:-1,children:[],parent:void 0};function i(s){r.type==="property"&&(r.length=s-r.offset,r=r.parent)}function a(s){return r.children.push(s),s}var o={onObjectBegin:function(s){r=a({type:"object",offset:s,length:-1,parent:r,children:[]})},onObjectProperty:function(s,l,c){r=a({type:"property",offset:l,length:-1,parent:r,children:[]}),r.children.push({type:"string",value:s,offset:l,length:c,parent:r})},onObjectEnd:function(s,l){i(s+l),r.length=s+l-r.offset,r=r.parent,i(s+l)},onArrayBegin:function(s,l){r=a({type:"array",offset:s,length:-1,parent:r,children:[]})},onArrayEnd:function(s,l){r.length=s+l-r.offset,r=r.parent,i(s+l)},onLiteralValue:function(s,l,c){a({type:zt(s),offset:l,length:c,parent:r,value:s}),i(l+c)},onSeparator:function(s,l,c){r.type==="property"&&(s===":"?r.colonOffset=l:s===","&&i(l))},onError:function(s,l,c){t.push({error:s,offset:l,length:c})}};Me(e,o,n);var u=r.children[0];return u&&delete u.parent,u}function gt(e,t){if(!e)return;for(var n=e,r=0,i=t;r<i.length;r++){var a=i[r];if(typeof a=="string"){if(n.type!=="object"||!Array.isArray(n.children))return;for(var o=!1,u=0,s=n.children;u<s.length;u++){var l=s[u];if(Array.isArray(l.children)&&l.children[0].value===a){n=l.children[1],o=!0;break}}if(!o)return}else{var c=a;if(n.type!=="array"||c<0||!Array.isArray(n.children)||c>=n.children.length)return;n=n.children[c]}}return n}function dt(e){if(!e.parent||!e.parent.children)return[];var t=dt(e.parent);if(e.parent.type==="property"){var n=e.parent.children[0].value;t.push(n)}else if(e.parent.type==="array"){var r=e.parent.children.indexOf(e);r!==-1&&t.push(r)}return t}function Ke(e){switch(e.type){case"array":return e.children.map(Ke);case"object":for(var t=Object.create(null),n=0,r=e.children;n<r.length;n++){var i=r[n],a=i.children[1];a&&(t[i.children[0].value]=Ke(a))}return t;case"null":case"string":case"number":case"boolean":return e.value;default:return}}function mn(e,t,n){return n===void 0&&(n=!1),t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}function mt(e,t,n){if(n===void 0&&(n=!1),mn(e,t,n)){var r=e.children;if(Array.isArray(r))for(var i=0;i<r.length&&r[i].offset<=t;i++){var a=mt(r[i],t,n);if(a)return a}return e}}function Me(e,t,n){n===void 0&&(n=Ne.DEFAULT);var r=Te(e,!1);function i(x){return x?function(){return x(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:function(){return!0}}function a(x){return x?function(T){return x(T,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:function(){return!0}}var o=i(t.onObjectBegin),u=a(t.onObjectProperty),s=i(t.onObjectEnd),l=i(t.onArrayBegin),c=i(t.onArrayEnd),f=a(t.onLiteralValue),p=a(t.onSeparator),d=i(t.onComment),m=a(t.onError),b=n&&n.disallowComments,v=n&&n.allowTrailingComma;function S(){for(;;){var x=r.scan();switch(r.getTokenError()){case 4:y(14);break;case 5:y(15);break;case 3:y(13);break;case 1:b||y(11);break;case 2:y(12);break;case 6:y(16);break}switch(x){case 12:case 13:b?y(10):d();break;case 16:y(1);break;case 15:case 14:break;default:return x}}}function y(x,T,j){if(T===void 0&&(T=[]),j===void 0&&(j=[]),m(x),T.length+j.length>0)for(var I=r.getToken();I!==17;){if(T.indexOf(I)!==-1){S();break}else if(j.indexOf(I)!==-1)break;I=S()}}function g(x){var T=r.getTokenValue();return x?f(T):u(T),S(),!0}function k(){switch(r.getToken()){case 11:var x=0;try{x=JSON.parse(r.getTokenValue()),typeof x!="number"&&(y(2),x=0)}catch(T){y(2)}f(x);break;case 7:f(null);break;case 8:f(!0);break;case 9:f(!1);break;default:return!1}return S(),!0}function w(){return r.getToken()!==10?(y(3,[],[2,5]),!1):(g(!1),r.getToken()===6?(p(":"),S(),F()||y(4,[],[2,5])):y(5,[],[2,5]),!0)}function C(){o(),S();for(var x=!1;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(x||y(4,[],[]),p(","),S(),r.getToken()===2&&v)break}else x&&y(6,[],[]);w()||y(4,[],[2,5]),x=!0}return s(),r.getToken()!==2?y(7,[2],[]):S(),!0}function A(){l(),S();for(var x=!1;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(x||y(4,[],[]),p(","),S(),r.getToken()===4&&v)break}else x&&y(6,[],[]);F()||y(4,[],[4,5]),x=!0}return c(),r.getToken()!==4?y(8,[4],[]):S(),!0}function F(){switch(r.getToken()){case 3:return A();case 1:return C();case 10:return g(!0);default:return k()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(y(4,[],[]),!1):F()?(r.getToken()!==17&&y(9,[],[]),!0):(y(4,[],[]),!1)}function Xt(e,t){var n=Te(e),r=[],i,a=0,o;do{o=n.getPosition(),i=n.scan();switch(i){case 12:case 13:case 17:a!==o&&r.push(e.substring(a,o)),t!==void 0&&r.push(n.getTokenValue().replace(/[^\r\n]/g,t)),a=n.getPosition();break}}while(i!==17);return r.join("")}function zt(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(e){if(Array.isArray(e))return"array"}else return"null";return"object"}default:return"null"}}"use strict";"use strict";var ue=Te,_i=Gt,Qt=Zt,Ji=ht,Ki=gt,Yt=mt,er=dt,tr=Ke,qi=Me,Bi=Xt;function Ae(e,t){if(e===t)return!0;if(e==null||t===null||t===void 0)return!1;if(typeof e!==typeof t)return!1;if(typeof e!="object")return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;var n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!Ae(e[n],t[n]))return!1}else{var i=[];for(r in e)i.push(r);i.sort();var a=[];for(r in t)a.push(r);if(a.sort(),!Ae(i,a))return!1;for(n=0;n<i.length;n++)if(!Ae(e[i[n]],t[i[n]]))return!1}return!0}function G(e){return typeof e=="number"}function Y(e){return typeof e!="undefined"}function X(e){return typeof e=="boolean"}function rr(e){return typeof e=="string"}"use strict";var Q;(function(e){function t(r,i){return{line:r,character:i}}e.create=t;function n(r){var i=r;return h.objectLiteral(i)&&h.number(i.line)&&h.number(i.character)}e.is=n})(Q||(Q={}));var V;(function(e){function t(r,i,a,o){if(h.number(r)&&h.number(i)&&h.number(a)&&h.number(o))return{start:Q.create(r,i),end:Q.create(a,o)};if(Q.is(r)&&Q.is(i))return{start:r,end:i};throw new Error("Range#create called with invalid arguments["+r+", "+i+", "+a+", "+o+"]")}e.create=t;function n(r){var i=r;return h.objectLiteral(i)&&Q.is(i.start)&&Q.is(i.end)}e.is=n})(V||(V={}));var be;(function(e){function t(r,i){return{uri:r,range:i}}e.create=t;function n(r){var i=r;return h.defined(i)&&V.is(i.range)&&(h.string(i.uri)||h.undefined(i.uri))}e.is=n})(be||(be={}));var nr;(function(e){function t(r,i,a,o){return{targetUri:r,targetRange:i,targetSelectionRange:a,originSelectionRange:o}}e.create=t;function n(r){var i=r;return h.defined(i)&&V.is(i.targetRange)&&h.string(i.targetUri)&&(V.is(i.targetSelectionRange)||h.undefined(i.targetSelectionRange))&&(V.is(i.originSelectionRange)||h.undefined(i.originSelectionRange))}e.is=n})(nr||(nr={}));var qe;(function(e){function t(r,i,a,o){return{red:r,green:i,blue:a,alpha:o}}e.create=t;function n(r){var i=r;return h.number(i.red)&&h.number(i.green)&&h.number(i.blue)&&h.number(i.alpha)}e.is=n})(qe||(qe={}));var vt;(function(e){function t(r,i){return{range:r,color:i}}e.create=t;function n(r){var i=r;return V.is(i.range)&&qe.is(i.color)}e.is=n})(vt||(vt={}));var yt;(function(e){function t(r,i,a){return{label:r,textEdit:i,additionalTextEdits:a}}e.create=t;function n(r){var i=r;return h.string(i.label)&&(h.undefined(i.textEdit)||Z.is(i))&&(h.undefined(i.additionalTextEdits)||h.typedArray(i.additionalTextEdits,Z.is))}e.is=n})(yt||(yt={}));var le;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(le||(le={}));var bt;(function(e){function t(r,i,a,o,u){var s={startLine:r,endLine:i};return h.defined(a)&&(s.startCharacter=a),h.defined(o)&&(s.endCharacter=o),h.defined(u)&&(s.kind=u),s}e.create=t;function n(r){var i=r;return h.number(i.startLine)&&h.number(i.startLine)&&(h.undefined(i.startCharacter)||h.number(i.startCharacter))&&(h.undefined(i.endCharacter)||h.number(i.endCharacter))&&(h.undefined(i.kind)||h.string(i.kind))}e.is=n})(bt||(bt={}));var St;(function(e){function t(r,i){return{location:r,message:i}}e.create=t;function n(r){var i=r;return h.defined(i)&&be.is(i.location)&&h.string(i.message)}e.is=n})(St||(St={}));var E;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(E||(E={}));var ir;(function(e){e.Unnecessary=1,e.Deprecated=2})(ir||(ir={}));var ee;(function(e){function t(r,i,a,o,u,s){var l={range:r,message:i};return h.defined(a)&&(l.severity=a),h.defined(o)&&(l.code=o),h.defined(u)&&(l.source=u),h.defined(s)&&(l.relatedInformation=s),l}e.create=t;function n(r){var i=r;return h.defined(i)&&V.is(i.range)&&h.string(i.message)&&(h.number(i.severity)||h.undefined(i.severity))&&(h.number(i.code)||h.string(i.code)||h.undefined(i.code))&&(h.string(i.source)||h.undefined(i.source))&&(h.undefined(i.relatedInformation)||h.typedArray(i.relatedInformation,St.is))}e.is=n})(ee||(ee={}));var Fe;(function(e){function t(r,i){for(var a=[],o=2;o<arguments.length;o++)a[o-2]=arguments[o];var u={title:r,command:i};return h.defined(a)&&a.length>0&&(u.arguments=a),u}e.create=t;function n(r){var i=r;return h.defined(i)&&h.string(i.title)&&h.string(i.command)}e.is=n})(Fe||(Fe={}));var Z;(function(e){function t(a,o){return{range:a,newText:o}}e.replace=t;function n(a,o){return{range:{start:a,end:a},newText:o}}e.insert=n;function r(a){return{range:a,newText:""}}e.del=r;function i(a){var o=a;return h.objectLiteral(o)&&h.string(o.newText)&&V.is(o.range)}e.is=i})(Z||(Z={}));var Be;(function(e){function t(r,i){return{textDocument:r,edits:i}}e.create=t;function n(r){var i=r;return h.defined(i)&&He.is(i.textDocument)&&Array.isArray(i.edits)}e.is=n})(Be||(Be={}));var ze;(function(e){function t(r,i){var a={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),a}e.create=t;function n(r){var i=r;return i&&i.kind==="create"&&h.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||h.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||h.boolean(i.options.ignoreIfExists)))}e.is=n})(ze||(ze={}));var Ge;(function(e){function t(r,i,a){var o={kind:"rename",oldUri:r,newUri:i};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),o}e.create=t;function n(r){var i=r;return i&&i.kind==="rename"&&h.string(i.oldUri)&&h.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||h.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||h.boolean(i.options.ignoreIfExists)))}e.is=n})(Ge||(Ge={}));var Ze;(function(e){function t(r,i){var a={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),a}e.create=t;function n(r){var i=r;return i&&i.kind==="delete"&&h.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||h.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||h.boolean(i.options.ignoreIfNotExists)))}e.is=n})(Ze||(Ze={}));var xt;(function(e){function t(n){var r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(function(i){return h.string(i.kind)?ze.is(i)||Ge.is(i)||Ze.is(i):Be.is(i)}))}e.is=t})(xt||(xt={}));var Xe=function(){function e(t){this.edits=t}return e.prototype.insert=function(t,n){this.edits.push(Z.insert(t,n))},e.prototype.replace=function(t,n){this.edits.push(Z.replace(t,n))},e.prototype.delete=function(t){this.edits.push(Z.del(t))},e.prototype.add=function(t){this.edits.push(t)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}(),Gi=function(){function e(t){var n=this;this._textEditChanges=Object.create(null),t&&(this._workspaceEdit=t,t.documentChanges?t.documentChanges.forEach(function(r){if(Be.is(r)){var i=new Xe(r.edits);n._textEditChanges[r.textDocument.uri]=i}}):t.changes&&Object.keys(t.changes).forEach(function(r){var i=new Xe(t.changes[r]);n._textEditChanges[r]=i}))}return Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(t){if(He.is(t)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var n=t,r=this._textEditChanges[n.uri];if(!r){var i=[],a={textDocument:n,edits:i};this._workspaceEdit.documentChanges.push(a),r=new Xe(i),this._textEditChanges[n.uri]=r}return r}else{if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r=this._textEditChanges[t];if(!r){var i=[];this._workspaceEdit.changes[t]=i,r=new Xe(i),this._textEditChanges[t]=r}return r}},e.prototype.createFile=function(t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(ze.create(t,n))},e.prototype.renameFile=function(t,n,r){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(Ge.create(t,n,r))},e.prototype.deleteFile=function(t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(Ze.create(t,n))},e.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")},e}(),ar;(function(e){function t(r){return{uri:r}}e.create=t;function n(r){var i=r;return h.defined(i)&&h.string(i.uri)}e.is=n})(ar||(ar={}));var He;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){var i=r;return h.defined(i)&&h.string(i.uri)&&(i.version===null||h.number(i.version))}e.is=n})(He||(He={}));var or;(function(e){function t(r,i,a,o){return{uri:r,languageId:i,version:a,text:o}}e.create=t;function n(r){var i=r;return h.defined(i)&&h.string(i.uri)&&h.string(i.languageId)&&h.number(i.version)&&h.string(i.text)}e.is=n})(or||(or={}));var te;(function(e){e.PlainText="plaintext",e.Markdown="markdown"})(te||(te={}));(function(e){function t(n){var r=n;return r===e.PlainText||r===e.Markdown}e.is=t})(te||(te={}));var Qe;(function(e){function t(n){var r=n;return h.objectLiteral(n)&&te.is(r.kind)&&h.string(r.value)}e.is=t})(Qe||(Qe={}));var M;(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})(M||(M={}));var U;(function(e){e.PlainText=1,e.Snippet=2})(U||(U={}));var sr;(function(e){e.Deprecated=1})(sr||(sr={}));var Le;(function(e){function t(n){return{label:n}}e.create=t})(Le||(Le={}));var kt;(function(e){function t(n,r){return{items:n||[],isIncomplete:!!r}}e.create=t})(kt||(kt={}));var Ve;(function(e){function t(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function n(r){var i=r;return h.string(i)||h.objectLiteral(i)&&h.string(i.language)&&h.string(i.value)}e.is=n})(Ve||(Ve={}));var Ct;(function(e){function t(n){var r=n;return!!r&&h.objectLiteral(r)&&(Qe.is(r.contents)||Ve.is(r.contents)||h.typedArray(r.contents,Ve.is))&&(n.range===void 0||V.is(n.range))}e.is=t})(Ct||(Ct={}));var ur;(function(e){function t(n,r){return r?{label:n,documentation:r}:{label:n}}e.create=t})(ur||(ur={}));var fr;(function(e){function t(n,r){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var o={label:n};return h.defined(r)&&(o.documentation=r),h.defined(i)?o.parameters=i:o.parameters=[],o}e.create=t})(fr||(fr={}));var cr;(function(e){e.Text=1,e.Read=2,e.Write=3})(cr||(cr={}));var lr;(function(e){function t(n,r){var i={range:n};return h.number(r)&&(i.kind=r),i}e.create=t})(lr||(lr={}));var D;(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})(D||(D={}));var pr;(function(e){e.Deprecated=1})(pr||(pr={}));var wt;(function(e){function t(n,r,i,a,o){var u={name:n,kind:r,location:{uri:a,range:i}};return o&&(u.containerName=o),u}e.create=t})(wt||(wt={}));var Tt;(function(e){function t(r,i,a,o,u,s){var l={name:r,detail:i,kind:a,range:o,selectionRange:u};return s!==void 0&&(l.children=s),l}e.create=t;function n(r){var i=r;return i&&h.string(i.name)&&h.number(i.kind)&&V.is(i.range)&&V.is(i.selectionRange)&&(i.detail===void 0||h.string(i.detail))&&(i.deprecated===void 0||h.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))}e.is=n})(Tt||(Tt={}));var hr;(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"})(hr||(hr={}));var gr;(function(e){function t(r,i){var a={diagnostics:r};return i!=null&&(a.only=i),a}e.create=t;function n(r){var i=r;return h.defined(i)&&h.typedArray(i.diagnostics,ee.is)&&(i.only===void 0||h.typedArray(i.only,h.string))}e.is=n})(gr||(gr={}));var dr;(function(e){function t(r,i,a){var o={title:r};return Fe.is(i)?o.command=i:o.edit=i,a!==void 0&&(o.kind=a),o}e.create=t;function n(r){var i=r;return i&&h.string(i.title)&&(i.diagnostics===void 0||h.typedArray(i.diagnostics,ee.is))&&(i.kind===void 0||h.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Fe.is(i.command))&&(i.isPreferred===void 0||h.boolean(i.isPreferred))&&(i.edit===void 0||xt.is(i.edit))}e.is=n})(dr||(dr={}));var mr;(function(e){function t(r,i){var a={range:r};return h.defined(i)&&(a.data=i),a}e.create=t;function n(r){var i=r;return h.defined(i)&&V.is(i.range)&&(h.undefined(i.command)||Fe.is(i.command))}e.is=n})(mr||(mr={}));var At;(function(e){function t(r,i){return{tabSize:r,insertSpaces:i}}e.create=t;function n(r){var i=r;return h.defined(i)&&h.number(i.tabSize)&&h.boolean(i.insertSpaces)}e.is=n})(At||(At={}));var vr;(function(e){function t(r,i,a){return{range:r,target:i,data:a}}e.create=t;function n(r){var i=r;return h.defined(i)&&V.is(i.range)&&(h.undefined(i.target)||h.string(i.target))}e.is=n})(vr||(vr={}));var Ye;(function(e){function t(r,i){return{range:r,parent:i}}e.create=t;function n(r){var i=r;return i!==void 0&&V.is(i.range)&&(i.parent===void 0||e.is(i.parent))}e.is=n})(Ye||(Ye={}));var yr;(function(e){function t(a,o,u,s){return new yn(a,o,u,s)}e.create=t;function n(a){var o=a;return!!(h.defined(o)&&h.string(o.uri)&&(h.undefined(o.languageId)||h.string(o.languageId))&&h.number(o.lineCount)&&h.func(o.getText)&&h.func(o.positionAt)&&h.func(o.offsetAt))}e.is=n;function r(a,o){for(var u=a.getText(),s=i(o,function(m,b){var v=m.range.start.line-b.range.start.line;return v===0?m.range.start.character-b.range.start.character:v}),l=u.length,c=s.length-1;c>=0;c--){var f=s[c],p=a.offsetAt(f.range.start),d=a.offsetAt(f.range.end);if(d<=l)u=u.substring(0,p)+f.newText+u.substring(d,u.length);else throw new Error("Overlapping edit");l=p}return u}e.applyEdits=r;function i(a,o){if(a.length<=1)return a;var u=a.length/2|0,s=a.slice(0,u),l=a.slice(u);i(s,o),i(l,o);for(var c=0,f=0,p=0;c<s.length&&f<l.length;){var d=o(s[c],l[f]);d<=0?a[p++]=s[c++]:a[p++]=l[f++]}for(;c<s.length;)a[p++]=s[c++];for(;f<l.length;)a[p++]=l[f++];return a}})(yr||(yr={}));var yn=function(){function e(t,n,r,i){this._uri=t,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(t){if(t){var n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content},e.prototype.update=function(t,n){this._content=t.text,this._version=n,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var t=[],n=this._content,r=!0,i=0;i<n.length;i++){r&&(t.push(i),r=!1);var a=n.charAt(i);r=a==="\r"||a===`
`,a==="\r"&&i+1<n.length&&n.charAt(i+1)===`
`&&i++}r&&n.length>0&&t.push(n.length),this._lineOffsets=t}return this._lineOffsets},e.prototype.positionAt=function(t){t=Math.max(Math.min(t,this._content.length),0);var n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return Q.create(0,t);for(;r<i;){var a=Math.floor((r+i)/2);n[a]>t?i=a:r=a+1}var o=r-1;return Q.create(o,t-n[o])},e.prototype.offsetAt=function(t){var n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;var r=n[t.line],i=t.line+1<n.length?n[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,i),r)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e}(),h;(function(e){var t=Object.prototype.toString;function n(c){return typeof c!="undefined"}e.defined=n;function r(c){return typeof c=="undefined"}e.undefined=r;function i(c){return c===!0||c===!1}e.boolean=i;function a(c){return t.call(c)==="[object String]"}e.string=a;function o(c){return t.call(c)==="[object Number]"}e.number=o;function u(c){return t.call(c)==="[object Function]"}e.func=u;function s(c){return c!==null&&typeof c=="object"}e.objectLiteral=s;function l(c,f){return Array.isArray(c)&&c.every(f)}e.typedArray=l})(h||(h={}));"use strict";var xr=function(){function e(t,n,r,i){this._uri=t,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(t){if(t){var n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content},e.prototype.update=function(t,n){for(var r=0,i=t;r<i.length;r++){var a=i[r];if(e.isIncremental(a)){var o=Sr(a.range),u=this.offsetAt(o.start),s=this.offsetAt(o.end);this._content=this._content.substring(0,u)+a.text+this._content.substring(s,this._content.length);var l=Math.max(o.start.line,0),c=Math.max(o.end.line,0),f=this._lineOffsets,p=br(a.text,!1,u);if(c-l===p.length)for(var d=0,m=p.length;d<m;d++)f[d+l+1]=p[d];else p.length<1e4?f.splice.apply(f,[l+1,c-l].concat(p)):this._lineOffsets=f=f.slice(0,l+1).concat(p,f.slice(c+1));var b=a.text.length-(s-u);if(b!==0)for(var d=l+1+p.length,m=f.length;d<m;d++)f[d]=f[d]+b}else if(e.isFull(a))this._content=a.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received")}this._version=n},e.prototype.getLineOffsets=function(){return this._lineOffsets===void 0&&(this._lineOffsets=br(this._content,!0)),this._lineOffsets},e.prototype.positionAt=function(t){t=Math.max(Math.min(t,this._content.length),0);var n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:t};for(;r<i;){var a=Math.floor((r+i)/2);n[a]>t?i=a:r=a+1}var o=r-1;return{line:o,character:t-n[o]}},e.prototype.offsetAt=function(t){var n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;var r=n[t.line],i=t.line+1<n.length?n[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,i),r)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e.isIncremental=function(t){var n=t;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")},e.isFull=function(t){var n=t;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0},e}(),jt;(function(e){function t(i,a,o,u){return new xr(i,a,o,u)}e.create=t;function n(i,a,o){if(i instanceof xr)return i.update(a,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}e.update=n;function r(i,a){for(var o=i.getText(),u=Ot(a.map(bn),function(m,b){var v=m.range.start.line-b.range.start.line;return v===0?m.range.start.character-b.range.start.character:v}),s=0,l=[],c=0,f=u;c<f.length;c++){var p=f[c],d=i.offsetAt(p.range.start);if(d<s)throw new Error("Overlapping edit");d>s&&l.push(o.substring(s,d)),p.newText.length&&l.push(p.newText),s=i.offsetAt(p.range.end)}return l.push(o.substr(s)),l.join("")}e.applyEdits=r})(jt||(jt={}));function Ot(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);Ot(r,t),Ot(i,t);for(var a=0,o=0,u=0;a<r.length&&o<i.length;){var s=t(r[a],i[o]);s<=0?e[u++]=r[a++]:e[u++]=i[o++]}for(;a<r.length;)e[u++]=r[a++];for(;o<i.length;)e[u++]=i[o++];return e}function br(e,t,n){n===void 0&&(n=0);for(var r=t?[n]:[],i=0;i<e.length;i++){var a=e.charCodeAt(i);(a===13||a===10)&&(a===13&&i+1<e.length&&e.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function Sr(e){var t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function bn(e){var t=Sr(e.range);return t!==e.range?{newText:e.newText,range:t}:e}var re;(function(e){e[e.Undefined=0]="Undefined",e[e.EnumValueMismatch=1]="EnumValueMismatch",e[e.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=258]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",e[e.InvalidUnicode=260]="InvalidUnicode",e[e.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",e[e.InvalidCharacter=262]="InvalidCharacter",e[e.PropertyExpected=513]="PropertyExpected",e[e.CommaExpected=514]="CommaExpected",e[e.ColonExpected=515]="ColonExpected",e[e.ValueExpected=516]="ValueExpected",e[e.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",e[e.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",e[e.TrailingComma=519]="TrailingComma",e[e.DuplicateKey=520]="DuplicateKey",e[e.CommentNotPermitted=521]="CommentNotPermitted",e[e.SchemaResolveError=768]="SchemaResolveError"})(re||(re={}));var kr;(function(e){e.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[te.Markdown,te.PlainText],commitCharactersSupport:!0}}}}})(kr||(kr={}));function Sn(e,t){var n;return t.length===0?n=e:n=e.replace(/\{(\d+)\}/g,function(r,i){var a=i[0];return typeof t[a]!="undefined"?t[a]:r}),n}function xn(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return Sn(t,n)}function oe(e){return xn}var Se=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)i.hasOwnProperty(a)&&(r[a]=i[a])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),N=oe(),kn={"color-hex":{errorMessage:N("colorHexFormatWarning","Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA."),pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:N("dateTimeFormatWarning","String is not a RFC3339 date-time."),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:N("dateFormatWarning","String is not a RFC3339 date."),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:N("timeFormatWarning","String is not a RFC3339 time."),pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:N("emailFormatWarning","String is not an e-mail address."),pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},xe=function(){function e(t,n,r){r===void 0&&(r=0),this.offset=n,this.length=r,this.parent=t}return Object.defineProperty(e.prototype,"children",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},e}(),oa=function(e){Se(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.type="null",i.value=null,i}return t}(xe),sa=function(e){Se(t,e);function t(n,r,i){var a=e.call(this,n,i)||this;return a.type="boolean",a.value=r,a}return t}(xe),ua=function(e){Se(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.type="array",i.items=[],i}return Object.defineProperty(t.prototype,"children",{get:function(){return this.items},enumerable:!1,configurable:!0}),t}(xe),fa=function(e){Se(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.type="number",i.isInteger=!0,i.value=Number.NaN,i}return t}(xe),ca=function(e){Se(t,e);function t(n,r,i){var a=e.call(this,n,r,i)||this;return a.type="string",a.value="",a}return t}(xe),la=function(e){Se(t,e);function t(n,r,i){var a=e.call(this,n,r)||this;return a.type="property",a.colonOffset=-1,a.keyNode=i,a}return Object.defineProperty(t.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!1,configurable:!0}),t}(xe),pa=function(e){Se(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.type="object",i.properties=[],i}return Object.defineProperty(t.prototype,"children",{get:function(){return this.properties},enumerable:!1,configurable:!0}),t}(xe);function B(e){return X(e)?e?{}:{not:{}}:e}var Cr;(function(e){e[e.Key=0]="Key",e[e.Enum=1]="Enum"})(Cr||(Cr={}));var Cn=function(){function e(t,n){t===void 0&&(t=-1),this.focusOffset=t,this.exclude=n,this.schemas=[]}return e.prototype.add=function(t){this.schemas.push(t)},e.prototype.merge=function(t){Array.prototype.push.apply(this.schemas,t.schemas)},e.prototype.include=function(t){return(this.focusOffset===-1||It(t,this.focusOffset))&&t!==this.exclude},e.prototype.newSub=function(){return new e(-1,this.exclude)},e}(),Et=function(){function e(){}return Object.defineProperty(e.prototype,"schemas",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.add=function(t){},e.prototype.merge=function(t){},e.prototype.include=function(t){return!0},e.prototype.newSub=function(){return this},e.instance=new e,e}(),H=function(){function e(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=void 0}return e.prototype.hasProblems=function(){return!!this.problems.length},e.prototype.mergeAll=function(t){for(var n=0,r=t;n<r.length;n++){var i=r[n];this.merge(i)}},e.prototype.merge=function(t){this.problems=this.problems.concat(t.problems)},e.prototype.mergeEnumValues=function(t){if(!this.enumValueMatch&&!t.enumValueMatch&&this.enumValues&&t.enumValues){this.enumValues=this.enumValues.concat(t.enumValues);for(var n=0,r=this.problems;n<r.length;n++){var i=r[n];i.code===re.EnumValueMismatch&&(i.message=N("enumWarning","Value is not accepted. Valid values: {0}.",this.enumValues.map(function(a){return JSON.stringify(a)}).join(", ")))}}},e.prototype.mergePropertyMatch=function(t){this.merge(t),this.propertiesMatches++,(t.enumValueMatch||!t.hasProblems()&&t.propertiesMatches)&&this.propertiesValueMatches++,t.enumValueMatch&&t.enumValues&&t.enumValues.length===1&&this.primaryValueMatches++},e.prototype.compare=function(t){var n=this.hasProblems();return n!==t.hasProblems()?n?-1:1:this.enumValueMatch!==t.enumValueMatch?t.enumValueMatch?-1:1:this.primaryValueMatches!==t.primaryValueMatches?this.primaryValueMatches-t.primaryValueMatches:this.propertiesValueMatches!==t.propertiesValueMatches?this.propertiesValueMatches-t.propertiesValueMatches:this.propertiesMatches-t.propertiesMatches},e}();function ne(e){return tr(e)}function De(e){return er(e)}function It(e,t,n){return n===void 0&&(n=!1),t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}var ha=function(){function e(t,n,r){n===void 0&&(n=[]),r===void 0&&(r=[]),this.root=t,this.syntaxErrors=n,this.comments=r}return e.prototype.getNodeFromOffset=function(t,n){return n===void 0&&(n=!1),this.root?Yt(this.root,t,n):void 0},e.prototype.visit=function(t){if(this.root){var n=function(r){var i=t(r),a=r.children;if(Array.isArray(a))for(var o=0;o<a.length&&i;o++)i=n(a[o]);return i};n(this.root)}},e.prototype.validate=function(t,n){if(this.root&&n){var r=new H;return q(this.root,n,r,Et.instance),r.problems.map(function(i){var a=V.create(t.positionAt(i.location.offset),t.positionAt(i.location.offset+i.location.length));return ee.create(a,i.message,i.severity,i.code)})}},e.prototype.getMatchingSchemas=function(t,n,r){n===void 0&&(n=-1);var i=new Cn(n,r);return this.root&&t&&q(this.root,t,new H,i),i.schemas},e}();function q(e,t,n,r){if(!e||!r.include(e))return;var i=e;switch(i.type){case"object":l(i,t,n,r);break;case"array":s(i,t,n,r);break;case"string":u(i,t,n,r);break;case"number":o(i,t,n,r);break;case"property":return q(i.valueNode,t,n,r)}a(),r.add({node:i,schema:t});function a(){function c(P){return i.type===P||P==="integer"&&i.type==="number"&&i.isInteger}if(Array.isArray(t.type)?t.type.some(c)||n.problems.push({location:{offset:i.offset,length:i.length},severity:E.Warning,message:t.errorMessage||N("typeArrayMismatchWarning","Incorrect type. Expected one of {0}.",t.type.join(", "))}):t.type&&(c(t.type)||n.problems.push({location:{offset:i.offset,length:i.length},severity:E.Warning,message:t.errorMessage||N("typeMismatchWarning",'Incorrect type. Expected "{0}".',t.type)})),Array.isArray(t.allOf))for(var f=0,p=t.allOf;f<p.length;f++){var d=p[f];q(i,B(d),n,r)}var m=B(t.not);if(m){var b=new H,v=r.newSub();q(i,m,b,v),b.hasProblems()||n.problems.push({location:{offset:i.offset,length:i.length},severity:E.Warning,message:N("notSchemaWarning","Matches a schema that is not allowed.")});for(var S=0,y=v.schemas;S<y.length;S++){var g=y[S];g.inverted=!g.inverted,r.add(g)}}var k=function(P,L){for(var K=[],W=void 0,se=0,ve=P;se<ve.length;se++){var Ie=ve[se],ye=B(Ie),z=new H,ce=r.newSub();if(q(i,ye,z,ce),z.hasProblems()||K.push(ye),!W)W={schema:ye,validationResult:z,matchingSchemas:ce};else if(!L&&!z.hasProblems()&&!W.validationResult.hasProblems())W.matchingSchemas.merge(ce),W.validationResult.propertiesMatches+=z.propertiesMatches,W.validationResult.propertiesValueMatches+=z.propertiesValueMatches;else{var ke=z.compare(W.validationResult);ke>0?W={schema:ye,validationResult:z,matchingSchemas:ce}:ke===0&&(W.matchingSchemas.merge(ce),W.validationResult.mergeEnumValues(z))}}return K.length>1&&L&&n.problems.push({location:{offset:i.offset,length:1},severity:E.Warning,message:N("oneOfWarning","Matches multiple schemas when only one must validate.")}),W&&(n.merge(W.validationResult),n.propertiesMatches+=W.validationResult.propertiesMatches,n.propertiesValueMatches+=W.validationResult.propertiesValueMatches,r.merge(W.matchingSchemas)),K.length};Array.isArray(t.anyOf)&&k(t.anyOf,!1),Array.isArray(t.oneOf)&&k(t.oneOf,!0);var w=function(P){var L=new H,K=r.newSub();q(i,B(P),L,K),n.merge(L),n.propertiesMatches+=L.propertiesMatches,n.propertiesValueMatches+=L.propertiesValueMatches,r.merge(K)},C=function(P,L,K){var W=B(P),se=new H,ve=r.newSub();q(i,W,se,ve),r.merge(ve),se.hasProblems()?K&&w(K):L&&w(L)},A=B(t.if);if(A&&C(A,B(t.then),B(t.else)),Array.isArray(t.enum)){for(var F=ne(i),x=!1,T=0,j=t.enum;T<j.length;T++){var I=j[T];if(Ae(F,I)){x=!0;break}}n.enumValues=t.enum,n.enumValueMatch=x,x||n.problems.push({location:{offset:i.offset,length:i.length},severity:E.Warning,code:re.EnumValueMismatch,message:t.errorMessage||N("enumWarning","Value is not accepted. Valid values: {0}.",t.enum.map(function(P){return JSON.stringify(P)}).join(", "))})}if(Y(t.const)){var F=ne(i);Ae(F,t.const)?n.enumValueMatch=!0:(n.problems.push({location:{offset:i.offset,length:i.length},severity:E.Warning,code:re.EnumValueMismatch,message:t.errorMessage||N("constWarning","Value must be {0}.",JSON.stringify(t.const))}),n.enumValueMatch=!1),n.enumValues=[t.const]}t.deprecationMessage&&i.parent&&n.problems.push({location:{offset:i.parent.offset,length:i.parent.length},severity:E.Warning,message:t.deprecationMessage})}function o(c,f,p,d){var m=c.value;function b(T){var j,I=/^(-?\d+)(?:\.(\d+))?(?:e([-+]\d+))?$/.exec(T.toString());return I&&{value:Number(I[1]+(I[2]||"")),multiplier:(((j=I[2])===null||j===void 0?void 0:j.length)||0)-(parseInt(I[3])||0)}}if(G(f.multipleOf)){var v=-1;if(Number.isInteger(f.multipleOf))v=m%f.multipleOf;else{var S=b(f.multipleOf),y=b(m);if(S&&y){var g=Math.pow(10,Math.abs(y.multiplier-S.multiplier));y.multiplier<S.multiplier?y.value*=g:S.value*=g,v=y.value%S.value}}v!==0&&p.problems.push({location:{offset:c.offset,length:c.length},severity:E.Warning,message:N("multipleOfWarning","Value is not divisible by {0}.",f.multipleOf)})}function k(T,j){return G(j)?j:X(j)&&j?T:void 0}function w(T,j){return!X(j)||!j?T:void 0}var C=k(f.minimum,f.exclusiveMinimum);G(C)&&m<=C&&p.problems.push({location:{offset:c.offset,length:c.length},severity:E.Warning,message:N("exclusiveMinimumWarning","Value is below the exclusive minimum of {0}.",C)});var A=k(f.maximum,f.exclusiveMaximum);G(A)&&m>=A&&p.problems.push({location:{offset:c.offset,length:c.length},severity:E.Warning,message:N("exclusiveMaximumWarning","Value is above the exclusive maximum of {0}.",A)});var F=w(f.minimum,f.exclusiveMinimum);G(F)&&m<F&&p.problems.push({location:{offset:c.offset,length:c.length},severity:E.Warning,message:N("minimumWarning","Value is below the minimum of {0}.",F)});var x=w(f.maximum,f.exclusiveMaximum);G(x)&&m>x&&p.problems.push({location:{offset:c.offset,length:c.length},severity:E.Warning,message:N("maximumWarning","Value is above the maximum of {0}.",x)})}function u(c,f,p,d){if(G(f.minLength)&&c.value.length<f.minLength&&p.problems.push({location:{offset:c.offset,length:c.length},severity:E.Warning,message:N("minLengthWarning","String is shorter than the minimum length of {0}.",f.minLength)}),G(f.maxLength)&&c.value.length>f.maxLength&&p.problems.push({location:{offset:c.offset,length:c.length},severity:E.Warning,message:N("maxLengthWarning","String is longer than the maximum length of {0}.",f.maxLength)}),rr(f.pattern)){var m=new RegExp(f.pattern);m.test(c.value)||p.problems.push({location:{offset:c.offset,length:c.length},severity:E.Warning,message:f.patternErrorMessage||f.errorMessage||N("patternWarning",'String does not match the pattern of "{0}".',f.pattern)})}if(f.format)switch(f.format){case"uri":case"uri-reference":{var b=void 0;if(!c.value)b=N("uriEmpty","URI expected.");else{var v=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(c.value);v?!v[2]&&f.format==="uri"&&(b=N("uriSchemeMissing","URI with a scheme is expected.")):b=N("uriMissing","URI is expected.")}b&&p.problems.push({location:{offset:c.offset,length:c.length},severity:E.Warning,message:f.patternErrorMessage||f.errorMessage||N("uriFormatWarning","String is not a URI: {0}",b)})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var S=kn[f.format];(!c.value||!S.pattern.exec(c.value))&&p.problems.push({location:{offset:c.offset,length:c.length},severity:E.Warning,message:f.patternErrorMessage||f.errorMessage||S.errorMessage});default:}}function s(c,f,p,d){if(Array.isArray(f.items)){for(var m=f.items,b=0;b<m.length;b++){var v=m[b],S=B(v),y=new H,g=c.items[b];g?(q(g,S,y,d),p.mergePropertyMatch(y)):c.items.length>=m.length&&p.propertiesValueMatches++}if(c.items.length>m.length)if(typeof f.additionalItems=="object")for(var k=m.length;k<c.items.length;k++){var y=new H;q(c.items[k],f.additionalItems,y,d),p.mergePropertyMatch(y)}else f.additionalItems===!1&&p.problems.push({location:{offset:c.offset,length:c.length},severity:E.Warning,message:N("ad