@dogsbay/render 0.2.0-beta.124 → 0.2.0-beta.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +1 -1
- package/dist/chunks/chunk-2WIDSLTD.mjs +7 -0
- package/dist/chunks/{chunk-YK4AUT2U.mjs → chunk-IWAXLAAV.mjs} +1 -1
- package/dist/chunks/chunk-XYDV5S5E.mjs +3366 -0
- package/dist/chunks/{highlight-FHL2FBBB.mjs → highlight-FVJ3DT6L.mjs} +2 -2
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +6 -6
- package/dist/chunks/chunk-24ZLCMLW.mjs +0 -313
- package/dist/chunks/chunk-F4KB5D2M.mjs +0 -3052
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as qn,f as Dt,g as Vn,h as Ls,i as jt}from"./chunk-24ZLCMLW.mjs";import{b as Ts}from"./chunk-2V77MTNA.mjs";var I=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Ps(e){return Jt(e)}function Jt(e){return Array.isArray(e)?Ms(e):e instanceof RegExp?e:typeof e=="object"?$s(e):e}function Ms(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Jt(e[n]);return t}function $s(e){let t={};for(let n in e)t[n]=Jt(e[n]);return t}function nr(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function rr(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?rr(e.substring(0,e.length-1)):e.substr(~t+1)}var Ht=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ze=class{static hasCaptures(e){return e===null?!1:(Ht.lastIndex=0,Ht.test(e))}static replaceCaptures(e,t,n){return e.replace(Ht,(r,o,s,i)=>{let a=n[parseInt(o||s,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(i){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function or(e,t){return e<t?-1:e>t?1:0}function sr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let o=0;o<n;o++){let s=or(e[o],t[o]);if(s!==0)return s}return 0}return n-r}function Xn(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 ir(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ar=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},he=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Gs(e),t)}static createFromParsedTheme(e,t){return js(e,t)}_cachedMatchRoot=new ar(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(o=>Fs(e.parent,o.parentScopes));return r?new lr(r.fontStyle,r.foreground,r.background):null}},Ut=class et{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(let r of n)t=new et(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new et(n,t[r]);return n}push(t){return new et(this,t)}getSegments(){let t=this,n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function Fs(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],o=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],o=!0}for(;e&&!Os(e.scopeName,r);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Os(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var lr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Gs(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let o=0,s=t.length;o<s;o++){let i=t[o];if(!i.settings)continue;let a;if(typeof i.scope=="string"){let d=i.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),a=d.split(",")}else Array.isArray(i.scope)?a=i.scope:a=[""];let l=-1;if(typeof i.settings.fontStyle=="string"){l=0;let d=i.settings.fontStyle.split(" ");for(let h=0,f=d.length;h<f;h++)switch(d[h]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let c=null;typeof i.settings.foreground=="string"&&Xn(i.settings.foreground)&&(c=i.settings.foreground);let u=null;typeof i.settings.background=="string"&&Xn(i.settings.background)&&(u=i.settings.background);for(let d=0,h=a.length;d<h;d++){let g=a[d].trim().split(" "),m=g[g.length-1],y=null;g.length>1&&(y=g.slice(0,g.length-1),y.reverse()),n[r++]=new Ds(m,y,o,l,c,u)}}return n}var Ds=class{constructor(e,t,n,r,o,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=o,this.background=s}},O=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(O||{});function js(e,t){e.sort((l,c)=>{let u=or(l.scope,c.scope);return u!==0||(u=sr(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(o=l.background)}let s=new Hs(t),i=new lr(n,s.getId(r),s.getId(o)),a=new Ws(new zt(0,null,-1,0,0),[]);for(let l=0,c=e.length;l<c;l++){let u=e[l];a.insert(0,u.scope,u.parentScopes,u.fontStyle,s.getId(u.foreground),s.getId(u.background))}return new he(s,i,a)}var Hs=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let 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}getColorMap(){return this._id2color.slice(0)}},Us=Object.freeze([]),zt=class cr{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,o,s){this.scopeDepth=t,this.parentScopes=n||Us,this.fontStyle=r,this.foreground=o,this.background=s}clone(){return new cr(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,o=t.length;r<o;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),o!==0&&(this.background=o)}},Ws=class qt{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,o=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[o]===">"&&o++,!(r>=t.parentScopes.length||o>=n.parentScopes.length);){let s=n.parentScopes[o].length-t.parentScopes[r].length;if(s!==0)return s;r++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),o,s;if(r===-1?(o=t,s=""):(o=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(o))return this._children[o].match(s)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(qt._cmpBySpecificity),n}insert(t,n,r,o,s,i){if(n===""){this._doInsertHere(t,r,o,s,i);return}let a=n.indexOf("."),l,c;a===-1?(l=n,c=""):(l=n.substring(0,a),c=n.substring(a+1));let u;this._children.hasOwnProperty(l)?u=this._children[l]:(u=new qt(this._mainRule.clone(),zt.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(t+1,c,r,o,s,i)}_doInsertHere(t,n,r,o,s){if(n===null){this._mainRule.acceptOverwrite(t,r,o,s);return}for(let i=0,a=this._rulesWithParentScopes.length;i<a;i++){let l=this._rulesWithParentScopes[i];if(sr(l.parentScopes,n)===0){l.acceptOverwrite(t,r,o,s);return}}r===-1&&(r=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new zt(t,n,r,o,s))}},ie=class q{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let n=q.getLanguageId(t),r=q.getTokenType(t),o=q.getFontStyle(t),s=q.getForeground(t),i=q.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:o,foreground:s,background:i})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,o,s,i,a){let l=q.getLanguageId(t),c=q.getTokenType(t),u=q.containsBalancedBrackets(t)?1:0,d=q.getFontStyle(t),h=q.getForeground(t),f=q.getBackground(t);return n!==0&&(l=n),r!==8&&(c=r),o!==null&&(u=o?1:0),s!==-1&&(d=s),i!==0&&(h=i),a!==0&&(f=a),(l<<0|c<<8|u<<10|d<<11|h<<15|f<<24)>>>0}};function nt(e,t){let n=[],r=zs(e),o=r.next();for(;o!==null;){let l=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=r.next()}let c=i();if(n.push({matcher:c,priority:l}),o!==",")break;o=r.next()}return n;function s(){if(o==="-"){o=r.next();let l=s();return c=>!!l&&!l(c)}if(o==="("){o=r.next();let l=a();return o===")"&&(o=r.next()),l}if(Yn(o)){let l=[];do l.push(o),o=r.next();while(Yn(o));return c=>t(l,c)}return null}function i(){let l=[],c=s();for(;c;)l.push(c),c=s();return u=>l.every(d=>d(u))}function a(){let l=[],c=i();for(;c&&(l.push(c),o==="|"||o===",");){do o=r.next();while(o==="|"||o===",");c=i()}return u=>l.some(d=>d(u))}}function Yn(e){return!!e&&!!e.match(/[\w\.:]+/)}function zs(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function ur(e){typeof e.dispose=="function"&&e.dispose()}var $e=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},qs=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Vs=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Xs=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new $e(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Vs;for(let n of e)Ys(n,this.initialScopeName,this.repo,t);for(let n of t.references)if(n instanceof $e){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Ys(e,t,n,r){let o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}let s=n.lookup(t);e instanceof $e?tt({baseGrammar:s,selfGrammar:o},r):Vt(e.ruleName,{baseGrammar:s,selfGrammar:o,repository:o.repository},r);let i=n.injections(e.scopeName);if(i)for(let a of i)r.add(new $e(a))}function Vt(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];rt([r],t,n)}}function tt(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&rt(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&rt(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function rt(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let o=r.repository?nr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&rt(r.patterns,{...t,repository:o},n);let s=r.include;if(!s)continue;let i=dr(s);switch(i.kind){case 0:tt({...t,selfGrammar:t.baseGrammar},n);break;case 1:tt(t,n);break;case 2:Vt(i.ruleName,{...t,repository:o},n);break;case 3:case 4:let a=i.scopeName===t.selfGrammar.scopeName?t.selfGrammar:i.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){let l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:o};i.kind===4?Vt(i.ruleName,l,n):tt(l,n)}else i.kind===4?n.add(new qs(i.scopeName,i.ruleName)):n.add(new $e(i.scopeName));break}}}var Ks=class{kind=0},Js=class{kind=1},Qs=class{constructor(e){this.ruleName=e}kind=2},Zs=class{constructor(e){this.scopeName=e}kind=3},ei=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function dr(e){if(e==="$base")return new Ks;if(e==="$self")return new Js;let t=e.indexOf("#");if(t===-1)return new Zs(e);if(t===0)return new Qs(e.substring(1));{let n=e.substring(0,t),r=e.substring(t+1);return new ei(n,r)}}var ti=/\\(\d+)/,Kn=/\\(\d+)/g,Xc=Symbol("RuleId"),ni=-1,fr=-2;var Ge=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ze.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ze.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${rr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Ze.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ze.replaceCaptures(this._contentName,e,t)}},ri=class extends Ge{retokenizeCapturedWithRuleId;constructor(e,t,n,r,o){super(e,t,n,r),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},oi=class extends Ge{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,o){super(e,t,n,null),this._match=new Fe(r,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Oe,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Jn=class extends Ge{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,o){super(e,t,n,r),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Oe,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Xt=class extends Ge{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,o,s,i,a,l,c){super(e,t,n,r),this._begin=new Fe(o,this.id),this.beginCaptures=s,this._end=new Fe(i||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Oe;for(let n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},ot=class extends Ge{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,o,s,i,a,l){super(e,t,n,r),this._begin=new Fe(o,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new Fe(i,fr),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Oe;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Oe,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},hr=class G{static createCaptureRule(t,n,r,o,s){return t.registerRule(i=>new ri(n,i,r,o,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new oi(t.$vscodeTextmateLocation,t.id,t.name,t.match,G._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=nr({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new Jn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,G._compilePatterns(s,n,r))}return t.while?new ot(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,G._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,G._compileCaptures(t.whileCaptures||t.captures,n,r),G._compilePatterns(t.patterns,n,r)):new Xt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,G._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,G._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,G._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let o=[];if(t){let s=0;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let a=parseInt(i,10);a>s&&(s=a)}for(let i=0;i<=s;i++)o[i]=null;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let a=parseInt(i,10),l=0;t[i].patterns&&(l=G.getCompiledRuleId(t[i],n,r)),o[a]=G.createCaptureRule(n,t[i].$vscodeTextmateLocation,t[i].name,t[i].contentName,l)}}return o}static _compilePatterns(t,n,r){let o=[];if(t)for(let s=0,i=t.length;s<i;s++){let a=t[s],l=-1;if(a.include){let c=dr(a.include);switch(c.kind){case 0:case 1:l=G.getCompiledRuleId(r[a.include],n,r);break;case 2:let u=r[c.ruleName];u&&(l=G.getCompiledRuleId(u,n,r));break;case 3:case 4:let d=c.scopeName,h=c.kind===4?c.ruleName:null,f=n.getExternalGrammar(d,r);if(f)if(h){let g=f.repository[h];g&&(l=G.getCompiledRuleId(g,n,f.repository))}else l=G.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else l=G.getCompiledRuleId(a,n,r);if(l!==-1){let c=n.getRule(l),u=!1;if((c instanceof Jn||c instanceof Xt||c instanceof ot)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;o.push(l)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Fe=class gr{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){let r=t.length,o=0,s=[],i=!1;for(let a=0;a<r;a++)if(t.charAt(a)==="\\"&&a+1<r){let c=t.charAt(a+1);c==="z"?(s.push(t.substring(o,a)),s.push("$(?!\\n)(?<!\\n)"),o=a+2):(c==="A"||c==="G")&&(i=!0),a++}this.hasAnchor=i,o===0?this.source=t:(s.push(t.substring(o,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=ti.test(this.source):this.hasBackReferences=!1}clone(){return new gr(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(o=>t.substring(o.start,o.end));return Kn.lastIndex=0,this.source.replace(Kn,(o,s)=>ir(r[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],o=[],s,i,a,l;for(s=0,i=this.source.length;s<i;s++)a=this.source.charAt(s),t[s]=a,n[s]=a,r[s]=a,o[s]=a,a==="\\"&&s+1<i&&(l=this.source.charAt(s+1),l==="A"?(t[s+1]="\uFFFF",n[s+1]="\uFFFF",r[s+1]="A",o[s+1]="A"):l==="G"?(t[s+1]="\uFFFF",n[s+1]="G",r[s+1]="\uFFFF",o[s+1]="G"):(t[s+1]=l,n[s+1]=l,r[s+1]=l,o[s+1]=l),s++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Oe=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){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)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Qn(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(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)}_resolveAnchors(e,t,n){let r=this._items.map(o=>o.resolveAnchors(t,n));return new Qn(e,r,this._items.map(o=>o.ruleId))}},Qn=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
1
|
+
import{a as qn,h as Dt,j as Vn,k as Ls,l as jt}from"./chunk-2WIDSLTD.mjs";import{b as Ts}from"./chunk-2V77MTNA.mjs";var I=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Ps(e){return Jt(e)}function Jt(e){return Array.isArray(e)?Ms(e):e instanceof RegExp?e:typeof e=="object"?$s(e):e}function Ms(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Jt(e[n]);return t}function $s(e){let t={};for(let n in e)t[n]=Jt(e[n]);return t}function nr(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function rr(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?rr(e.substring(0,e.length-1)):e.substr(~t+1)}var Ht=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ze=class{static hasCaptures(e){return e===null?!1:(Ht.lastIndex=0,Ht.test(e))}static replaceCaptures(e,t,n){return e.replace(Ht,(r,o,s,i)=>{let a=n[parseInt(o||s,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(i){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function or(e,t){return e<t?-1:e>t?1:0}function sr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let o=0;o<n;o++){let s=or(e[o],t[o]);if(s!==0)return s}return 0}return n-r}function Xn(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 ir(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ar=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},he=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Gs(e),t)}static createFromParsedTheme(e,t){return js(e,t)}_cachedMatchRoot=new ar(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(o=>Fs(e.parent,o.parentScopes));return r?new lr(r.fontStyle,r.foreground,r.background):null}},Ut=class et{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(let r of n)t=new et(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new et(n,t[r]);return n}push(t){return new et(this,t)}getSegments(){let t=this,n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function Fs(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],o=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],o=!0}for(;e&&!Os(e.scopeName,r);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Os(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var lr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Gs(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let o=0,s=t.length;o<s;o++){let i=t[o];if(!i.settings)continue;let a;if(typeof i.scope=="string"){let d=i.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),a=d.split(",")}else Array.isArray(i.scope)?a=i.scope:a=[""];let l=-1;if(typeof i.settings.fontStyle=="string"){l=0;let d=i.settings.fontStyle.split(" ");for(let h=0,f=d.length;h<f;h++)switch(d[h]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let c=null;typeof i.settings.foreground=="string"&&Xn(i.settings.foreground)&&(c=i.settings.foreground);let u=null;typeof i.settings.background=="string"&&Xn(i.settings.background)&&(u=i.settings.background);for(let d=0,h=a.length;d<h;d++){let g=a[d].trim().split(" "),m=g[g.length-1],y=null;g.length>1&&(y=g.slice(0,g.length-1),y.reverse()),n[r++]=new Ds(m,y,o,l,c,u)}}return n}var Ds=class{constructor(e,t,n,r,o,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=o,this.background=s}},O=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(O||{});function js(e,t){e.sort((l,c)=>{let u=or(l.scope,c.scope);return u!==0||(u=sr(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(o=l.background)}let s=new Hs(t),i=new lr(n,s.getId(r),s.getId(o)),a=new Ws(new zt(0,null,-1,0,0),[]);for(let l=0,c=e.length;l<c;l++){let u=e[l];a.insert(0,u.scope,u.parentScopes,u.fontStyle,s.getId(u.foreground),s.getId(u.background))}return new he(s,i,a)}var Hs=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let 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}getColorMap(){return this._id2color.slice(0)}},Us=Object.freeze([]),zt=class cr{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,o,s){this.scopeDepth=t,this.parentScopes=n||Us,this.fontStyle=r,this.foreground=o,this.background=s}clone(){return new cr(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,o=t.length;r<o;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),o!==0&&(this.background=o)}},Ws=class qt{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,o=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[o]===">"&&o++,!(r>=t.parentScopes.length||o>=n.parentScopes.length);){let s=n.parentScopes[o].length-t.parentScopes[r].length;if(s!==0)return s;r++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),o,s;if(r===-1?(o=t,s=""):(o=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(o))return this._children[o].match(s)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(qt._cmpBySpecificity),n}insert(t,n,r,o,s,i){if(n===""){this._doInsertHere(t,r,o,s,i);return}let a=n.indexOf("."),l,c;a===-1?(l=n,c=""):(l=n.substring(0,a),c=n.substring(a+1));let u;this._children.hasOwnProperty(l)?u=this._children[l]:(u=new qt(this._mainRule.clone(),zt.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(t+1,c,r,o,s,i)}_doInsertHere(t,n,r,o,s){if(n===null){this._mainRule.acceptOverwrite(t,r,o,s);return}for(let i=0,a=this._rulesWithParentScopes.length;i<a;i++){let l=this._rulesWithParentScopes[i];if(sr(l.parentScopes,n)===0){l.acceptOverwrite(t,r,o,s);return}}r===-1&&(r=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new zt(t,n,r,o,s))}},ie=class q{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let n=q.getLanguageId(t),r=q.getTokenType(t),o=q.getFontStyle(t),s=q.getForeground(t),i=q.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:o,foreground:s,background:i})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,o,s,i,a){let l=q.getLanguageId(t),c=q.getTokenType(t),u=q.containsBalancedBrackets(t)?1:0,d=q.getFontStyle(t),h=q.getForeground(t),f=q.getBackground(t);return n!==0&&(l=n),r!==8&&(c=r),o!==null&&(u=o?1:0),s!==-1&&(d=s),i!==0&&(h=i),a!==0&&(f=a),(l<<0|c<<8|u<<10|d<<11|h<<15|f<<24)>>>0}};function nt(e,t){let n=[],r=zs(e),o=r.next();for(;o!==null;){let l=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=r.next()}let c=i();if(n.push({matcher:c,priority:l}),o!==",")break;o=r.next()}return n;function s(){if(o==="-"){o=r.next();let l=s();return c=>!!l&&!l(c)}if(o==="("){o=r.next();let l=a();return o===")"&&(o=r.next()),l}if(Yn(o)){let l=[];do l.push(o),o=r.next();while(Yn(o));return c=>t(l,c)}return null}function i(){let l=[],c=s();for(;c;)l.push(c),c=s();return u=>l.every(d=>d(u))}function a(){let l=[],c=i();for(;c&&(l.push(c),o==="|"||o===",");){do o=r.next();while(o==="|"||o===",");c=i()}return u=>l.some(d=>d(u))}}function Yn(e){return!!e&&!!e.match(/[\w\.:]+/)}function zs(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function ur(e){typeof e.dispose=="function"&&e.dispose()}var $e=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},qs=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Vs=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Xs=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new $e(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Vs;for(let n of e)Ys(n,this.initialScopeName,this.repo,t);for(let n of t.references)if(n instanceof $e){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Ys(e,t,n,r){let o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}let s=n.lookup(t);e instanceof $e?tt({baseGrammar:s,selfGrammar:o},r):Vt(e.ruleName,{baseGrammar:s,selfGrammar:o,repository:o.repository},r);let i=n.injections(e.scopeName);if(i)for(let a of i)r.add(new $e(a))}function Vt(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];rt([r],t,n)}}function tt(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&rt(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&rt(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function rt(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let o=r.repository?nr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&rt(r.patterns,{...t,repository:o},n);let s=r.include;if(!s)continue;let i=dr(s);switch(i.kind){case 0:tt({...t,selfGrammar:t.baseGrammar},n);break;case 1:tt(t,n);break;case 2:Vt(i.ruleName,{...t,repository:o},n);break;case 3:case 4:let a=i.scopeName===t.selfGrammar.scopeName?t.selfGrammar:i.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){let l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:o};i.kind===4?Vt(i.ruleName,l,n):tt(l,n)}else i.kind===4?n.add(new qs(i.scopeName,i.ruleName)):n.add(new $e(i.scopeName));break}}}var Ks=class{kind=0},Js=class{kind=1},Qs=class{constructor(e){this.ruleName=e}kind=2},Zs=class{constructor(e){this.scopeName=e}kind=3},ei=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function dr(e){if(e==="$base")return new Ks;if(e==="$self")return new Js;let t=e.indexOf("#");if(t===-1)return new Zs(e);if(t===0)return new Qs(e.substring(1));{let n=e.substring(0,t),r=e.substring(t+1);return new ei(n,r)}}var ti=/\\(\d+)/,Kn=/\\(\d+)/g,Xc=Symbol("RuleId"),ni=-1,fr=-2;var Ge=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ze.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ze.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${rr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Ze.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ze.replaceCaptures(this._contentName,e,t)}},ri=class extends Ge{retokenizeCapturedWithRuleId;constructor(e,t,n,r,o){super(e,t,n,r),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},oi=class extends Ge{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,o){super(e,t,n,null),this._match=new Fe(r,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Oe,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Jn=class extends Ge{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,o){super(e,t,n,r),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Oe,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Xt=class extends Ge{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,o,s,i,a,l,c){super(e,t,n,r),this._begin=new Fe(o,this.id),this.beginCaptures=s,this._end=new Fe(i||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Oe;for(let n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},ot=class extends Ge{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,o,s,i,a,l){super(e,t,n,r),this._begin=new Fe(o,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new Fe(i,fr),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Oe;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Oe,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},hr=class G{static createCaptureRule(t,n,r,o,s){return t.registerRule(i=>new ri(n,i,r,o,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new oi(t.$vscodeTextmateLocation,t.id,t.name,t.match,G._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=nr({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new Jn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,G._compilePatterns(s,n,r))}return t.while?new ot(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,G._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,G._compileCaptures(t.whileCaptures||t.captures,n,r),G._compilePatterns(t.patterns,n,r)):new Xt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,G._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,G._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,G._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let o=[];if(t){let s=0;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let a=parseInt(i,10);a>s&&(s=a)}for(let i=0;i<=s;i++)o[i]=null;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let a=parseInt(i,10),l=0;t[i].patterns&&(l=G.getCompiledRuleId(t[i],n,r)),o[a]=G.createCaptureRule(n,t[i].$vscodeTextmateLocation,t[i].name,t[i].contentName,l)}}return o}static _compilePatterns(t,n,r){let o=[];if(t)for(let s=0,i=t.length;s<i;s++){let a=t[s],l=-1;if(a.include){let c=dr(a.include);switch(c.kind){case 0:case 1:l=G.getCompiledRuleId(r[a.include],n,r);break;case 2:let u=r[c.ruleName];u&&(l=G.getCompiledRuleId(u,n,r));break;case 3:case 4:let d=c.scopeName,h=c.kind===4?c.ruleName:null,f=n.getExternalGrammar(d,r);if(f)if(h){let g=f.repository[h];g&&(l=G.getCompiledRuleId(g,n,f.repository))}else l=G.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else l=G.getCompiledRuleId(a,n,r);if(l!==-1){let c=n.getRule(l),u=!1;if((c instanceof Jn||c instanceof Xt||c instanceof ot)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;o.push(l)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Fe=class gr{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){let r=t.length,o=0,s=[],i=!1;for(let a=0;a<r;a++)if(t.charAt(a)==="\\"&&a+1<r){let c=t.charAt(a+1);c==="z"?(s.push(t.substring(o,a)),s.push("$(?!\\n)(?<!\\n)"),o=a+2):(c==="A"||c==="G")&&(i=!0),a++}this.hasAnchor=i,o===0?this.source=t:(s.push(t.substring(o,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=ti.test(this.source):this.hasBackReferences=!1}clone(){return new gr(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(o=>t.substring(o.start,o.end));return Kn.lastIndex=0,this.source.replace(Kn,(o,s)=>ir(r[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],o=[],s,i,a,l;for(s=0,i=this.source.length;s<i;s++)a=this.source.charAt(s),t[s]=a,n[s]=a,r[s]=a,o[s]=a,a==="\\"&&s+1<i&&(l=this.source.charAt(s+1),l==="A"?(t[s+1]="\uFFFF",n[s+1]="\uFFFF",r[s+1]="A",o[s+1]="A"):l==="G"?(t[s+1]="\uFFFF",n[s+1]="G",r[s+1]="\uFFFF",o[s+1]="G"):(t[s+1]=l,n[s+1]=l,r[s+1]=l,o[s+1]=l),s++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Oe=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){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)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Qn(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(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)}_resolveAnchors(e,t,n){let r=this._items.map(o=>o.resolveAnchors(t,n));return new Qn(e,r,this._items.map(o=>o.ruleId))}},Qn=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
2
2
|
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Wt=class{constructor(e,t){this.languageId=e,this.tokenType=t}},si=class Yt{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Wt(t,8),this._embeddedLanguagesMatcher=new ii(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Yt._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Wt(0,0);_getBasicScopeAttributes=new ar(t=>{let n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Wt(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){let n=t.match(Yt.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!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},ii=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([n,r])=>ir(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Yc={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},pr=!1,Zn=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function mr(e,t,n,r,o,s,i,a){let l=t.content.length,c=!1,u=-1;if(i){let f=ai(e,t,n,r,o,s);o=f.stack,r=f.linePos,n=f.isFirstLine,u=f.anchorPosition}let d=Date.now();for(;!c;){if(a!==0&&Date.now()-d>a)return new Zn(o,!0);h()}return new Zn(o,!1);function h(){let f=li(e,t,n,r,o,u);if(!f){s.produce(o,l),c=!0;return}let g=f.captureIndices,m=f.matchedRuleId,y=g&&g.length>0?g[0].end>r:!1;if(m===ni){let b=o.getRule(e);s.produce(o,g[0].start),o=o.withContentNameScopesList(o.nameScopesList),Pe(e,t,n,o,s,b.endCaptures,g),s.produce(o,g[0].end);let p=o;if(o=o.parent,u=p.getAnchorPos(),!y&&p.getEnterPos()===r){o=p,s.produce(o,l),c=!0;return}}else{let b=e.getRule(m);s.produce(o,g[0].start);let p=o,w=b.getName(t.content,g),C=o.contentNameScopesList.pushAttributed(w,e);if(o=o.push(m,r,u,g[0].end===l,null,C,C),b instanceof Xt){let S=b;Pe(e,t,n,o,s,S.beginCaptures,g),s.produce(o,g[0].end),u=g[0].end;let E=S.getContentName(t.content,g),R=C.pushAttributed(E,e);if(o=o.withContentNameScopesList(R),S.endHasBackReferences&&(o=o.withEndRule(S.getEndWithResolvedBackReferences(t.content,g))),!y&&p.hasSameRuleAs(o)){o=o.pop(),s.produce(o,l),c=!0;return}}else if(b instanceof ot){let S=b;Pe(e,t,n,o,s,S.beginCaptures,g),s.produce(o,g[0].end),u=g[0].end;let E=S.getContentName(t.content,g),R=C.pushAttributed(E,e);if(o=o.withContentNameScopesList(R),S.whileHasBackReferences&&(o=o.withEndRule(S.getWhileWithResolvedBackReferences(t.content,g))),!y&&p.hasSameRuleAs(o)){o=o.pop(),s.produce(o,l),c=!0;return}}else if(Pe(e,t,n,o,s,b.captures,g),s.produce(o,g[0].end),o=o.pop(),!y){o=o.safePop(),s.produce(o,l),c=!0;return}}g[0].end>r&&(r=g[0].end,n=!1)}}function ai(e,t,n,r,o,s){let i=o.beginRuleCapturedEOL?0:-1,a=[];for(let l=o;l;l=l.pop()){let c=l.getRule(e);c instanceof ot&&a.push({rule:c,stack:l})}for(let l=a.pop();l;l=a.pop()){let{ruleScanner:c,findOptions:u}=di(l.rule,e,l.stack.endRule,n,r===i),d=c.findNextMatchSync(t,r,u);if(d){if(d.ruleId!==fr){o=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),Pe(e,t,n,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),i=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{o=l.stack.pop();break}}return{stack:o,linePos:r,anchorPosition:i,isFirstLine:n}}function li(e,t,n,r,o,s){let i=ci(e,t,n,r,o,s),a=e.getInjections();if(a.length===0)return i;let l=ui(a,e,t,n,r,o,s);if(!l)return i;if(!i)return l;let c=i.captureIndices[0].start,u=l.captureIndices[0].start;return u<c||l.priorityMatch&&u===c?l:i}function ci(e,t,n,r,o,s){let i=o.getRule(e),{ruleScanner:a,findOptions:l}=br(i,e,o.endRule,n,r===s),c=a.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function ui(e,t,n,r,o,s,i){let a=Number.MAX_VALUE,l=null,c,u=0,d=s.contentNameScopesList.getScopeNames();for(let h=0,f=e.length;h<f;h++){let g=e[h];if(!g.matcher(d))continue;let m=t.getRule(g.ruleId),{ruleScanner:y,findOptions:b}=br(m,t,null,r,o===i),p=y.findNextMatchSync(n,o,b);if(!p)continue;let w=p.captureIndices[0].start;if(!(w>=a)&&(a=w,l=p.captureIndices,c=p.ruleId,u=g.priority,a===o))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function br(e,t,n,r,o){if(pr){let i=e.compile(t,n),a=yr(r,o);return{ruleScanner:i,findOptions:a}}return{ruleScanner:e.compileAG(t,n,r,o),findOptions:0}}function di(e,t,n,r,o){if(pr){let i=e.compileWhile(t,n),a=yr(r,o);return{ruleScanner:i,findOptions:a}}return{ruleScanner:e.compileWhileAG(t,n,r,o),findOptions:0}}function yr(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function Pe(e,t,n,r,o,s,i){if(s.length===0)return;let a=t.content,l=Math.min(s.length,i.length),c=[],u=i[0].end;for(let d=0;d<l;d++){let h=s[d];if(h===null)continue;let f=i[d];if(f.length===0)continue;if(f.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=f.start;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?o.produceFromScopes(c[c.length-1].scopes,f.start):o.produce(r,f.start),h.retokenizeCapturedWithRuleId){let m=h.getName(a,i),y=r.contentNameScopesList.pushAttributed(m,e),b=h.getContentName(a,i),p=y.pushAttributed(b,e),w=r.push(h.retokenizeCapturedWithRuleId,f.start,-1,!1,null,y,p),C=e.createOnigString(a.substring(0,f.end));mr(e,C,n&&f.start===0,f.start,w,o,!1,0),ur(C);continue}let g=h.getName(a,i);if(g!==null){let y=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(g,e);c.push(new fi(y,f.end))}}for(;c.length>0;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var fi=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function hi(e,t,n,r,o,s,i,a){return new pi(e,t,n,r,o,s,i,a)}function er(e,t,n,r,o){let s=nt(t,st),i=hr.getCompiledRuleId(n,r,o.repository);for(let a of s)e.push({debugSelector:t,matcher:a.matcher,ruleId:i,grammar:o,priority:a.priority})}function st(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let o=n;o<t.length;o++)if(gi(t[o],r))return n=o+1,!0;return!1})}function gi(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var pi=class{constructor(e,t,n,r,o,s,i,a){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new si(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=tr(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(let l of Object.keys(o)){let c=nt(l,st);for(let u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:o[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let o=r.injections;if(o)for(let i in o)er(t,i,o[i],this,r);let s=this._grammarRepository.injections(n);s&&s.forEach(i=>{let a=this.getExternalGrammar(i);if(a){let l=a.injectionSelector;l&&er(t,l,a,this,a)}})}return t.sort((o,s)=>o.priority-s.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=tr(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=hr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===Kt.NULL){o=!0;let c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=ie.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),h=this.getRule(this._rootId).getName(null,null),f;h?f=Me.createRootAndLookUpScopeName(h,d,this):f=Me.createRoot("unknown",d),t=new Kt(null,this._rootId,-1,-1,!1,null,f,f)}else o=!1,t.reset();e=e+`
|
|
3
3
|
`;let s=this.createOnigString(e),i=s.content.length,a=new bi(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=mr(this,s,o,0,t,a,!0,r);return ur(s),{lineLength:i,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function tr(e,t){return e=Ps(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Me=class J{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,o=t?.scopePath??null;for(let s of n)o=Ut.push(o,s.scopeNames),r=new J(r,o,s.encodedTokenAttributes);return r}static createRoot(t,n){return new J(null,new Ut(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let o=r.getMetadataForScope(t),s=new Ut(null,t),i=r.themeProvider.themeMatch(s),a=J.mergeAttributes(n,o,i);return new J(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return J.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let o=-1,s=0,i=0;return r!==null&&(o=r.fontStyle,s=r.foregroundId,i=r.backgroundId),ie.set(t,n.languageId,n.tokenType,null,o,s,i)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return J._pushAttributed(this,t,n);let r=t.split(/ /g),o=this;for(let s of r)o=J._pushAttributed(o,s,n);return o}static _pushAttributed(t,n,r){let o=r.getMetadataForScope(n),s=t.scopePath.push(n),i=r.themeProvider.themeMatch(s),a=J.mergeAttributes(t.tokenAttributes,o,i);return new J(t,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Kt=class fe{constructor(t,n,r,o,s,i,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=i,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new fe(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:fe._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Me.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){fe._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,o,s,i,a){return new fe(this,t,n,r,o,s,i,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){let t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new fe(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Me.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new fe(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Me.fromExtension(r,n.contentNameScopesList))}},mi=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):nt(n,st).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>nt(n,st).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},bi=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let s=e?.getScopeNames()??[];for(let i of this._tokenTypeOverrides)i.matcher(s)&&(r=ie.set(r,0,i.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(s))}if(o&&(r=ie.set(r,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let r=0,o=this._binaryTokens.length;r<o;r++)n[r]=this._binaryTokens[r];return n}},yi=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,o){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,hi(e,s,t,n,r,o,this,this._onigLib))}return this._grammars.get(e)}},kr=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new yi(he.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(he.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new mi(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,o){let s=new Xs(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(i=>this._loadSingleGrammar(i.scopeName)),s.processQueue();return this._grammarForScopeName(e,t,n,r,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,o=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,o)}},xe=Kt.NULL;function ge(e,t){let n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(let[o,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[o]=s:o===r&&Object.assign(n,s);return n}function U(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function _r(e){return Array.isArray(e)?e:[e]}async function Qt(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function je(e){return!e||["plaintext","txt","text","plain"].includes(e)}function xr(e){return e==="ansi"||je(e)}function He(e){return e==="none"}function Er(e){return He(e)}var ki=/(\r?\n)/g;function ae(e,t=!1){if(e.length===0)return[["",0]];let n=e.split(ki),r=0,o=[];for(let s=0;s<n.length;s+=2){let i=t?n[s]+(n[s+1]||""):n[s];o.push([i,r]),r+=n[s].length,r+=n[s+1]?.length||0}return o}var wr={light:"#333333",dark:"#bbbbbb"},Cr={light:"#fffffe",dark:"#1e1e1e"},Sr="__shiki_resolved";function it(e){if(e?.[Sr])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?wr.light:wr.dark),n||(n=t.type==="light"?Cr.light:Cr.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0,s=new Map;function i(a){if(s.has(a))return s.get(a);o+=1;let l=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?i(a):(s.set(a,l),l)}t.settings=t.settings.map(a=>{let l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),c=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!c)return a;let u={...a,settings:{...a.settings}};if(l){let d=i(a.settings.foreground);t.colorReplacements[d]=a.settings.foreground,u.settings.foreground=d}if(c){let d=i(a.settings.background);t.colorReplacements[d]=a.settings.background,u.settings.background=d}return u});for(let a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){let l=i(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,Sr,{enumerable:!1,writable:!1,value:!0}),t}async function Ir(e){return[...new Set((await Promise.all(e.filter(t=>!xr(t)).map(async t=>await Qt(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Ar(e){return(await Promise.all(e.map(async t=>Er(t)?null:it(await Qt(t))))).filter(t=>!!t)}function Rr(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new I(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var wi=class extends kr{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=it(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=he.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Rr(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(o=>{this._alias[o]=e.name}),this._loadedLanguagesCache=null,t.size)for(let o of t)this._resolvedGrammars.delete(o.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(o.scopeName),this._syncRegistry?._grammars?.delete(o.scopeName),this.loadLanguage(this._langMap.get(o.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let r of e)this.resolveEmbeddedLanguages(r);let t=[...this._langGraph.entries()],n=t.filter(([r,o])=>!o);if(n.length){let r=t.filter(([o,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(i=>n.map(([a])=>a).includes(i)):!1).filter(o=>!n.includes(o));throw new I(`Missing languages ${n.map(([o])=>`\`${o}\``).join(", ")}, required by ${r.map(([o])=>`\`${o}\``).join(", ")}`)}for(let[r,o]of t)this._resolver.addLanguage(o);for(let[r,o]of t)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let n of t)this._langGraph.set(n,this._langMap.get(n))}},Ci=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split("."),n=[];for(let r=1;r<=t.length;r++){let o=t.slice(0,r).join(".");n=[...n,...this._injections.get(o)||[]]}return n}},De=0;function Zt(e){De+=1,e.warnings!==!1&&De>=10&&De%10===0&&console.warn(`[Shiki] ${De} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new I("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(it),o=new wi(new Ci(e.engine,n),r,n,e.langAlias),s;function i(p){return Rr(p,e.langAlias)}function a(p){y();let w=o.getGrammar(typeof p=="string"?p:p.name);if(!w)throw new I(`Language \`${p}\` not found, you may need to load it first`);return w}function l(p){if(p==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();let w=o.getTheme(p);if(!w)throw new I(`Theme \`${p}\` not found, you may need to load it first`);return w}function c(p){y();let w=l(p);return s!==p&&(o.setTheme(w),s=p),{theme:w,colorMap:o.getColorMap()}}function u(){return y(),o.getLoadedThemes()}function d(){return y(),o.getLoadedLanguages()}function h(...p){y(),o.loadLanguages(p.flat(1))}async function f(...p){return h(await Ir(p))}function g(...p){y();for(let w of p.flat(1))o.loadTheme(w)}async function m(...p){return y(),g(await Ar(p))}function y(){if(t)throw new I("Shiki instance has been disposed")}function b(){t||(t=!0,o.dispose(),De-=1)}return{setTheme:c,getTheme:l,getLanguage:a,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:i,loadLanguage:f,loadLanguageSync:h,loadTheme:m,loadThemeSync:g,dispose:b,[Symbol.dispose]:b}}async function en(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Ar(e.themes||[]),Ir(e.langs||[]),e.engine]);return Zt({...e,themes:t,langs:n,engine:r})}var Nr=new WeakMap;function Ue(e,t){Nr.set(e,t)}function Ee(e){return Nr.get(e)}var at=class Br{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Br(Object.fromEntries(_r(n).map(r=>[r,xe])),t)}constructor(...t){if(t.length===2){let[n,r]=t;this.lang=r,this._stacks=n}else{let[n,r,o]=t;this.lang=r,this._stacks={[o]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Si(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Si(e){let t=[],n=new Set;function r(o){if(n.has(o))return;n.add(o);let s=o?.nameScopesList?.scopeName;s&&t.push(s),o.parent&&r(o.parent)}return r(e),t}function vi(e,t){if(!(e instanceof at))throw new I("Invalid grammar state");return e.getInternalStack(t)}var _i=/,/,xi=/ /;function tn(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(je(e.resolveLangAlias(n.lang||"text"))||He(r))return ae(t).map(a=>[{content:a[0],offset:a[1]}]);let{theme:o,colorMap:s}=e.setTheme(r),i=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==i.name)throw new I(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${i.name}"`);if(!n.grammarState.themes.includes(o.name))throw new I(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return Lr(t,i,o,s,n)}function Tr(...e){if(e.length===2)return Ee(e[1]);let[t,n,r={}]=e,{lang:o="text",theme:s=t.getLoadedThemes()[0]}=r;if(je(o)||He(s))throw new I("Plain language does not have grammar state");if(o==="ansi")throw new I("ANSI language does not have grammar state");let{theme:i,colorMap:a}=t.setTheme(s),l=t.getLanguage(o);return new at(nn(n,l,i,a,r).stateStack,l.name,i.name)}function Lr(e,t,n,r,o){let s=nn(e,t,n,r,o),i=new at(s.stateStack,t.name,n.name);return Ue(s.tokens,i),s.tokens}function nn(e,t,n,r,o){let s=ge(n,o),{tokenizeMaxLineLength:i=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=o,c=ae(e),u=o.grammarState?vi(o.grammarState,n.name)??xe:o.grammarContextCode!=null?nn(o.grammarContextCode,t,n,r,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:xe,d=[],h=[];for(let f=0,g=c.length;f<g;f++){let[m,y]=c[f];if(m===""){d=[],h.push([]);continue}if(i>0&&m.length>=i){d=[],h.push([{content:m,offset:y,color:"",fontStyle:0}]);continue}let b,p,w;l&&l!=="tokenType"&&(b=t.tokenizeLine(m,u,a),p=b.tokens,w=0);let C=t.tokenizeLine2(m,u,a),S=C.tokens.length/2;for(let E=0;E<S;E++){let R=C.tokens[2*E],F=E+1<S?C.tokens[2*E+2]:m.length;if(R===F)continue;let N=C.tokens[2*E+1],K=U(r[ie.getForeground(N)],s),D=ie.getFontStyle(N),A={content:m.substring(R,F),offset:y+R,color:K,fontStyle:D};if(l==="tokenType")A.type=ie.getTokenType(N);else if(l){let ve=[];if(l!=="scopeName")for(let z of n.settings){let _e;switch(typeof z.scope){case"string":_e=z.scope.split(_i).map(Gt=>Gt.trim());break;case"object":_e=z.scope;break;default:continue}ve.push({settings:z,selectors:_e.map(Gt=>Gt.split(xi))})}A.explanation=[];let Le=0;for(;R+Le<F;){let z=p[w],_e=m.substring(z.startIndex,z.endIndex);Le+=_e.length,A.explanation.push({content:_e,scopes:l==="scopeName"?Ei(z.scopes):Ii(ve,z.scopes)}),w+=1}}d.push(A)}h.push(d),d=[],u=C.ruleStack}return{tokens:h,stateStack:u}}function Ei(e){return e.map(t=>({scopeName:t}))}function Ii(e,t){let n=[];for(let r=0,o=t.length;r<o;r++){let s=t[r];n[r]={scopeName:s,themeMatches:Ri(e,s,t.slice(0,r))}}return n}function vr(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Ai(e,t,n){if(!vr(e.at(-1),t))return!1;let r=e.length-2,o=n.length-1;for(;r>=0&&o>=0;)vr(e[r],n[o])&&(r-=1),o-=1;return r===-1}function Ri(e,t,n){let r=[];for(let{selectors:o,settings:s}of e)for(let i of o)if(Ai(i,t,n)){r.push(s);break}return r}function lt(e,t,n,r=tn){let o=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),s=o.map(c=>{let u=r(e,t,{...n,theme:c.theme});return{tokens:u,state:Ee(u),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),i=Ni(...s.map(c=>c.tokens)),a=i[0].map((c,u)=>c.map((d,h)=>{let f={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=d.explanation),i.forEach((g,m)=>{let{content:y,explanation:b,offset:p,...w}=g[u][h];f.variants[o[m].color]=w}),f})),l=s[0].state?new at(Object.fromEntries(s.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),s[0].state.lang):void 0;return l&&Ue(a,l),a}function Ni(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let o=e.map(l=>l[r]),s=t.map(()=>[]);t.forEach((l,c)=>l.push(s[c]));let i=o.map(()=>0),a=o.map(l=>l[0]);for(;a.every(l=>l);){let l=Math.min(...a.map(c=>c.content.length));for(let c=0;c<n;c++){let u=a[c];u.content.length===l?(s[c].push(u),i[c]+=1,a[c]=o[c][i[c]]):(s[c].push({...u,content:u.content.slice(0,l)}),a[c]={...u,content:u.content.slice(l),offset:u.offset+l})}}}return t}var Pr=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var Q=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Q.prototype.normal={};Q.prototype.property={};Q.prototype.space=void 0;function rn(e,t){let n={},r={};for(let o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Q(n,r,t)}function We(e){return e.toLowerCase()}var $=class{constructor(t,n){this.attribute=n,this.property=t}};$.prototype.attribute="";$.prototype.booleanish=!1;$.prototype.boolean=!1;$.prototype.commaOrSpaceSeparated=!1;$.prototype.commaSeparated=!1;$.prototype.defined=!1;$.prototype.mustUseProperty=!1;$.prototype.number=!1;$.prototype.overloadedBoolean=!1;$.prototype.property="";$.prototype.spaceSeparated=!1;$.prototype.space=void 0;var ze={};Ts(ze,{boolean:()=>v,booleanish:()=>B,commaOrSpaceSeparated:()=>j,commaSeparated:()=>Z,number:()=>k,overloadedBoolean:()=>ct,spaceSeparated:()=>x});var Bi=0,v=pe(),B=pe(),ct=pe(),k=pe(),x=pe(),Z=pe(),j=pe();function pe(){return 2**++Bi}var on=Object.keys(ze),me=class extends ${constructor(t,n,r,o){let s=-1;if(super(t,n),Mr(this,"space",o),typeof r=="number")for(;++s<on.length;){let i=on[s];Mr(this,on[s],(r&ze[i])===ze[i])}}};me.prototype.defined=!0;function Mr(e,t,n){n&&(e[t]=n)}function V(e){let t={},n={};for(let[r,o]of Object.entries(e.properties)){let s=new me(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[We(r)]=r,n[We(s.attribute)]=r}return new Q(t,n,e.space)}var sn=V({properties:{ariaActiveDescendant:null,ariaAtomic:B,ariaAutoComplete:null,ariaBusy:B,ariaChecked:B,ariaColCount:k,ariaColIndex:k,ariaColSpan:k,ariaControls:x,ariaCurrent:null,ariaDescribedBy:x,ariaDetails:null,ariaDisabled:B,ariaDropEffect:x,ariaErrorMessage:null,ariaExpanded:B,ariaFlowTo:x,ariaGrabbed:B,ariaHasPopup:null,ariaHidden:B,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:x,ariaLevel:k,ariaLive:null,ariaModal:B,ariaMultiLine:B,ariaMultiSelectable:B,ariaOrientation:null,ariaOwns:x,ariaPlaceholder:null,ariaPosInSet:k,ariaPressed:B,ariaReadOnly:B,ariaRelevant:null,ariaRequired:B,ariaRoleDescription:x,ariaRowCount:k,ariaRowIndex:k,ariaRowSpan:k,ariaSelected:B,ariaSetSize:k,ariaSort:null,ariaValueMax:k,ariaValueMin:k,ariaValueNow:k,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ut(e,t){return t in e?e[t]:t}function dt(e,t){return ut(e,t.toLowerCase())}var $r=V({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Z,acceptCharset:x,accessKey:x,action:null,allow:null,allowFullScreen:v,allowPaymentRequest:v,allowUserMedia:v,alpha:v,alt:null,as:null,async:v,autoCapitalize:null,autoComplete:x,autoFocus:v,autoPlay:v,blocking:x,capture:null,charSet:null,checked:v,cite:null,className:x,closedBy:null,colorSpace:null,cols:k,colSpan:k,command:null,commandFor:null,content:null,contentEditable:B,controls:v,controlsList:x,coords:k|Z,crossOrigin:null,data:null,dateTime:null,decoding:null,default:v,defer:v,dir:null,dirName:null,disabled:v,download:ct,draggable:B,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:v,formTarget:null,headers:x,height:k,hidden:ct,high:k,href:null,hrefLang:null,htmlFor:x,httpEquiv:x,id:null,imageSizes:null,imageSrcSet:null,inert:v,inputMode:null,integrity:null,is:null,isMap:v,itemId:null,itemProp:x,itemRef:x,itemScope:v,itemType:x,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:v,low:k,manifest:null,max:null,maxLength:k,media:null,method:null,min:null,minLength:k,multiple:v,muted:v,name:null,nonce:null,noModule:v,noValidate:v,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:v,optimum:k,pattern:null,ping:x,placeholder:null,playsInline:v,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:v,referrerPolicy:null,rel:x,required:v,reversed:v,rows:k,rowSpan:k,sandbox:x,scope:null,scoped:v,seamless:v,selected:v,shadowRootClonable:v,shadowRootCustomElementRegistry:v,shadowRootDelegatesFocus:v,shadowRootMode:null,shadowRootSerializable:v,shape:null,size:k,sizes:null,slot:null,span:k,spellCheck:B,src:null,srcDoc:null,srcLang:null,srcSet:null,start:k,step:null,style:null,tabIndex:k,target:null,title:null,translate:null,type:null,typeMustMatch:v,useMap:null,value:B,width:k,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:x,axis:null,background:null,bgColor:null,border:k,borderColor:null,bottomMargin:k,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:v,declare:v,event:null,face:null,frame:null,frameBorder:null,hSpace:k,leftMargin:k,link:null,longDesc:null,lowSrc:null,marginHeight:k,marginWidth:k,noResize:v,noHref:v,noShade:v,noWrap:v,object:null,profile:null,prompt:null,rev:null,rightMargin:k,rules:null,scheme:null,scrolling:B,standby:null,summary:null,text:null,topMargin:k,valueType:null,version:null,vAlign:null,vLink:null,vSpace:k,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:v,disablePictureInPicture:v,disableRemotePlayback:v,exportParts:Z,part:x,prefix:null,property:null,results:k,security:null,unselectable:null},space:"html",transform:dt});var Fr=V({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:j,accentHeight:k,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:k,amplitude:k,arabicForm:null,ascent:k,attributeName:null,attributeType:null,azimuth:k,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:k,by:null,calcMode:null,capHeight:k,className:x,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:k,diffuseConstant:k,direction:null,display:null,dur:null,divisor:k,dominantBaseline:null,download:v,dx:null,dy:null,edgeMode:null,editable:null,elevation:k,enableBackground:null,end:null,event:null,exponent:k,externalResourcesRequired:null,fill:null,fillOpacity:k,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Z,g2:Z,glyphName:Z,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:k,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:k,horizOriginX:k,horizOriginY:k,id:null,ideographic:k,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:k,k,k1:k,k2:k,k3:k,k4:k,kernelMatrix:j,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:k,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:k,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:k,overlineThickness:k,paintOrder:null,panose1:null,path:null,pathLength:k,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:x,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:k,pointsAtY:k,pointsAtZ:k,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:j,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:j,rev:j,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:j,requiredFeatures:j,requiredFonts:j,requiredFormats:j,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:k,specularExponent:k,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:k,strikethroughThickness:k,string:null,stroke:null,strokeDashArray:j,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:k,strokeOpacity:k,strokeWidth:null,style:null,surfaceScale:k,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:j,tabIndex:k,tableValues:null,target:null,targetX:k,targetY:k,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:j,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:k,underlineThickness:k,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:k,values:null,vAlphabetic:k,vMathematical:k,vectorEffect:null,vHanging:k,vIdeographic:k,version:null,vertAdvY:k,vertOriginX:k,vertOriginY:k,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:k,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ut});var an=V({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var ln=V({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dt});var cn=V({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var Ti=/[A-Z]/g,Or=/-[a-z]/g,Li=/^data[-\w.:]+$/i;function un(e,t){let n=We(t),r=t,o=$;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Li.test(t)){if(t.charAt(4)==="-"){let s=t.slice(5).replace(Or,Mi);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{let s=t.slice(4);if(!Or.test(s)){let i=s.replace(Ti,Pi);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}o=me}return new o(r,t)}function Pi(e){return"-"+e.toLowerCase()}function Mi(e){return e.charAt(1).toUpperCase()}var Gr=rn([sn,$r,an,ln,cn],"html"),ft=rn([sn,Fr,an,ln,cn],"svg");var Dr={}.hasOwnProperty;function jr(e,t){let n=t||{};function r(o,...s){let i=r.invalid,a=r.handlers;if(o&&Dr.call(o,e)){let l=String(o[e]);i=Dr.call(a,l)?a[l]:r.unknown}if(i)return i.call(this,o,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var $i=/["&'<>`]/g,Fi=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Oi=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Gi=/[|\\{}()[\]^$+*?.]/g,Hr=new WeakMap;function Ur(e,t){if(e=e.replace(t.subset?Di(t.subset):$i,r),t.subset||t.escapeOnly)return e;return e.replace(Fi,n).replace(Oi,r);function n(o,s,i){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,i.charCodeAt(s+2),t)}function r(o,s,i){return t.format(o.charCodeAt(0),i.charCodeAt(s+1),t)}}function Di(e){let t=Hr.get(e);return t||(t=ji(e),Hr.set(e,t)),t}function ji(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Gi,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}var Hi=/[\dA-Fa-f]/;function Wr(e,t,n){let r="&#x"+e.toString(16).toUpperCase();return n&&t&&!Hi.test(String.fromCharCode(t))?r:r+";"}var Ui=/\d/;function zr(e,t,n){let r="&#"+String(e);return n&&t&&!Ui.test(String.fromCharCode(t))?r:r+";"}var qr=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"];var ht={nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",fnof:"\u0192",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",bull:"\u2022",hellip:"\u2026",prime:"\u2032",Prime:"\u2033",oline:"\u203E",frasl:"\u2044",weierp:"\u2118",image:"\u2111",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",quot:'"',amp:"&",lt:"<",gt:">",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"};var Vr=["cent","copy","divide","gt","lt","not","para","times"];var Xr={}.hasOwnProperty,dn={},gt;for(gt in ht)Xr.call(ht,gt)&&(dn[ht[gt]]=gt);var Wi=/[^\dA-Za-z]/;function Yr(e,t,n,r){let o=String.fromCharCode(e);if(Xr.call(dn,o)){let s=dn[o],i="&"+s;return n&&qr.includes(s)&&!Vr.includes(s)&&(!r||t&&t!==61&&Wi.test(String.fromCharCode(t)))?i:i+";"}return""}function Kr(e,t,n){let r=Wr(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=Yr(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){let s=zr(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return o&&(!n.useShortestReferences||o.length<r.length)?o:r}function ee(e,t){return Ur(e,Object.assign({format:Kr},t))}var zi=/^>|^->|<!--|-->|--!>|<!-$/g,qi=[">"],Vi=["<",">"];function Jr(e,t,n,r){return r.settings.bogusComments?"<?"+ee(e.value,Object.assign({},r.settings.characterReferences,{subset:qi}))+">":"<!--"+e.value.replace(zi,o)+"-->";function o(s){return ee(s,Object.assign({},r.settings.characterReferences,{subset:Vi}))}}function Qr(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function fn(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function Zr(e,t){let n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function eo(e){return e.join(" ").trim()}var Xi=/[ \t\n\f\r]/g;function be(e){return typeof e=="object"?e.type==="text"?to(e.value):!1:to(e)}function to(e){return e.replace(Xi,"")===""}var T=no(1),hn=no(-1),Yi=[];function no(e){return t;function t(n,r,o){let s=n?n.children:Yi,i=(r||0)+e,a=s[i];if(!o)for(;a&&be(a);)i+=e,a=s[i];return a}}var Ki={}.hasOwnProperty;function pt(e){return t;function t(n,r,o){return Ki.call(e,n.tagName)&&e[n.tagName](n,r,o)}}var qe=pt({body:Qi,caption:gn,colgroup:gn,dd:na,dt:ta,head:gn,html:Ji,li:ea,optgroup:ra,option:oa,p:Zi,rp:ro,rt:ro,tbody:ia,td:oo,tfoot:aa,th:oo,thead:sa,tr:la});function gn(e,t,n){let r=T(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&be(r.value.charAt(0)))}function Ji(e,t,n){let r=T(n,t);return!r||r.type!=="comment"}function Qi(e,t,n){let r=T(n,t);return!r||r.type!=="comment"}function Zi(e,t,n){let r=T(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function ea(e,t,n){let r=T(n,t);return!r||r.type==="element"&&r.tagName==="li"}function ta(e,t,n){let r=T(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function na(e,t,n){let r=T(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function ro(e,t,n){let r=T(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function ra(e,t,n){let r=T(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function oa(e,t,n){let r=T(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function sa(e,t,n){let r=T(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function ia(e,t,n){let r=T(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function aa(e,t,n){return!T(n,t)}function la(e,t,n){let r=T(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function oo(e,t,n){let r=T(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}var so=pt({body:da,colgroup:fa,head:ua,html:ca,tbody:ha});function ca(e){let t=T(e,-1);return!t||t.type!=="comment"}function ua(e){let t=new Set;for(let r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}let n=e.children[0];return!n||n.type==="element"}function da(e){let t=T(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&be(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function fa(e,t,n){let r=hn(n,t),o=T(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&qe(r,n.children.indexOf(r),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function ha(e,t,n){let r=hn(n,t),o=T(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&qe(r,n.children.indexOf(r),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}var mt={name:[[`
|
|
4
4
|
\f\r &/=>`.split(""),`
|
|
@@ -151,4 +151,4 @@ XID_Start XIDS`.split(/\s/).map(e=>[Re(e),e])),jl=new Map([["s",M(383)],[M(383),
|
|
|
151
151
|
?|[
|
|
152
152
|
\v\f\x85\u2028\u2029])`),t));else if(l==="posix")if(!o&&(u==="graph"||u==="print")){if(r==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[u];c&&(d=`\0-${M(d.codePointAt(0)-1)}${M(d.codePointAt(2)+1)}-\u{10FFFF}`),n(L(se(`[${d}]`),t))}else n(L(Mn(se(Wl.get(u)),c),t));else if(l==="property")On.has(Re(u))||(e.key="sc");else if(l==="space")n(de(we("space",{negate:c}),t));else if(l==="word")n(L(Mn(se(oe),c),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:o,removeAllPrevSiblings:s,removeAllNextSiblings:i}){let{kind:a,flags:l}=e;if(a==="flags")if(!l.enable&&!l.disable)r();else{let c=W({flags:l});c.body[0].body=i(),o(L(c,t),{traverse:!0})}else if(a==="keep"){let c=n.body[0],d=n.body.length===1&&_t(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(t.parent!==d||d.body.length>1)throw new Error(_`Uses "\K" in a way that's unsupported`);let h=ce({behind:!0});h.body[0].body=s(),o(L(h,t))}else throw new Error(`Unexpected directive kind "${a}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r==="fail")n(L(ce({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){let t=W();t.body[0].body.push(e.body),e.body=L(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,o=!1;for(let s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{let i=as(s.body);i?(r=!0,Array.isArray(i)?n.push(...i):n.push(i)):o=!0}r&&!o&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(_`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Pn(n)&&(n=Ln(n,t),e.ref=n)}},Xl={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:o}=e;r||n.set(e,[...t.get(o).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:o,groupsByName:s,multiplexCapturesToLeftByRef:i,openRefs:a,reffedNodesByReferencer:l}){let c=o.get(e);if(c&&a.has(e.number)){let d=de(Ko(e.number),t);l.set(d,a.get(e.number)),n(d);return}a.set(e.number,e),i.set(e.number,[]),e.name&&Qe(i,e.name,[]);let u=i.get(e.name??e.number);for(let d=0;d<u.length;d++){let h=u[d];if(c===h.node||c&&c===h.origin||e===h.origin){u.splice(d,1);break}}if(i.get(e.number).push({node:e,origin:c}),e.name&&i.get(e.name).push({node:e,origin:c}),e.name){let d=Qe(s,e.name,new Map),h=!1;if(c)h=!0;else for(let f of d.values())if(!f.hasDuplicateNameToRemove){h=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:h})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Bt(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:o,ref:s}=e;if(o){let u=t;for(;(u=u.parent)&&!(u.type==="CapturingGroup"&&(u.name===s||u.number===s)););r.reffedNodesByReferencer.set(e,u);return}let i=r.subroutineRefMap.get(s),a=s===0,l=a?Ko(0):os(i,r.groupOriginByCopy,null),c=l;if(!a){let u=ss(Ql(i,h=>h.type==="Group"&&!!h.flags)),d=u?Bt(r.globalFlags,u):r.globalFlags;Kl(d,r.currentFlags)||(c=W({flags:Zl(d)}),c.body[0].body.push(l))}n(L(c,t),{traverse:!a})}},Yl={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let s=r.reffedNodesByReferencer.get(e).filter(i=>Jl(i,e));if(!s.length)n(L(ce({negate:!0}),t));else if(s.length>1){let i=W({atomic:!0,body:s.reverse().map(a=>re({body:[xt(a.number)]}))});n(L(i,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){let o=vn();e.body.at(-1).body.push(o)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function rs(e){Ce(e,{"*"({node:t,parent:n}){t.parent=n}})}function Kl(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Jl(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;let r=is(n.parent);for(let o of r){if(o===n)break;if(o===e||ls(o,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function os(e,t,n,r){let o=Array.isArray(e)?[]:{};for(let[s,i]of Object.entries(e))s==="parent"?o.parent=Array.isArray(n)?r:n:i&&typeof i=="object"?o[s]=os(i,t,o,n):(s==="type"&&i==="CapturingGroup"&&t.set(o,t.get(e)??e),o[s]=i);return o}function Ko(e){let t=xn(e);return t.isRecursive=!0,t}function Ql(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Ln(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function ss(e){let t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(o=>{r.enable?.[o]&&(delete n.disable[o],n.enable[o]=!0),r.disable?.[o]&&(n.disable[o]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Zl({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function is(e){if(!e)throw new Error("Node expected");let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function as(e){let t=e.find(n=>n.kind==="search_start"||nc(n,{negate:!1})||!ec(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){let n=[];for(let r of t.body){let o=as(r.body);if(!o)return null;Array.isArray(o)?n.push(...o):n.push(o)}return n}return null}function ls(e,t){let n=is(e)??[];for(let r of n)if(r===t||ls(r,t))return!0;return!1}function ec({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function tc(e){let t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function nc(e,t){let n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&_t(e.body[0],{type:"Assertion",kind:"search_start"})}function Pn(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function se(e,t){let r=Et(e,{...t,unicodePropertyMap:On}).body;return r.length>1||r[0].body.length>1?W({body:r}):r[0].body[0]}function Mn(e,t){return e.negate=t,e}function de(e,t){return e.parent=t,e}function L(e,t){return rs(e),e.parent=t,e}function rc(e,t){let n=es(t),r=$n(n.target,"ES2024"),o=$n(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let i=null,a=null;if(!o){let f=[e.flags.ignoreCase];Ce(e,oc,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(g){f.push(g)},setHasCasedChar(){f.at(-1)?i=!0:a=!0}})}let l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||i)&&!a)},c=e,u={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!o&&i&&a),useFlagMods:o,useFlagV:r,verbose:n.verbose};function d(f){return u.lastNode=c,c=f,Fl(sc[f.type],`Unexpected node type "${f.type}"`)(f,u,d)}let h={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return r||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],u.captureMap.forEach((f,g)=>{f.hidden&&h._hiddenCaptures.push(g),f.transferTo&&Qe(h._captureTransfers,f.transferTo,[]).push(g)}),h}var oc={"*":{enter({node:e},t){if(Qo(e)){let n=t.getCurrentModI();t.pushModI(e.flags?Bt({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Qo(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Gn(M(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),cs(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&ns.has(e.value)&&t.setHasCasedChar()}},sc={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?_`\B`:_`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){let{body:r,name:o,number:s}=e,i={ignoreCase:t.currentFlags.ignoreCase},a=t.originMap.get(e);return a&&(i.hidden=!0,s>a.number&&(i.transferTo=a.number)),t.captureMap.set(s,i),`(${o?`?<${o}>`:""}${r.map(n).join("|")})`},Character({value:e},t){let n=M(e),r=Be(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Gn(n)){let o=ts(n);return t.inCharClass?o.join(""):o.length>1?`[${o.join("")}]`:o[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:o,parent:s}=e,{body:i}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Y.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&i.some(Zo)&&(i=[Ae(45),...i.filter(c=>!Zo(c))]);let a=()=>`[${o?"^":""}${i.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Y.bugNestedClassIgnoresNegation)&&!o){let u=i.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(u.length){let d=W(),h=d.body[0];return d.parent=s,h.parent=d,i=i.filter(f=>!u.includes(f)),e.body=i,i.length?(e.parent=h,h.body.push(e)):d.body.pop(),u.forEach(f=>{let g=re({body:[f]});f.parent=g,g.parent=d,d.body.push(g)}),n(d)}}t.inCharClass=!0;let c=a();return t.inCharClass=!1,c}let l=i[0];if(r==="union"&&!o&&l&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(Y.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&i.length===1&&l.type!=="CharacterClassRange"))return i.map(n).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,o={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=Be(n,o),i=Be(r,o),a=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){let l=cs(e);uc(l).forEach(u=>{a.add(Array.isArray(u)?`${Be(u[0],o)}-${Be(u[1],o)}`:Be(u,o))})}return`${s}-${i}${[...a].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},o){if(e==="dot")return o.currentFlags.dotAll?o.appliedGlobalFlags.dotAll||o.useFlagMods?".":"[^]":_`[^\n]`;if(e==="digit")return t?_`\D`:_`\d`;if(e==="property"){if(o.useAppliedIgnoreCase&&o.currentFlags.ignoreCase&&ns.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?_`\P`:_`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?_`\W`:_`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},o,s){let i=o.currentFlags;n&&(o.currentFlags=Bt(i,n));let a=t.map(s).join("|"),l=!o.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!o.useFlagMods||!n)?a:`(?${dc(e,n,o.useFlagMods)}${a})`;return o.currentFlags=i,l},LookaroundAssertion({body:e,kind:t,negate:n},r,o){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(o).join("|")})`},Quantifier(e,t,n){return n(e.body)+fc(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");let r=n.recursionLimit;return t===0?`(?R=${r})`:_`\g<${t}&R=${r}>`}},ic=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),ac=new Set(["-","\\","]","^","["]),lc=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Jo=new Map([[9,_`\t`],[10,_`\n`],[11,_`\v`],[12,_`\f`],[13,_`\r`],[8232,_`\u2028`],[8233,_`\u2029`],[65279,_`\uFEFF`]]),cc=new RegExp("^\\p{Cased}$","u");function Gn(e){return cc.test(e)}function cs(e,t){let n=!!t?.firstOnly,r=e.min.value,o=e.max.value,s=[];if(r<65&&(o===65535||o>=131071)||r===65536&&o>=131071)return s;for(let i=r;i<=o;i++){let a=M(i);if(!Gn(a))continue;let l=ts(a).filter(c=>{let u=c.codePointAt(0);return u<r||u>o});if(l.length&&(s.push(...l),n))break}return s}function Be(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Jo.has(e))return Jo.get(e);if(e<32||e>126&&e<160||e>262143||t&&hc(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;let o=n?r?lc:ac:ic,s=M(e);return(o.has(s)?"\\":"")+s}function uc(e){let t=e.map(o=>o.codePointAt(0)).sort((o,s)=>o-s),n=[],r=null;for(let o=0;o<t.length;o++)t[o+1]===t[o]+1?r??=t[o]:r===null?n.push(t[o]):(n.push([r,t[o]]),r=null);return n}function dc(e,t,n){if(e)return">";let r="";if(t&&n){let{enable:o,disable:s}=t;r=(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${r}:`}function fc({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function Qo({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function hc(e){return e>47&&e<58}function Zo({type:e,value:t}){return e==="Character"&&t===45}var gc=class Fn extends RegExp{#t=new Map;#e=null;#r;#n=null;#o=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){let o=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");let s=t;super(s,n),this.#r=s.source,s instanceof Fn&&(this.#t=s.#t,this.#n=s.#n,this.#o=s.#o,this.rawOptions=s.rawOptions)}else{let s={hiddenCaptures:[],strategy:null,transfers:[],...r};super(o?"":t,n),this.#r=t,this.#t=mc(s.hiddenCaptures,s.transfers),this.#o=s.strategy,this.rawOptions=r??{}}o||(this.#e=this)}exec(t){if(!this.#e){let{lazyCompile:o,...s}=this.rawOptions;this.#e=new Fn(this.#r,this.flags,s)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#o==="clip_search"&&n&&r){this.lastIndex=0;let o=this.#s(t.slice(r));return o&&(pc(o,r,t,this.hasIndices),this.lastIndex+=r),o}return this.#s(t)}#s(t){this.#e.lastIndex=this.lastIndex;let n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;let r=[...n];n.length=1;let o;this.hasIndices&&(o=[...n.indices],n.indices.length=1);let s=[0];for(let i=1;i<r.length;i++){let{hidden:a,transferTo:l}=this.#t.get(i)??{};if(a?s.push(null):(s.push(n.length),n.push(r[i]),this.hasIndices&&n.indices.push(o[i])),l&&r[i]!==void 0){let c=s[l];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=r[i],this.hasIndices&&(n.indices[c]=o[i]),n.groups){this.#n||(this.#n=bc(this.source));let u=this.#n.get(l);u&&(n.groups[u]=r[i],this.hasIndices&&(n.indices.groups[u]=o[i]))}}}return n}};function pc(e,t,n,r){if(e.index+=t,e.input=n,r){let o=e.indices;for(let i=0;i<o.length;i++){let a=o[i];a&&(o[i]=[a[0]+t,a[1]+t])}let s=o.groups;s&&Object.keys(s).forEach(i=>{let a=s[i];a&&(s[i]=[a[0]+t,a[1]+t])})}}function mc(e,t){let n=new Map;for(let r of e)n.set(r,{hidden:!0});for(let[r,o]of t)for(let s of o)Qe(n,s,{}).transferTo=r;return n}function bc(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,o=0,s;for(;s=t.exec(e);){let{0:i,groups:{capture:a,name:l}}=s;i==="["?r++:r?i==="]"&&r--:a&&(o++,l&&n.set(o,l))}return n}function us(e,t){let n=yc(e,t);return n.options?new gc(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function yc(e,t){let n=es(t),r=Et(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:On}),o=ql(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=rc(o,n),i=Xo(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),a=Rn(i.pattern),l=An(a.pattern,{captureTransfers:i.captureTransfers,hiddenCaptures:i.hiddenCaptures}),c={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{let u=l.hiddenCaptures.sort((g,m)=>g-m),d=Array.from(l.captureTransfers),h=o._strategy,f=c.pattern.length>=n.lazyCompileLength;(u.length||d.length||h||f)&&(c.options={...u.length&&{hiddenCaptures:u},...d.length&&{transfers:d},...h&&{strategy:h},...f&&{lazyCompile:f}})}return c}function Lt(e,t){return us(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Dn(e={}){let t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>Lt(n,{target:t.target}),{createScanner(n){return new yo(n,t)},createString(n){return{content:n}}}}var Pt={NotSet:-1,Underline:4,Strikethrough:8};function ds(e,t){let n=e.getTheme(t),r=he.createFromRawTheme(n),o=ge(n,{});return{name:n.name,fg:U(n.fg,o)??"",bg:U(n.bg,o)??"",theme:r,colorMap:r.getColorMap(),replacements:o,defaults:r.getDefaults()}}var kc=5e4,wc=100,Mt=class extends Error{};function hs(e,t){let n=[ds(e,t.light),ds(e,t.dark)],r=["light","dark"],o=`--shiki-light:${n[0].fg||"inherit"};--shiki-dark:${n[1].fg||"inherit"}`,s=`--shiki-light-bg:${n[0].bg||"inherit"};--shiki-dark-bg:${n[1].bg||"inherit"}`,i=`shiki-themes ${n[0].name} ${n[1].name}`,a=()=>({path:null,fontStyle:[n[0].defaults.fontStyle,n[1].defaults.fontStyle],fg:[n[0].defaults.foregroundId,n[1].defaults.foregroundId],children:new Map}),l=a(),c=0,u=(f,g)=>{let m=f.children.get(g);if(m)return m;let y={parent:f.path,scopeName:g};m={path:y,fontStyle:[...f.fontStyle],fg:[...f.fg],children:new Map};for(let b of[0,1]){let p=n[b].theme.match(y);p&&(p.fontStyle!==Pt.NotSet&&(m.fontStyle[b]=p.fontStyle),p.foregroundId!==0&&(m.fg[b]=p.foregroundId))}return f.children.set(g,m),c++,m},d=f=>f.style??=[0,1].map(g=>({color:U(n[g].colorMap[f.fg[g]],n[g].replacements)??"",fontStyle:f.fontStyle[g]===Pt.NotSet?0:f.fontStyle[g]})),h=f=>{if(f.length>wc)throw new Mt;let g=l;for(let m of f)g=u(g,m);return g};return function(g,m){c>kc&&(l=a(),c=0);let y=e.getLanguage(m.lang),b=xe,p=[];try{for(let[S,E]of ae(g)){if(S===""){p.push([]);continue}if(m.tokenizeMaxLineLength>0&&S.length>=m.tokenizeMaxLineLength){p.push([St({content:S,offset:E,variants:{light:{color:"",fontStyle:0},dark:{color:"",fontStyle:0}}},r,"--shiki-",!1)]);continue}let R=y.tokenizeLine(S,b,m.tokenizeTimeLimit),F=[],N,K=()=>{N&&F.push(St({content:S.slice(N.start,N.end),offset:E+N.start,variants:{light:N.l,dark:N.d}},r,"--shiki-",!1))};for(let D=0;D<R.tokens.length;D++){let A=R.tokens[D],ve=D+1<R.tokens.length?R.tokens[D+1].startIndex:S.length;if(ve<=A.startIndex)continue;let[Le,z]=d(h(A.scopes));N&&N.end===A.startIndex&&fs(N.l,Le)&&fs(N.d,z)?N.end=ve:(K(),N={l:Le,d:z,start:A.startIndex,end:ve})}K(),p.push(F),b=R.ruleStack}}catch(S){if(S instanceof Mt)return;throw S}let w={meta:{},options:{lang:m.lang,themes:t,defaultColor:!1,transformers:m.transformers},codeToHast:()=>{throw new Error("codeToHast is not available in the one-pass renderer")},codeToTokens:()=>{throw new Error("codeToTokens is not available in the one-pass renderer")},get source(){return g}},C=kn(Cc(p),{...w.options,fg:o,bg:s,themeName:i,rootStyle:`${o};${s}`},w);return wn(C)}}var fs=(e,t)=>e.color===t.color&&e.fontStyle===t.fontStyle;function Cc(e){let t=/^\s+$/;return e.map(n=>{let r=[],o="",s;return n.forEach((i,a)=>{let l=!(i.fontStyle&&(i.fontStyle&Pt.Underline||i.fontStyle&Pt.Strikethrough));l&&t.test(i.content)&&n[a+1]?(s===void 0&&(s=i.offset),o+=i.content):o?(l?r.push({...i,offset:s,content:o+i.content}):r.push({content:o,offset:s},i),s=void 0,o=""):r.push(i)}),r})}var gs=Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#fd8c73","activityBar.background":"#ffffff","activityBar.border":"#d0d7de","activityBar.foreground":"#1f2328","activityBar.inactiveForeground":"#656d76","activityBarBadge.background":"#0969da","activityBarBadge.foreground":"#ffffff","badge.background":"#0969da","badge.foreground":"#ffffff","breadcrumb.activeSelectionForeground":"#656d76","breadcrumb.focusForeground":"#1f2328","breadcrumb.foreground":"#656d76","breadcrumbPicker.background":"#ffffff","button.background":"#1f883d","button.foreground":"#ffffff","button.hoverBackground":"#1a7f37","button.secondaryBackground":"#ebecf0","button.secondaryForeground":"#24292f","button.secondaryHoverBackground":"#f3f4f6","checkbox.background":"#f6f8fa","checkbox.border":"#d0d7de","debugConsole.errorForeground":"#cf222e","debugConsole.infoForeground":"#57606a","debugConsole.sourceForeground":"#9a6700","debugConsole.warningForeground":"#7d4e00","debugConsoleInputIcon.foreground":"#6639ba","debugIcon.breakpointForeground":"#cf222e","debugTokenExpression.boolean":"#116329","debugTokenExpression.error":"#a40e26","debugTokenExpression.name":"#0550ae","debugTokenExpression.number":"#116329","debugTokenExpression.string":"#0a3069","debugTokenExpression.value":"#0a3069","debugToolBar.background":"#ffffff","descriptionForeground":"#656d76","diffEditor.insertedLineBackground":"#aceebb4d","diffEditor.insertedTextBackground":"#6fdd8b80","diffEditor.removedLineBackground":"#ffcecb4d","diffEditor.removedTextBackground":"#ff818266","dropdown.background":"#ffffff","dropdown.border":"#d0d7de","dropdown.foreground":"#1f2328","dropdown.listBackground":"#ffffff","editor.background":"#ffffff","editor.findMatchBackground":"#bf8700","editor.findMatchHighlightBackground":"#fae17d80","editor.focusedStackFrameHighlightBackground":"#4ac26b66","editor.foldBackground":"#6e77811a","editor.foreground":"#1f2328","editor.lineHighlightBackground":"#eaeef280","editor.linkedEditingBackground":"#0969da12","editor.selectionHighlightBackground":"#4ac26b40","editor.stackFrameHighlightBackground":"#d4a72c66","editor.wordHighlightBackground":"#eaeef280","editor.wordHighlightBorder":"#afb8c199","editor.wordHighlightStrongBackground":"#afb8c14d","editor.wordHighlightStrongBorder":"#afb8c199","editorBracketHighlight.foreground1":"#0969da","editorBracketHighlight.foreground2":"#1a7f37","editorBracketHighlight.foreground3":"#9a6700","editorBracketHighlight.foreground4":"#cf222e","editorBracketHighlight.foreground5":"#bf3989","editorBracketHighlight.foreground6":"#8250df","editorBracketHighlight.unexpectedBracket.foreground":"#656d76","editorBracketMatch.background":"#4ac26b40","editorBracketMatch.border":"#4ac26b99","editorCursor.foreground":"#0969da","editorGroup.border":"#d0d7de","editorGroupHeader.tabsBackground":"#f6f8fa","editorGroupHeader.tabsBorder":"#d0d7de","editorGutter.addedBackground":"#4ac26b66","editorGutter.deletedBackground":"#ff818266","editorGutter.modifiedBackground":"#d4a72c66","editorIndentGuide.activeBackground":"#1f23283d","editorIndentGuide.background":"#1f23281f","editorInlayHint.background":"#afb8c133","editorInlayHint.foreground":"#656d76","editorInlayHint.paramBackground":"#afb8c133","editorInlayHint.paramForeground":"#656d76","editorInlayHint.typeBackground":"#afb8c133","editorInlayHint.typeForeground":"#656d76","editorLineNumber.activeForeground":"#1f2328","editorLineNumber.foreground":"#8c959f","editorOverviewRuler.border":"#ffffff","editorWhitespace.foreground":"#afb8c1","editorWidget.background":"#ffffff","errorForeground":"#cf222e","focusBorder":"#0969da","foreground":"#1f2328","gitDecoration.addedResourceForeground":"#1a7f37","gitDecoration.conflictingResourceForeground":"#bc4c00","gitDecoration.deletedResourceForeground":"#cf222e","gitDecoration.ignoredResourceForeground":"#6e7781","gitDecoration.modifiedResourceForeground":"#9a6700","gitDecoration.submoduleResourceForeground":"#656d76","gitDecoration.untrackedResourceForeground":"#1a7f37","icon.foreground":"#656d76","input.background":"#ffffff","input.border":"#d0d7de","input.foreground":"#1f2328","input.placeholderForeground":"#6e7781","keybindingLabel.foreground":"#1f2328","list.activeSelectionBackground":"#afb8c133","list.activeSelectionForeground":"#1f2328","list.focusBackground":"#ddf4ff","list.focusForeground":"#1f2328","list.highlightForeground":"#0969da","list.hoverBackground":"#eaeef280","list.hoverForeground":"#1f2328","list.inactiveFocusBackground":"#ddf4ff","list.inactiveSelectionBackground":"#afb8c133","list.inactiveSelectionForeground":"#1f2328","minimapSlider.activeBackground":"#8c959f47","minimapSlider.background":"#8c959f33","minimapSlider.hoverBackground":"#8c959f3d","notificationCenterHeader.background":"#f6f8fa","notificationCenterHeader.foreground":"#656d76","notifications.background":"#ffffff","notifications.border":"#d0d7de","notifications.foreground":"#1f2328","notificationsErrorIcon.foreground":"#cf222e","notificationsInfoIcon.foreground":"#0969da","notificationsWarningIcon.foreground":"#9a6700","panel.background":"#f6f8fa","panel.border":"#d0d7de","panelInput.border":"#d0d7de","panelTitle.activeBorder":"#fd8c73","panelTitle.activeForeground":"#1f2328","panelTitle.inactiveForeground":"#656d76","pickerGroup.border":"#d0d7de","pickerGroup.foreground":"#656d76","progressBar.background":"#0969da","quickInput.background":"#ffffff","quickInput.foreground":"#1f2328","scrollbar.shadow":"#6e778133","scrollbarSlider.activeBackground":"#8c959f47","scrollbarSlider.background":"#8c959f33","scrollbarSlider.hoverBackground":"#8c959f3d","settings.headerForeground":"#1f2328","settings.modifiedItemIndicator":"#d4a72c66","sideBar.background":"#f6f8fa","sideBar.border":"#d0d7de","sideBar.foreground":"#1f2328","sideBarSectionHeader.background":"#f6f8fa","sideBarSectionHeader.border":"#d0d7de","sideBarSectionHeader.foreground":"#1f2328","sideBarTitle.foreground":"#1f2328","statusBar.background":"#ffffff","statusBar.border":"#d0d7de","statusBar.debuggingBackground":"#cf222e","statusBar.debuggingForeground":"#ffffff","statusBar.focusBorder":"#0969da80","statusBar.foreground":"#656d76","statusBar.noFolderBackground":"#ffffff","statusBarItem.activeBackground":"#1f23281f","statusBarItem.focusBorder":"#0969da","statusBarItem.hoverBackground":"#1f232814","statusBarItem.prominentBackground":"#afb8c133","statusBarItem.remoteBackground":"#eaeef2","statusBarItem.remoteForeground":"#1f2328","symbolIcon.arrayForeground":"#953800","symbolIcon.booleanForeground":"#0550ae","symbolIcon.classForeground":"#953800","symbolIcon.colorForeground":"#0a3069","symbolIcon.constantForeground":"#116329","symbolIcon.constructorForeground":"#3e1f79","symbolIcon.enumeratorForeground":"#953800","symbolIcon.enumeratorMemberForeground":"#0550ae","symbolIcon.eventForeground":"#57606a","symbolIcon.fieldForeground":"#953800","symbolIcon.fileForeground":"#7d4e00","symbolIcon.folderForeground":"#7d4e00","symbolIcon.functionForeground":"#6639ba","symbolIcon.interfaceForeground":"#953800","symbolIcon.keyForeground":"#0550ae","symbolIcon.keywordForeground":"#a40e26","symbolIcon.methodForeground":"#6639ba","symbolIcon.moduleForeground":"#a40e26","symbolIcon.namespaceForeground":"#a40e26","symbolIcon.nullForeground":"#0550ae","symbolIcon.numberForeground":"#116329","symbolIcon.objectForeground":"#953800","symbolIcon.operatorForeground":"#0a3069","symbolIcon.packageForeground":"#953800","symbolIcon.propertyForeground":"#953800","symbolIcon.referenceForeground":"#0550ae","symbolIcon.snippetForeground":"#0550ae","symbolIcon.stringForeground":"#0a3069","symbolIcon.structForeground":"#953800","symbolIcon.textForeground":"#0a3069","symbolIcon.typeParameterForeground":"#0a3069","symbolIcon.unitForeground":"#0550ae","symbolIcon.variableForeground":"#953800","tab.activeBackground":"#ffffff","tab.activeBorder":"#ffffff","tab.activeBorderTop":"#fd8c73","tab.activeForeground":"#1f2328","tab.border":"#d0d7de","tab.hoverBackground":"#ffffff","tab.inactiveBackground":"#f6f8fa","tab.inactiveForeground":"#656d76","tab.unfocusedActiveBorder":"#ffffff","tab.unfocusedActiveBorderTop":"#d0d7de","tab.unfocusedHoverBackground":"#eaeef280","terminal.ansiBlack":"#24292f","terminal.ansiBlue":"#0969da","terminal.ansiBrightBlack":"#57606a","terminal.ansiBrightBlue":"#218bff","terminal.ansiBrightCyan":"#3192aa","terminal.ansiBrightGreen":"#1a7f37","terminal.ansiBrightMagenta":"#a475f9","terminal.ansiBrightRed":"#a40e26","terminal.ansiBrightWhite":"#8c959f","terminal.ansiBrightYellow":"#633c01","terminal.ansiCyan":"#1b7c83","terminal.ansiGreen":"#116329","terminal.ansiMagenta":"#8250df","terminal.ansiRed":"#cf222e","terminal.ansiWhite":"#6e7781","terminal.ansiYellow":"#4d2d00","terminal.foreground":"#1f2328","textBlockQuote.background":"#f6f8fa","textBlockQuote.border":"#d0d7de","textCodeBlock.background":"#afb8c133","textLink.activeForeground":"#0969da","textLink.foreground":"#0969da","textPreformat.background":"#afb8c133","textPreformat.foreground":"#656d76","textSeparator.foreground":"#d8dee4","titleBar.activeBackground":"#ffffff","titleBar.activeForeground":"#656d76","titleBar.border":"#d0d7de","titleBar.inactiveBackground":"#f6f8fa","titleBar.inactiveForeground":"#656d76","tree.indentGuidesStroke":"#d8dee4","welcomePage.buttonBackground":"#f6f8fa","welcomePage.buttonHoverBackground":"#f3f4f6"},"displayName":"GitHub Light Default","name":"github-light-default","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#6e7781"}},{"scope":["constant.other.placeholder","constant.character"],"settings":{"foreground":"#cf222e"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language","entity"],"settings":{"foreground":"#0550ae"}},{"scope":["entity.name","meta.export.default","meta.definition.variable"],"settings":{"foreground":"#953800"}},{"scope":["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.object.member","meta.embedded.expression"],"settings":{"foreground":"#1f2328"}},{"scope":"entity.name.function","settings":{"foreground":"#8250df"}},{"scope":["entity.name.tag","support.class.component"],"settings":{"foreground":"#116329"}},{"scope":"keyword","settings":{"foreground":"#cf222e"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#cf222e"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#1f2328"}},{"scope":["string","string punctuation.section.embedded source"],"settings":{"foreground":"#0a3069"}},{"scope":"support","settings":{"foreground":"#0550ae"}},{"scope":"meta.property-name","settings":{"foreground":"#0550ae"}},{"scope":"variable","settings":{"foreground":"#953800"}},{"scope":"variable.other","settings":{"foreground":"#1f2328"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#82071e"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#82071e"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#82071e"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#82071e"}},{"scope":"carriage-return","settings":{"background":"#cf222e","content":"^M","fontStyle":"italic underline","foreground":"#f6f8fa"}},{"scope":"message.error","settings":{"foreground":"#82071e"}},{"scope":"string variable","settings":{"foreground":"#0550ae"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#0a3069"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#0a3069"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#116329"}},{"scope":"support.constant","settings":{"foreground":"#0550ae"}},{"scope":"support.variable","settings":{"foreground":"#0550ae"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#116329"}},{"scope":"meta.module-reference","settings":{"foreground":"#0550ae"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#953800"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#0550ae"}},{"scope":"markup.quote","settings":{"foreground":"#116329"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#1f2328"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#1f2328"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#0550ae"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#ffebe9","foreground":"#82071e"}},{"scope":["punctuation.section.embedded"],"settings":{"foreground":"#cf222e"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#dafbe1","foreground":"#116329"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#ffd8b5","foreground":"#953800"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#0550ae","foreground":"#eaeef2"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#8250df"}},{"scope":"meta.diff.header","settings":{"foreground":"#0550ae"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#0550ae"}},{"scope":"meta.output","settings":{"foreground":"#0550ae"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#57606a"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#82071e"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"foreground":"#0a3069"}}],"type":"light"}'));var ps=Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#f78166","activityBar.background":"#0d1117","activityBar.border":"#30363d","activityBar.foreground":"#e6edf3","activityBar.inactiveForeground":"#7d8590","activityBarBadge.background":"#1f6feb","activityBarBadge.foreground":"#ffffff","badge.background":"#1f6feb","badge.foreground":"#ffffff","breadcrumb.activeSelectionForeground":"#7d8590","breadcrumb.focusForeground":"#e6edf3","breadcrumb.foreground":"#7d8590","breadcrumbPicker.background":"#161b22","button.background":"#238636","button.foreground":"#ffffff","button.hoverBackground":"#2ea043","button.secondaryBackground":"#282e33","button.secondaryForeground":"#c9d1d9","button.secondaryHoverBackground":"#30363d","checkbox.background":"#161b22","checkbox.border":"#30363d","debugConsole.errorForeground":"#ffa198","debugConsole.infoForeground":"#8b949e","debugConsole.sourceForeground":"#e3b341","debugConsole.warningForeground":"#d29922","debugConsoleInputIcon.foreground":"#bc8cff","debugIcon.breakpointForeground":"#f85149","debugTokenExpression.boolean":"#56d364","debugTokenExpression.error":"#ffa198","debugTokenExpression.name":"#79c0ff","debugTokenExpression.number":"#56d364","debugTokenExpression.string":"#a5d6ff","debugTokenExpression.value":"#a5d6ff","debugToolBar.background":"#161b22","descriptionForeground":"#7d8590","diffEditor.insertedLineBackground":"#23863626","diffEditor.insertedTextBackground":"#3fb9504d","diffEditor.removedLineBackground":"#da363326","diffEditor.removedTextBackground":"#ff7b724d","dropdown.background":"#161b22","dropdown.border":"#30363d","dropdown.foreground":"#e6edf3","dropdown.listBackground":"#161b22","editor.background":"#0d1117","editor.findMatchBackground":"#9e6a03","editor.findMatchHighlightBackground":"#f2cc6080","editor.focusedStackFrameHighlightBackground":"#2ea04366","editor.foldBackground":"#6e76811a","editor.foreground":"#e6edf3","editor.lineHighlightBackground":"#6e76811a","editor.linkedEditingBackground":"#2f81f712","editor.selectionHighlightBackground":"#3fb95040","editor.stackFrameHighlightBackground":"#bb800966","editor.wordHighlightBackground":"#6e768180","editor.wordHighlightBorder":"#6e768199","editor.wordHighlightStrongBackground":"#6e76814d","editor.wordHighlightStrongBorder":"#6e768199","editorBracketHighlight.foreground1":"#79c0ff","editorBracketHighlight.foreground2":"#56d364","editorBracketHighlight.foreground3":"#e3b341","editorBracketHighlight.foreground4":"#ffa198","editorBracketHighlight.foreground5":"#ff9bce","editorBracketHighlight.foreground6":"#d2a8ff","editorBracketHighlight.unexpectedBracket.foreground":"#7d8590","editorBracketMatch.background":"#3fb95040","editorBracketMatch.border":"#3fb95099","editorCursor.foreground":"#2f81f7","editorGroup.border":"#30363d","editorGroupHeader.tabsBackground":"#010409","editorGroupHeader.tabsBorder":"#30363d","editorGutter.addedBackground":"#2ea04366","editorGutter.deletedBackground":"#f8514966","editorGutter.modifiedBackground":"#bb800966","editorIndentGuide.activeBackground":"#e6edf33d","editorIndentGuide.background":"#e6edf31f","editorInlayHint.background":"#8b949e33","editorInlayHint.foreground":"#7d8590","editorInlayHint.paramBackground":"#8b949e33","editorInlayHint.paramForeground":"#7d8590","editorInlayHint.typeBackground":"#8b949e33","editorInlayHint.typeForeground":"#7d8590","editorLineNumber.activeForeground":"#e6edf3","editorLineNumber.foreground":"#6e7681","editorOverviewRuler.border":"#010409","editorWhitespace.foreground":"#484f58","editorWidget.background":"#161b22","errorForeground":"#f85149","focusBorder":"#1f6feb","foreground":"#e6edf3","gitDecoration.addedResourceForeground":"#3fb950","gitDecoration.conflictingResourceForeground":"#db6d28","gitDecoration.deletedResourceForeground":"#f85149","gitDecoration.ignoredResourceForeground":"#6e7681","gitDecoration.modifiedResourceForeground":"#d29922","gitDecoration.submoduleResourceForeground":"#7d8590","gitDecoration.untrackedResourceForeground":"#3fb950","icon.foreground":"#7d8590","input.background":"#0d1117","input.border":"#30363d","input.foreground":"#e6edf3","input.placeholderForeground":"#6e7681","keybindingLabel.foreground":"#e6edf3","list.activeSelectionBackground":"#6e768166","list.activeSelectionForeground":"#e6edf3","list.focusBackground":"#388bfd26","list.focusForeground":"#e6edf3","list.highlightForeground":"#2f81f7","list.hoverBackground":"#6e76811a","list.hoverForeground":"#e6edf3","list.inactiveFocusBackground":"#388bfd26","list.inactiveSelectionBackground":"#6e768166","list.inactiveSelectionForeground":"#e6edf3","minimapSlider.activeBackground":"#8b949e47","minimapSlider.background":"#8b949e33","minimapSlider.hoverBackground":"#8b949e3d","notificationCenterHeader.background":"#161b22","notificationCenterHeader.foreground":"#7d8590","notifications.background":"#161b22","notifications.border":"#30363d","notifications.foreground":"#e6edf3","notificationsErrorIcon.foreground":"#f85149","notificationsInfoIcon.foreground":"#2f81f7","notificationsWarningIcon.foreground":"#d29922","panel.background":"#010409","panel.border":"#30363d","panelInput.border":"#30363d","panelTitle.activeBorder":"#f78166","panelTitle.activeForeground":"#e6edf3","panelTitle.inactiveForeground":"#7d8590","peekViewEditor.background":"#6e76811a","peekViewEditor.matchHighlightBackground":"#bb800966","peekViewResult.background":"#0d1117","peekViewResult.matchHighlightBackground":"#bb800966","pickerGroup.border":"#30363d","pickerGroup.foreground":"#7d8590","progressBar.background":"#1f6feb","quickInput.background":"#161b22","quickInput.foreground":"#e6edf3","scrollbar.shadow":"#484f5833","scrollbarSlider.activeBackground":"#8b949e47","scrollbarSlider.background":"#8b949e33","scrollbarSlider.hoverBackground":"#8b949e3d","settings.headerForeground":"#e6edf3","settings.modifiedItemIndicator":"#bb800966","sideBar.background":"#010409","sideBar.border":"#30363d","sideBar.foreground":"#e6edf3","sideBarSectionHeader.background":"#010409","sideBarSectionHeader.border":"#30363d","sideBarSectionHeader.foreground":"#e6edf3","sideBarTitle.foreground":"#e6edf3","statusBar.background":"#0d1117","statusBar.border":"#30363d","statusBar.debuggingBackground":"#da3633","statusBar.debuggingForeground":"#ffffff","statusBar.focusBorder":"#1f6feb80","statusBar.foreground":"#7d8590","statusBar.noFolderBackground":"#0d1117","statusBarItem.activeBackground":"#e6edf31f","statusBarItem.focusBorder":"#1f6feb","statusBarItem.hoverBackground":"#e6edf314","statusBarItem.prominentBackground":"#6e768166","statusBarItem.remoteBackground":"#30363d","statusBarItem.remoteForeground":"#e6edf3","symbolIcon.arrayForeground":"#f0883e","symbolIcon.booleanForeground":"#58a6ff","symbolIcon.classForeground":"#f0883e","symbolIcon.colorForeground":"#79c0ff","symbolIcon.constantForeground":["#aff5b4","#7ee787","#56d364","#3fb950","#2ea043","#238636","#196c2e","#0f5323","#033a16","#04260f"],"symbolIcon.constructorForeground":"#d2a8ff","symbolIcon.enumeratorForeground":"#f0883e","symbolIcon.enumeratorMemberForeground":"#58a6ff","symbolIcon.eventForeground":"#6e7681","symbolIcon.fieldForeground":"#f0883e","symbolIcon.fileForeground":"#d29922","symbolIcon.folderForeground":"#d29922","symbolIcon.functionForeground":"#bc8cff","symbolIcon.interfaceForeground":"#f0883e","symbolIcon.keyForeground":"#58a6ff","symbolIcon.keywordForeground":"#ff7b72","symbolIcon.methodForeground":"#bc8cff","symbolIcon.moduleForeground":"#ff7b72","symbolIcon.namespaceForeground":"#ff7b72","symbolIcon.nullForeground":"#58a6ff","symbolIcon.numberForeground":"#3fb950","symbolIcon.objectForeground":"#f0883e","symbolIcon.operatorForeground":"#79c0ff","symbolIcon.packageForeground":"#f0883e","symbolIcon.propertyForeground":"#f0883e","symbolIcon.referenceForeground":"#58a6ff","symbolIcon.snippetForeground":"#58a6ff","symbolIcon.stringForeground":"#79c0ff","symbolIcon.structForeground":"#f0883e","symbolIcon.textForeground":"#79c0ff","symbolIcon.typeParameterForeground":"#79c0ff","symbolIcon.unitForeground":"#58a6ff","symbolIcon.variableForeground":"#f0883e","tab.activeBackground":"#0d1117","tab.activeBorder":"#0d1117","tab.activeBorderTop":"#f78166","tab.activeForeground":"#e6edf3","tab.border":"#30363d","tab.hoverBackground":"#0d1117","tab.inactiveBackground":"#010409","tab.inactiveForeground":"#7d8590","tab.unfocusedActiveBorder":"#0d1117","tab.unfocusedActiveBorderTop":"#30363d","tab.unfocusedHoverBackground":"#6e76811a","terminal.ansiBlack":"#484f58","terminal.ansiBlue":"#58a6ff","terminal.ansiBrightBlack":"#6e7681","terminal.ansiBrightBlue":"#79c0ff","terminal.ansiBrightCyan":"#56d4dd","terminal.ansiBrightGreen":"#56d364","terminal.ansiBrightMagenta":"#d2a8ff","terminal.ansiBrightRed":"#ffa198","terminal.ansiBrightWhite":"#ffffff","terminal.ansiBrightYellow":"#e3b341","terminal.ansiCyan":"#39c5cf","terminal.ansiGreen":"#3fb950","terminal.ansiMagenta":"#bc8cff","terminal.ansiRed":"#ff7b72","terminal.ansiWhite":"#b1bac4","terminal.ansiYellow":"#d29922","terminal.foreground":"#e6edf3","textBlockQuote.background":"#010409","textBlockQuote.border":"#30363d","textCodeBlock.background":"#6e768166","textLink.activeForeground":"#2f81f7","textLink.foreground":"#2f81f7","textPreformat.background":"#6e768166","textPreformat.foreground":"#7d8590","textSeparator.foreground":"#21262d","titleBar.activeBackground":"#0d1117","titleBar.activeForeground":"#7d8590","titleBar.border":"#30363d","titleBar.inactiveBackground":"#010409","titleBar.inactiveForeground":"#7d8590","tree.indentGuidesStroke":"#21262d","welcomePage.buttonBackground":"#21262d","welcomePage.buttonHoverBackground":"#30363d"},"displayName":"GitHub Dark Default","name":"github-dark-default","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#8b949e"}},{"scope":["constant.other.placeholder","constant.character"],"settings":{"foreground":"#ff7b72"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language","entity"],"settings":{"foreground":"#79c0ff"}},{"scope":["entity.name","meta.export.default","meta.definition.variable"],"settings":{"foreground":"#ffa657"}},{"scope":["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.object.member","meta.embedded.expression"],"settings":{"foreground":"#e6edf3"}},{"scope":"entity.name.function","settings":{"foreground":"#d2a8ff"}},{"scope":["entity.name.tag","support.class.component"],"settings":{"foreground":"#7ee787"}},{"scope":"keyword","settings":{"foreground":"#ff7b72"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#ff7b72"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#e6edf3"}},{"scope":["string","string punctuation.section.embedded source"],"settings":{"foreground":"#a5d6ff"}},{"scope":"support","settings":{"foreground":"#79c0ff"}},{"scope":"meta.property-name","settings":{"foreground":"#79c0ff"}},{"scope":"variable","settings":{"foreground":"#ffa657"}},{"scope":"variable.other","settings":{"foreground":"#e6edf3"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#ffa198"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#ffa198"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#ffa198"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#ffa198"}},{"scope":"carriage-return","settings":{"background":"#ff7b72","content":"^M","fontStyle":"italic underline","foreground":"#f0f6fc"}},{"scope":"message.error","settings":{"foreground":"#ffa198"}},{"scope":"string variable","settings":{"foreground":"#79c0ff"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#a5d6ff"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#a5d6ff"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#7ee787"}},{"scope":"support.constant","settings":{"foreground":"#79c0ff"}},{"scope":"support.variable","settings":{"foreground":"#79c0ff"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#7ee787"}},{"scope":"meta.module-reference","settings":{"foreground":"#79c0ff"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#ffa657"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#79c0ff"}},{"scope":"markup.quote","settings":{"foreground":"#7ee787"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#e6edf3"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#e6edf3"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#79c0ff"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#490202","foreground":"#ffa198"}},{"scope":["punctuation.section.embedded"],"settings":{"foreground":"#ff7b72"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#04260f","foreground":"#7ee787"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#5a1e02","foreground":"#ffa657"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#79c0ff","foreground":"#161b22"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#d2a8ff"}},{"scope":"meta.diff.header","settings":{"foreground":"#79c0ff"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#79c0ff"}},{"scope":"meta.output","settings":{"foreground":"#79c0ff"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#8b949e"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#ffa198"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"foreground":"#a5d6ff"}}],"type":"dark"}'));var ms={bash:()=>import("./bash-AXAJJ7K6.mjs"),shellsession:()=>import("./shellsession-REQ4XMXL.mjs"),powershell:()=>import("./powershell-CF3YYGE3.mjs"),bat:()=>import("./bat-7CTKDPA4.mjs"),javascript:()=>import("./javascript-FK6BYXR7.mjs"),typescript:()=>import("./typescript-423LFGQL.mjs"),jsx:()=>import("./jsx-53PXQ2NL.mjs"),tsx:()=>import("./tsx-IMEWP7MM.mjs"),json:()=>import("./json-KOMOQDAQ.mjs"),jsonc:()=>import("./jsonc-ZEH5OBPD.mjs"),yaml:()=>import("./yaml-HBNW4TN5.mjs"),toml:()=>import("./toml-HFJFO2T2.mjs"),ini:()=>import("./ini-4KFO7XTF.mjs"),properties:()=>import("./properties-2HBJIUMB.mjs"),xml:()=>import("./xml-J4Q6YQIU.mjs"),xsl:()=>import("./xsl-QZERU56Y.mjs"),html:()=>import("./html-M7IQMCZW.mjs"),css:()=>import("./css-TX5O34LD.mjs"),scss:()=>import("./scss-UA7SFP3B.mjs"),markdown:()=>import("./markdown-AXYPIRPT.mjs"),java:()=>import("./java-4TDTVHME.mjs"),python:()=>import("./python-4EUPCMJH.mjs"),go:()=>import("./go-UCPHIMPJ.mjs"),rust:()=>import("./rust-YKPB2B2E.mjs"),c:()=>import("./c-2ALCOF6B.mjs"),cpp:()=>import("./cpp-ELFCDB6P.mjs"),csharp:()=>import("./csharp-UJBNPXBE.mjs"),sql:()=>import("./sql-WST4KER7.mjs"),diff:()=>import("./diff-ITLGU3RJ.mjs"),docker:()=>import("./docker-W46D43PZ.mjs"),makefile:()=>import("./makefile-PSNUPH2Q.mjs"),groovy:()=>import("./groovy-RX766UL6.mjs"),kotlin:()=>import("./kotlin-7LYXSLAF.mjs"),ruby:()=>import("./ruby-6JITY6TM.mjs"),graphql:()=>import("./graphql-GWC2SWRW.mjs"),nginx:()=>import("./nginx-G3STFXGR.mjs"),hcl:()=>import("./hcl-BQZ3TWA5.mjs"),http:()=>import("./http-YDAJYC64.mjs")},$t={bash:"bash",bat:"bat",batch:"bat",c:"c","c#":"csharp","c++":"cpp",cjs:"javascript",console:"shellsession",cpp:"cpp","cpp-macro":"cpp",cs:"csharp",csharp:"csharp",css:"css",cts:"typescript",diff:"diff",docker:"docker",dockerfile:"docker",glsl:"cpp",go:"go",gql:"graphql",graphql:"graphql",groovy:"groovy",haml:"ruby",hcl:"hcl",html:"html",http:"http",ini:"ini",java:"java",javascript:"javascript",js:"javascript",json:"json",jsonc:"jsonc",jsx:"jsx",kotlin:"kotlin",kt:"kotlin",kts:"kotlin",lua:"ruby",make:"makefile",makefile:"makefile",markdown:"markdown",md:"markdown",mjs:"javascript",mts:"typescript",nginx:"nginx",powershell:"powershell",properties:"ini",ps:"powershell",ps1:"powershell",py:"python",python:"python",rb:"ruby",regex:"cpp",regexp:"cpp",rs:"rust",ruby:"ruby",rust:"rust",scss:"scss",sh:"bash",shell:"bash",shellscript:"bash",shellsession:"shellsession",sql:"sql",toml:"toml",ts:"typescript",tsx:"tsx",typescript:"typescript",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yaml",zsh:"bash"},bs={markdown:{bat:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(bat(?:|ch))((\\s+|[,:?{])[^`]*)?$)"],c:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:([ch])((\\s+|[,:?{])[^`]*)?$)"],cpp:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(c(?:pp|\\+\\+|xx))((\\s+|[,:?{])[^`]*)?$)"],csharp:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(c(?:s|sharp|#))((\\s+|[,:?{])[^`]*)?$)"],css:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(css(?:|.erb))((\\s+|[,:?{])[^`]*)?$)"],diff:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(patch|diff|rej)((\\s+|[,:?{])[^`]*)?$)"],docker:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:([Dd]ockerfile)((\\s+|[,:?{])[^`]*)?$)"],go:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(go(?:|lang))((\\s+|[,:?{])[^`]*)?$)"],groovy:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(g(?:roovy|vy))((\\s+|[,:?{])[^`]*)?$)"],html:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(html?|shtml|xhtml|inc|tmpl|tpl)((\\s+|[,:?{])[^`]*)?$)","(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(php3??|php4|php5|phpt|phtml|aw|ctp)((\\s+|[,:?{])[^`]*)?$)"],ini:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(ini|conf)((\\s+|[,:?{])[^`]*)?$)"],java:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(java|bsh)((\\s+|[,:?{])[^`]*)?$)"],javascript:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(jsx??|javascript|es6|mjs|cjs|dataviewjs|\\{\\.js.+?})((\\s+|[,:?{])[^`]*)?$)"],json:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(json5??|sublime-settings|sublime-menu|sublime-keymap|sublime-mousemap|sublime-theme|sublime-build|sublime-project|sublime-completions)((\\s+|[,:?{])[^`]*)?$)"],jsonc:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(jsonc)((\\s+|[,:?{])[^`]*)?$)"],lua:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(lua)((\\s+|[,:?{])[^`]*)?$)"],make:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:((?:[Mm]|GNUm|OCamlM)akefile)((\\s+|[,:?{])[^`]*)?$)"],powershell:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(p(?:owershell|s1|sm1|sd1|wsh))((\\s+|[,:?{])[^`]*)?$)"],python:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(python|py3??|rpy|pyw|cpy|SConstruct|Sconstruct|sconstruct|SConscript|gypi??|\\{\\.python.+?})((\\s+|[,:?{])[^`]*)?$)"],regexp:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(re)((\\s+|[,:?{])[^`]*)?$)"],ruby:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(ruby|rbx??|rjs|Rakefile|rake|cgi|fcgi|gemspec|irbrc|Capfile|ru|prawn|Cheffile|Gemfile|Guardfile|Hobofile|Vagrantfile|Appraisals|Rantfile|Berksfile|Berksfile.lock|Thorfile|Puppetfile)((\\s+|[,:?{])[^`]*)?$)"],rust:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(rust|rs|\\{\\.rust.+?})((\\s+|[,:?{])[^`]*)?$)"],scss:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(scss)((\\s+|[,:?{])[^`]*)?$)"],shellscript:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(shell|sh|bash|zsh|bashrc|bash_profile|bash_login|profile|bash_logout|.textmate_init|\\{\\.bash.+?})((\\s+|[,:?{])[^`]*)?$)"],sql:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(sql|ddl|dml)((\\s+|[,:?{])[^`]*)?$)"],tsx:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(tsx)((\\s+|[,:?{])[^`]*)?$)"],typescript:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(t(?:ypescript|s))((\\s+|[,:?{])[^`]*)?$)"],xml:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(xml|xsd|tld|jsp|pt|cpt|dtml|rss|opml)((\\s+|[,:?{])[^`]*)?$)"],xsl:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(xslt??)((\\s+|[,:?{])[^`]*)?$)"],yaml:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(ya?ml)((\\s+|[,:?{])[^`]*)?$)","(?=(-{3,}))"]},haml:{css:["(\\s*)(:(css|styles?))$"],javascript:["(\\s*):javascript","(\\s*)%script"],markdown:["(\\s*)(:markdown)"],ruby:["(\\s*):ruby","(\\s*):ruby$","\\s*(?:((%)([-:\\w]+))|(?=[#.]))","(\\s*):(ruby|opal)$","(\\s*)(:ruby)","#\\{","!?==","\\{","(&|!)?([-=~])"]}},jn={haml:["haml"],markdown:["markdown"],ruby:["haml"]};var Sc=/(\s+\/\/)/,vc=/(?:\/\/|["'#]|;{1,2}|%{1,2}|--)(\s*)$/,_c=/(?:\/\/|#|;{1,2}|%{1,2}|--)(\s*)$/,xc=[[/^(<!--)(.+)(-->)$/,!1],[/^(\/\*)(.+)(\*\/)$/,!1],[/^(\/\/|["'#]|;{1,2}|%{1,2}|--)(.*)$/,!0],[/^(\*)(.+)$/,!0]];function Ec(e,t,n){let r=[];for(let o of e){if(n==="v3"){let a=o.children.flatMap((l,c)=>{if(l.type!=="element")return l;let u=l.children[0];if(u.type!=="text")return l;let d=c===o.children.length-1;if(!Hn(u.value,d))return l;let h=u.value.split(Sc);if(h.length<=1)return l;let f=[h[0]];for(let g=1;g<h.length;g+=2)f.push(h[g]+(h[g+1]||""));return f=f.filter(Boolean),f.length<=1?l:f.map(g=>({...l,children:[{type:"text",value:g}]}))});a.length!==o.children.length&&(o.children=a)}let s=o.children,i=s.length-1;n==="v1"?i=0:t&&(i=s.length-2);for(let a=Math.max(i,0);a<s.length;a++){let l=s[a];if(l.type!=="element")continue;let c=l.children.at(0);if(c?.type!=="text")continue;let u=a===s.length-1,d=Hn(c.value,u),h;if(!d&&a>0&&c.value.trim().startsWith("[!code")){let f=s[a-1];if(f?.type==="element"){let g=f.children.at(0);if(g?.type==="text"&&g.value.includes("//")){let m=Hn(g.value+c.value,u);if(m){d=m,r.push({info:m,line:o,token:f,isLineCommentOnly:s.length===2&&f.children.length===1&&l.children.length===1,isJsxStyle:!1,additionalTokens:[l]});continue}}}}if(d)if(t&&!u&&a!==0){let f=ys(s[a-1],"{")&&ys(s[a+1],"}");r.push({info:d,line:o,token:l,isLineCommentOnly:s.length===3&&l.children.length===1,isJsxStyle:f,additionalTokens:h})}else r.push({info:d,line:o,token:l,isLineCommentOnly:s.length===1&&l.children.length===1,isJsxStyle:!1,additionalTokens:h})}}return r}function ys(e,t){if(e.type!=="element")return!1;let n=e.children[0];return n.type!=="text"?!1:n.value.trim()===t}function Hn(e,t){let n=e.trimStart(),r=e.length-n.length;n=n.trimEnd();let o=e.length-n.length-r;for(let[s,i]of xc){if(i&&!t)continue;let a=s.exec(n);if(a)return[" ".repeat(r)+a[1],a[2],a[3]?a[3]+" ".repeat(o):void 0]}}function Ic(e){let t=e.match(vc);return t&&t[1].trim().length===0?e.slice(0,t.index):e}function Ac(e){let t=e.match(_c);return t&&t[1].trim().length===0?e.slice(0,t.index).trimEnd():e}function ks(e,t,n,r){return r??="v3",{name:e,code(o){let s=o.children.filter(c=>c.type==="element"),i=[];o.data??={};let a=o.data;a._shiki_notation??=Ec(s,["jsx","tsx"].includes(this.options.lang),r);let l=a._shiki_notation;for(let c of l){if(c.info[1].length===0)continue;let u=s.indexOf(c.line);c.isLineCommentOnly&&r!=="v1"&&u++;let d=!1;if(c.info[1]=c.info[1].replace(t,(...f)=>n.call(this,f,c.line,c.token,s,u)?(d=!0,""):f[0]),!d)continue;r==="v1"?c.info[1]=Ic(c.info[1]):r==="v3"&&(c.info[1]=Ac(c.info[1]));let h=c.info[1].trim().length===0;if(h&&(c.info[1]=""),h&&c.isLineCommentOnly)i.push(c.line);else if(h&&c.isJsxStyle)c.line.children.splice(c.line.children.indexOf(c.token)-1,3);else if(h){if(c.additionalTokens)for(let f=c.additionalTokens.length-1;f>=0;f--){let g=c.additionalTokens[f],m=c.line.children.indexOf(g);m!==-1&&c.line.children.splice(m,1)}c.line.children.splice(c.line.children.indexOf(c.token),1)}else{let f=c.token.children[0];if(f.type==="text"&&(f.value=c.info.join(""),c.additionalTokens))for(let g of c.additionalTokens){let m=g.children[0];m?.type==="text"&&(m.value="")}}}for(let c of i){let u=o.children.indexOf(c),d=o.children[u+1],h=1;d?.type==="text"&&d?.value===`
|
|
153
153
|
`&&(h=2),o.children.splice(u,h)}}}}var Gh=Symbol("highlighted-lines");var Rc=/[.*+?^${}()|[\]\\]/g;function Nc(e){return e.replace(Rc,"\\$&")}function Ft(e={},t="@shikijs/transformers:notation-map"){let{classMap:n={},classActivePre:r=void 0,classActiveCode:o=void 0}=e;return ks(t,new RegExp(`#?\\s*\\[!code (${Object.keys(n).map(Nc).join("|")})(:\\d+)?\\]`,"gi"),function([s,i,a=":1"],l,c,u,d){let h=Number.parseInt(a.slice(1),10);for(let f=d;f<Math.min(d+h,u.length);f++)this.addClassToHast(u[f],n[i]);return r&&this.addClassToHast(this.pre,r),o&&this.addClassToHast(this.code,o),!0},e.matchAlgorithm)}function ws(e={}){let{classLineAdd:t="diff add",classLineRemove:n="diff remove",classActivePre:r="has-diff",classActiveCode:o}=e;return Ft({classMap:{"++":t,"--":n},classActivePre:r,classActiveCode:o,matchAlgorithm:e.matchAlgorithm},"@shikijs/transformers:notation-diff")}function Cs(e={}){let{classMap:t={error:["highlighted","error"],warning:["highlighted","warning"],info:["highlighted","info"]},classActivePre:n="has-highlighted",classActiveCode:r}=e;return Ft({classMap:t,classActivePre:n,classActiveCode:r,matchAlgorithm:e.matchAlgorithm},"@shikijs/transformers:notation-error-level")}function Ss(e={}){let{classActiveLine:t="focused",classActivePre:n="has-focused",classActiveCode:r}=e;return Ft({classMap:{focus:t},classActivePre:n,classActiveCode:r,matchAlgorithm:e.matchAlgorithm},"@shikijs/transformers:notation-focus")}function vs(e={}){let{classActiveLine:t="highlighted",classActivePre:n="has-highlighted",classActiveCode:r}=e;return Ft({classMap:{highlight:t,hl:t},classActivePre:n,classActiveCode:r,matchAlgorithm:e.matchAlgorithm},"@shikijs/transformers:notation-highlight")}function Bc(e,t,n,r){let o=_s(e),s=o.indexOf(n);for(;s!==-1;)Tc.call(this,e.children,t,s,n.length,r),s=o.indexOf(n,s+1)}function _s(e){return e.type==="text"?e.value:e.type==="element"&&e.tagName==="span"?e.children.map(_s).join(""):""}function Tc(e,t,n,r,o){let s=0;for(let i=0;i<e.length;i++){let a=e[i];if(a.type!=="element"||a.tagName!=="span"||a===t)continue;let l=a.children[0];if(l.type==="text"){if(Lc([s,s+l.value.length-1],[n,n+r])){let c=Math.max(0,n-s),u=r-Math.max(0,s-n);if(u===0)continue;let d=Pc(a,l,c,u);this.addClassToHast(d[1],o);let h=d.filter(Boolean);e.splice(i,1,...h),i+=h.length-1}s+=l.value.length}}}function Lc(e,t){return e[0]<=t[1]&&e[1]>=t[0]}function Pc(e,t,n,r){let o=t.value,s=i=>Mc(e,{children:[{type:"text",value:i}]});return[n>0?s(o.slice(0,n)):void 0,s(o.slice(n,n+r)),n+r<o.length?s(o.slice(n+r)):void 0]}function Mc(e,t){return{...e,properties:{...e.properties},...t}}var $c=/\s*\[!code word:((?:\\.|[^:\]])+)(:\d+)?\]/,Fc=/\\(.)/g;function xs(e={}){let{classActiveWord:t="highlighted-word",classActivePre:n=void 0}=e;return ks("@shikijs/transformers:notation-highlight-word",$c,function([r,o,s],i,a,l,c){let u=s?Number.parseInt(s.slice(1),10):l.length;o=o.replace(Fc,"$1");for(let d=c;d<Math.min(c+u,l.length);d++)Bc.call(this,l[d],a,o,t);return n&&this.addClassToHast(this.pre,n),!0},e.matchAlgorithm)}var Oc={terminal:"bash",console:"shellsession","shell-session":"shellsession",cmd:"bat",dos:"bat",batch:"bat",dita:"xml",ditamap:"xml",ditaval:"xml",xhtml:"html",svg:"xml",xslt:"xsl",yml:"yaml",conf:"ini",cfg:"ini",env:"properties",dockerfile:"docker",containerfile:"docker","c++":"cpp","c#":"csharp",cs:"csharp",gradle:"groovy",kt:"kotlin",py:"python",rb:"ruby",md:"markdown",terraform:"hcl",tf:"hcl"},zn=1e3,Es=5e3,Is;function Gc(){return Is??=bo({themes:[gs,ps],langs:[],engine:Dn({forgiving:!0})}),Is}var Un=new Map,Te=new Set;function Dc(e,t){let n=Un.get(t);return n||(n=ms[t]().then(async r=>{await e.loadLanguage(...r.default);for(let o of e.getLoadedLanguages())Te.add(o)}).catch(r=>{throw Un.delete(t),r}),Un.set(t,n)),n}var Wn=new Map;function jc(e){if(!Wn.has(e)){let t=null;try{t=Lt(e)}catch{t=null}Wn.set(e,t)}return Wn.get(e)}function Ot(e,t,n=new Set,r=Hc(t)){if(e==="text"||n.has(e))return n;n.add(e);for(let o of jn[e]??[])for(let[s,i]of Object.entries(bs[o])){if(n.has(s))continue;(!r||i.some(l=>{if(l==="")return!0;let c=jc(l);return!c||r.some(u=>(c.lastIndex=0,c.test(u)))}))&&Ot(s,t,n,r)}return n}function Hc(e){if(e!==void 0)return Dt(e.replace(/\n$/,""),!1).split(/\r?\n/).filter(t=>t.length<zn).map(t=>t+`
|
|
154
|
-
`)}var As=new Map;function Bs(e){let t=As.get(e);return t||As.set(e,t=[...Ot(e,void 0)]),t}function Uc(e,t){if(!Te.has(e))return!1;if(!jn[e]||Bs(e).every(n=>Te.has(n)))return!0;for(let n of Ot(e,t))if(!Te.has(n))return!1;return!0}function Rs(e){let t=(e??"").toLowerCase().trim();if(Vn.has(t))return"text";let n=Oc[t]??t;return Object.hasOwn($t,n)?n:"text"}var Wc=8e6;async function
|
|
154
|
+
`)}var As=new Map;function Bs(e){let t=As.get(e);return t||As.set(e,t=[...Ot(e,void 0)]),t}function Uc(e,t){if(!Te.has(e))return!1;if(!jn[e]||Bs(e).every(n=>Te.has(n)))return!0;for(let n of Ot(e,t))if(!Te.has(n))return!1;return!0}function Rs(e){let t=(e??"").toLowerCase().trim();if(Vn.has(t))return"text";let n=Oc[t]??t;return Object.hasOwn($t,n)?n:"text"}var Wc=8e6;async function Jh(e={}){let t=await Gc(),n={light:"github-light-default",dark:"github-dark-default"},r=e.onePass===!1?void 0:hs(t,n),o=Rs,s=0,i=!0,a=async y=>{let b=new Set;for(let p of y){let w=typeof p=="object"?p:{lang:p,code:void 0},C=Rs(w.lang);if(C==="text")continue;let S=Bs(C);if(!S.every(E=>Te.has(E)))for(let E of w.code===void 0||S.length===1?S:Ot(C,w.code))Te.has(E)||b.add($t[E])}b.size&&await Promise.all([...b].map(p=>Dc(t,p)))};e.langs==="all"?await a(Object.keys($t)):e.langs&&await a(e.langs);let l=new Map,c=0,u=0,d=0,h=Number.isFinite(e.cacheChars)&&e.cacheChars>=0?e.cacheChars:Wc,f=(y,b,p)=>`${b??""}\0${p.lineNumbers?1:0}\0${(p.highlights??[]).join(",")}\0${(p.diffAdd??[]).join(",")}\0${(p.diffRemove??[]).join(",")}\0${y}`,g=(y,b)=>{let p=y.length+b.length;if(p>h/4)return;for(let[C,S]of l){if(c+p<=h)break;l.delete(C),c-=S.key.length+S.html.length}let w={key:Ns(y),html:Ns(b)};l.set(w.key,w),c+=p},m=(y,b,p={})=>{let w=o(b),C=Dt(y.replace(/\n$/,""),w==="text"),S=new Set(p.highlights??[]),E=new Set(p.diffAdd??[]),R=new Set(p.diffRemove??[]),F=p.lineNumbers?" line-numbers":"";if(i=!0,w==="text")return jt(C,p);if(!Uc(w,y))return i=!1,s++,jt(C,p);let N=C.includes("[!code"),K=[...N?[ws(),vs(),Ss(),Cs(),xs()]:[],{name:"dogsbay:lines",line(D,A){S.has(A)&&this.addClassToHast(D,"highlighted"),E.has(A)?this.addClassToHast(D,["diff","add"]):R.has(A)&&this.addClassToHast(D,["diff","remove"])}}];(p.lineNumbers||E.size||R.size||N)&&K.push(zc(!!p.lineNumbers));try{let D=()=>t.codeToHtml(C,{lang:w,themes:n,defaultColor:!1,tokenizeMaxLineLength:zn,tokenizeTimeLimit:Es,transformers:K}),A;if(r&&!N)try{A=r(C,{lang:w,tokenizeMaxLineLength:zn,tokenizeTimeLimit:Es,transformers:K})}catch{A=void 0}return A??=D(),F?A.replace('<pre class="shiki',`<pre class="shiki${F}`):A}catch{return`<pre class="shiki shiki-plain${F}" tabindex="0"><code>${qn(C)}</code></pre>`}};return{resolve:o,render:m,load:a,cacheStats:()=>({entries:l.size,chars:c,hits:u,misses:d,unloaded:s}),has:(y,b,p={})=>l.has(f(y,b,p)),prime(y,b,p,w){let C=f(y,b,p);l.has(C)||g(C,w)},code(y,b,p={}){let w=f(y,b,p),C=l.get(w);if(C!==void 0)return u++,l.delete(w),l.set(C.key,C),C.html;d++;let S=m(y,b,p);return i&&g(w,S),S}}}var Ns=e=>JSON.parse(JSON.stringify(e));function zc(e){return{name:"dogsbay:gutter",code(t){let n=i=>{let a=i.properties?.class;return Array.isArray(a)?a.join(" "):String(a??"")},r=t.children.filter(i=>i.type==="element"&&i.tagName==="span"),o=r.some(i=>/\bdiff\b/.test(n(i)));if(!e&&!o)return;let s=1;for(let i of r){let a=n(i);if(!/\bline\b/.test(a))continue;let l=/\badd\b/.test(a)?"add":/\bremove\b/.test(a)?"remove":"",c=[];e&&c.push(String(s).padStart(3)),o&&c.push(l==="add"?"+":l==="remove"?"\u2212":" "),i.children.unshift({type:"element",tagName:"span",properties:{class:`gutter${l?` ${l}`:""}`,"data-pagefind-ignore":""},children:[{type:"text",value:c.join(" ")}]}),s++}}}}export{Wc as DEFAULT_HIGHLIGHT_CACHE_CHARS,Jh as createHighlighter,Ls as parseLineRanges};
|
package/dist/cli.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunks/chunk-
|
|
1
|
+
import{a,b}from"./chunks/chunk-IWAXLAAV.mjs";import"./chunks/chunk-XYDV5S5E.mjs";import"./chunks/chunk-2WIDSLTD.mjs";import"./chunks/chunk-2V77MTNA.mjs";export{a as containedReader,b as runCli};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as r,c as t}from"./chunks/chunk-
|
|
1
|
+
import{a as e,b as r,c as t}from"./chunks/chunk-XYDV5S5E.mjs";import"./chunks/chunk-2WIDSLTD.mjs";import"./chunks/chunk-2V77MTNA.mjs";export{r as VERSION,t as renderDocument,e as themeNames};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dogsbay/render",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.126",
|
|
4
4
|
"description": "Render one Dogsbay Markdown file to one self-contained HTML page: themed, light and dark, accessible, nothing external. A single bundled file with no dependencies, for people and agents (npx -y @dogsbay/render doc.md -o doc.html)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"tailwindcss": "4.3.2",
|
|
35
35
|
"typescript": "^5.9.3",
|
|
36
36
|
"vitest": "^4.1.10",
|
|
37
|
-
"@dogsbay/elements": "0.2.0-beta.
|
|
38
|
-
"@dogsbay/format-dogsbay-md": "0.2.0-beta.
|
|
39
|
-
"@dogsbay/highlight": "0.2.0-beta.
|
|
40
|
-
"@dogsbay/render-html": "0.2.0-beta.
|
|
41
|
-
"@dogsbay/types": "0.2.0-beta.
|
|
37
|
+
"@dogsbay/elements": "0.2.0-beta.126",
|
|
38
|
+
"@dogsbay/format-dogsbay-md": "0.2.0-beta.126",
|
|
39
|
+
"@dogsbay/highlight": "0.2.0-beta.126",
|
|
40
|
+
"@dogsbay/render-html": "0.2.0-beta.126",
|
|
41
|
+
"@dogsbay/types": "0.2.0-beta.126"
|
|
42
42
|
},
|
|
43
43
|
"license": "MIT",
|
|
44
44
|
"repository": {
|