UNPKG

monaco-editor

Version:
11 lines • 340 kB
/*!----------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.46.0(21007360cad28648bdf46282a2592cb47c3a7a6f) * Released under the MIT license * https://github.com/microsoft/vscode/blob/main/LICENSE.txt *-----------------------------------------------------------*/(function(){var X=["require","exports","vs/editor/common/core/range","vs/editor/common/core/offsetRange","vs/editor/common/core/position","vs/base/common/errors","vs/base/common/strings","vs/base/common/arrays","vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm","vs/base/common/event","vs/editor/common/core/lineRange","vs/base/common/arraysFind","vs/base/common/assert","vs/base/common/lifecycle","vs/base/common/objects","vs/editor/common/diff/defaultLinesDiffComputer/utils","vs/editor/common/diff/rangeMapping","vs/base/common/platform","vs/base/common/uri","vs/nls","vs/base/common/functional","vs/base/common/iterator","vs/base/common/linkedList","vs/base/common/stopwatch","vs/base/common/diff/diff","vs/base/common/types","vs/base/common/uint","vs/editor/common/core/characterClassifier","vs/editor/common/core/wordHelper","vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm","vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence","vs/editor/common/diff/linesDiffComputer","vs/base/common/cache","vs/base/common/color","vs/base/common/diff/diffChange","vs/base/common/keyCodes","vs/base/common/lazy","vs/base/common/map","vs/base/common/cancellation","vs/base/common/hash","vs/base/common/codicons","vs/editor/common/core/selection","vs/editor/common/core/wordCharacterClassifier","vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations","vs/editor/common/diff/defaultLinesDiffComputer/lineSequence","vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing","vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines","vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer","vs/editor/common/diff/legacyLinesDiffComputer","vs/editor/common/diff/linesDiffComputers","vs/editor/common/languages/defaultDocumentColorsComputer","vs/editor/common/languages/linkComputer","vs/editor/common/languages/supports/inplaceReplaceSupport","vs/editor/common/model","vs/editor/common/model/prefixSumComputer","vs/editor/common/model/mirrorTextModel","vs/editor/common/model/textModelSearch","vs/editor/common/services/unicodeTextModelHighlighter","vs/editor/common/standalone/standaloneEnums","vs/editor/common/tokenizationRegistry","vs/nls!vs/base/common/platform","vs/nls!vs/base/common/worker/simpleWorker","vs/base/common/process","vs/base/common/path","vs/nls!vs/editor/common/languages","vs/editor/common/languages","vs/editor/common/services/editorBaseApi","vs/base/common/worker/simpleWorker","vs/editor/common/services/editorSimpleWorker"],J=function(q){for(var n=[],M=0,A=q.length;M<A;M++)n[M]=X[q[M]];return n};const Ne=this,Re=typeof global=="object"?global:{};var le;(function(q){q.global=Ne;class n{get isWindows(){return this._detect(),this._isWindows}get isNode(){return this._detect(),this._isNode}get isElectronRenderer(){return this._detect(),this._isElectronRenderer}get isWebWorker(){return this._detect(),this._isWebWorker}get isElectronNodeIntegrationWebWorker(){return this._detect(),this._isElectronNodeIntegrationWebWorker}constructor(){this._detected=!1,this._isWindows=!1,this._isNode=!1,this._isElectronRenderer=!1,this._isWebWorker=!1,this._isElectronNodeIntegrationWebWorker=!1}_detect(){this._detected||(this._detected=!0,this._isWindows=n._isWindows(),this._isNode=typeof module<"u"&&!!module.exports,this._isElectronRenderer=typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.electron<"u"&&process.type==="renderer",this._isWebWorker=typeof q.global.importScripts=="function",this._isElectronNodeIntegrationWebWorker=this._isWebWorker&&typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.electron<"u"&&process.type==="worker")}static _isWindows(){return typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.indexOf("Windows")>=0?!0:typeof process<"u"?process.platform==="win32":!1}}q.Environment=n})(le||(le={}));var le;(function(q){class n{constructor(d,b,p){this.type=d,this.detail=b,this.timestamp=p}}q.LoaderEvent=n;class M{constructor(d){this._events=[new n(1,"",d)]}record(d,b){this._events.push(new n(d,b,q.Utilities.getHighPerformanceTimestamp()))}getEvents(){return this._events}}q.LoaderEventRecorder=M;class A{record(d,b){}getEvents(){return[]}}A.INSTANCE=new A,q.NullLoaderEventRecorder=A})(le||(le={}));var le;(function(q){class n{static fileUriToFilePath(A,i){if(i=decodeURI(i).replace(/%23/g,"#"),A){if(/^file:\/\/\//.test(i))return i.substr(8);if(/^file:\/\//.test(i))return i.substr(5)}else if(/^file:\/\//.test(i))return i.substr(7);return i}static startsWith(A,i){return A.length>=i.length&&A.substr(0,i.length)===i}static endsWith(A,i){return A.length>=i.length&&A.substr(A.length-i.length)===i}static containsQueryString(A){return/^[^\#]*\?/gi.test(A)}static isAbsolutePath(A){return/^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(A)}static forEachProperty(A,i){if(A){let d;for(d in A)A.hasOwnProperty(d)&&i(d,A[d])}}static isEmpty(A){let i=!0;return n.forEachProperty(A,()=>{i=!1}),i}static recursiveClone(A){if(!A||typeof A!="object"||A instanceof RegExp||!Array.isArray(A)&&Object.getPrototypeOf(A)!==Object.prototype)return A;let i=Array.isArray(A)?[]:{};return n.forEachProperty(A,(d,b)=>{b&&typeof b=="object"?i[d]=n.recursiveClone(b):i[d]=b}),i}static generateAnonymousModule(){return"===anonymous"+n.NEXT_ANONYMOUS_ID+++"==="}static isAnonymousModule(A){return n.startsWith(A,"===anonymous")}static getHighPerformanceTimestamp(){return this.PERFORMANCE_NOW_PROBED||(this.PERFORMANCE_NOW_PROBED=!0,this.HAS_PERFORMANCE_NOW=q.global.performance&&typeof q.global.performance.now=="function"),this.HAS_PERFORMANCE_NOW?q.global.performance.now():Date.now()}}n.NEXT_ANONYMOUS_ID=1,n.PERFORMANCE_NOW_PROBED=!1,n.HAS_PERFORMANCE_NOW=!1,q.Utilities=n})(le||(le={}));var le;(function(q){function n(i){if(i instanceof Error)return i;const d=new Error(i.message||String(i)||"Unknown Error");return i.stack&&(d.stack=i.stack),d}q.ensureError=n;class M{static validateConfigurationOptions(d){function b(p){if(p.phase==="loading"){console.error('Loading "'+p.moduleId+'" failed'),console.error(p),console.error("Here are the modules that depend on it:"),console.error(p.neededBy);return}if(p.phase==="factory"){console.error('The factory function of "'+p.moduleId+'" has thrown an exception'),console.error(p),console.error("Here are the modules that depend on it:"),console.error(p.neededBy);return}}if(d=d||{},typeof d.baseUrl!="string"&&(d.baseUrl=""),typeof d.isBuild!="boolean"&&(d.isBuild=!1),typeof d.paths!="object"&&(d.paths={}),typeof d.config!="object"&&(d.config={}),typeof d.catchError>"u"&&(d.catchError=!1),typeof d.recordStats>"u"&&(d.recordStats=!1),typeof d.urlArgs!="string"&&(d.urlArgs=""),typeof d.onError!="function"&&(d.onError=b),Array.isArray(d.ignoreDuplicateModules)||(d.ignoreDuplicateModules=[]),d.baseUrl.length>0&&(q.Utilities.endsWith(d.baseUrl,"/")||(d.baseUrl+="/")),typeof d.cspNonce!="string"&&(d.cspNonce=""),typeof d.preferScriptTags>"u"&&(d.preferScriptTags=!1),d.nodeCachedData&&typeof d.nodeCachedData=="object"&&(typeof d.nodeCachedData.seed!="string"&&(d.nodeCachedData.seed="seed"),(typeof d.nodeCachedData.writeDelay!="number"||d.nodeCachedData.writeDelay<0)&&(d.nodeCachedData.writeDelay=1e3*7),!d.nodeCachedData.path||typeof d.nodeCachedData.path!="string")){const p=n(new Error("INVALID cached data configuration, 'path' MUST be set"));p.phase="configuration",d.onError(p),d.nodeCachedData=void 0}return d}static mergeConfigurationOptions(d=null,b=null){let p=q.Utilities.recursiveClone(b||{});return q.Utilities.forEachProperty(d,(h,o)=>{h==="ignoreDuplicateModules"&&typeof p.ignoreDuplicateModules<"u"?p.ignoreDuplicateModules=p.ignoreDuplicateModules.concat(o):h==="paths"&&typeof p.paths<"u"?q.Utilities.forEachProperty(o,(L,e)=>p.paths[L]=e):h==="config"&&typeof p.config<"u"?q.Utilities.forEachProperty(o,(L,e)=>p.config[L]=e):p[h]=q.Utilities.recursiveClone(o)}),M.validateConfigurationOptions(p)}}q.ConfigurationOptionsUtil=M;class A{constructor(d,b){if(this._env=d,this.options=M.mergeConfigurationOptions(b),this._createIgnoreDuplicateModulesMap(),this._createSortedPathsRules(),this.options.baseUrl===""&&this.options.nodeRequire&&this.options.nodeRequire.main&&this.options.nodeRequire.main.filename&&this._env.isNode){let p=this.options.nodeRequire.main.filename,h=Math.max(p.lastIndexOf("/"),p.lastIndexOf("\\"));this.options.baseUrl=p.substring(0,h+1)}}_createIgnoreDuplicateModulesMap(){this.ignoreDuplicateModulesMap={};for(let d=0;d<this.options.ignoreDuplicateModules.length;d++)this.ignoreDuplicateModulesMap[this.options.ignoreDuplicateModules[d]]=!0}_createSortedPathsRules(){this.sortedPathsRules=[],q.Utilities.forEachProperty(this.options.paths,(d,b)=>{Array.isArray(b)?this.sortedPathsRules.push({from:d,to:b}):this.sortedPathsRules.push({from:d,to:[b]})}),this.sortedPathsRules.sort((d,b)=>b.from.length-d.from.length)}cloneAndMerge(d){return new A(this._env,M.mergeConfigurationOptions(d,this.options))}getOptionsLiteral(){return this.options}_applyPaths(d){let b;for(let p=0,h=this.sortedPathsRules.length;p<h;p++)if(b=this.sortedPathsRules[p],q.Utilities.startsWith(d,b.from)){let o=[];for(let L=0,e=b.to.length;L<e;L++)o.push(b.to[L]+d.substr(b.from.length));return o}return[d]}_addUrlArgsToUrl(d){return q.Utilities.containsQueryString(d)?d+"&"+this.options.urlArgs:d+"?"+this.options.urlArgs}_addUrlArgsIfNecessaryToUrl(d){return this.options.urlArgs?this._addUrlArgsToUrl(d):d}_addUrlArgsIfNecessaryToUrls(d){if(this.options.urlArgs)for(let b=0,p=d.length;b<p;b++)d[b]=this._addUrlArgsToUrl(d[b]);return d}moduleIdToPaths(d){if(this._env.isNode&&this.options.amdModulesPattern instanceof RegExp&&!this.options.amdModulesPattern.test(d))return this.isBuild()?["empty:"]:["node|"+d];let b=d,p;if(!q.Utilities.endsWith(b,".js")&&!q.Utilities.isAbsolutePath(b)){p=this._applyPaths(b);for(let h=0,o=p.length;h<o;h++)this.isBuild()&&p[h]==="empty:"||(q.Utilities.isAbsolutePath(p[h])||(p[h]=this.options.baseUrl+p[h]),!q.Utilities.endsWith(p[h],".js")&&!q.Utilities.containsQueryString(p[h])&&(p[h]=p[h]+".js"))}else!q.Utilities.endsWith(b,".js")&&!q.Utilities.containsQueryString(b)&&(b=b+".js"),p=[b];return this._addUrlArgsIfNecessaryToUrls(p)}requireToUrl(d){let b=d;return q.Utilities.isAbsolutePath(b)||(b=this._applyPaths(b)[0],q.Utilities.isAbsolutePath(b)||(b=this.options.baseUrl+b)),this._addUrlArgsIfNecessaryToUrl(b)}isBuild(){return this.options.isBuild}shouldInvokeFactory(d){return!!(!this.options.isBuild||q.Utilities.isAnonymousModule(d)||this.options.buildForceInvokeFactory&&this.options.buildForceInvokeFactory[d])}isDuplicateMessageIgnoredFor(d){return this.ignoreDuplicateModulesMap.hasOwnProperty(d)}getConfigForModule(d){if(this.options.config)return this.options.config[d]}shouldCatchError(){return this.options.catchError}shouldRecordStats(){return this.options.recordStats}onError(d){this.options.onError(d)}}q.Configuration=A})(le||(le={}));var le;(function(q){class n{constructor(o){this._env=o,this._scriptLoader=null,this._callbackMap={}}load(o,L,e,a){if(!this._scriptLoader)if(this._env.isWebWorker)this._scriptLoader=new i;else if(this._env.isElectronRenderer){const{preferScriptTags:c}=o.getConfig().getOptionsLiteral();c?this._scriptLoader=new M:this._scriptLoader=new d(this._env)}else this._env.isNode?this._scriptLoader=new d(this._env):this._scriptLoader=new M;let u={callback:e,errorback:a};if(this._callbackMap.hasOwnProperty(L)){this._callbackMap[L].push(u);return}this._callbackMap[L]=[u],this._scriptLoader.load(o,L,()=>this.triggerCallback(L),c=>this.triggerErrorback(L,c))}triggerCallback(o){let L=this._callbackMap[o];delete this._callbackMap[o];for(let e=0;e<L.length;e++)L[e].callback()}triggerErrorback(o,L){let e=this._callbackMap[o];delete this._callbackMap[o];for(let a=0;a<e.length;a++)e[a].errorback(L)}}class M{attachListeners(o,L,e){let a=()=>{o.removeEventListener("load",u),o.removeEventListener("error",c)},u=m=>{a(),L()},c=m=>{a(),e(m)};o.addEventListener("load",u),o.addEventListener("error",c)}load(o,L,e,a){if(/^node\|/.test(L)){let u=o.getConfig().getOptionsLiteral(),c=b(o.getRecorder(),u.nodeRequire||q.global.nodeRequire),m=L.split("|"),f=null;try{f=c(m[1])}catch(y){a(y);return}o.enqueueDefineAnonymousModule([],()=>f),e()}else{let u=document.createElement("script");u.setAttribute("async","async"),u.setAttribute("type","text/javascript"),this.attachListeners(u,e,a);const{trustedTypesPolicy:c}=o.getConfig().getOptionsLiteral();c&&(L=c.createScriptURL(L)),u.setAttribute("src",L);const{cspNonce:m}=o.getConfig().getOptionsLiteral();m&&u.setAttribute("nonce",m),document.getElementsByTagName("head")[0].appendChild(u)}}}function A(h){const{trustedTypesPolicy:o}=h.getConfig().getOptionsLiteral();try{return(o?self.eval(o.createScript("","true")):new Function("true")).call(self),!0}catch{return!1}}class i{constructor(){this._cachedCanUseEval=null}_canUseEval(o){return this._cachedCanUseEval===null&&(this._cachedCanUseEval=A(o)),this._cachedCanUseEval}load(o,L,e,a){if(/^node\|/.test(L)){const u=o.getConfig().getOptionsLiteral(),c=b(o.getRecorder(),u.nodeRequire||q.global.nodeRequire),m=L.split("|");let f=null;try{f=c(m[1])}catch(y){a(y);return}o.enqueueDefineAnonymousModule([],function(){return f}),e()}else{const{trustedTypesPolicy:u}=o.getConfig().getOptionsLiteral();if(!(/^((http:)|(https:)|(file:))/.test(L)&&L.substring(0,self.origin.length)!==self.origin)&&this._canUseEval(o)){fetch(L).then(m=>{if(m.status!==200)throw new Error(m.statusText);return m.text()}).then(m=>{m=`${m} //# sourceURL=${L}`,(u?self.eval(u.createScript("",m)):new Function(m)).call(self),e()}).then(void 0,a);return}try{u&&(L=u.createScriptURL(L)),importScripts(L),e()}catch(m){a(m)}}}}class d{constructor(o){this._env=o,this._didInitialize=!1,this._didPatchNodeRequire=!1}_init(o){this._didInitialize||(this._didInitialize=!0,this._fs=o("fs"),this._vm=o("vm"),this._path=o("path"),this._crypto=o("crypto"))}_initNodeRequire(o,L){const{nodeCachedData:e}=L.getConfig().getOptionsLiteral();if(!e||this._didPatchNodeRequire)return;this._didPatchNodeRequire=!0;const a=this,u=o("module");function c(m){const f=m.constructor;let y=function(E){try{return m.require(E)}finally{}};return y.resolve=function(E,S){return f._resolveFilename(E,m,!1,S)},y.resolve.paths=function(E){return f._resolveLookupPaths(E,m)},y.main=process.mainModule,y.extensions=f._extensions,y.cache=f._cache,y}u.prototype._compile=function(m,f){const y=u.wrap(m.replace(/^#!.*/,"")),w=L.getRecorder(),E=a._getCachedDataPath(e,f),S={filename:f};let C;try{const R=a._fs.readFileSync(E);C=R.slice(0,16),S.cachedData=R.slice(16),w.record(60,E)}catch{w.record(61,E)}const r=new a._vm.Script(y,S),s=r.runInThisContext(S),l=a._path.dirname(f),_=c(this),g=[this.exports,_,this,f,l,process,Re,Buffer],v=s.apply(this.exports,g);return a._handleCachedData(r,y,E,!S.cachedData,L),a._verifyCachedData(r,y,E,C,L),v}}load(o,L,e,a){const u=o.getConfig().getOptionsLiteral(),c=b(o.getRecorder(),u.nodeRequire||q.global.nodeRequire),m=u.nodeInstrumenter||function(y){return y};this._init(c),this._initNodeRequire(c,o);let f=o.getRecorder();if(/^node\|/.test(L)){let y=L.split("|"),w=null;try{w=c(y[1])}catch(E){a(E);return}o.enqueueDefineAnonymousModule([],()=>w),e()}else{L=q.Utilities.fileUriToFilePath(this._env.isWindows,L);const y=this._path.normalize(L),w=this._getElectronRendererScriptPathOrUri(y),E=!!u.nodeCachedData,S=E?this._getCachedDataPath(u.nodeCachedData,L):void 0;this._readSourceAndCachedData(y,S,f,(C,r,s,l)=>{if(C){a(C);return}let _;r.charCodeAt(0)===d._BOM?_=d._PREFIX+r.substring(1)+d._SUFFIX:_=d._PREFIX+r+d._SUFFIX,_=m(_,y);const g={filename:w,cachedData:s},v=this._createAndEvalScript(o,_,g,e,a);this._handleCachedData(v,_,S,E&&!s,o),this._verifyCachedData(v,_,S,l,o)})}}_createAndEvalScript(o,L,e,a,u){const c=o.getRecorder();c.record(31,e.filename);const m=new this._vm.Script(L,e),f=m.runInThisContext(e),y=o.getGlobalAMDDefineFunc();let w=!1;const E=function(){return w=!0,y.apply(null,arguments)};return E.amd=y.amd,f.call(q.global,o.getGlobalAMDRequireFunc(),E,e.filename,this._path.dirname(e.filename)),c.record(32,e.filename),w?a():u(new Error(`Didn't receive define call in ${e.filename}!`)),m}_getElectronRendererScriptPathOrUri(o){if(!this._env.isElectronRenderer)return o;let L=o.match(/^([a-z])\:(.*)/i);return L?`file:///${(L[1].toUpperCase()+":"+L[2]).replace(/\\/g,"/")}`:`file://${o}`}_getCachedDataPath(o,L){const e=this._crypto.createHash("md5").update(L,"utf8").update(o.seed,"utf8").update(process.arch,"").digest("hex"),a=this._path.basename(L).replace(/\.js$/,"");return this._path.join(o.path,`${a}-${e}.code`)}_handleCachedData(o,L,e,a,u){o.cachedDataRejected?this._fs.unlink(e,c=>{u.getRecorder().record(62,e),this._createAndWriteCachedData(o,L,e,u),c&&u.getConfig().onError(c)}):a&&this._createAndWriteCachedData(o,L,e,u)}_createAndWriteCachedData(o,L,e,a){let u=Math.ceil(a.getConfig().getOptionsLiteral().nodeCachedData.writeDelay*(1+Math.random())),c=-1,m=0,f;const y=()=>{setTimeout(()=>{f||(f=this._crypto.createHash("md5").update(L,"utf8").digest());const w=o.createCachedData();if(!(w.length===0||w.length===c||m>=5)){if(w.length<c){y();return}c=w.length,this._fs.writeFile(e,Buffer.concat([f,w]),E=>{E&&a.getConfig().onError(E),a.getRecorder().record(63,e),y()})}},u*Math.pow(4,m++))};y()}_readSourceAndCachedData(o,L,e,a){if(!L)this._fs.readFile(o,{encoding:"utf8"},a);else{let u,c,m,f=2;const y=w=>{w?a(w):--f===0&&a(void 0,u,c,m)};this._fs.readFile(o,{encoding:"utf8"},(w,E)=>{u=E,y(w)}),this._fs.readFile(L,(w,E)=>{!w&&E&&E.length>0?(m=E.slice(0,16),c=E.slice(16),e.record(60,L)):e.record(61,L),y()})}}_verifyCachedData(o,L,e,a,u){a&&(o.cachedDataRejected||setTimeout(()=>{const c=this._crypto.createHash("md5").update(L,"utf8").digest();a.equals(c)||(u.getConfig().onError(new Error(`FAILED TO VERIFY CACHED DATA, deleting stale '${e}' now, but a RESTART IS REQUIRED`)),this._fs.unlink(e,m=>{m&&u.getConfig().onError(m)}))},Math.ceil(5e3*(1+Math.random()))))}}d._BOM=65279,d._PREFIX="(function (require, define, __filename, __dirname) { ",d._SUFFIX=` });`;function b(h,o){if(o.__$__isRecorded)return o;const L=function(a){h.record(33,a);try{return o(a)}finally{h.record(34,a)}};return L.__$__isRecorded=!0,L}q.ensureRecordedNodeRequire=b;function p(h){return new n(h)}q.createScriptLoader=p})(le||(le={}));var le;(function(q){class n{constructor(h){let o=h.lastIndexOf("/");o!==-1?this.fromModulePath=h.substr(0,o+1):this.fromModulePath=""}static _normalizeModuleId(h){let o=h,L;for(L=/\/\.\//;L.test(o);)o=o.replace(L,"/");for(o=o.replace(/^\.\//g,""),L=/\/(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//;L.test(o);)o=o.replace(L,"/");return o=o.replace(/^(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//,""),o}resolveModule(h){let o=h;return q.Utilities.isAbsolutePath(o)||(q.Utilities.startsWith(o,"./")||q.Utilities.startsWith(o,"../"))&&(o=n._normalizeModuleId(this.fromModulePath+o)),o}}n.ROOT=new n(""),q.ModuleIdResolver=n;class M{constructor(h,o,L,e,a,u){this.id=h,this.strId=o,this.dependencies=L,this._callback=e,this._errorback=a,this.moduleIdResolver=u,this.exports={},this.error=null,this.exportsPassedIn=!1,this.unresolvedDependenciesCount=this.dependencies.length,this._isComplete=!1}static _safeInvokeFunction(h,o){try{return{returnedValue:h.apply(q.global,o),producedError:null}}catch(L){return{returnedValue:null,producedError:L}}}static _invokeFactory(h,o,L,e){return h.shouldInvokeFactory(o)?h.shouldCatchError()?this._safeInvokeFunction(L,e):{returnedValue:L.apply(q.global,e),producedError:null}:{returnedValue:null,producedError:null}}complete(h,o,L,e){this._isComplete=!0;let a=null;if(this._callback)if(typeof this._callback=="function"){h.record(21,this.strId);let u=M._invokeFactory(o,this.strId,this._callback,L);a=u.producedError,h.record(22,this.strId),!a&&typeof u.returnedValue<"u"&&(!this.exportsPassedIn||q.Utilities.isEmpty(this.exports))&&(this.exports=u.returnedValue)}else this.exports=this._callback;if(a){let u=q.ensureError(a);u.phase="factory",u.moduleId=this.strId,u.neededBy=e(this.id),this.error=u,o.onError(u)}this.dependencies=null,this._callback=null,this._errorback=null,this.moduleIdResolver=null}onDependencyError(h){return this._isComplete=!0,this.error=h,this._errorback?(this._errorback(h),!0):!1}isComplete(){return this._isComplete}}q.Module=M;class A{constructor(){this._nextId=0,this._strModuleIdToIntModuleId=new Map,this._intModuleIdToStrModuleId=[],this.getModuleId("exports"),this.getModuleId("module"),this.getModuleId("require")}getMaxModuleId(){return this._nextId}getModuleId(h){let o=this._strModuleIdToIntModuleId.get(h);return typeof o>"u"&&(o=this._nextId++,this._strModuleIdToIntModuleId.set(h,o),this._intModuleIdToStrModuleId[o]=h),o}getStrModuleId(h){return this._intModuleIdToStrModuleId[h]}}class i{constructor(h){this.id=h}}i.EXPORTS=new i(0),i.MODULE=new i(1),i.REQUIRE=new i(2),q.RegularDependency=i;class d{constructor(h,o,L){this.id=h,this.pluginId=o,this.pluginParam=L}}q.PluginDependency=d;class b{constructor(h,o,L,e,a=0){this._env=h,this._scriptLoader=o,this._loaderAvailableTimestamp=a,this._defineFunc=L,this._requireFunc=e,this._moduleIdProvider=new A,this._config=new q.Configuration(this._env),this._hasDependencyCycle=!1,this._modules2=[],this._knownModules2=[],this._inverseDependencies2=[],this._inversePluginDependencies2=new Map,this._currentAnonymousDefineCall=null,this._recorder=null,this._buildInfoPath=[],this._buildInfoDefineStack=[],this._buildInfoDependencies=[],this._requireFunc.moduleManager=this}reset(){return new b(this._env,this._scriptLoader,this._defineFunc,this._requireFunc,this._loaderAvailableTimestamp)}getGlobalAMDDefineFunc(){return this._defineFunc}getGlobalAMDRequireFunc(){return this._requireFunc}static _findRelevantLocationInStack(h,o){let L=u=>u.replace(/\\/g,"/"),e=L(h),a=o.split(/\n/);for(let u=0;u<a.length;u++){let c=a[u].match(/(.*):(\d+):(\d+)\)?$/);if(c){let m=c[1],f=c[2],y=c[3],w=Math.max(m.lastIndexOf(" ")+1,m.lastIndexOf("(")+1);if(m=m.substr(w),m=L(m),m===e){let E={line:parseInt(f,10),col:parseInt(y,10)};return E.line===1&&(E.col-=53),E}}}throw new Error("Could not correlate define call site for needle "+h)}getBuildInfo(){if(!this._config.isBuild())return null;let h=[],o=0;for(let L=0,e=this._modules2.length;L<e;L++){let a=this._modules2[L];if(!a)continue;let u=this._buildInfoPath[a.id]||null,c=this._buildInfoDefineStack[a.id]||null,m=this._buildInfoDependencies[a.id];h[o++]={id:a.strId,path:u,defineLocation:u&&c?b._findRelevantLocationInStack(u,c):null,dependencies:m,shim:null,exports:a.exports}}return h}getRecorder(){return this._recorder||(this._config.shouldRecordStats()?this._recorder=new q.LoaderEventRecorder(this._loaderAvailableTimestamp):this._recorder=q.NullLoaderEventRecorder.INSTANCE),this._recorder}getLoaderEvents(){return this.getRecorder().getEvents()}enqueueDefineAnonymousModule(h,o){if(this._currentAnonymousDefineCall!==null)throw new Error("Can only have one anonymous define call per script file");let L=null;this._config.isBuild()&&(L=new Error("StackLocation").stack||null),this._currentAnonymousDefineCall={stack:L,dependencies:h,callback:o}}defineModule(h,o,L,e,a,u=new n(h)){let c=this._moduleIdProvider.getModuleId(h);if(this._modules2[c]){this._config.isDuplicateMessageIgnoredFor(h)||console.warn("Duplicate definition of module '"+h+"'");return}let m=new M(c,h,this._normalizeDependencies(o,u),L,e,u);this._modules2[c]=m,this._config.isBuild()&&(this._buildInfoDefineStack[c]=a,this._buildInfoDependencies[c]=(m.dependencies||[]).map(f=>this._moduleIdProvider.getStrModuleId(f.id))),this._resolve(m)}_normalizeDependency(h,o){if(h==="exports")return i.EXPORTS;if(h==="module")return i.MODULE;if(h==="require")return i.REQUIRE;let L=h.indexOf("!");if(L>=0){let e=o.resolveModule(h.substr(0,L)),a=o.resolveModule(h.substr(L+1)),u=this._moduleIdProvider.getModuleId(e+"!"+a),c=this._moduleIdProvider.getModuleId(e);return new d(u,c,a)}return new i(this._moduleIdProvider.getModuleId(o.resolveModule(h)))}_normalizeDependencies(h,o){let L=[],e=0;for(let a=0,u=h.length;a<u;a++)L[e++]=this._normalizeDependency(h[a],o);return L}_relativeRequire(h,o,L,e){if(typeof o=="string")return this.synchronousRequire(o,h);this.defineModule(q.Utilities.generateAnonymousModule(),o,L,e,null,h)}synchronousRequire(h,o=new n(h)){let L=this._normalizeDependency(h,o),e=this._modules2[L.id];if(!e)throw new Error("Check dependency list! Synchronous require cannot resolve module '"+h+"'. This is the first mention of this module!");if(!e.isComplete())throw new Error("Check dependency list! Synchronous require cannot resolve module '"+h+"'. This module has not been resolved completely yet.");if(e.error)throw e.error;return e.exports}configure(h,o){let L=this._config.shouldRecordStats();o?this._config=new q.Configuration(this._env,h):this._config=this._config.cloneAndMerge(h),this._config.shouldRecordStats()&&!L&&(this._recorder=null)}getConfig(){return this._config}_onLoad(h){if(this._currentAnonymousDefineCall!==null){let o=this._currentAnonymousDefineCall;this._currentAnonymousDefineCall=null,this.defineModule(this._moduleIdProvider.getStrModuleId(h),o.dependencies,o.callback,null,o.stack)}}_createLoadError(h,o){let L=this._moduleIdProvider.getStrModuleId(h),e=(this._inverseDependencies2[h]||[]).map(u=>this._moduleIdProvider.getStrModuleId(u));const a=q.ensureError(o);return a.phase="loading",a.moduleId=L,a.neededBy=e,a}_onLoadError(h,o){const L=this._createLoadError(h,o);this._modules2[h]||(this._modules2[h]=new M(h,this._moduleIdProvider.getStrModuleId(h),[],()=>{},null,null));let e=[];for(let c=0,m=this._moduleIdProvider.getMaxModuleId();c<m;c++)e[c]=!1;let a=!1,u=[];for(u.push(h),e[h]=!0;u.length>0;){let c=u.shift(),m=this._modules2[c];m&&(a=m.onDependencyError(L)||a);let f=this._inverseDependencies2[c];if(f)for(let y=0,w=f.length;y<w;y++){let E=f[y];e[E]||(u.push(E),e[E]=!0)}}a||this._config.onError(L)}_hasDependencyPath(h,o){let L=this._modules2[h];if(!L)return!1;let e=[];for(let u=0,c=this._moduleIdProvider.getMaxModuleId();u<c;u++)e[u]=!1;let a=[];for(a.push(L),e[h]=!0;a.length>0;){let c=a.shift().dependencies;if(c)for(let m=0,f=c.length;m<f;m++){let y=c[m];if(y.id===o)return!0;let w=this._modules2[y.id];w&&!e[y.id]&&(e[y.id]=!0,a.push(w))}}return!1}_findCyclePath(h,o,L){if(h===o||L===50)return[h];let e=this._modules2[h];if(!e)return null;let a=e.dependencies;if(a)for(let u=0,c=a.length;u<c;u++){let m=this._findCyclePath(a[u].id,o,L+1);if(m!==null)return m.push(h),m}return null}_createRequire(h){let o=(L,e,a)=>this._relativeRequire(h,L,e,a);return o.toUrl=L=>this._config.requireToUrl(h.resolveModule(L)),o.getStats=()=>this.getLoaderEvents(),o.hasDependencyCycle=()=>this._hasDependencyCycle,o.config=(L,e=!1)=>{this.configure(L,e)},o.__$__nodeRequire=q.global.nodeRequire,o}_loadModule(h){if(this._modules2[h]||this._knownModules2[h])return;this._knownModules2[h]=!0;let o=this._moduleIdProvider.getStrModuleId(h),L=this._config.moduleIdToPaths(o),e=/^@[^\/]+\/[^\/]+$/;this._env.isNode&&(o.indexOf("/")===-1||e.test(o))&&L.push("node|"+o);let a=-1,u=c=>{if(a++,a>=L.length)this._onLoadError(h,c);else{let m=L[a],f=this.getRecorder();if(this._config.isBuild()&&m==="empty:"){this._buildInfoPath[h]=m,this.defineModule(this._moduleIdProvider.getStrModuleId(h),[],null,null,null),this._onLoad(h);return}f.record(10,m),this._scriptLoader.load(this,m,()=>{this._config.isBuild()&&(this._buildInfoPath[h]=m),f.record(11,m),this._onLoad(h)},y=>{f.record(12,m),u(y)})}};u(null)}_loadPluginDependency(h,o){if(this._modules2[o.id]||this._knownModules2[o.id])return;this._knownModules2[o.id]=!0;let L=e=>{this.defineModule(this._moduleIdProvider.getStrModuleId(o.id),[],e,null,null)};L.error=e=>{this._config.onError(this._createLoadError(o.id,e))},h.load(o.pluginParam,this._createRequire(n.ROOT),L,this._config.getOptionsLiteral())}_resolve(h){let o=h.dependencies;if(o)for(let L=0,e=o.length;L<e;L++){let a=o[L];if(a===i.EXPORTS){h.exportsPassedIn=!0,h.unresolvedDependenciesCount--;continue}if(a===i.MODULE){h.unresolvedDependenciesCount--;continue}if(a===i.REQUIRE){h.unresolvedDependenciesCount--;continue}let u=this._modules2[a.id];if(u&&u.isComplete()){if(u.error){h.onDependencyError(u.error);return}h.unresolvedDependenciesCount--;continue}if(this._hasDependencyPath(a.id,h.id)){this._hasDependencyCycle=!0,console.warn("There is a dependency cycle between '"+this._moduleIdProvider.getStrModuleId(a.id)+"' and '"+this._moduleIdProvider.getStrModuleId(h.id)+"'. The cyclic path follows:");let c=this._findCyclePath(a.id,h.id,0)||[];c.reverse(),c.push(a.id),console.warn(c.map(m=>this._moduleIdProvider.getStrModuleId(m)).join(` => `)),h.unresolvedDependenciesCount--;continue}if(this._inverseDependencies2[a.id]=this._inverseDependencies2[a.id]||[],this._inverseDependencies2[a.id].push(h.id),a instanceof d){let c=this._modules2[a.pluginId];if(c&&c.isComplete()){this._loadPluginDependency(c.exports,a);continue}let m=this._inversePluginDependencies2.get(a.pluginId);m||(m=[],this._inversePluginDependencies2.set(a.pluginId,m)),m.push(a),this._loadModule(a.pluginId);continue}this._loadModule(a.id)}h.unresolvedDependenciesCount===0&&this._onModuleComplete(h)}_onModuleComplete(h){let o=this.getRecorder();if(h.isComplete())return;let L=h.dependencies,e=[];if(L)for(let m=0,f=L.length;m<f;m++){let y=L[m];if(y===i.EXPORTS){e[m]=h.exports;continue}if(y===i.MODULE){e[m]={id:h.strId,config:()=>this._config.getConfigForModule(h.strId)};continue}if(y===i.REQUIRE){e[m]=this._createRequire(h.moduleIdResolver);continue}let w=this._modules2[y.id];if(w){e[m]=w.exports;continue}e[m]=null}const a=m=>(this._inverseDependencies2[m]||[]).map(f=>this._moduleIdProvider.getStrModuleId(f));h.complete(o,this._config,e,a);let u=this._inverseDependencies2[h.id];if(this._inverseDependencies2[h.id]=null,u)for(let m=0,f=u.length;m<f;m++){let y=u[m],w=this._modules2[y];w.unresolvedDependenciesCount--,w.unresolvedDependenciesCount===0&&this._onModuleComplete(w)}let c=this._inversePluginDependencies2.get(h.id);if(c){this._inversePluginDependencies2.delete(h.id);for(let m=0,f=c.length;m<f;m++)this._loadPluginDependency(h.exports,c[m])}}}q.ModuleManager=b})(le||(le={}));var Y,le;(function(q){const n=new q.Environment;let M=null;const A=function(p,h,o){typeof p!="string"&&(o=h,h=p,p=null),(typeof h!="object"||!Array.isArray(h))&&(o=h,h=null),h||(h=["require","exports","module"]),p?M.defineModule(p,h,o,null,null):M.enqueueDefineAnonymousModule(h,o)};A.amd={jQuery:!0};const i=function(p,h=!1){M.configure(p,h)},d=function(){if(arguments.length===1){if(arguments[0]instanceof Object&&!Array.isArray(arguments[0])){i(arguments[0]);return}if(typeof arguments[0]=="string")return M.synchronousRequire(arguments[0])}if((arguments.length===2||arguments.length===3)&&Array.isArray(arguments[0])){M.defineModule(q.Utilities.generateAnonymousModule(),arguments[0],arguments[1],arguments[2],null);return}throw new Error("Unrecognized require call")};d.config=i,d.getConfig=function(){return M.getConfig().getOptionsLiteral()},d.reset=function(){M=M.reset()},d.getBuildInfo=function(){return M.getBuildInfo()},d.getStats=function(){return M.getLoaderEvents()},d.define=A;function b(){if(typeof q.global.require<"u"||typeof require<"u"){const p=q.global.require||require;if(typeof p=="function"&&typeof p.resolve=="function"){const h=q.ensureRecordedNodeRequire(M.getRecorder(),p);q.global.nodeRequire=h,d.nodeRequire=h,d.__$__nodeRequire=h}}n.isNode&&!n.isElectronRenderer&&!n.isElectronNodeIntegrationWebWorker?module.exports=d:(n.isElectronRenderer||(q.global.define=A),q.global.require=d)}q.init=b,(typeof q.global.define!="function"||!q.global.define.amd)&&(M=new q.ModuleManager(n,q.createScriptLoader(n),A,d,q.Utilities.getHighPerformanceTimestamp()),typeof q.global.require<"u"&&typeof q.global.require!="function"&&d.config(q.global.require),Y=function(){return A.apply(null,arguments)},Y.amd=A.amd,typeof doNotInitLoader>"u"&&b())})(le||(le={})),Y(X[19],J([0,1]),function(q,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.load=n.create=n.setPseudoTranslation=n.getConfiguredDefaultLocale=n.localize2=n.localize=void 0;let M=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;const A="i-default";function i(f,y){let w;return y.length===0?w=f:w=f.replace(/\{(\d+)\}/g,(E,S)=>{const C=S[0],r=y[C];let s=E;return typeof r=="string"?s=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(s=String(r)),s}),M&&(w="\uFF3B"+w.replace(/[aouei]/g,"$&$&")+"\uFF3D"),w}function d(f,y){let w=f[y];return w||(w=f["*"],w)?w:null}function b(f){return f.charAt(f.length-1)==="/"?f:f+"/"}async function p(f,y,w){const E=b(f)+b(y)+"vscode/"+b(w),S=await fetch(E);if(S.ok)return await S.json();throw new Error(`${S.status} - ${S.statusText}`)}function h(f){return function(y,w){const E=Array.prototype.slice.call(arguments,2);return i(f[y],E)}}function o(f){return(y,w,...E)=>({value:i(f[y],E),original:i(w,E)})}function L(f,y,...w){return i(y,w)}n.localize=L;function e(f,y,...w){const E=i(y,w);return{value:E,original:E}}n.localize2=e;function a(f){}n.getConfiguredDefaultLocale=a;function u(f){M=f}n.setPseudoTranslation=u;function c(f,y){var w;return{localize:h(y[f]),localize2:o(y[f]),getConfiguredDefaultLocale:(w=y.getConfiguredDefaultLocale)!==null&&w!==void 0?w:E=>{}}}n.create=c;function m(f,y,w,E){var S;const C=(S=E["vs/nls"])!==null&&S!==void 0?S:{};if(!f||f.length===0)return w({localize:L,localize2:e,getConfiguredDefaultLocale:()=>{var g;return(g=C.availableLanguages)===null||g===void 0?void 0:g["*"]}});const r=C.availableLanguages?d(C.availableLanguages,f):null,s=r===null||r===A;let l=".nls";s||(l=l+"."+r);const _=g=>{Array.isArray(g)?(g.localize=h(g),g.localize2=o(g)):(g.localize=h(g[f]),g.localize2=o(g[f])),g.getConfiguredDefaultLocale=()=>{var v;return(v=C.availableLanguages)===null||v===void 0?void 0:v["*"]},w(g)};typeof C.loadBundle=="function"?C.loadBundle(f,r,(g,v)=>{g?y([f+".nls"],_):_(v)}):C.translationServiceUrl&&!s?(async()=>{var g;try{const v=await p(C.translationServiceUrl,r,f);return _(v)}catch(v){if(!r.includes("-"))return console.error(v),y([f+".nls"],_);try{const R=r.split("-")[0],N=await p(C.translationServiceUrl,R,f);return(g=C.availableLanguages)!==null&&g!==void 0||(C.availableLanguages={}),C.availableLanguages["*"]=R,_(N)}catch(R){return console.error(R),y([f+".nls"],_)}}})():y([f+l],_,g=>{if(l===".nls"){console.error("Failed trying to load default language strings",g);return}console.error(`Failed to load message bundle for language ${r}. Falling back to the default language:`,g),y([f+".nls"],_)})}n.load=m}),function(){const q=globalThis.MonacoEnvironment,n=q&&q.baseUrl?q.baseUrl:"../../../";function M(L,e){var a;if(q?.createTrustedTypesPolicy)try{return q.createTrustedTypesPolicy(L,e)}catch(u){console.warn(u);return}try{return(a=self.trustedTypes)===null||a===void 0?void 0:a.createPolicy(L,e)}catch(u){console.warn(u);return}}const A=M("amdLoader",{createScriptURL:L=>L,createScript:(L,...e)=>{const a=e.slice(0,-1).join(","),u=e.pop().toString();return`(function anonymous(${a}) { ${u} })`}});function i(){try{return(A?globalThis.eval(A.createScript("","true")):new Function("true")).call(globalThis),!0}catch{return!1}}function d(){return new Promise((L,e)=>{if(typeof globalThis.define=="function"&&globalThis.define.amd)return L();const a=n+"vs/loader.js";if(!(/^((http:)|(https:)|(file:))/.test(a)&&a.substring(0,globalThis.origin.length)!==globalThis.origin)&&i()){fetch(a).then(c=>{if(c.status!==200)throw new Error(c.statusText);return c.text()}).then(c=>{c=`${c} //# sourceURL=${a}`,(A?globalThis.eval(A.createScript("",c)):new Function(c)).call(globalThis),L()}).then(void 0,e);return}A?importScripts(A.createScriptURL(a)):importScripts(a),L()})}function b(){require.config({baseUrl:n,catchError:!0,trustedTypesPolicy:A,amdModulesPattern:/^vs\//})}function p(L){d().then(()=>{b(),require([L],function(e){setTimeout(function(){const a=e.create((u,c)=>{globalThis.postMessage(u,c)},null);for(globalThis.onmessage=u=>a.onmessage(u.data,u.ports);o.length>0;){const u=o.shift();a.onmessage(u.data,u.ports)}},0)})})}typeof globalThis.define=="function"&&globalThis.define.amd&&b();let h=!0;const o=[];globalThis.onmessage=L=>{if(!h){o.push(L);return}h=!1,p(L.data)}}(),Y(X[7],J([0,1]),function(q,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CallbackIterable=n.ArrayQueue=n.reverseOrder=n.booleanComparator=n.numberComparator=n.tieBreakComparators=n.compareBy=n.CompareResult=n.splice=n.insertInto=n.asArray=n.pushMany=n.pushToEnd=n.pushToStart=n.arrayInsert=n.range=n.firstOrDefault=n.distinct=n.isNonEmptyArray=n.isFalsyOrEmpty=n.coalesceInPlace=n.coalesce=n.forEachWithNeighbors=n.forEachAdjacent=n.groupAdjacentBy=n.groupBy=n.quickSelect=n.binarySearch2=n.binarySearch=n.removeFastWithoutKeepingOrder=n.equals=n.tail2=n.tail=void 0;function M(k,O=0){return k[k.length-(1+O)]}n.tail=M;function A(k){if(k.length===0)throw new Error("Invalid tail call");return[k.slice(0,k.length-1),k[k.length-1]]}n.tail2=A;function i(k,O,I=(W,z)=>W===z){if(k===O)return!0;if(!k||!O||k.length!==O.length)return!1;for(let W=0,z=k.length;W<z;W++)if(!I(k[W],O[W]))return!1;return!0}n.equals=i;function d(k,O){const I=k.length-1;O<I&&(k[O]=k[I]),k.pop()}n.removeFastWithoutKeepingOrder=d;function b(k,O,I){return p(k.length,W=>I(k[W],O))}n.binarySearch=b;function p(k,O){let I=0,W=k-1;for(;I<=W;){const z=(I+W)/2|0,G=O(z);if(G<0)I=z+1;else if(G>0)W=z-1;else return z}return-(I+1)}n.binarySearch2=p;function h(k,O,I){if(k=k|0,k>=O.length)throw new TypeError("invalid index");const W=O[Math.floor(O.length*Math.random())],z=[],G=[],t=[];for(const se of O){const ce=I(se,W);ce<0?z.push(se):ce>0?G.push(se):t.push(se)}return k<z.length?h(k,z,I):k<z.length+t.length?t[0]:h(k-(z.length+t.length),G,I)}n.quickSelect=h;function o(k,O){const I=[];let W;for(const z of k.slice(0).sort(O))!W||O(W[0],z)!==0?(W=[z],I.push(W)):W.push(z);return I}n.groupBy=o;function*L(k,O){let I,W;for(const z of k)W!==void 0&&O(W,z)?I.push(z):(I&&(yield I),I=[z]),W=z;I&&(yield I)}n.groupAdjacentBy=L;function e(k,O){for(let I=0;I<=k.length;I++)O(I===0?void 0:k[I-1],I===k.length?void 0:k[I])}n.forEachAdjacent=e;function a(k,O){for(let I=0;I<k.length;I++)O(I===0?void 0:k[I-1],k[I],I+1===k.length?void 0:k[I+1])}n.forEachWithNeighbors=a;function u(k){return k.filter(O=>!!O)}n.coalesce=u;function c(k){let O=0;for(let I=0;I<k.length;I++)k[I]&&(k[O]=k[I],O+=1);k.length=O}n.coalesceInPlace=c;function m(k){return!Array.isArray(k)||k.length===0}n.isFalsyOrEmpty=m;function f(k){return Array.isArray(k)&&k.length>0}n.isNonEmptyArray=f;function y(k,O=I=>I){const I=new Set;return k.filter(W=>{const z=O(W);return I.has(z)?!1:(I.add(z),!0)})}n.distinct=y;function w(k,O){return k.length>0?k[0]:O}n.firstOrDefault=w;function E(k,O){let I=typeof O=="number"?k:0;typeof O=="number"?I=k:(I=0,O=k);const W=[];if(I<=O)for(let z=I;z<O;z++)W.push(z);else for(let z=I;z>O;z--)W.push(z);return W}n.range=E;function S(k,O,I){const W=k.slice(0,O),z=k.slice(O);return W.concat(I,z)}n.arrayInsert=S;function C(k,O){const I=k.indexOf(O);I>-1&&(k.splice(I,1),k.unshift(O))}n.pushToStart=C;function r(k,O){const I=k.indexOf(O);I>-1&&(k.splice(I,1),k.push(O))}n.pushToEnd=r;function s(k,O){for(const I of O)k.push(I)}n.pushMany=s;function l(k){return Array.isArray(k)?k:[k]}n.asArray=l;function _(k,O,I){const W=v(k,O),z=k.length,G=I.length;k.length=z+G;for(let t=z-1;t>=W;t--)k[t+G]=k[t];for(let t=0;t<G;t++)k[t+W]=I[t]}n.insertInto=_;function g(k,O,I,W){const z=v(k,O);let G=k.splice(z,I);return G===void 0&&(G=[]),_(k,z,W),G}n.splice=g;function v(k,O){return O<0?Math.max(O+k.length,0):Math.min(O,k.length)}var R;(function(k){function O(G){return G<0}k.isLessThan=O;function I(G){return G<=0}k.isLessThanOrEqual=I;function W(G){return G>0}k.isGreaterThan=W;function z(G){return G===0}k.isNeitherLessOrGreaterThan=z,k.greaterThan=1,k.lessThan=-1,k.neitherLessOrGreaterThan=0})(R||(n.CompareResult=R={}));function N(k,O){return(I,W)=>O(k(I),k(W))}n.compareBy=N;function D(...k){return(O,I)=>{for(const W of k){const z=W(O,I);if(!R.isNeitherLessOrGreaterThan(z))return z}return R.neitherLessOrGreaterThan}}n.tieBreakComparators=D;const x=(k,O)=>k-O;n.numberComparator=x;const T=(k,O)=>(0,n.numberComparator)(k?1:0,O?1:0);n.booleanComparator=T;function F(k){return(O,I)=>-k(O,I)}n.reverseOrder=F;class B{constructor(O){this.items=O,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(O){let I=this.firstIdx;for(;I<this.items.length&&O(this.items[I]);)I++;const W=I===this.firstIdx?null:this.items.slice(this.firstIdx,I);return this.firstIdx=I,W}takeFromEndWhile(O){let I=this.lastIdx;for(;I>=0&&O(this.items[I]);)I--;const W=I===this.lastIdx?null:this.items.slice(I+1,this.lastIdx+1);return this.lastIdx=I,W}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const O=this.items[this.firstIdx];return this.firstIdx++,O}takeCount(O){const I=this.items.slice(this.firstIdx,this.firstIdx+O);return this.firstIdx+=O,I}}n.ArrayQueue=B;class V{constructor(O){this.iterate=O}toArray(){const O=[];return this.iterate(I=>(O.push(I),!0)),O}filter(O){return new V(I=>this.iterate(W=>O(W)?I(W):!0))}map(O){return new V(I=>this.iterate(W=>I(O(W))))}findLast(O){let I;return this.iterate(W=>(O(W)&&(I=W),!0)),I}findLastMaxBy(O){let I,W=!0;return this.iterate(z=>((W||R.isGreaterThan(O(z,I)))&&(W=!1,I=z),!0)),I}}n.CallbackIterable=V,V.empty=new V(k=>{})}),Y(X[11],J([0,1]),function(q,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.mapFindFirst=n.findMaxIdxBy=n.findFirstMinBy=n.findLastMaxBy=n.findFirstMaxBy=n.MonotonousArray=n.findFirstIdxMonotonousOrArrLen=n.findFirstMonotonous=n.findLastIdxMonotonous=n.findLastMonotonous=n.findLastIdx=n.findLast=void 0;function M(c,m,f){const y=A(c,m);if(y!==-1)return c[y]}n.findLast=M;function A(c,m,f=c.length-1){for(let y=f;y>=0;y--){const w=c[y];if(m(w))return y}return-1}n.findLastIdx=A;function i(c,m){const f=d(c,m);return f===-1?void 0:c[f]}n.findLastMonotonous=i;function d(c,m,f=0,y=c.length){let w=f,E=y;for(;w<E;){const S=Math.floor((w+E)/2);m(c[S])?w=S+1:E=S}return w-1}n.findLastIdxMonotonous=d;function b(c,m){const f=p(c,m);return f===c.length?void 0:c[f]}n.findFirstMonotonous=b;function p(c,m,f=0,y=c.length){let w=f,E=y;for(;w<E;){const S=Math.floor((w+E)/2);m(c[S])?E=S:w=S+1}return w}n.findFirstIdxMonotonousOrArrLen=p;class h{constructor(m){this._array=m,this._findLastMonotonousLastIdx=0}findLastMonotonous(m){if(h.assertInvariants){if(this._prevFindLastPredicate){for(const y of this._array)if(this._prevFindLastPredicate(y)&&!m(y))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=m}const f=d(this._array,m,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=f+1,f===-1?void 0:this._array[f]}}n.MonotonousArray=h,h.assertInvariants=!1;function o(c,m){if(c.length===0)return;let f=c[0];for(let y=1;y<c.length;y++){const w=c[y];m(w,f)>0&&(f=w)}return f}n.findFirstMaxBy=o;function L(c,m){if(c.length===0)return;let f=c[0];for(let y=1;y<c.length;y++){const w=c[y];m(w,f)>=0&&(f=w)}return f}n.findLastMaxBy=L;function e(c,m){return o(c,(f,y)=>-m(f,y))}n.findFirstMinBy=e;function a(c,m){if(c.length===0)return-1;let f=0;for(let y=1;y<c.length;y++){const w=c[y];m(w,c[f])>0&&(f=y)}return f}n.findMaxIdxBy=a;function u(c,m){for(const f of c){const y=m(f);if(y!==void 0)return y}}n.mapFindFirst=u}),Y(X[32],J([0,1]),function(q,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CachedFunction=n.LRUCachedFunction=void 0;class M{constructor(d){this.fn=d,this.lastCache=void 0,this.lastArgKey=void 0}get(d){const b=JSON.stringify(d);return this.lastArgKey!==b&&(this.lastArgKey=b,this.lastCache=this.fn(d)),this.lastCache}}n.LRUCachedFunction=M;class A{get cachedValues(){return this._map}constructor(d){this.fn=d,this._map=new Map}get(d){if(this._map.has(d))return this._map.get(d);const b=this.fn(d);return this._map.set(d,b),b}}n.CachedFunction=A}),Y(X[33],J([0,1]),function(q,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Color=n.HSVA=n.HSLA=n.RGBA=void 0;function M(p,h){const o=Math.pow(10,h);return Math.round(p*o)/o}class A{constructor(h,o,L,e=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,h))|0,this.g=Math.min(255,Math.max(0,o))|0,this.b=Math.min(255,Math.max(0,L))|0,this.a=M(Math.max(Math.min(1,e),0),3)}static equals(h,o){return h.r===o.r&&h.g===o.g&&h.b===o.b&&h.a===o.a}}n.RGBA=A;class i{constructor(h,o,L,e){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,h),0)|0,this.s=M(Math.max(Math.min(1,o),0),3),this.l=M(Math.max(Math.min(1,L),0),3),this.a=M(Math.max(Math.min(1,e),0),3)}static equals(h,o){return h.h===o.h&&h.s===o.s&&h.l===o.l&&h.a===o.a}static fromRGBA(h){const o=h.r/255,L=h.g/255,e=h.b/255,a=h.a,u=Math.max(o,L,e),c=Math.min(o,L,e);let m=0,f=0;const y=(c+u)/2,w=u-c;if(w>0){switch(f=Math.min(y<=.5?w/(2*y):w/(2-2*y),1),u){case o:m=(L-e)/w+(L<e?6:0);break;case L:m=(e-o)/w+2;break;case e:m=(o-L)/w+4;break}m*=60,m=Math.round(m)}return new i(m,f,y,a)}static _hue2rgb(h,o,L){return L<0&&(L+=1),L>1&&(L-=1),L<1/6?h+(o-h)*6*L:L<1/2?o:L<2/3?h+(o-h)*(2/3-L)*6:h}static toRGBA(h){const o=h.h/360,{s:L,l:e,a}=h;let u,c,m;if(L===0)u=c=m=e;else{const f=e<.5?e*(1+L):e+L-e*L,y=2*e-f;u=i._hue2rgb(y,f,o+1/3),c=i._hue2rgb(y,f,o),m=i._hue2rgb(y,f,o-1/3)}return new A(Math.round(u*255),Math.round(c*255),Math.round(m*255),a)}}n.HSLA=i;class d{constructor(h,o,L,e){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,h),0)|0,this.s=M(Math.max(Math.min(1,o),0),3),this.v=M(Math.max(Math.min(1,L),0),3),this.a=M(Math.max(Math.min(1,e),0),3)}static equals(h,o){return h.h===o.h&&h.s===o.s&&h.v===o.v&&h.a===o.a}static fromRGBA(h){const o=h.r/255,L=h.g/255,e=h.b/255,a=Math.max(o,L,e),u=Math.min(o,L,e),c=a-u,m=a===0?0:c/a;let f;return c===0?f=0:a===o?f=((L-e)/c%6+6)%6:a===L?f=(e-o)/c+2:f=(o-L)/c+4,new d(Math.round(f*60),m,a,h.a)}static toRGBA(h){const{h:o,s:L,v:e,a}=h,u=e*L,c=u*(1-Math.abs(o/60%2-1)),m=e-u;let[f,y,w]=[0,0,0];return o<60?(f=u,y=c):o<120?(f=c,y=u):o<180?(y=u,w=c):o<240?(y=c,w=u):o<300?(f=c,w=u):o<=360&&(f=u,w=c),f=Math.round((f+m)*255),y=Math.round((y+m)*255),w=Math.round((w+m)*255),new A(f,y,w,a)}}n.HSVA=d;class b{static fromHex(h){return b.Format.CSS.parseHex(h)||b.red}static equals(h,o){return!h&&!o?!0:!h||!o?!1:h.equals(o)}get hsla(){return this._hsla?this._hsla:i.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:d.fromRGBA(this.rgba)}constructor(h){if(h)if(h instanceof A)this.rgba=h;else if(h instanceof i)this._hsla=h,this.rgba=i.toRGBA(h);else if(h instanceof d)this._hsva=h,this.rgba=d.toRGBA(h);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(h){return!!h&&A.equals(this.rgba,h.rgba)&&i.equals(this.hsla,h.hsla)&&d.equals(this.hsva,h.hsva)}getRelativeLuminance(){const h=b._relativeLuminanceForComponent(this.rgba.r),o=b._relativeLuminanceForComponent(this.rgba.g),L=b._relativeLuminanceForComponent(this.rgba.b),e=.2126*h+.7152*o+.0722*L;return M(e,4)}static _relativeLuminanceForComponent(h){const o=h/255;return o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(h){const o=this.getRelativeLuminance(),L=h.getRelativeLuminance();return o>L}isDarkerThan(h){const o=this.getRelativeLuminance(),L=h.getRelativeLuminance();return o<L}lighten(h){return new b(new i(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*h,this.hsla.a))}darken(h){return new b(new i(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*h,this.hsla.a))}transparent(h){const{r:o,g:L,b:e,a}=this.rgba;return new b(new A(o,L,e,a*h))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new b(new A(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}makeOpaque(h){if(this.isOpaque()||h.rgba.a!==1)return this;const{r:o,g:L,b:e,a}=this.rgba;return new b(new A(h.rgba.r-a*(h.rgba.r-o),h.rgba.g-a*(h.rgba.g-L),h.rgba.b-a*(h.rgba.b-e),1))}toString(){return this._toString||(this._toString=b.Format.CSS.format(this)),this._toString}static getLighterColor(h,o,L){if(h.isLighterThan(o))return h;L=L||.5;const e=h.getRelativeLuminance(),a=o.getRelativeLuminance();return L=L*(a-e)/a,h.lighten(L)}static getDarkerColor(h,o,L){if(h.isDarkerThan(o))return h;L=L||.5;const e=h.getRelativeLuminance(),a=o.getRelativeLuminance();return L=L*(e-a)/e,h.darken(L)}}n.Color=b,b.white=new b(new A(255,255,255,1)),b.black=new b(new A(0,0,0,1)),b.red=new b(new A(255,0,0,1)),b.blue=new b(new A(0,0,255,1)),b.green=new b(new A(0,255,0,1)),b.cyan=new b(new A(0,255,255,1)),b.lightgrey=new b(new A(211,211,211,1)),b.transparent=new b(new A(0,0,0,0)),function(p){let h;(function(o){let L;(function(e){function a(r){return r.rgba.a===1?`rgb(${r.rgba.r}, ${r.rgba.g}, ${r.rgba.b})`:p.Format.CSS.formatRGBA(r)}e.formatRGB=a;function u(r){return`rgba(${r.rgba.r}, ${r.rgba.g}, ${r.rgba.b}, ${+r.rgba.a.toFixed(2)})`}e.formatRGBA=u;function c(r){return r.hsla.a===1?`hsl(${r.hsla.h}, ${(r.hsla.s*100).toFixed(2)}%, ${(r.hsla.l*100).toFixed(2)}%)`:p.Format.CSS.formatHSLA(r)}e.formatHSL=c;function m(r){return`hsla(${r.hsla.h}, ${(r.hsla.s*100).toFixed(2)}%, ${(r.hsla.l*100).toFixed(2)}%, ${r.hsla.a.toFixed(2)})`}e.formatHSLA=m;function f(r){const s=r.toString(16);return s.length!==2?"0"+s:s}function y(r){return`#${f(r.rgba.r)}${f(r.rgba.g)}${f(r.rgba.b)}`}e.formatHex=