UNPKG

@asyncapi/studio

Version:

One place that allows you to develop an AsyncAPI document, validate it, convert it to the latest version, preview the documentation and visualize the events flow.

1 lines 37.5 kB
"use strict";exports.id=1384,exports.ids=[1384],exports.modules={31384:(e,t,n)=>{let r;n.r(t),n.d(t,{CompletionAdapter:()=>eC,DefinitionAdapter:()=>eT,DiagnosticsAdapter:()=>eb,DocumentColorAdapter:()=>eN,DocumentFormattingEditProvider:()=>eL,DocumentHighlightAdapter:()=>eS,DocumentLinkAdapter:()=>ej,DocumentRangeFormattingEditProvider:()=>eF,DocumentSymbolAdapter:()=>eM,FoldingRangeAdapter:()=>eW,HoverAdapter:()=>ex,ReferenceAdapter:()=>eD,RenameAdapter:()=>eP,SelectionRangeAdapter:()=>eU,WorkerManager:()=>em,fromPosition:()=>ew,fromRange:()=>ey,setupMode:()=>eG,toRange:()=>eE,toTextEdit:()=>eA});var i,o,a,s,c,u,d,l,g,f,h,p,m,v,_,k,b,C,w,y,E,A,x,I,S,T,R,D,P,M,j,L,F,O,N,W,U,V,H,K,z,q,X,B,$,Q,G,J,Y,Z,ee,et,en,er,ei,eo,ea,es,ec,eu=n(68567),ed=Object.defineProperty,el=Object.getOwnPropertyDescriptor,eg=Object.getOwnPropertyNames,ef=Object.prototype.hasOwnProperty,eh=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of eg(t))ef.call(e,i)||i===n||ed(e,i,{get:()=>t[i],enumerable:!(r=el(t,i))||r.enumerable});return e},ep={};eh(ep,eu,"default"),r&&eh(r,eu,"default");var em=class{_defaults;_idleCheckInterval;_lastUsedTime;_configChangeListener;_worker;_client;constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),3e4),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(){this._worker&&Date.now()-this._lastUsedTime>12e4&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=ep.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}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}};(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647})(i||(i={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647}(o||(o={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=o.MAX_VALUE),t===Number.MAX_VALUE&&(t=o.MAX_VALUE),{line:e,character:t}},e.is=function(e){return es.objectLiteral(e)&&es.uinteger(e.line)&&es.uinteger(e.character)}}(a||(a={})),function(e){e.create=function(e,t,n,r){if(es.uinteger(e)&&es.uinteger(t)&&es.uinteger(n)&&es.uinteger(r))return{start:a.create(e,t),end:a.create(n,r)};if(a.is(e)&&a.is(t))return{start:e,end:t};throw Error("Range#create called with invalid arguments["+e+", "+t+", "+n+", "+r+"]")},e.is=function(e){return es.objectLiteral(e)&&a.is(e.start)&&a.is(e.end)}}(s||(s={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){return es.defined(e)&&s.is(e.range)&&(es.string(e.uri)||es.undefined(e.uri))}}(c||(c={})),function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){return es.defined(e)&&s.is(e.targetRange)&&es.string(e.targetUri)&&(s.is(e.targetSelectionRange)||es.undefined(e.targetSelectionRange))&&(s.is(e.originSelectionRange)||es.undefined(e.originSelectionRange))}}(u||(u={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){return es.numberRange(e.red,0,1)&&es.numberRange(e.green,0,1)&&es.numberRange(e.blue,0,1)&&es.numberRange(e.alpha,0,1)}}(d||(d={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){return s.is(e.range)&&d.is(e.color)}}(l||(l={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){return es.string(e.label)&&(es.undefined(e.textEdit)||C.is(e))&&(es.undefined(e.additionalTextEdits)||es.typedArray(e.additionalTextEdits,C.is))}}(g||(g={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(f||(f={})),function(e){e.create=function(e,t,n,r,i){var o={startLine:e,endLine:t};return es.defined(n)&&(o.startCharacter=n),es.defined(r)&&(o.endCharacter=r),es.defined(i)&&(o.kind=i),o},e.is=function(e){return es.uinteger(e.startLine)&&es.uinteger(e.startLine)&&(es.undefined(e.startCharacter)||es.uinteger(e.startCharacter))&&(es.undefined(e.endCharacter)||es.uinteger(e.endCharacter))&&(es.undefined(e.kind)||es.string(e.kind))}}(h||(h={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){return es.defined(e)&&c.is(e.location)&&es.string(e.message)}}(p||(p={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(m||(m={})),function(e){e.Unnecessary=1,e.Deprecated=2}(v||(v={})),(_||(_={})).is=function(e){return null!=e&&es.string(e.href)},function(e){e.create=function(e,t,n,r,i,o){var a={range:e,message:t};return es.defined(n)&&(a.severity=n),es.defined(r)&&(a.code=r),es.defined(i)&&(a.source=i),es.defined(o)&&(a.relatedInformation=o),a},e.is=function(e){var t;return es.defined(e)&&s.is(e.range)&&es.string(e.message)&&(es.number(e.severity)||es.undefined(e.severity))&&(es.integer(e.code)||es.string(e.code)||es.undefined(e.code))&&(es.undefined(e.codeDescription)||es.string(null===(t=e.codeDescription)||void 0===t?void 0:t.href))&&(es.string(e.source)||es.undefined(e.source))&&(es.undefined(e.relatedInformation)||es.typedArray(e.relatedInformation,p.is))}}(k||(k={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={title:e,command:t};return es.defined(n)&&n.length>0&&(i.arguments=n),i},e.is=function(e){return es.defined(e)&&es.string(e.title)&&es.string(e.command)}}(b||(b={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){return es.objectLiteral(e)&&es.string(e.newText)&&s.is(e.range)}}(C||(C={})),function(e){e.create=function(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){return void 0!==e&&es.objectLiteral(e)&&es.string(e.label)&&(es.boolean(e.needsConfirmation)||void 0===e.needsConfirmation)&&(es.string(e.description)||void 0===e.description)}}(w||(w={})),(y||(y={})).is=function(e){return"string"==typeof e},function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){return C.is(e)&&(w.is(e.annotationId)||y.is(e.annotationId))}}(E||(E={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){return es.defined(e)&&P.is(e.textDocument)&&Array.isArray(e.edits)}}(A||(A={})),function(e){e.create=function(e,t,n){var r={kind:"create",uri:e};return void 0!==t&&(void 0!==t.overwrite||void 0!==t.ignoreIfExists)&&(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){return e&&"create"===e.kind&&es.string(e.uri)&&(void 0===e.options||(void 0===e.options.overwrite||es.boolean(e.options.overwrite))&&(void 0===e.options.ignoreIfExists||es.boolean(e.options.ignoreIfExists)))&&(void 0===e.annotationId||y.is(e.annotationId))}}(x||(x={})),function(e){e.create=function(e,t,n,r){var i={kind:"rename",oldUri:e,newUri:t};return void 0!==n&&(void 0!==n.overwrite||void 0!==n.ignoreIfExists)&&(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){return e&&"rename"===e.kind&&es.string(e.oldUri)&&es.string(e.newUri)&&(void 0===e.options||(void 0===e.options.overwrite||es.boolean(e.options.overwrite))&&(void 0===e.options.ignoreIfExists||es.boolean(e.options.ignoreIfExists)))&&(void 0===e.annotationId||y.is(e.annotationId))}}(I||(I={})),function(e){e.create=function(e,t,n){var r={kind:"delete",uri:e};return void 0!==t&&(void 0!==t.recursive||void 0!==t.ignoreIfNotExists)&&(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){return e&&"delete"===e.kind&&es.string(e.uri)&&(void 0===e.options||(void 0===e.options.recursive||es.boolean(e.options.recursive))&&(void 0===e.options.ignoreIfNotExists||es.boolean(e.options.ignoreIfNotExists)))&&(void 0===e.annotationId||y.is(e.annotationId))}}(S||(S={})),(T||(T={})).is=function(e){return e&&(void 0!==e.changes||void 0!==e.documentChanges)&&(void 0===e.documentChanges||e.documentChanges.every(function(e){return es.string(e.kind)?x.is(e)||I.is(e)||S.is(e):A.is(e)}))};var ev=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,n){var r,i;if(void 0===n?r=C.insert(e,t):y.is(n)?(i=n,r=E.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=E.insert(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.replace=function(e,t,n){var r,i;if(void 0===n?r=C.replace(e,t):y.is(n)?(i=n,r=E.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=E.replace(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=C.del(e):y.is(t)?(r=t,n=E.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=E.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw Error("Text edit change is not configured to manage change annotations.")},e}(),e_=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(y.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw Error("Id "+n+" is already in use.");if(void 0===t)throw Error("No annotation provided for id "+n);return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}();(function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new e_(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(function(e){if(A.is(e)){var n=new ev(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(function(n){var r=new ev(e.changes[n]);t._textEditChanges[n]=r})):this._workspaceEdit={}}Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(P.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version},n=this._textEditChanges[t.uri];if(!n){var r=[],i={textDocument:t,edits:r};this._workspaceEdit.documentChanges.push(i),n=new ev(r,this._changeAnnotations),this._textEditChanges[t.uri]=n}return n}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw Error("Workspace edit is not configured for normal text edit changes.");var n=this._textEditChanges[e];if(!n){var r=[];this._workspaceEdit.changes[e]=r,n=new ev(r),this._textEditChanges[e]=n}return n},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new e_,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){var r,i,o;if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw Error("Workspace edit is not configured for document changes.");if(w.is(t)||y.is(t)?r=t:n=t,void 0===r?i=x.create(e,n):(o=y.is(r)?r:this._changeAnnotations.manage(r),i=x.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e.prototype.renameFile=function(e,t,n,r){var i,o,a;if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw Error("Workspace edit is not configured for document changes.");if(w.is(n)||y.is(n)?i=n:r=n,void 0===i?o=I.create(e,t,r):(a=y.is(i)?i:this._changeAnnotations.manage(i),o=I.create(e,t,r,a)),this._workspaceEdit.documentChanges.push(o),void 0!==a)return a},e.prototype.deleteFile=function(e,t,n){var r,i,o;if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw Error("Workspace edit is not configured for document changes.");if(w.is(t)||y.is(t)?r=t:n=t,void 0===r?i=S.create(e,n):(o=y.is(r)?r:this._changeAnnotations.manage(r),i=S.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o}})(),function(e){e.create=function(e){return{uri:e}},e.is=function(e){return es.defined(e)&&es.string(e.uri)}}(R||(R={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){return es.defined(e)&&es.string(e.uri)&&es.integer(e.version)}}(D||(D={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){return es.defined(e)&&es.string(e.uri)&&(null===e.version||es.integer(e.version))}}(P||(P={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){return es.defined(e)&&es.string(e.uri)&&es.string(e.languageId)&&es.integer(e.version)&&es.string(e.text)}}(M||(M={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(j||(j={})),function(e){e.is=function(t){return t===e.PlainText||t===e.Markdown}}(j||(j={})),(L||(L={})).is=function(e){return es.objectLiteral(e)&&j.is(e.kind)&&es.string(e.value)},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}(F||(F={})),function(e){e.PlainText=1,e.Snippet=2}(O||(O={})),(N||(N={})).Deprecated=1,function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){return e&&es.string(e.newText)&&s.is(e.insert)&&s.is(e.replace)}}(W||(W={})),function(e){e.asIs=1,e.adjustIndentation=2}(U||(U={})),(V||(V={})).create=function(e){return{label:e}},(H||(H={})).create=function(e,t){return{items:e||[],isIncomplete:!!t}},function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){return es.string(e)||es.objectLiteral(e)&&es.string(e.language)&&es.string(e.value)}}(K||(K={})),(z||(z={})).is=function(e){return!!e&&es.objectLiteral(e)&&(L.is(e.contents)||K.is(e.contents)||es.typedArray(e.contents,K.is))&&(void 0===e.range||s.is(e.range))},(q||(q={})).create=function(e,t){return t?{label:e,documentation:t}:{label:e}},(X||(X={})).create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={label:e};return es.defined(t)&&(i.documentation=t),es.defined(n)?i.parameters=n:i.parameters=[],i},function(e){e.Text=1,e.Read=2,e.Write=3}(B||(B={})),($||($={})).create=function(e,t){var n={range:e};return es.number(t)&&(n.kind=t),n},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}(Q||(Q={})),(G||(G={})).Deprecated=1,(J||(J={})).create=function(e,t,n,r,i){var o={name:e,kind:t,location:{uri:r,range:n}};return i&&(o.containerName=i),o},function(e){e.create=function(e,t,n,r,i,o){var a={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==o&&(a.children=o),a},e.is=function(e){return e&&es.string(e.name)&&es.number(e.kind)&&s.is(e.range)&&s.is(e.selectionRange)&&(void 0===e.detail||es.string(e.detail))&&(void 0===e.deprecated||es.boolean(e.deprecated))&&(void 0===e.children||Array.isArray(e.children))&&(void 0===e.tags||Array.isArray(e.tags))}}(Y||(Y={})),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"}(Z||(Z={})),function(e){e.create=function(e,t){var n={diagnostics:e};return null!=t&&(n.only=t),n},e.is=function(e){return es.defined(e)&&es.typedArray(e.diagnostics,k.is)&&(void 0===e.only||es.typedArray(e.only,es.string))}}(ee||(ee={})),function(e){e.create=function(e,t,n){var r={title:e},i=!0;return"string"==typeof t?(i=!1,r.kind=t):b.is(t)?r.command=t:r.edit=t,i&&void 0!==n&&(r.kind=n),r},e.is=function(e){return e&&es.string(e.title)&&(void 0===e.diagnostics||es.typedArray(e.diagnostics,k.is))&&(void 0===e.kind||es.string(e.kind))&&(void 0!==e.edit||void 0!==e.command)&&(void 0===e.command||b.is(e.command))&&(void 0===e.isPreferred||es.boolean(e.isPreferred))&&(void 0===e.edit||T.is(e.edit))}}(et||(et={})),function(e){e.create=function(e,t){var n={range:e};return es.defined(t)&&(n.data=t),n},e.is=function(e){return es.defined(e)&&s.is(e.range)&&(es.undefined(e.command)||b.is(e.command))}}(en||(en={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){return es.defined(e)&&es.uinteger(e.tabSize)&&es.boolean(e.insertSpaces)}}(er||(er={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){return es.defined(e)&&s.is(e.range)&&(es.undefined(e.target)||es.string(e.target))}}(ei||(ei={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){return void 0!==t&&s.is(t.range)&&(void 0===t.parent||e.is(t.parent))}}(eo||(eo={})),function(e){e.create=function(e,t,n,r){return new ek(e,t,n,r)},e.is=function(e){return!!(es.defined(e)&&es.string(e.uri)&&(es.undefined(e.languageId)||es.string(e.languageId))&&es.uinteger(e.lineCount)&&es.func(e.getText)&&es.func(e.positionAt)&&es.func(e.offsetAt))},e.applyEdits=function(e,t){for(var n=e.getText(),r=function e(t,n){if(t.length<=1)return t;var r=t.length/2|0,i=t.slice(0,r),o=t.slice(r);e(i,n),e(o,n);for(var a=0,s=0,c=0;a<i.length&&s<o.length;)0>=n(i[a],o[s])?t[c++]=i[a++]:t[c++]=o[s++];for(;a<i.length;)t[c++]=i[a++];for(;s<o.length;)t[c++]=o[s++];return t}(t,function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n}),i=n.length,o=r.length-1;o>=0;o--){var a=r[o],s=e.offsetAt(a.range.start),c=e.offsetAt(a.range.end);if(c<=i)n=n.substring(0,s)+a.newText+n.substring(c,n.length);else throw Error("Overlapping edit");i=s}return n}}(ea||(ea={}));var ek=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r<t.length;r++){n&&(e.push(r),n=!1);var i=t.charAt(r);n="\r"===i||"\n"===i,"\r"===i&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return a.create(0,e);for(;n<r;){var i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}var o=n-1;return a.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.numberRange=function(e,n,r){return"[object Number]"===t.call(e)&&n<=e&&e<=r},e.integer=function(e){return"[object Number]"===t.call(e)&&-2147483648<=e&&e<=2147483647},e.uinteger=function(e){return"[object Number]"===t.call(e)&&0<=e&&e<=2147483647},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(es||(es={}));var eb=class{constructor(e,t,n){this._languageId=e,this._worker=t;let r=e=>{let t,n=e.getLanguageId();n===this._languageId&&(this._listener[e.uri.toString()]=e.onDidChangeContent(()=>{window.clearTimeout(t),t=window.setTimeout(()=>this._doValidate(e.uri,n),500)}),this._doValidate(e.uri,n))},i=e=>{ep.editor.setModelMarkers(e,this._languageId,[]);let t=e.uri.toString(),n=this._listener[t];n&&(n.dispose(),delete this._listener[t])};this._disposables.push(ep.editor.onDidCreateModel(r)),this._disposables.push(ep.editor.onWillDisposeModel(i)),this._disposables.push(ep.editor.onDidChangeModelLanguage(e=>{i(e.model),r(e.model)})),this._disposables.push(n(e=>{ep.editor.getModels().forEach(e=>{e.getLanguageId()===this._languageId&&(i(e),r(e))})})),this._disposables.push({dispose:()=>{for(let e in ep.editor.getModels().forEach(i),this._listener)this._listener[e].dispose()}}),ep.editor.getModels().forEach(r)}_disposables=[];_listener=Object.create(null);dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables.length=0}_doValidate(e,t){this._worker(e).then(t=>t.doValidation(e.toString())).then(n=>{let r=n.map(e=>{let t;return t="number"==typeof e.code?String(e.code):e.code,{severity:function(e){switch(e){case m.Error:return ep.MarkerSeverity.Error;case m.Warning:return ep.MarkerSeverity.Warning;case m.Information:return ep.MarkerSeverity.Info;case m.Hint:return ep.MarkerSeverity.Hint;default:return ep.MarkerSeverity.Info}}(e.severity),startLineNumber:e.range.start.line+1,startColumn:e.range.start.character+1,endLineNumber:e.range.end.line+1,endColumn:e.range.end.character+1,message:e.message,code:t,source:e.source}}),i=ep.editor.getModel(e);i&&i.getLanguageId()===t&&ep.editor.setModelMarkers(i,t,r)}).then(void 0,e=>{console.error(e)})}},eC=class{constructor(e,t){this._worker=e,this._triggerCharacters=t}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(e,t,n,r){let i=e.uri;return this._worker(i).then(e=>e.doComplete(i.toString(),ew(t))).then(n=>{if(!n)return;let r=e.getWordUntilPosition(t),i=new ep.Range(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn),o=n.items.map(e=>{var t,n;let r={label:e.label,insertText:e.insertText||e.label,sortText:e.sortText,filterText:e.filterText,documentation:e.documentation,detail:e.detail,command:(t=e.command)&&"editor.action.triggerSuggest"===t.command?{id:t.command,title:t.title,arguments:t.arguments}:void 0,range:i,kind:function(e){let t=ep.languages.CompletionItemKind;switch(e){case F.Text:return t.Text;case F.Method:return t.Method;case F.Function:return t.Function;case F.Constructor:return t.Constructor;case F.Field:return t.Field;case F.Variable:return t.Variable;case F.Class:return t.Class;case F.Interface:return t.Interface;case F.Module:return t.Module;case F.Property:break;case F.Unit:return t.Unit;case F.Value:return t.Value;case F.Enum:return t.Enum;case F.Keyword:return t.Keyword;case F.Snippet:return t.Snippet;case F.Color:return t.Color;case F.File:return t.File;case F.Reference:return t.Reference}return t.Property}(e.kind)};return e.textEdit&&(void 0!==(n=e.textEdit).insert&&void 0!==n.replace?r.range={insert:eE(e.textEdit.insert),replace:eE(e.textEdit.replace)}:r.range=eE(e.textEdit.range),r.insertText=e.textEdit.newText),e.additionalTextEdits&&(r.additionalTextEdits=e.additionalTextEdits.map(eA)),e.insertTextFormat===O.Snippet&&(r.insertTextRules=ep.languages.CompletionItemInsertTextRule.InsertAsSnippet),r});return{isIncomplete:n.isIncomplete,suggestions:o}})}};function ew(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function ey(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function eE(e){if(e)return new ep.Range(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function eA(e){if(e)return{range:eE(e.range),text:e.newText}}var ex=class{constructor(e){this._worker=e}provideHover(e,t,n){let r=e.uri;return this._worker(r).then(e=>e.doHover(r.toString(),ew(t))).then(e=>{if(e){var t;return{range:eE(e.range),contents:(t=e.contents)?Array.isArray(t)?t.map(eI):[eI(t)]:void 0}}})}};function eI(e){return"string"==typeof e?{value:e}:e&&"object"==typeof e&&"string"==typeof e.kind?"plaintext"===e.kind?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+"\n"+e.value+"\n```\n"}}var eS=class{constructor(e){this._worker=e}provideDocumentHighlights(e,t,n){let r=e.uri;return this._worker(r).then(e=>e.findDocumentHighlights(r.toString(),ew(t))).then(e=>{if(e)return e.map(e=>({range:eE(e.range),kind:function(e){switch(e){case B.Read:return ep.languages.DocumentHighlightKind.Read;case B.Write:return ep.languages.DocumentHighlightKind.Write;case B.Text:}return ep.languages.DocumentHighlightKind.Text}(e.kind)}))})}},eT=class{constructor(e){this._worker=e}provideDefinition(e,t,n){let r=e.uri;return this._worker(r).then(e=>e.findDefinition(r.toString(),ew(t))).then(e=>{if(e)return[eR(e)]})}};function eR(e){return{uri:ep.Uri.parse(e.uri),range:eE(e.range)}}var eD=class{constructor(e){this._worker=e}provideReferences(e,t,n,r){let i=e.uri;return this._worker(i).then(e=>e.findReferences(i.toString(),ew(t))).then(e=>{if(e)return e.map(eR)})}},eP=class{constructor(e){this._worker=e}provideRenameEdits(e,t,n,r){let i=e.uri;return this._worker(i).then(e=>e.doRename(i.toString(),ew(t),n)).then(e=>(function(e){if(!e||!e.changes)return;let t=[];for(let n in e.changes){let r=ep.Uri.parse(n);for(let i of e.changes[n])t.push({resource:r,versionId:void 0,textEdit:{range:eE(i.range),text:i.newText}})}return{edits:t}})(e))}},eM=class{constructor(e){this._worker=e}provideDocumentSymbols(e,t){let n=e.uri;return this._worker(n).then(e=>e.findDocumentSymbols(n.toString())).then(e=>{if(e)return e.map(e=>({name:e.name,detail:"",containerName:e.containerName,kind:function(e){let t=ep.languages.SymbolKind;switch(e){case Q.File:return t.Array;case Q.Module:return t.Module;case Q.Namespace:return t.Namespace;case Q.Package:return t.Package;case Q.Class:return t.Class;case Q.Method:return t.Method;case Q.Property:return t.Property;case Q.Field:return t.Field;case Q.Constructor:return t.Constructor;case Q.Enum:return t.Enum;case Q.Interface:return t.Interface;case Q.Function:break;case Q.Variable:return t.Variable;case Q.Constant:return t.Constant;case Q.String:return t.String;case Q.Number:return t.Number;case Q.Boolean:return t.Boolean;case Q.Array:return t.Array}return t.Function}(e.kind),range:eE(e.location.range),selectionRange:eE(e.location.range),tags:[]}))})}},ej=class{constructor(e){this._worker=e}provideLinks(e,t){let n=e.uri;return this._worker(n).then(e=>e.findDocumentLinks(n.toString())).then(e=>{if(e)return{links:e.map(e=>({range:eE(e.range),url:e.target}))}})}},eL=class{constructor(e){this._worker=e}provideDocumentFormattingEdits(e,t,n){let r=e.uri;return this._worker(r).then(e=>e.format(r.toString(),null,eO(t)).then(e=>{if(e&&0!==e.length)return e.map(eA)}))}},eF=class{constructor(e){this._worker=e}provideDocumentRangeFormattingEdits(e,t,n,r){let i=e.uri;return this._worker(i).then(e=>e.format(i.toString(),ey(t),eO(n)).then(e=>{if(e&&0!==e.length)return e.map(eA)}))}};function eO(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}var eN=class{constructor(e){this._worker=e}provideDocumentColors(e,t){let n=e.uri;return this._worker(n).then(e=>e.findDocumentColors(n.toString())).then(e=>{if(e)return e.map(e=>({color:e.color,range:eE(e.range)}))})}provideColorPresentations(e,t,n){let r=e.uri;return this._worker(r).then(e=>e.getColorPresentations(r.toString(),t.color,ey(t.range))).then(e=>{if(e)return e.map(e=>{let t={label:e.label};return e.textEdit&&(t.textEdit=eA(e.textEdit)),e.additionalTextEdits&&(t.additionalTextEdits=e.additionalTextEdits.map(eA)),t})})}},eW=class{constructor(e){this._worker=e}provideFoldingRanges(e,t,n){let r=e.uri;return this._worker(r).then(e=>e.getFoldingRanges(r.toString(),t)).then(e=>{if(e)return e.map(e=>{let t={start:e.startLine+1,end:e.endLine+1};return void 0!==e.kind&&(t.kind=function(e){switch(e){case f.Comment:return ep.languages.FoldingRangeKind.Comment;case f.Imports:return ep.languages.FoldingRangeKind.Imports;case f.Region:return ep.languages.FoldingRangeKind.Region}}(e.kind)),t})})}},eU=class{constructor(e){this._worker=e}provideSelectionRanges(e,t,n){let r=e.uri;return this._worker(r).then(e=>e.getSelectionRanges(r.toString(),t.map(ew))).then(e=>{if(e)return e.map(e=>{let t=[];for(;e;)t.push({range:eE(e.range)}),e=e.parent;return t})})}};function eV(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function eH(e){return 10===e||13===e||8232===e||8233===e}function eK(e){return e>=48&&e<=57}(ec||(ec={})).DEFAULT={allowTrailingComma:!1};var ez=function(e,t){void 0===t&&(t=!1);var n=e.length,r=0,i="",o=0,a=16,s=0,c=0,u=0,d=0,l=0;function g(){if(i="",l=0,o=r,c=s,d=u,r>=n)return o=n,a=17;var t=e.charCodeAt(r);if(eV(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(eV(t));return a=15}if(eH(t))return r++,i+=String.fromCharCode(t),13===t&&10===e.charCodeAt(r)&&(r++,i+="\n"),s++,u=r,a=14;switch(t){case 123:return r++,a=1;case 125:return r++,a=2;case 91:return r++,a=3;case 93:return r++,a=4;case 58:return r++,a=6;case 44:return r++,a=5;case 34:return r++,i=function(){for(var t="",i=r;;){if(r>=n){t+=e.substring(i,r),l=2;break}var o=e.charCodeAt(r);if(34===o){t+=e.substring(i,r),r++;break}if(92===o){if(t+=e.substring(i,r),++r>=n){l=2;break}switch(e.charCodeAt(r++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+=" ";break;case 117:var a=function(t,n){for(var i=0,o=0;i<4||!n;){var a=e.charCodeAt(r);if(a>=48&&a<=57)o=16*o+a-48;else if(a>=65&&a<=70)o=16*o+a-65+10;else if(a>=97&&a<=102)o=16*o+a-97+10;else break;r++,i++}return i<4&&(o=-1),o}(0,!0);a>=0?t+=String.fromCharCode(a):l=4;break;default:l=5}i=r;continue}if(o>=0&&o<=31){if(eH(o)){t+=e.substring(i,r),l=2;break}l=6}r++}return t}(),a=10;case 47:var g=r-1;if(47===e.charCodeAt(r+1)){for(r+=2;r<n&&!eH(e.charCodeAt(r));)r++;return i=e.substring(g,r),a=12}if(42===e.charCodeAt(r+1)){r+=2;for(var f=n-1,h=!1;r<f;){var p=e.charCodeAt(r);if(42===p&&47===e.charCodeAt(r+1)){r+=2,h=!0;break}r++,eH(p)&&(13===p&&10===e.charCodeAt(r)&&r++,s++,u=r)}return h||(r++,l=1),i=e.substring(g,r),a=13}return i+=String.fromCharCode(t),r++,a=16;case 45:if(i+=String.fromCharCode(t),++r===n||!eK(e.charCodeAt(r)))return a=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=function(){var t=r;if(48===e.charCodeAt(r))r++;else for(r++;r<e.length&&eK(e.charCodeAt(r));)r++;if(r<e.length&&46===e.charCodeAt(r)){if(!(++r<e.length&&eK(e.charCodeAt(r))))return l=3,e.substring(t,r);for(r++;r<e.length&&eK(e.charCodeAt(r));)r++}var n=r;if(r<e.length&&(69===e.charCodeAt(r)||101===e.charCodeAt(r))){if((++r<e.length&&43===e.charCodeAt(r)||45===e.charCodeAt(r))&&r++,r<e.length&&eK(e.charCodeAt(r))){for(r++;r<e.length&&eK(e.charCodeAt(r));)r++;n=r}else l=3}return e.substring(t,n)}(),a=11;default:for(;r<n&&function(e){if(eV(e)||eH(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}(t);)r++,t=e.charCodeAt(r);if(o!==r){switch(i=e.substring(o,r)){case"true":return a=8;case"false":return a=9;case"null":return a=7}return a=16}return i+=String.fromCharCode(t),r++,a=16}}return{setPosition:function(e){r=e,i="",o=0,a=16,l=0},getPosition:function(){return r},scan:t?function(){var e;do e=g();while(e>=12&&e<=15);return e}:g,getToken:function(){return a},getTokenValue:function(){return i},getTokenOffset:function(){return o},getTokenLength:function(){return r-o},getTokenStartLine:function(){return c},getTokenStartCharacter:function(){return o-d},getTokenError:function(){return l}}},eq="delimiter.bracket.json",eX="delimiter.array.json",eB=class{constructor(e,t){this.parent=e,this.type=t}static pop(e){return e?e.parent:null}static push(e,t){return new eB(e,t)}static equals(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;for(;e&&t&&e!==t;){if(e.type!==t.type)return!1;e=e.parent,t=t.parent}return!0}},e$=class{_state;scanError;lastWasColon;parents;constructor(e,t,n,r){this._state=e,this.scanError=t,this.lastWasColon=n,this.parents=r}clone(){return new e$(this._state,this.scanError,this.lastWasColon,this.parents)}equals(e){return e===this||!!e&&e instanceof e$&&this.scanError===e.scanError&&this.lastWasColon===e.lastWasColon&&eB.equals(this.parents,e.parents)}getStateData(){return this._state}setStateData(e){this._state=e}},eQ=class extends eb{constructor(e,t,n){super(e,t,n.onDidChange),this._disposables.push(ep.editor.onWillDisposeModel(e=>{this._resetSchema(e.uri)})),this._disposables.push(ep.editor.onDidChangeModelLanguage(e=>{this._resetSchema(e.model.uri)}))}_resetSchema(e){this._worker().then(t=>{t.resetSchema(e.toString())})}};function eG(e){let t=[],n=[],r=new em(e);t.push(r);let i=(...e)=>r.getLanguageServiceWorker(...e);function o(){let{languageId:t,modeConfiguration:r}=e;eY(n),r.documentFormattingEdits&&n.push(ep.languages.registerDocumentFormattingEditProvider(t,new eL(i))),r.documentRangeFormattingEdits&&n.push(ep.languages.registerDocumentRangeFormattingEditProvider(t,new eF(i))),r.completionItems&&n.push(ep.languages.registerCompletionItemProvider(t,new eC(i,[" ",":",'"']))),r.hovers&&n.push(ep.languages.registerHoverProvider(t,new ex(i))),r.documentSymbols&&n.push(ep.languages.registerDocumentSymbolProvider(t,new eM(i))),r.tokens&&n.push(ep.languages.setTokensProvider(t,{getInitialState:()=>new e$(null,null,!1,null),tokenize:(e,t)=>(function(e,t,n,r=0){let i=0,o=!1;switch(n.scanError){case 2:t='"'+t,i=1;break;case 1:t="/*"+t,i=2}let a=ez(t),s=n.lastWasColon,c=n.parents,u={tokens:[],endState:n.clone()};for(;;){let d=r+a.getPosition(),l="",g=a.scan();if(17===g)break;if(d===r+a.getPosition())throw Error("Scanner did not advance, next 3 characters are: "+t.substr(a.getPosition(),3));switch(o&&(d-=i),o=i>0,g){case 1:c=eB.push(c,0),l=eq,s=!1;break;case 2:c=eB.pop(c),l=eq,s=!1;break;case 3:c=eB.push(c,1),l=eX,s=!1;break;case 4:c=eB.pop(c),l=eX,s=!1;break;case 6:l="delimiter.colon.json",s=!0;break;case 5:l="delimiter.comma.json",s=!1;break;case 8:case 9:case 7:l="keyword.json",s=!1;break;case 10:let f=1===(c?c.type:0);l=s||f?"string.value.json":"string.key.json",s=!1;break;case 11:l="number.json",s=!1}if(e)switch(g){case 12:l="comment.line.json";break;case 13:l="comment.block.json"}u.endState=new e$(n.getStateData(),a.getTokenError(),s,c),u.tokens.push({startIndex:d,scopes:l})}return u})(!0,e,t)})),r.colors&&n.push(ep.languages.registerColorProvider(t,new eN(i))),r.foldingRanges&&n.push(ep.languages.registerFoldingRangeProvider(t,new eW(i))),r.diagnostics&&n.push(new eQ(t,i,e)),r.selectionRanges&&n.push(ep.languages.registerSelectionRangeProvider(t,new eU(i)))}o(),t.push(ep.languages.setLanguageConfiguration(e.languageId,eZ));let a=e.modeConfiguration;return e.onDidChange(e=>{e.modeConfiguration!==a&&(a=e.modeConfiguration,o())}),t.push(eJ(n)),eJ(t)}function eJ(e){return{dispose:()=>eY(e)}}function eY(e){for(;e.length;)e.pop().dispose()}var eZ={wordPattern:/(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}]}}};