Files
2025-11-25 22:42:56 +01:00

2 lines
60 KiB
JavaScript

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vscodetextmate=t():e.vscodetextmate=t()}(this,(function(){return(()=>{"use strict";var e={350:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UseOnigurumaFindOptions=t.DebugFlags=void 0,t.DebugFlags={InDebugMode:"undefined"!=typeof process&&!!process.env.VSCODE_TEXTMATE_DEBUG},t.UseOnigurumaFindOptions=!1},527:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BalancedBracketSelectors=t.LocalStackElement=t.StackElement=t.ScopeListElement=t.StackElementMetadata=t.Grammar=t.ScopeMetadata=t.ScopeDependencyProcessor=t.ScopeDependencyCollector=t.PartialScopeDependency=t.FullScopeDependency=t.createGrammar=void 0;var r=n(878),o=n(792),i=n(736),s=n(350),a="undefined"==typeof performance?function(){return Date.now()}:function(){return performance.now()};t.createGrammar=function(e,t,n,r,o,i,s,a){return new C(e,t,n,r,o,i,s,a)};var c=function(e){this.scopeName=e};t.FullScopeDependency=c;var u=function(){function e(e,t){this.scopeName=e,this.include=t}return e.prototype.toKey=function(){return this.scopeName+"#"+this.include},e}();t.PartialScopeDependency=u;var l=function(){function e(){this.full=[],this.partial=[],this.visitedRule=new Set,this._seenFull=new Set,this._seenPartial=new Set}return e.prototype.add=function(e){e instanceof c?this._seenFull.has(e.scopeName)||(this._seenFull.add(e.scopeName),this.full.push(e)):this._seenPartial.has(e.toKey())||(this._seenPartial.add(e.toKey()),this.partial.push(e))},e}();function h(e,t,n,o,i){for(var s=0,a=o;s<a.length;s++){var l=a[s];if(!e.visitedRule.has(l)){e.visitedRule.add(l);var p=l.repository?r.mergeObjects({},i,l.repository):i;Array.isArray(l.patterns)&&h(e,t,n,l.patterns,p);var d=l.include;if(d)if("$base"===d||d===t.scopeName)g(e,t,t);else if("$self"===d||d===n.scopeName)g(e,t,n);else if("#"===d.charAt(0))f(e,t,n,d.substring(1),p);else{var m=d.indexOf("#");if(m>=0){var _=d.substring(0,m),y=d.substring(m+1);_===t.scopeName?f(e,t,t,y,p):_===n.scopeName?f(e,t,n,y,p):e.add(new u(_,d.substring(m+1)))}else e.add(new c(d))}}}}t.ScopeDependencyCollector=l;var p=function(){function e(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests=new Set,this.seenPartialScopeRequests=new Set,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new c(this.initialScopeName)]}return e.prototype.processQueue=function(){var e=this.Q;this.Q=[];for(var t=new l,n=0,r=e;n<r.length;n++){var o=r[n];d(this.repo,this.initialScopeName,t,o)}for(var i=0,s=t.full;i<s.length;i++)o=s[i],this.seenFullScopeRequests.has(o.scopeName)||(this.seenFullScopeRequests.add(o.scopeName),this.Q.push(o));for(var a=0,c=t.partial;a<c.length;a++)o=c[a],this.seenFullScopeRequests.has(o.scopeName)||this.seenPartialScopeRequests.has(o.toKey())||(this.seenPartialScopeRequests.add(o.toKey()),this.Q.push(o))},e}();function d(e,t,n,r){var o=e.lookup(r.scopeName);if(o){r instanceof c?g(n,e.lookup(t),o):f(n,e.lookup(t),o,r.include);var i=e.injections(r.scopeName);if(i)for(var s=0,a=i;s<a.length;s++){var u=a[s];n.add(new c(u))}}else if(r.scopeName===t)throw new Error("No grammar provided for <"+t+">")}function f(e,t,n,r,o){void 0===o&&(o=n.repository),o&&o[r]&&h(e,t,n,[o[r]],o)}function g(e,t,n){if(n.patterns&&Array.isArray(n.patterns)&&h(e,t,n,n.patterns,n.repository),n.injections){var r=[];for(var o in n.injections)r.push(n.injections[o]);h(e,t,n,r,n.repository)}}function m(e,t){if(!e)return!1;if(e===t)return!0;var n=t.length;return e.length>n&&e.substr(0,n)===t&&"."===e[n]}function _(e,t){if(t.length<e.length)return!1;var n=0;return e.every((function(e){for(var r=n;r<t.length;r++)if(m(t[r],e))return n=r+1,!0;return!1}))}function y(e,t,n,r,s){for(var a=i.createMatchers(t,_),c=o.RuleFactory.getCompiledRuleId(n,r,s.repository),u=0,l=a;u<l.length;u++){var h=l[u];e.push({debugSelector:t,matcher:h.matcher,ruleId:c,grammar:s,priority:h.priority})}}t.ScopeDependencyProcessor=p;var v=function(e,t,n,r){this.scopeName=e,this.languageId=t,this.tokenType=n,this.themeData=r};t.ScopeMetadata=v;var b=function(){function e(t,n,r){if(this._initialLanguage=t,this._themeProvider=n,this._cache=new Map,this._defaultMetaData=new v("",this._initialLanguage,8,[this._themeProvider.getDefaults()]),this._embeddedLanguages=Object.create(null),r)for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var a=o[i],c=r[a];"number"==typeof c&&0!==c?this._embeddedLanguages[a]=c:console.warn("Invalid embedded language found at scope "+a+": <<"+c+">>")}var u=Object.keys(this._embeddedLanguages).map((function(t){return e._escapeRegExpCharacters(t)}));0===u.length?this._embeddedLanguagesRegex=null:(u.sort(),u.reverse(),this._embeddedLanguagesRegex=new RegExp("^(("+u.join(")|(")+"))($|\\.)",""))}return e.prototype.onDidChangeTheme=function(){this._cache=new Map,this._defaultMetaData=new v("",this._initialLanguage,8,[this._themeProvider.getDefaults()])},e.prototype.getDefaultMetadata=function(){return this._defaultMetaData},e._escapeRegExpCharacters=function(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")},e.prototype.getMetadataForScope=function(t){if(null===t)return e._NULL_SCOPE_METADATA;var n=this._cache.get(t);return n||(n=this._doGetMetadataForScope(t),this._cache.set(t,n),n)},e.prototype._doGetMetadataForScope=function(e){var t=this._scopeToLanguage(e),n=this._toStandardTokenType(e),r=this._themeProvider.themeMatch(e);return new v(e,t,n,r)},e.prototype._scopeToLanguage=function(e){if(!e)return 0;if(!this._embeddedLanguagesRegex)return 0;var t=e.match(this._embeddedLanguagesRegex);return t&&(this._embeddedLanguages[t[1]]||0)||0},e.prototype._toStandardTokenType=function(t){var n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")},e._NULL_SCOPE_METADATA=new v("",0,0,null),e.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/,e}(),C=function(){function e(e,t,n,r,o,s,a,c){if(this.balancedBracketSelectors=s,this._scopeName=e,this._scopeMetadataProvider=new b(n,a,r),this._onigLib=c,this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=k(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(var u=0,l=Object.keys(o);u<l.length;u++)for(var h=l[u],p=0,d=i.createMatchers(h,_);p<d.length;p++){var f=d[p];this._tokenTypeMatchers.push({matcher:f.matcher,type:o[h]})}}return e.prototype.dispose=function(){for(var e=0,t=this._ruleId2desc;e<t.length;e++){var n=t[e];n&&n.dispose()}},e.prototype.createOnigScanner=function(e){return this._onigLib.createOnigScanner(e)},e.prototype.createOnigString=function(e){return this._onigLib.createOnigString(e)},e.prototype.onDidChangeTheme=function(){this._scopeMetadataProvider.onDidChangeTheme()},e.prototype.getMetadataForScope=function(e){return this._scopeMetadataProvider.getMetadataForScope(e)},e.prototype._collectInjections=function(){var e=this,t={lookup:function(t){return t===e._scopeName?e._grammar:e.getExternalGrammar(t)},injections:function(t){return e._grammarRepository.injections(t)}},n=new p(t,this._scopeName),r=[];return n.seenFullScopeRequests.forEach((function(n){var o=t.lookup(n);if(o){var i=o.injections;if(i)for(var s in i)y(r,s,i[s],e,o);if(e._grammarRepository){var a=e._grammarRepository.injections(n);a&&a.forEach((function(t){var n=e.getExternalGrammar(t);if(n){var o=n.injectionSelector;o&&y(r,o,n,e,n)}}))}}})),r.sort((function(e,t){return e.priority-t.priority})),r},e.prototype.getInjections=function(){if(null===this._injections&&(this._injections=this._collectInjections(),s.DebugFlags.InDebugMode&&this._injections.length>0)){console.log("Grammar "+this._scopeName+" contains the following injections:");for(var e=0,t=this._injections;e<t.length;e++){var n=t[e];console.log(" - "+n.debugSelector)}}return this._injections},e.prototype.registerRule=function(e){var t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n},e.prototype.getRule=function(e){return this._ruleId2desc[e]},e.prototype.getExternalGrammar=function(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){var n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=k(n,t&&t.$base),this._includedGrammars[e]}},e.prototype.tokenizeLine=function(e,t,n){void 0===n&&(n=0);var r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}},e.prototype.tokenizeLine2=function(e,t,n){void 0===n&&(n=0);var r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}},e.prototype._tokenize=function(e,t,n,r){var i;if(-1===this._rootId&&(this._rootId=o.RuleFactory.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository)),t&&t!==M.NULL)i=!1,t.reset();else{i=!0;var s=this._scopeMetadataProvider.getDefaultMetadata(),a=s.themeData[0],c=G.set(0,s.languageId,s.tokenType,null,a.fontStyle,a.foreground,a.background),u=this.getRule(this._rootId).getName(null,null),l=this._scopeMetadataProvider.getMetadataForScope(u),h=E.mergeMetadata(c,null,l),p=new E(null,null===u?"unknown":u,h);t=new M(null,this._rootId,-1,-1,!1,null,p,p)}e+="\n";var d=this.createOnigString(e),f=d.content.length,g=new O(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),m=T(this,d,i,0,t,g,!0,r);return S(d),{lineLength:f,lineTokens:g,ruleStack:m.stack,stoppedEarly:m.stoppedEarly}},e}();function S(e){"function"==typeof e.dispose&&e.dispose()}function k(e,t){return(e=r.clone(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}function R(e,t,n,r,o,i,s){if(0!==i.length){for(var a=t.content,c=Math.min(i.length,s.length),u=[],l=s[0].end,h=0;h<c;h++){var p=i[h];if(null!==p){var d=s[h];if(0!==d.length){if(d.start>l)break;for(;u.length>0&&u[u.length-1].endPos<=d.start;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?o.produceFromScopes(u[u.length-1].scopes,d.start):o.produce(r,d.start),p.retokenizeCapturedWithRuleId){var f=p.getName(a,s),g=r.contentNameScopesList.push(e,f),m=p.getContentName(a,s),_=g.push(e,m),y=r.push(p.retokenizeCapturedWithRuleId,d.start,-1,!1,null,g,_),v=e.createOnigString(a.substring(0,d.end));T(e,v,n&&0===d.start,d.start,y,o,!1,0),S(v)}else{var b=p.getName(a,s);if(null!==b){var C=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).push(e,b);u.push(new N(C,d.end))}}}}}for(;u.length>0;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}}function w(e){for(var t=[],n=0,r=e.rules.length;n<r;n++)t.push(" - "+e.rules[n]+": "+e.debugRegExps[n]);return t.join("\n")}function P(e,t){var n=0;return e||(n|=1),t||(n|=4),n}function A(e,t,n,r,o){return s.UseOnigurumaFindOptions?{ruleScanner:e.compile(t,n),findOptions:P(r,o)}:{ruleScanner:e.compileAG(t,n,r,o),findOptions:0}}function I(e,t,n,r,o){return s.UseOnigurumaFindOptions?{ruleScanner:e.compileWhile(t,n),findOptions:P(r,o)}:{ruleScanner:e.compileWhileAG(t,n,r,o),findOptions:0}}t.Grammar=C;var x=function(e,t){this.stack=e,this.stoppedEarly=t};function T(e,t,n,r,i,c,u,l){var h=t.content.length,p=!1,d=-1;if(u){var f=function(e,t,n,r,i,a){for(var c=i.beginRuleCapturedEOL?0:-1,u=[],l=i;l;l=l.pop()){var h=l.getRule(e);h instanceof o.BeginWhileRule&&u.push({rule:h,stack:l})}for(var p=u.pop();p;p=u.pop()){var d=I(p.rule,e,p.stack.endRule,n,r===c),f=d.ruleScanner,g=d.findOptions,m=f.scanner.findNextMatchSync(t,r,g);if(s.DebugFlags.InDebugMode&&(console.log(" scanning for while rule"),console.log(w(f))),!m){s.DebugFlags.InDebugMode&&console.log(" popping "+p.rule.debugName+" - "+p.rule.debugWhileRegExp),i=p.stack.pop();break}if(-2!==f.rules[m.index]){i=p.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(a.produce(p.stack,m.captureIndices[0].start),R(e,t,n,p.stack,a,p.rule.whileCaptures,m.captureIndices),a.produce(p.stack,m.captureIndices[0].end),c=m.captureIndices[0].end,m.captureIndices[0].end>r&&(r=m.captureIndices[0].end,n=!1))}return{stack:i,linePos:r,anchorPosition:c,isFirstLine:n}}(e,t,n,r,i,c);i=f.stack,r=f.linePos,n=f.isFirstLine,d=f.anchorPosition}for(var g=Date.now();!p;){if(0!==l&&Date.now()-g>l)return new x(i,!0);m()}return new x(i,!1);function m(){s.DebugFlags.InDebugMode&&(console.log(""),console.log("@@scanNext "+r+": |"+t.content.substr(r).replace(/\n$/,"\\n")+"|"));var u=function(e,t,n,r,o,i){var c=function(e,t,n,r,o,i){var c=o.getRule(e),u=A(c,e,o.endRule,n,r===i),l=u.ruleScanner,h=u.findOptions,p=0;s.DebugFlags.InDebugMode&&(p=a());var d=l.scanner.findNextMatchSync(t,r,h);if(s.DebugFlags.InDebugMode){var f=a()-p;f>5&&console.warn("Rule "+c.debugName+" ("+c.id+") matching took "+f+" against '"+t+"'"),console.log(" scanning for (linePos: "+r+", anchorPosition: "+i+")"),console.log(w(l)),d&&console.log("matched rule id: "+l.rules[d.index]+" from "+d.captureIndices[0].start+" to "+d.captureIndices[0].end)}return d?{captureIndices:d.captureIndices,matchedRuleId:l.rules[d.index]}:null}(e,t,n,r,o,i),u=e.getInjections();if(0===u.length)return c;var l=function(e,t,n,r,o,i,a){for(var c,u=Number.MAX_VALUE,l=null,h=0,p=i.contentNameScopesList.generateScopes(),d=0,f=e.length;d<f;d++){var g=e[d];if(g.matcher(p)){var m=A(t.getRule(g.ruleId),t,null,r,o===a),_=m.ruleScanner,y=m.findOptions,v=_.scanner.findNextMatchSync(n,o,y);if(v){s.DebugFlags.InDebugMode&&(console.log(" matched injection: "+g.debugSelector),console.log(w(_)));var b=v.captureIndices[0].start;if(!(b>=u)&&(u=b,l=v.captureIndices,c=_.rules[v.index],h=g.priority,u===o))break}}}return l?{priorityMatch:-1===h,captureIndices:l,matchedRuleId:c}:null}(u,e,t,n,r,o,i);if(!l)return c;if(!c)return l;var h=c.captureIndices[0].start,p=l.captureIndices[0].start;return p<h||l.priorityMatch&&p===h?l:c}(e,t,n,r,i,d);if(!u)return s.DebugFlags.InDebugMode&&console.log(" no more matches."),c.produce(i,h),void(p=!0);var l=u.captureIndices,f=u.matchedRuleId,g=!!(l&&l.length>0)&&l[0].end>r;if(-1===f){var m=i.getRule(e);s.DebugFlags.InDebugMode&&console.log(" popping "+m.debugName+" - "+m.debugEndRegExp),c.produce(i,l[0].start),i=i.setContentNameScopesList(i.nameScopesList),R(e,t,n,i,c,m.endCaptures,l),c.produce(i,l[0].end);var _=i;if(i=i.pop(),d=_.getAnchorPos(),!g&&_.getEnterPos()===r)return s.DebugFlags.InDebugMode&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),i=_,c.produce(i,h),void(p=!0)}else{var y=e.getRule(f);c.produce(i,l[0].start);var v=i,b=y.getName(t.content,l),C=i.contentNameScopesList.push(e,b);if(i=i.push(f,r,d,l[0].end===h,null,C,C),y instanceof o.BeginEndRule){var S=y;s.DebugFlags.InDebugMode&&console.log(" pushing "+S.debugName+" - "+S.debugBeginRegExp),R(e,t,n,i,c,S.beginCaptures,l),c.produce(i,l[0].end),d=l[0].end;var k=S.getContentName(t.content,l),P=C.push(e,k);if(i=i.setContentNameScopesList(P),S.endHasBackReferences&&(i=i.setEndRule(S.getEndWithResolvedBackReferences(t.content,l))),!g&&v.hasSameRuleAs(i))return s.DebugFlags.InDebugMode&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),i=i.pop(),c.produce(i,h),void(p=!0)}else if(y instanceof o.BeginWhileRule){if(S=y,s.DebugFlags.InDebugMode&&console.log(" pushing "+S.debugName),R(e,t,n,i,c,S.beginCaptures,l),c.produce(i,l[0].end),d=l[0].end,k=S.getContentName(t.content,l),P=C.push(e,k),i=i.setContentNameScopesList(P),S.whileHasBackReferences&&(i=i.setEndRule(S.getWhileWithResolvedBackReferences(t.content,l))),!g&&v.hasSameRuleAs(i))return s.DebugFlags.InDebugMode&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),i=i.pop(),c.produce(i,h),void(p=!0)}else{var I=y;if(s.DebugFlags.InDebugMode&&console.log(" matched "+I.debugName+" - "+I.debugMatchRegExp),R(e,t,n,i,c,I.captures,l),c.produce(i,l[0].end),i=i.pop(),!g)return s.DebugFlags.InDebugMode&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),i=i.safePop(),c.produce(i,h),void(p=!0)}}l[0].end>r&&(r=l[0].end,n=!1)}}var G=function(){function e(){}return e.toBinaryStr=function(e){for(var t=e.toString(2);t.length<32;)t="0"+t;return t},e.printMetadata=function(t){var n=e.getLanguageId(t),r=e.getTokenType(t),o=e.getFontStyle(t),i=e.getForeground(t),s=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:o,foreground:i,background:s})},e.getLanguageId=function(e){return(255&e)>>>0},e.getTokenType=function(e){return(768&e)>>>8},e.containsBalancedBrackets=function(e){return 0!=(1024&e)},e.getFontStyle=function(e){return(30720&e)>>>11},e.getForeground=function(e){return(16744448&e)>>>15},e.getBackground=function(e){return(4278190080&e)>>>24},e.set=function(t,n,r,o,i,s,a){var c=e.getLanguageId(t),u=e.getTokenType(t),l=e.containsBalancedBrackets(t)?1:0,h=e.getFontStyle(t),p=e.getForeground(t),d=e.getBackground(t);return 0!==n&&(c=n),8!==r&&(u=r),null!==o&&(l=o?1:0),-1!==i&&(h=i),0!==s&&(p=s),0!==a&&(d=a),(c<<0|u<<8|l<<10|h<<11|p<<15|d<<24)>>>0},e}();t.StackElementMetadata=G;var E=function(){function e(e,t,n){this.parent=e,this.scope=t,this.metadata=n}return e._equals=function(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scope!==t.scope||e.metadata!==t.metadata)return!1;e=e.parent,t=t.parent}},e.prototype.equals=function(t){return e._equals(this,t)},e._matchesScope=function(e,t,n){return t===e||e.substring(0,n.length)===n},e._matches=function(e,t){if(null===t)return!0;for(var n=t.length,r=0,o=t[r],i=o+".";e;){if(this._matchesScope(e.scope,o,i)){if(++r===n)return!0;i=(o=t[r])+"."}e=e.parent}return!1},e.mergeMetadata=function(e,t,n){if(null===n)return e;var r=-1,o=0,i=0;if(null!==n.themeData)for(var s=0,a=n.themeData.length;s<a;s++){var c=n.themeData[s];if(this._matches(t,c.parentScopes)){r=c.fontStyle,o=c.foreground,i=c.background;break}}return G.set(e,n.languageId,n.tokenType,null,r,o,i)},e._push=function(t,n,r){for(var o=0,i=r.length;o<i;o++){var s=r[o],a=n.getMetadataForScope(s),c=e.mergeMetadata(t.metadata,t,a);t=new e(t,s,c)}return t},e.prototype.push=function(t,n){return null===n?this:n.indexOf(" ")>=0?e._push(this,t,n.split(/ /g)):e._push(this,t,[n])},e._generateScopes=function(e){for(var t=[],n=0;e;)t[n++]=e.scope,e=e.parent;return t.reverse(),t},e.prototype.generateScopes=function(){return e._generateScopes(this)},e}();t.ScopeListElement=E;var M=function(){function e(e,t,n,r,o,i,s,a){this._stackElementBrand=void 0,this.parent=e,this.depth=this.parent?this.parent.depth+1:1,this.ruleId=t,this._enterPos=n,this._anchorPos=r,this.beginRuleCapturedEOL=o,this.endRule=i,this.nameScopesList=s,this.contentNameScopesList=a}return e._structuralEquals=function(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}},e._equals=function(e,t){return e===t||!!this._structuralEquals(e,t)&&e.contentNameScopesList.equals(t.contentNameScopesList)},e.prototype.clone=function(){return this},e.prototype.equals=function(t){return null!==t&&e._equals(this,t)},e._reset=function(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent},e.prototype.reset=function(){e._reset(this)},e.prototype.pop=function(){return this.parent},e.prototype.safePop=function(){return this.parent?this.parent:this},e.prototype.push=function(t,n,r,o,i,s,a){return new e(this,t,n,r,o,i,s,a)},e.prototype.getEnterPos=function(){return this._enterPos},e.prototype.getAnchorPos=function(){return this._anchorPos},e.prototype.getRule=function(e){return e.getRule(this.ruleId)},e.prototype._writeString=function(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]="("+this.ruleId+", TODO-"+this.nameScopesList+", TODO-"+this.contentNameScopesList+")",t},e.prototype.toString=function(){var e=[];return this._writeString(e,0),"["+e.join(",")+"]"},e.prototype.setContentNameScopesList=function(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)},e.prototype.setEndRule=function(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)},e.prototype.hasSameRuleAs=function(e){for(var t=this;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1},e.NULL=new e(null,0,0,0,!1,null,null,null),e}();t.StackElement=M;var N=function(e,t){this.scopes=e,this.endPos=t};t.LocalStackElement=N;var L=function(){function e(e,t){var n=this;this.allowAny=!1,this.balancedBracketScopes=e.flatMap((function(e){return"*"===e?(n.allowAny=!0,[]):i.createMatchers(e,_).map((function(e){return e.matcher}))})),this.unbalancedBracketScopes=t.flatMap((function(e){return i.createMatchers(e,_).map((function(e){return e.matcher}))}))}return Object.defineProperty(e.prototype,"matchesAlways",{get:function(){return this.allowAny&&0===this.unbalancedBracketScopes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"matchesNever",{get:function(){return 0===this.balancedBracketScopes.length&&!this.allowAny},enumerable:!1,configurable:!0}),e.prototype.match=function(e){for(var t=0,n=this.unbalancedBracketScopes;t<n.length;t++)if((0,n[t])(e))return!1;for(var r=0,o=this.balancedBracketScopes;r<o.length;r++)if((0,o[r])(e))return!0;return this.allowAny},e}();t.BalancedBracketSelectors=L;var O=function(){function e(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,s.DebugFlags.InDebugMode?this._lineText=t:this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}return e.prototype.produce=function(e,t){this.produceFromScopes(e.contentNameScopesList,t)},e.prototype.produceFromScopes=function(e,t){var n;if(!(this._lastTokenEndIndex>=t)){if(this._emitBinaryTokens){var r=e.metadata,o=!1;if((null===(n=this.balancedBracketSelectors)||void 0===n?void 0:n.matchesAlways)&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){for(var i=e.generateScopes(),a=0,c=this._tokenTypeOverrides;a<c.length;a++){var u=c[a];u.matcher(i)&&(r=G.set(r,0,u.type,null,-1,0,0))}this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(i))}if(o&&(r=G.set(r,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r)return void(this._lastTokenEndIndex=t);if(s.DebugFlags.InDebugMode){var l=e.generateScopes();console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,t).replace(/\n$/,"\\n")+"|");for(var h=0;h<l.length;h++)console.log(" * "+l[h])}return this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),void(this._lastTokenEndIndex=t)}var p=e.generateScopes();if(s.DebugFlags.InDebugMode)for(console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,t).replace(/\n$/,"\\n")+"|"),h=0;h<p.length;h++)console.log(" * "+p[h]);this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:p}),this._lastTokenEndIndex=t}},e.prototype.getResult=function(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens},e.prototype.getBinaryResult=function(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);for(var n=new Uint32Array(this._binaryTokens.length),r=0,o=this._binaryTokens.length;r<o;r++)n[r]=this._binaryTokens[r];return n},e}()},25:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseRawGrammar=void 0;var r=n(69),o=n(350),i=n(974);t.parseRawGrammar=function(e,t){return void 0===t&&(t=null),null!==t&&/\.json$/.test(t)?(n=e,s=t,o.DebugFlags.InDebugMode?i.parse(n,s,!0):JSON.parse(n)):function(e,t){return o.DebugFlags.InDebugMode?r.parseWithLocation(e,t,"$vscodeTextmateLocation"):r.parse(e)}(e,t);var n,s}},974:(e,t)=>{function n(e,t){throw new Error("Near offset "+e.pos+": "+t+" ~~~"+e.source.substr(e.pos,50)+"~~~")}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0,t.parse=function(e,t,s){var a=new r(e),c=new o,u=0,l=null,h=[],p=[];function d(){h.push(u),p.push(l)}function f(){u=h.pop(),l=p.pop()}function g(e){n(a,e)}for(;i(a,c);){if(0===u){if(null!==l&&g("too many constructs in root"),3===c.type){l={},s&&(l.$vscodeTextmateLocation=c.toLocation(t)),d(),u=1;continue}if(2===c.type){l=[],d(),u=4;continue}g("unexpected token in root")}if(2===u){if(5===c.type){f();continue}if(7===c.type){u=3;continue}g("expected , or }")}if(1===u||3===u){if(1===u&&5===c.type){f();continue}if(1===c.type){var m=c.value;if(i(a,c)&&6===c.type||g("expected colon"),i(a,c)||g("expected value"),u=2,1===c.type){l[m]=c.value;continue}if(8===c.type){l[m]=null;continue}if(9===c.type){l[m]=!0;continue}if(10===c.type){l[m]=!1;continue}if(11===c.type){l[m]=parseFloat(c.value);continue}if(2===c.type){var _=[];l[m]=_,d(),u=4,l=_;continue}if(3===c.type){var y={};s&&(y.$vscodeTextmateLocation=c.toLocation(t)),l[m]=y,d(),u=1,l=y;continue}}g("unexpected token in dict")}if(5===u){if(4===c.type){f();continue}if(7===c.type){u=6;continue}g("expected , or ]")}if(4===u||6===u){if(4===u&&4===c.type){f();continue}if(u=5,1===c.type){l.push(c.value);continue}if(8===c.type){l.push(null);continue}if(9===c.type){l.push(!0);continue}if(10===c.type){l.push(!1);continue}if(11===c.type){l.push(parseFloat(c.value));continue}if(2===c.type){_=[],l.push(_),d(),u=4,l=_;continue}if(3===c.type){y={},s&&(y.$vscodeTextmateLocation=c.toLocation(t)),l.push(y),d(),u=1,l=y;continue}g("unexpected token in array")}g("unknown state")}return 0!==p.length&&g("unclosed constructs"),l};var r=function(e){this.source=e,this.pos=0,this.len=e.length,this.line=1,this.char=0},o=function(){function e(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}return e.prototype.toLocation=function(e){return{filename:e,line:this.line,char:this.char}},e}();function i(e,t){t.value=null,t.type=0,t.offset=-1,t.len=-1,t.line=-1,t.char=-1;for(var r,o=e.source,i=e.pos,s=e.len,a=e.line,c=e.char;;){if(i>=s)return!1;if(32!==(r=o.charCodeAt(i))&&9!==r&&13!==r){if(10!==r)break;i++,a++,c=0}else i++,c++}if(t.offset=i,t.line=a,t.char=c,34===r){for(t.type=1,i++,c++;;){if(i>=s)return!1;if(r=o.charCodeAt(i),i++,c++,92!==r){if(34===r)break}else i++,c++}t.value=o.substring(t.offset+1,i-1).replace(/\\u([0-9A-Fa-f]{4})/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/\\(.)/g,(function(t,r){switch(r){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";default:n(e,"invalid escape sequence")}throw new Error("unreachable")}))}else if(91===r)t.type=2,i++,c++;else if(123===r)t.type=3,i++,c++;else if(93===r)t.type=4,i++,c++;else if(125===r)t.type=5,i++,c++;else if(58===r)t.type=6,i++,c++;else if(44===r)t.type=7,i++,c++;else if(110===r){if(t.type=8,i++,c++,117!==(r=o.charCodeAt(i)))return!1;if(i++,c++,108!==(r=o.charCodeAt(i)))return!1;if(i++,c++,108!==(r=o.charCodeAt(i)))return!1;i++,c++}else if(116===r){if(t.type=9,i++,c++,114!==(r=o.charCodeAt(i)))return!1;if(i++,c++,117!==(r=o.charCodeAt(i)))return!1;if(i++,c++,101!==(r=o.charCodeAt(i)))return!1;i++,c++}else if(102===r){if(t.type=10,i++,c++,97!==(r=o.charCodeAt(i)))return!1;if(i++,c++,108!==(r=o.charCodeAt(i)))return!1;if(i++,c++,115!==(r=o.charCodeAt(i)))return!1;if(i++,c++,101!==(r=o.charCodeAt(i)))return!1;i++,c++}else for(t.type=11;;){if(i>=s)return!1;if(!(46===(r=o.charCodeAt(i))||r>=48&&r<=57||101===r||69===r||45===r||43===r))break;i++,c++}return t.len=i-t.offset,null===t.value&&(t.value=o.substr(t.offset,t.len)),e.pos=i,e.line=a,e.char=c,!0}},787:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseRawGrammar=t.INITIAL=t.Registry=void 0;var a=n(652),c=n(25),u=n(583),l=n(527);o(n(42),t);var h=function(){function e(e){this._options=e,this._syncRegistry=new a.SyncRegistry(u.Theme.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}return e.prototype.dispose=function(){this._syncRegistry.dispose()},e.prototype.setTheme=function(e,t){this._syncRegistry.setTheme(u.Theme.createFromRawTheme(e,t))},e.prototype.getColorMap=function(){return this._syncRegistry.getColorMap()},e.prototype.loadGrammarWithEmbeddedLanguages=function(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})},e.prototype.loadGrammarWithConfiguration=function(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new l.BalancedBracketSelectors(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))},e.prototype.loadGrammar=function(e){return this._loadGrammar(e,0,null,null,null)},e.prototype._doLoadSingleGrammar=function(e){return i(this,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return[4,this._options.loadGrammar(e)];case 1:return(t=r.sent())&&(n="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0,this._syncRegistry.addGrammar(t,n)),[2]}}))}))},e.prototype._loadSingleGrammar=function(e){return i(this,void 0,void 0,(function(){return s(this,(function(t){return this._ensureGrammarCache.has(e)||this._ensureGrammarCache.set(e,this._doLoadSingleGrammar(e)),[2,this._ensureGrammarCache.get(e)]}))}))},e.prototype._loadGrammar=function(e,t,n,r,o){return i(this,void 0,void 0,(function(){var i,a=this;return s(this,(function(s){switch(s.label){case 0:i=new l.ScopeDependencyProcessor(this._syncRegistry,e),s.label=1;case 1:return i.Q.length>0?[4,Promise.all(i.Q.map((function(e){return a._loadSingleGrammar(e.scopeName)})))]:[3,3];case 2:return s.sent(),i.processQueue(),[3,1];case 3:return[2,this._grammarForScopeName(e,t,n,r,o)]}}))}))},e.prototype.addGrammar=function(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r=null),i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return this._syncRegistry.addGrammar(e,t),[4,this._grammarForScopeName(e.scopeName,n,r)];case 1:return[2,o.sent()]}}))}))},e.prototype._grammarForScopeName=function(e,t,n,r,o){return void 0===t&&(t=0),void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=null),this._syncRegistry.grammarForScopeName(e,t,n,r,o)},e}();t.Registry=h,t.INITIAL=l.StackElement.NULL,t.parseRawGrammar=c.parseRawGrammar},736:(e,t)=>{function n(e){return!!e&&!!e.match(/[\w\.:]+/)}Object.defineProperty(t,"__esModule",{value:!0}),t.createMatchers=void 0,t.createMatchers=function(e,t){for(var r,o,i,s=[],a=(i=(o=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g).exec(r=e),{next:function(){if(!i)return null;var e=i[0];return i=o.exec(r),e}}),c=a.next();null!==c;){var u=0;if(2===c.length&&":"===c.charAt(1)){switch(c.charAt(0)){case"R":u=1;break;case"L":u=-1;break;default:console.log("Unknown priority "+c+" in scope selector")}c=a.next()}var l=p();if(s.push({matcher:l,priority:u}),","!==c)break;c=a.next()}return s;function h(){if("-"===c){c=a.next();var e=h();return function(t){return!!e&&!e(t)}}if("("===c){c=a.next();var r=function(){for(var e=[],t=p();t&&(e.push(t),"|"===c||","===c);){do{c=a.next()}while("|"===c||","===c);t=p()}return function(t){return e.some((function(e){return e(t)}))}}();return")"===c&&(c=a.next()),r}if(n(c)){var o=[];do{o.push(c),c=a.next()}while(n(c));return function(e){return t(o,e)}}return null}function p(){for(var e=[],t=h();t;)e.push(t),t=h();return function(t){return e.every((function(e){return e(t)}))}}}},69:(e,t)=>{function n(e,t,n){var r=e.length,o=0,i=1,s=0;function a(t){if(null===n)o+=t;else for(;t>0;)10===e.charCodeAt(o)?(o++,i++,s=0):(o++,s++),t--}function c(e){null===n?o=e:a(e-o)}function u(){for(;o<r;){var t=e.charCodeAt(o);if(32!==t&&9!==t&&13!==t&&10!==t)break;a(1)}}function l(t){return e.substr(o,t.length)===t&&(a(t.length),!0)}function h(t){var n=e.indexOf(t,o);c(-1!==n?n+t.length:r)}function p(t){var n=e.indexOf(t,o);if(-1!==n){var i=e.substring(o,n);return c(n+t.length),i}return i=e.substr(o),c(r),i}r>0&&65279===e.charCodeAt(0)&&(o=1);var d=0,f=null,g=[],m=[],_=null;function y(e,t){g.push(d),m.push(f),d=e,f=t}function v(){if(0===g.length)return b("illegal state stack");d=g.pop(),f=m.pop()}function b(t){throw new Error("Near offset "+o+": "+t+" ~~~"+e.substr(o,50)+"~~~")}var C,S,k,R,w,P=function(){if(null===_)return b("missing <key>");var e={};null!==n&&(e[n]={filename:t,line:i,char:s}),f[_]=e,_=null,y(1,e)},A=function(){if(null===_)return b("missing <key>");var e=[];f[_]=e,_=null,y(2,e)};function I(){if(1!==d)return b("unexpected </dict>");v()}function x(){return 1===d||2!==d?b("unexpected </array>"):void v()}function T(e){if(1===d){if(null===_)return b("missing <key>");f[_]=e,_=null}else 2===d?f.push(e):f=e}function G(e){if(isNaN(e))return b("cannot parse float");if(1===d){if(null===_)return b("missing <key>");f[_]=e,_=null}else 2===d?f.push(e):f=e}function E(e){if(isNaN(e))return b("cannot parse integer");if(1===d){if(null===_)return b("missing <key>");f[_]=e,_=null}else 2===d?f.push(e):f=e}function M(e){if(1===d){if(null===_)return b("missing <key>");f[_]=e,_=null}else 2===d?f.push(e):f=e}function N(e){if(1===d){if(null===_)return b("missing <key>");f[_]=e,_=null}else 2===d?f.push(e):f=e}function L(e){if(1===d){if(null===_)return b("missing <key>");f[_]=e,_=null}else 2===d?f.push(e):f=e}function O(e){if(e.isClosed)return"";var t=p("</");return h(">"),t.replace(/&#([0-9]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,10))})).replace(/&#x([0-9a-f]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/&amp;|&lt;|&gt;|&quot;|&apos;/g,(function(e){switch(e){case"&amp;":return"&";case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&apos;":return"'"}return e}))}for(;o<r&&(u(),!(o>=r));){var D=e.charCodeAt(o);if(a(1),60!==D)return b("expected <");if(o>=r)return b("unexpected end of input");var F=e.charCodeAt(o);if(63!==F)if(33!==F){if(47===F){if(a(1),u(),l("plist")){h(">");continue}if(l("dict")){h(">"),I();continue}if(l("array")){h(">"),x();continue}return b("unexpected closed tag")}var j=(S=void 0,k=void 0,k=!1,47===(S=p(">")).charCodeAt(S.length-1)&&(k=!0,S=S.substring(0,S.length-1)),{name:S.trim(),isClosed:k});switch(j.name){case"dict":1===d?P():2===d?(w=void 0,w={},null!==n&&(w[n]={filename:t,line:i,char:s}),f.push(w),y(1,w)):(f={},null!==n&&(f[n]={filename:t,line:i,char:s}),y(1,f)),j.isClosed&&I();continue;case"array":1===d?A():2===d?(R=void 0,R=[],f.push(R),y(2,R)):y(2,f=[]),j.isClosed&&x();continue;case"key":C=O(j),1!==d?b("unexpected <key>"):null!==_?b("too many <key>"):_=C;continue;case"string":T(O(j));continue;case"real":G(parseFloat(O(j)));continue;case"integer":E(parseInt(O(j),10));continue;case"date":M(new Date(O(j)));continue;case"data":N(O(j));continue;case"true":O(j),L(!0);continue;case"false":O(j),L(!1);continue}if(!/^plist/.test(j.name))return b("unexpected opened tag "+j.name)}else{if(a(1),l("--")){h("--\x3e");continue}h(">")}else a(1),h("?>")}return f}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.parseWithLocation=void 0,t.parseWithLocation=function(e,t,r){return n(e,t,r)},t.parse=function(e){return n(e,null,null)}},652:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SyncRegistry=void 0;var i=n(527),s=function(){function e(e,t){this._theme=e,this._grammars={},this._rawGrammars={},this._injectionGrammars={},this._onigLibPromise=t}return e.prototype.dispose=function(){for(var e in this._grammars)this._grammars.hasOwnProperty(e)&&this._grammars[e].dispose()},e.prototype.setTheme=function(e){var t=this;this._theme=e,Object.keys(this._grammars).forEach((function(e){t._grammars[e].onDidChangeTheme()}))},e.prototype.getColorMap=function(){return this._theme.getColorMap()},e.prototype.addGrammar=function(e,t){this._rawGrammars[e.scopeName]=e,t&&(this._injectionGrammars[e.scopeName]=t)},e.prototype.lookup=function(e){return this._rawGrammars[e]},e.prototype.injections=function(e){return this._injectionGrammars[e]},e.prototype.getDefaults=function(){return this._theme.getDefaults()},e.prototype.themeMatch=function(e){return this._theme.match(e)},e.prototype.grammarForScopeName=function(e,t,n,s,a){return r(this,void 0,void 0,(function(){var r,c,u,l,h;return o(this,(function(o){switch(o.label){case 0:return this._grammars[e]?[3,2]:(r=this._rawGrammars[e])?(c=this._grammars,u=e,l=i.createGrammar,h=[e,r,t,n,s,a,this],[4,this._onigLibPromise]):[2,null];case 1:c[u]=l.apply(void 0,h.concat([o.sent()])),o.label=2;case 2:return[2,this._grammars[e]]}}))}))},e}();t.SyncRegistry=s},792:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.RuleFactory=t.BeginWhileRule=t.BeginEndRule=t.IncludeOnlyRule=t.MatchRule=t.RegExpSourceList=t.RegExpSource=t.CaptureRule=t.Rule=t.CompiledRule=void 0;var i=n(878),s=/\\(\d+)/,a=/\\(\d+)/g,c=function(){function e(e,t,n){this.debugRegExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}return e.prototype.dispose=function(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()},e}();t.CompiledRule=c;var u=function(){function e(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=i.RegexSource.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=i.RegexSource.hasCaptures(this._contentName)}return Object.defineProperty(e.prototype,"debugName",{get:function(){var e=this.$location?i.basename(this.$location.filename)+":"+this.$location.line:"unknown";return this.constructor.name+"#"+this.id+" @ "+e},enumerable:!1,configurable:!0}),e.prototype.getName=function(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?i.RegexSource.replaceCaptures(this._name,e,t):this._name},e.prototype.getContentName=function(e,t){return this._contentNameIsCapturing&&null!==this._contentName?i.RegexSource.replaceCaptures(this._contentName,e,t):this._contentName},e}();t.Rule=u;var l=function(e){function t(t,n,r,o,i){var s=e.call(this,t,n,r,o)||this;return s.retokenizeCapturedWithRuleId=i,s}return o(t,e),t.prototype.dispose=function(){},t.prototype.collectPatternsRecursive=function(e,t,n){throw new Error("Not supported!")},t.prototype.compile=function(e,t){throw new Error("Not supported!")},t.prototype.compileAG=function(e,t,n,r){throw new Error("Not supported!")},t}(u);t.CaptureRule=l;var h=function(){function e(e,t,n){if(void 0===n&&(n=!0),n)if(e){for(var r=e.length,o=0,i=[],a=!1,c=0;c<r;c++)if("\\"===e.charAt(c)&&c+1<r){var u=e.charAt(c+1);"z"===u?(i.push(e.substring(o,c)),i.push("$(?!\\n)(?<!\\n)"),o=c+2):"A"!==u&&"G"!==u||(a=!0),c++}this.hasAnchor=a,0===o?this.source=e:(i.push(e.substring(o,r)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,this.hasBackReferences=s.test(this.source)}return e.prototype.clone=function(){return new e(this.source,this.ruleId,!0)},e.prototype.setSource=function(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))},e.prototype.resolveBackReferences=function(e,t){var n=t.map((function(t){return e.substring(t.start,t.end)}));return a.lastIndex=0,this.source.replace(a,(function(e,t){return(n[parseInt(t,10)]||"").replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}))},e.prototype._buildAnchorCache=function(){var e,t,n,r,o=[],i=[],s=[],a=[];for(e=0,t=this.source.length;e<t;e++)n=this.source.charAt(e),o[e]=n,i[e]=n,s[e]=n,a[e]=n,"\\"===n&&e+1<t&&("A"===(r=this.source.charAt(e+1))?(o[e+1]="￿",i[e+1]="￿",s[e+1]="A",a[e+1]="A"):"G"===r?(o[e+1]="￿",i[e+1]="G",s[e+1]="￿",a[e+1]="G"):(o[e+1]=r,i[e+1]=r,s[e+1]=r,a[e+1]=r),e++);return{A0_G0:o.join(""),A0_G1:i.join(""),A1_G0:s.join(""),A1_G1:a.join("")}},e.prototype.resolveAnchors=function(e,t){return this.hasAnchor&&this._anchorCache?e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0:this.source},e}();t.RegExpSource=h;var p=function(){function e(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}return e.prototype.dispose=function(){this._disposeCaches()},e.prototype._disposeCaches=function(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)},e.prototype.push=function(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor},e.prototype.unshift=function(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor},e.prototype.length=function(){return this._items.length},e.prototype.setSource=function(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))},e.prototype.compile=function(e){if(!this._cached){var t=this._items.map((function(e){return e.source}));this._cached=new c(e,t,this._items.map((function(e){return e.ruleId})))}return this._cached},e.prototype.compileAG=function(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)},e.prototype._resolveAnchors=function(e,t,n){var r=this._items.map((function(e){return e.resolveAnchors(t,n)}));return new c(e,r,this._items.map((function(e){return e.ruleId})))},e}();t.RegExpSourceList=p;var d=function(e){function t(t,n,r,o,i){var s=e.call(this,t,n,r,null)||this;return s._match=new h(o,s.id),s.captures=i,s._cachedCompiledPatterns=null,s}return o(t,e),t.prototype.dispose=function(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)},Object.defineProperty(t.prototype,"debugMatchRegExp",{get:function(){return""+this._match.source},enumerable:!1,configurable:!0}),t.prototype.collectPatternsRecursive=function(e,t,n){t.push(this._match)},t.prototype.compile=function(e,t){return this._getCachedCompiledPatterns(e).compile(e)},t.prototype.compileAG=function(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)},t.prototype._getCachedCompiledPatterns=function(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new p,this.collectPatternsRecursive(e,this._cachedCompiledPatterns,!0)),this._cachedCompiledPatterns},t}(u);t.MatchRule=d;var f=function(e){function t(t,n,r,o,i){var s=e.call(this,t,n,r,o)||this;return s.patterns=i.patterns,s.hasMissingPatterns=i.hasMissingPatterns,s._cachedCompiledPatterns=null,s}return o(t,e),t.prototype.dispose=function(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)},t.prototype.collectPatternsRecursive=function(e,t,n){var r,o;for(r=0,o=this.patterns.length;r<o;r++)e.getRule(this.patterns[r]).collectPatternsRecursive(e,t,!1)},t.prototype.compile=function(e,t){return this._getCachedCompiledPatterns(e).compile(e)},t.prototype.compileAG=function(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)},t.prototype._getCachedCompiledPatterns=function(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new p,this.collectPatternsRecursive(e,this._cachedCompiledPatterns,!0)),this._cachedCompiledPatterns},t}(u);t.IncludeOnlyRule=f;var g=function(e){function t(t,n,r,o,i,s,a,c,u,l){var p=e.call(this,t,n,r,o)||this;return p._begin=new h(i,p.id),p.beginCaptures=s,p._end=new h(a||"￿",-1),p.endHasBackReferences=p._end.hasBackReferences,p.endCaptures=c,p.applyEndPatternLast=u||!1,p.patterns=l.patterns,p.hasMissingPatterns=l.hasMissingPatterns,p._cachedCompiledPatterns=null,p}return o(t,e),t.prototype.dispose=function(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)},Object.defineProperty(t.prototype,"debugBeginRegExp",{get:function(){return""+this._begin.source},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugEndRegExp",{get:function(){return""+this._end.source},enumerable:!1,configurable:!0}),t.prototype.getEndWithResolvedBackReferences=function(e,t){return this._end.resolveBackReferences(e,t)},t.prototype.collectPatternsRecursive=function(e,t,n){if(n){var r,o=void 0;for(o=0,r=this.patterns.length;o<r;o++)e.getRule(this.patterns[o]).collectPatternsRecursive(e,t,!1)}else t.push(this._begin)},t.prototype.compile=function(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)},t.prototype.compileAG=function(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)},t.prototype._getCachedCompiledPatterns=function(e,t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new p,this.collectPatternsRecursive(e,this._cachedCompiledPatterns,!0),this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)),this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns},t}(u);t.BeginEndRule=g;var m=function(e){function t(t,n,r,o,i,s,a,c,u){var l=e.call(this,t,n,r,o)||this;return l._begin=new h(i,l.id),l.beginCaptures=s,l.whileCaptures=c,l._while=new h(a,-2),l.whileHasBackReferences=l._while.hasBackReferences,l.patterns=u.patterns,l.hasMissingPatterns=u.hasMissingPatterns,l._cachedCompiledPatterns=null,l._cachedCompiledWhilePatterns=null,l}return o(t,e),t.prototype.dispose=function(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)},Object.defineProperty(t.prototype,"debugBeginRegExp",{get:function(){return""+this._begin.source},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugWhileRegExp",{get:function(){return""+this._while.source},enumerable:!1,configurable:!0}),t.prototype.getWhileWithResolvedBackReferences=function(e,t){return this._while.resolveBackReferences(e,t)},t.prototype.collectPatternsRecursive=function(e,t,n){if(n){var r,o=void 0;for(o=0,r=this.patterns.length;o<r;o++)e.getRule(this.patterns[o]).collectPatternsRecursive(e,t,!1)}else t.push(this._begin)},t.prototype.compile=function(e,t){return this._getCachedCompiledPatterns(e).compile(e)},t.prototype.compileAG=function(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)},t.prototype._getCachedCompiledPatterns=function(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new p,this.collectPatternsRecursive(e,this._cachedCompiledPatterns,!0)),this._cachedCompiledPatterns},t.prototype.compileWhile=function(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)},t.prototype.compileWhileAG=function(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)},t.prototype._getCachedCompiledWhilePatterns=function(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new p,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns},t}(u);t.BeginWhileRule=m;var _=function(){function e(){}return e.createCaptureRule=function(e,t,n,r,o){return e.registerRule((function(e){return new l(t,e,n,r,o)}))},e.getCompiledRuleId=function(t,n,r){return t.id||n.registerRule((function(o){if(t.id=o,t.match)return new d(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(void 0===t.begin){t.repository&&(r=i.mergeObjects({},r,t.repository));var s=t.patterns;return void 0===s&&t.include&&(s=[{include:t.include}]),new f(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(s,n,r))}return t.while?new m(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new g(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))})),t.id},e._compileCaptures=function(t,n,r){var o=[];if(t){var i=0;for(var s in t)"$vscodeTextmateLocation"!==s&&(c=parseInt(s,10))>i&&(i=c);for(var a=0;a<=i;a++)o[a]=null;for(var s in t)if("$vscodeTextmateLocation"!==s){var c=parseInt(s,10),u=0;t[s].patterns&&(u=e.getCompiledRuleId(t[s],n,r)),o[c]=e.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,u)}}return o},e._compilePatterns=function(t,n,r){var o=[];if(t)for(var i=0,s=t.length;i<s;i++){var a=t[i],c=-1;if(a.include)if("#"===a.include.charAt(0)){var u=r[a.include.substr(1)];u&&(c=e.getCompiledRuleId(u,n,r))}else if("$base"===a.include||"$self"===a.include)c=e.getCompiledRuleId(r[a.include],n,r);else{var l=null,h=null,p=a.include.indexOf("#");p>=0?(l=a.include.substring(0,p),h=a.include.substring(p+1)):l=a.include;var d=n.getExternalGrammar(l,r);if(d)if(h){var _=d.repository[h];_&&(c=e.getCompiledRuleId(_,n,d.repository))}else c=e.getCompiledRuleId(d.repository.$self,n,d.repository)}else c=e.getCompiledRuleId(a,n,r);if(-1!==c){var y=n.getRule(c),v=!1;if((y instanceof f||y instanceof g||y instanceof m)&&y.hasMissingPatterns&&0===y.patterns.length&&(v=!0),v)continue;o.push(c)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}},e}();t.RuleFactory=_},583:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeTrieElement=t.ThemeTrieElementRule=t.strArrCmp=t.strcmp=t.Theme=t.ColorMap=t.parseTheme=t.ParsedThemeRule=void 0;var n=function(e,t,n,r,o,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=o,this.background=i};function r(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function o(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];for(var t=e.settings,o=[],i=0,s=0,a=t.length;s<a;s++){var c=t[s];if(c.settings){var u=void 0;u="string"==typeof c.scope?c.scope.replace(/^[,]+/,"").replace(/[,]+$/,"").split(","):Array.isArray(c.scope)?c.scope:[""];var l=-1;if("string"==typeof c.settings.fontStyle){l=0;for(var h=0,p=(g=c.settings.fontStyle.split(" ")).length;h<p;h++)switch(g[h]){case"italic":l|=1;break;case"bold":l|=2;break;case"underline":l|=4;break;case"strikethrough":l|=8}}var d=null;"string"==typeof c.settings.foreground&&r(c.settings.foreground)&&(d=c.settings.foreground);var f=null;for("string"==typeof c.settings.background&&r(c.settings.background)&&(f=c.settings.background),h=0,p=u.length;h<p;h++){var g,m=(g=u[h].trim().split(" "))[g.length-1],_=null;g.length>1&&(_=g.slice(0,g.length-1)).reverse(),o[i++]=new n(m,_,s,l,d,f)}}}return o}function i(e,t){e.sort((function(e,t){var n=c(e.scope,t.scope);return 0!==n||0!==(n=u(e.parentScopes,t.parentScopes))?n:e.index-t.index}));for(var n=0,r="#000000",o="#ffffff";e.length>=1&&""===e[0].scope;){var i=e.shift();-1!==i.fontStyle&&(n=i.fontStyle),null!==i.foreground&&(r=i.foreground),null!==i.background&&(o=i.background)}for(var p=new s(t),d=new l(0,null,n,p.getId(r),p.getId(o)),f=new h(new l(0,null,-1,0,0),[]),g=0,m=e.length;g<m;g++){var _=e[g];f.insert(0,_.scope,_.parentScopes,_.fontStyle,p.getId(_.foreground),p.getId(_.background))}return new a(p,d,f)}t.ParsedThemeRule=n,t.parseTheme=o;var s=function(){function e(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(var t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}return e.prototype.getId=function(e){if(null===e)return 0;e=e.toUpperCase();var t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error("Missing color in color map - "+e);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t},e.prototype.getColorMap=function(){return this._id2color.slice(0)},e}();t.ColorMap=s;var a=function(){function e(e,t,n){this._colorMap=e,this._root=n,this._defaults=t,this._cache={}}return e.createFromRawTheme=function(e,t){return this.createFromParsedTheme(o(e),t)},e.createFromParsedTheme=function(e,t){return i(e,t)},e.prototype.getColorMap=function(){return this._colorMap.getColorMap()},e.prototype.getDefaults=function(){return this._defaults},e.prototype.match=function(e){return this._cache.hasOwnProperty(e)||(this._cache[e]=this._root.match(e)),this._cache[e]},e}();function c(e,t){return e<t?-1:e>t?1:0}function u(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;var n=e.length,r=t.length;if(n===r){for(var o=0;o<n;o++){var i=c(e[o],t[o]);if(0!==i)return i}return 0}return n-r}t.Theme=a,t.strcmp=c,t.strArrCmp=u;var l=function(){function e(e,t,n,r,o){this.scopeDepth=e,this.parentScopes=t,this.fontStyle=n,this.foreground=r,this.background=o}return e.prototype.clone=function(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)},e.cloneArr=function(e){for(var t=[],n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t},e.prototype.acceptOverwrite=function(e,t,n,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==r&&(this.background=r)},e}();t.ThemeTrieElementRule=l;var h=function(){function e(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={}),this._mainRule=e,this._rulesWithParentScopes=t,this._children=n}return e._sortBySpecificity=function(e){return 1===e.length||e.sort(this._cmpBySpecificity),e},e._cmpBySpecificity=function(e,t){if(e.scopeDepth===t.scopeDepth){var n=e.parentScopes,r=t.parentScopes,o=null===n?0:n.length,i=null===r?0:r.length;if(o===i)for(var s=0;s<o;s++){var a=n[s].length,c=r[s].length;if(a!==c)return c-a}return i-o}return t.scopeDepth-e.scopeDepth},e.prototype.match=function(t){if(""===t)return e._sortBySpecificity([].concat(this._mainRule).concat(this._rulesWithParentScopes));var n,r,o=t.indexOf(".");return-1===o?(n=t,r=""):(n=t.substring(0,o),r=t.substring(o+1)),this._children.hasOwnProperty(n)?this._children[n].match(r):e._sortBySpecificity([].concat(this._mainRule).concat(this._rulesWithParentScopes))},e.prototype.insert=function(t,n,r,o,i,s){if(""!==n){var a,c,u,h=n.indexOf(".");-1===h?(a=n,c=""):(a=n.substring(0,h),c=n.substring(h+1)),this._children.hasOwnProperty(a)?u=this._children[a]:(u=new e(this._mainRule.clone(),l.cloneArr(this._rulesWithParentScopes)),this._children[a]=u),u.insert(t+1,c,r,o,i,s)}else this._doInsertHere(t,r,o,i,s)},e.prototype._doInsertHere=function(e,t,n,r,o){if(null!==t){for(var i=0,s=this._rulesWithParentScopes.length;i<s;i++){var a=this._rulesWithParentScopes[i];if(0===u(a.parentScopes,t))return void a.acceptOverwrite(e,n,r,o)}-1===n&&(n=this._mainRule.fontStyle),0===r&&(r=this._mainRule.foreground),0===o&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new l(e,t,n,r,o))}else this._mainRule.acceptOverwrite(e,n,r,o)},e}();t.ThemeTrieElement=h},42:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},878:(e,t)=>{function n(e){return Array.isArray(e)?function(e){for(var t=[],r=0,o=e.length;r<o;r++)t[r]=n(e[r]);return t}(e):"object"==typeof e?function(e){var t={};for(var r in e)t[r]=n(e[r]);return t}(e):e}Object.defineProperty(t,"__esModule",{value:!0}),t.RegexSource=t.basename=t.mergeObjects=t.clone=void 0,t.clone=function(e){return n(e)},t.mergeObjects=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.forEach((function(t){for(var n in t)e[n]=t[n]})),e},t.basename=function e(t){var n=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return 0===n?t:~n==t.length-1?e(t.substring(0,t.length-1)):t.substr(1+~n)};var r=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,o=function(){function e(){}return e.hasCaptures=function(e){return null!==e&&(r.lastIndex=0,r.test(e))},e.replaceCaptures=function(e,t,n){return e.replace(r,(function(e,r,o,i){var s=n[parseInt(r||o,10)];if(!s)return e;for(var a=t.substring(s.start,s.end);"."===a[0];)a=a.substring(1);switch(i){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}))},e}();t.RegexSource=o}},t={};return function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(787)})()}));
//# sourceMappingURL=main.js.map