@datalayer/agent-runtimes 1.5.93 → 1.5.94
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-embed/chunks/{code-block-IT6T5CEO-DqNGASTc.js → code-block-IT6T5CEO-BG9nTZfk.js} +16 -16
- package/dist-embed/datalayer-app-main.js +8 -8
- package/lib/specs/apps.js +67 -67
- package/lib/specs/appspecSchema.js +62 -62
- package/lib/specs/harnesses.js +2 -2
- package/lib/specs/sceneSchema.js +2 -2
- package/lib/specs/scenes.js +4 -4
- package/package.json +1 -1
package/dist-embed/chunks/{code-block-IT6T5CEO-DqNGASTc.js → code-block-IT6T5CEO-BG9nTZfk.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{ly as Mt,lz as Br,lA as zn,lB as qn,lC as Xn,lD as tr,lE as Qn,lF as Jn,lG as Kn,_ as c,r as ce,lH as Zn,j as V,lI as Yn,lJ as Gt}from"../datalayer-app-main.js";let I=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function ei(t){return Bt(t)}function Bt(t){return Array.isArray(t)?ti(t):t instanceof RegExp?t:typeof t=="object"?ri(t):t}function ti(t){let e=[];for(let r=0,n=t.length;r<n;r++)e[r]=Bt(t[r]);return e}function ri(t){let e={};for(let r in t)e[r]=Bt(t[r]);return e}function Fr(t,...e){return e.forEach(r=>{for(let n in r)t[n]=r[n]}),t}function jr(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?jr(t.substring(0,t.length-1)):t.substr(~e+1)}var at=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Te=class{static hasCaptures(t){return t===null?!1:(at.lastIndex=0,at.test(t))}static replaceCaptures(t,e,r){return t.replace(at,(n,i,o,s)=>{let l=r[parseInt(i||o,10)];if(l){let a=e.substring(l.start,l.end);for(;a[0]===".";)a=a.substring(1);switch(s){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return n})}};function Ur(t,e){return t<e?-1:t>e?1:0}function Wr(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let r=t.length,n=e.length;if(r===n){for(let i=0;i<r;i++){let o=Ur(t[i],e[i]);if(o!==0)return o}return 0}return r-n}function rr(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Hr(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var zr=class{constructor(t){this.fn=t}fn;cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Be=class{constructor(t,e,r){this._colorMap=t,this._defaults=e,this._root=r}_colorMap;_defaults;_root;static createFromRawTheme(t,e){return this.createFromParsedTheme(oi(t),e)}static createFromParsedTheme(t,e){return ai(t,e)}_cachedMatchRoot=new zr(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,n=this._cachedMatchRoot.get(e).find(i=>ni(t.parent,i.parentScopes));return n?new qr(n.fontStyle,n.foreground,n.background):null}},lt=class Ve{constructor(e,r){this.parent=e,this.scopeName=r}parent;scopeName;static push(e,r){for(const n of r)e=new Ve(e,n);return e}static from(...e){let r=null;for(let n=0;n<e.length;n++)r=new Ve(r,e[n]);return r}push(e){return new Ve(this,e)}getSegments(){let e=this;const r=[];for(;e;)r.push(e.scopeName),e=e.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const r=[];let n=this;for(;n&&n!==e;)r.push(n.scopeName),n=n.parent;return n===e?r.reverse():void 0}};function ni(t,e){if(e.length===0)return!0;for(let r=0;r<e.length;r++){let n=e[r],i=!1;if(n===">"){if(r===e.length-1)return!1;n=e[++r],i=!0}for(;t&&!ii(t.scopeName,n);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function ii(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var qr=class{constructor(t,e,r){this.fontStyle=t,this.foregroundId=e,this.backgroundId=r}fontStyle;foregroundId;backgroundId};function oi(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,r=[],n=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];if(!s.settings)continue;let l;if(typeof s.scope=="string"){let m=s.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),l=m.split(",")}else Array.isArray(s.scope)?l=s.scope:l=[""];let a=-1;if(typeof s.settings.fontStyle=="string"){a=0;let m=s.settings.fontStyle.split(" ");for(let d=0,h=m.length;d<h;d++)switch(m[d]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let u=null;typeof s.settings.foreground=="string"&&rr(s.settings.foreground)&&(u=s.settings.foreground);let p=null;typeof s.settings.background=="string"&&rr(s.settings.background)&&(p=s.settings.background);for(let m=0,d=l.length;m<d;m++){let f=l[m].trim().split(" "),y=f[f.length-1],E=null;f.length>1&&(E=f.slice(0,f.length-1),E.reverse()),r[n++]=new si(y,E,i,a,u,p)}}return r}var si=class{constructor(t,e,r,n,i,o){this.scope=t,this.parentScopes=e,this.index=r,this.fontStyle=n,this.foreground=i,this.background=o}scope;parentScopes;index;fontStyle;foreground;background},x=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(x||{});function ai(t,e){t.sort((a,u)=>{let p=Ur(a.scope,u.scope);return p!==0||(p=Wr(a.parentScopes,u.parentScopes),p!==0)?p:a.index-u.index});let r=0,n="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let a=t.shift();a.fontStyle!==-1&&(r=a.fontStyle),a.foreground!==null&&(n=a.foreground),a.background!==null&&(i=a.background)}let o=new li(e),s=new qr(r,o.getId(n),o.getId(i)),l=new ci(new vt(0,null,-1,0,0),[]);for(let a=0,u=t.length;a<u;a++){let p=t[a];l.insert(0,p.scope,p.parentScopes,p.fontStyle,o.getId(p.foreground),o.getId(p.background))}return new Be(o,s,l)}var li=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,r=t.length;e<r;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},ui=Object.freeze([]),vt=class Xr{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,r,n,i,o){this.scopeDepth=e,this.parentScopes=r||ui,this.fontStyle=n,this.foreground=i,this.background=o}clone(){return new Xr(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let r=[];for(let n=0,i=e.length;n<i;n++)r[n]=e[n].clone();return r}acceptOverwrite(e,r,n,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,r!==-1&&(this.fontStyle=r),n!==0&&(this.foreground=n),i!==0&&(this.background=i)}},ci=class Ct{constructor(e,r=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=r}_mainRule;_children;_rulesWithParentScopes;static _cmpBySpecificity(e,r){if(e.scopeDepth!==r.scopeDepth)return r.scopeDepth-e.scopeDepth;let n=0,i=0;for(;e.parentScopes[n]===">"&&n++,r.parentScopes[i]===">"&&i++,!(n>=e.parentScopes.length||i>=r.parentScopes.length);){const o=r.parentScopes[i].length-e.parentScopes[n].length;if(o!==0)return o;n++,i++}return r.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let n=e.indexOf("."),i,o;if(n===-1?(i=e,o=""):(i=e.substring(0,n),o=e.substring(n+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(Ct._cmpBySpecificity),r}insert(e,r,n,i,o,s){if(r===""){this._doInsertHere(e,n,i,o,s);return}let l=r.indexOf("."),a,u;l===-1?(a=r,u=""):(a=r.substring(0,l),u=r.substring(l+1));let p;this._children.hasOwnProperty(a)?p=this._children[a]:(p=new Ct(this._mainRule.clone(),vt.cloneArr(this._rulesWithParentScopes)),this._children[a]=p),p.insert(e+1,u,n,i,o,s)}_doInsertHere(e,r,n,i,o){if(r===null){this._mainRule.acceptOverwrite(e,n,i,o);return}for(let s=0,l=this._rulesWithParentScopes.length;s<l;s++){let a=this._rulesWithParentScopes[s];if(Wr(a.parentScopes,r)===0){a.acceptOverwrite(e,n,i,o);return}}n===-1&&(n=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new vt(e,r,n,i,o))}},de=class D{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const r=D.getLanguageId(e),n=D.getTokenType(e),i=D.getFontStyle(e),o=D.getForeground(e),s=D.getBackground(e);console.log({languageId:r,tokenType:n,fontStyle:i,foreground:o,background:s})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,r,n,i,o,s,l){let a=D.getLanguageId(e),u=D.getTokenType(e),p=D.containsBalancedBrackets(e)?1:0,m=D.getFontStyle(e),d=D.getForeground(e),h=D.getBackground(e);return r!==0&&(a=r),n!==8&&(u=n),i!==null&&(p=i?1:0),o!==-1&&(m=o),s!==0&&(d=s),l!==0&&(h=l),(a<<0|u<<8|p<<10|m<<11|d<<15|h<<24)>>>0}};function Fe(t,e){const r=[],n=pi(t);let i=n.next();for(;i!==null;){let a=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=n.next()}let u=s();if(r.push({matcher:u,priority:a}),i!==",")break;i=n.next()}return r;function o(){if(i==="-"){i=n.next();const a=o();return u=>!!a&&!a(u)}if(i==="("){i=n.next();const a=l();return i===")"&&(i=n.next()),a}if(nr(i)){const a=[];do a.push(i),i=n.next();while(nr(i));return u=>e(a,u)}return null}function s(){const a=[];let u=o();for(;u;)a.push(u),u=o();return p=>a.every(m=>m(p))}function l(){const a=[];let u=s();for(;u&&(a.push(u),i==="|"||i===",");){do i=n.next();while(i==="|"||i===",");u=s()}return p=>a.some(m=>m(p))}}function nr(t){return!!t&&!!t.match(/[\w\.:]+/)}function pi(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=e.exec(t);return{next:()=>{if(!r)return null;const n=r[0];return r=e.exec(t),n}}}function Qr(t){typeof t.dispose=="function"&&t.dispose()}var Ae=class{constructor(t){this.scopeName=t}scopeName;toKey(){return this.scopeName}},mi=class{constructor(t,e){this.scopeName=t,this.ruleName=e}scopeName;ruleName;toKey(){return`${this.scopeName}#${this.ruleName}`}},di=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},hi=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ae(this.initialScopeName)]}repo;initialScopeName;seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new di;for(const r of t)fi(r,this.initialScopeName,this.repo,e);for(const r of e.references)if(r instanceof Ae){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function fi(t,e,r,n){const i=r.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const o=r.lookup(e);t instanceof Ae?Me({baseGrammar:o,selfGrammar:i},n):It(t.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},n);const s=r.injections(t.scopeName);if(s)for(const l of s)n.add(new Ae(l))}function It(t,e,r){if(e.repository&&e.repository[t]){const n=e.repository[t];je([n],e,r)}}function Me(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&je(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&je(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function je(t,e,r){for(const n of t){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);const i=n.repository?Fr({},e.repository,n.repository):e.repository;Array.isArray(n.patterns)&&je(n.patterns,{...e,repository:i},r);const o=n.include;if(!o)continue;const s=Jr(o);switch(s.kind){case 0:Me({...e,selfGrammar:e.baseGrammar},r);break;case 1:Me(e,r);break;case 2:It(s.ruleName,{...e,repository:i},r);break;case 3:case 4:const l=s.scopeName===e.selfGrammar.scopeName?e.selfGrammar:s.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(l){const a={baseGrammar:e.baseGrammar,selfGrammar:l,repository:i};s.kind===4?It(s.ruleName,a,r):Me(a,r)}else s.kind===4?r.add(new mi(s.scopeName,s.ruleName)):r.add(new Ae(s.scopeName));break}}}var gi=class{kind=0},_i=class{kind=1},yi=class{constructor(t){this.ruleName=t}ruleName;kind=2},Ei=class{constructor(t){this.scopeName=t}scopeName;kind=3},bi=class{constructor(t,e){this.scopeName=t,this.ruleName=e}scopeName;ruleName;kind=4};function Jr(t){if(t==="$base")return new gi;if(t==="$self")return new _i;const e=t.indexOf("#");if(e===-1)return new Ei(t);if(e===0)return new yi(t.substring(1));{const r=t.substring(0,e),n=t.substring(e+1);return new bi(r,n)}}var wi=/\\(\d+)/,ir=/\\(\d+)/g,Ai=-1,Kr=-2;var Se=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,r,n){this.$location=t,this.id=e,this._name=r||null,this._nameIsCapturing=Te.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=Te.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${jr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Te.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Te.replaceCaptures(this._contentName,t,e)}},vi=class extends Se{retokenizeCapturedWithRuleId;constructor(t,e,r,n,i){super(t,e,r,n),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,r,n){throw new Error("Not supported!")}},Ci=class extends Se{_match;captures;_cachedCompiledPatterns;constructor(t,e,r,n,i){super(t,e,r,null),this._match=new ve(n,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ce,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},or=class extends Se{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,r,n,i){super(t,e,r,n),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const r of this.patterns)t.getRule(r).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ce,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Rt=class extends Se{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,r,n,i,o,s,l,a,u){super(t,e,r,n),this._begin=new ve(i,this.id),this.beginCaptures=o,this._end=new ve(s||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=a||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.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(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t,e).compileAG(t,r,n)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ce;for(const r of this.patterns)t.getRule(r).collectPatterns(t,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,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Ue=class extends Se{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,r,n,i,o,s,l,a){super(t,e,r,n),this._begin=new ve(i,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new ve(s,Kr),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.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(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ce;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,r,n){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,r,n)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Ce,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},Zr=class O{static createCaptureRule(e,r,n,i,o){return e.registerRule(s=>new vi(r,s,n,i,o))}static getCompiledRuleId(e,r,n){return e.id||r.registerRule(i=>{if(e.id=i,e.match)return new Ci(e.$vscodeTextmateLocation,e.id,e.name,e.match,O._compileCaptures(e.captures,r,n));if(typeof e.begin>"u"){e.repository&&(n=Fr({},n,e.repository));let o=e.patterns;return typeof o>"u"&&e.include&&(o=[{include:e.include}]),new or(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,O._compilePatterns(o,r,n))}return e.while?new Ue(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,O._compileCaptures(e.beginCaptures||e.captures,r,n),e.while,O._compileCaptures(e.whileCaptures||e.captures,r,n),O._compilePatterns(e.patterns,r,n)):new Rt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,O._compileCaptures(e.beginCaptures||e.captures,r,n),e.end,O._compileCaptures(e.endCaptures||e.captures,r,n),e.applyEndPatternLast,O._compilePatterns(e.patterns,r,n))}),e.id}static _compileCaptures(e,r,n){let i=[];if(e){let o=0;for(const s in e){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);l>o&&(o=l)}for(let s=0;s<=o;s++)i[s]=null;for(const s in e){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);let a=0;e[s].patterns&&(a=O.getCompiledRuleId(e[s],r,n)),i[l]=O.createCaptureRule(r,e[s].$vscodeTextmateLocation,e[s].name,e[s].contentName,a)}}return i}static _compilePatterns(e,r,n){let i=[];if(e)for(let o=0,s=e.length;o<s;o++){const l=e[o];let a=-1;if(l.include){const u=Jr(l.include);switch(u.kind){case 0:case 1:a=O.getCompiledRuleId(n[l.include],r,n);break;case 2:let p=n[u.ruleName];p&&(a=O.getCompiledRuleId(p,r,n));break;case 3:case 4:const m=u.scopeName,d=u.kind===4?u.ruleName:null,h=r.getExternalGrammar(m,n);if(h)if(d){let f=h.repository[d];f&&(a=O.getCompiledRuleId(f,r,h.repository))}else a=O.getCompiledRuleId(h.repository.$self,r,h.repository);break}}else a=O.getCompiledRuleId(l,r,n);if(a!==-1){const u=r.getRule(a);let p=!1;if((u instanceof or||u instanceof Rt||u instanceof Ue)&&u.hasMissingPatterns&&u.patterns.length===0&&(p=!0),p)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}},ve=class Yr{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,r){if(e&&typeof e=="string"){const n=e.length;let i=0,o=[],s=!1;for(let l=0;l<n;l++)if(e.charAt(l)==="\\"&&l+1<n){const u=e.charAt(l+1);u==="z"?(o.push(e.substring(i,l)),o.push("$(?!\\n)(?<!\\n)"),i=l+2):(u==="A"||u==="G")&&(s=!0),l++}this.hasAnchor=s,i===0?this.source=e:(o.push(e.substring(i,n)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=wi.test(this.source):this.hasBackReferences=!1}clone(){return new Yr(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,r){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let n=r.map(i=>e.substring(i.start,i.end));return ir.lastIndex=0,this.source.replace(ir,(i,o)=>Hr(n[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],r=[],n=[],i=[],o,s,l,a;for(o=0,s=this.source.length;o<s;o++)l=this.source.charAt(o),e[o]=l,r[o]=l,n[o]=l,i[o]=l,l==="\\"&&o+1<s&&(a=this.source.charAt(o+1),a==="A"?(e[o+1]="",r[o+1]="",n[o+1]="A",i[o+1]="A"):a==="G"?(e[o+1]="",r[o+1]="G",n[o+1]="",i[o+1]="G"):(e[o+1]=a,r[o+1]=a,n[o+1]=a,i[o+1]=a),o++);return{A0_G0:e.join(""),A0_G1:r.join(""),A1_G0:n.join(""),A1_G1:i.join("")}}resolveAnchors(e,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Ce=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(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(r=>r.source);this._cached=new sr(t,e,this._items.map(r=>r.ruleId))}return this._cached}compileAG(t,e,r){return this._hasAnchors?e?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,r)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,r){let n=this._items.map(i=>i.resolveAnchors(e,r));return new sr(t,n,this._items.map(i=>i.ruleId))}},sr=class{constructor(t,e,r){this.regExps=e,this.rules=r,this.scanner=t.createOnigScanner(e)}regExps;rules;scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,r=this.rules.length;e<r;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
2
|
-
`)}findNextMatchSync(t,e,r){const n=this.scanner.findNextMatchSync(t,e,r);return n?{ruleId:this.rules[n.index],captureIndices:n.captureIndices}:null}},
|
|
3
|
-
`;const o=this.createOnigString(t),s=o.content.length,l=new Vi(r,t,this._tokenTypeMatchers,this.balancedBracketSelectors),a=en(this,o,i,0,e,l,!0,n);return Qr(o),{lineLength:s,lineTokens:l,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function ur(t,e){return t=ei(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var be=class F{constructor(e,r,n){this.parent=e,this.scopePath=r,this.tokenAttributes=n}parent;scopePath;tokenAttributes;static fromExtension(e,r){let n=e,i=e?.scopePath??null;for(const o of r)i=lt.push(i,o.scopeNames),n=new F(n,i,o.encodedTokenAttributes);return n}static createRoot(e,r){return new F(null,new lt(null,e),r)}static createRootAndLookUpScopeName(e,r,n){const i=n.getMetadataForScope(e),o=new lt(null,e),s=n.themeProvider.themeMatch(o),l=F.mergeAttributes(r,i,s);return new F(null,o,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return F.equals(this,e)}static equals(e,r){do{if(e===r||!e&&!r)return!0;if(!e||!r||e.scopeName!==r.scopeName||e.tokenAttributes!==r.tokenAttributes)return!1;e=e.parent,r=r.parent}while(!0)}static mergeAttributes(e,r,n){let i=-1,o=0,s=0;return n!==null&&(i=n.fontStyle,o=n.foregroundId,s=n.backgroundId),de.set(e,r.languageId,r.tokenType,null,i,o,s)}pushAttributed(e,r){if(e===null)return this;if(e.indexOf(" ")===-1)return F._pushAttributed(this,e,r);const n=e.split(/ /g);let i=this;for(const o of n)i=F._pushAttributed(i,o,r);return i}static _pushAttributed(e,r,n){const i=n.getMetadataForScope(r),o=e.scopePath.push(r),s=n.themeProvider.themeMatch(o),l=F.mergeAttributes(e.tokenAttributes,i,s);return new F(e,o,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const r=[];let n=this;for(;n&&n!==e;)r.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?r.reverse():void 0}},Lt=class Y{constructor(e,r,n,i,o,s,l,a){this.parent=e,this.ruleId=r,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=l,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=i}parent;ruleId;beginRuleCapturedEOL;endRule;nameScopesList;contentNameScopesList;_stackElementBrand=void 0;static NULL=new Y(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:Y._equals(this,e)}static _equals(e,r){return e===r?!0:this._structuralEquals(e,r)?be.equals(e.contentNameScopesList,r.contentNameScopesList):!1}static _structuralEquals(e,r){do{if(e===r||!e&&!r)return!0;if(!e||!r||e.depth!==r.depth||e.ruleId!==r.ruleId||e.endRule!==r.endRule)return!1;e=e.parent,r=r.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){Y._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,r,n,i,o,s,l){return new Y(this,e,r,n,i,o,s,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,r){return this.parent&&(r=this.parent._writeString(e,r)),e[r++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,r}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new Y(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let r=this;for(;r&&r._enterPos===e._enterPos;){if(r.ruleId===e.ruleId)return!0;r=r.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(e,r){const n=be.fromExtension(e?.nameScopesList??null,r.nameScopesList);return new Y(e,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,n,be.fromExtension(n,r.contentNameScopesList))}},$i=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(r=>r==="*"?(this.allowAny=!0,[]):Fe(r,We).map(n=>n.matcher)),this.unbalancedBracketScopes=e.flatMap(r=>Fe(r,We).map(n=>n.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},Vi=class{constructor(t,e,r,n){this.balancedBracketSelectors=n,this._emitBinaryTokens=t,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}balancedBracketSelectors;_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let n=t?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=t?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(o)&&(n=de.set(n,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(n=de.set(n,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=e;return}const r=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:r}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const r=new Uint32Array(this._binaryTokens.length);for(let n=0,i=this._binaryTokens.length;n<i;n++)r[n]=this._binaryTokens[n];return r}},Mi=class{constructor(t,e){this._onigLib=e,this._theme=t}_onigLib;_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,r,n,i){if(!this._grammars.has(t)){let o=this._rawGrammars.get(t);if(!o)return null;this._grammars.set(t,xi(t,o,e,r,n,i,this,this._onigLib))}return this._grammars.get(t)}},Gi=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Mi(Be.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,r){this._syncRegistry.setTheme(Be.createFromRawTheme(e,r))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,r,n){return this.loadGrammarWithConfiguration(e,r,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,r,n){return this._loadGrammar(e,r,n.embeddedLanguages,n.tokenTypes,new $i(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,r,n,i,o){const s=new hi(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(l=>this._loadSingleGrammar(l.scopeName)),s.processQueue();return this._grammarForScopeName(e,r,n,i,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const r=this._options.loadGrammar(e);if(r){const n=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(r,n)}}addGrammar(e,r=[],n=0,i=null){return this._syncRegistry.addGrammar(e,r),this._grammarForScopeName(e.scopeName,n,i)}_grammarForScopeName(e,r=0,n=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(e,r,n,i,o)}},kt=Lt.NULL;const Bi=/["&'<>`]/g,Fi=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ji=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ui=/[|\\{}()[\]^$+*?.]/g,cr=new WeakMap;function Wi(t,e){if(t=t.replace(e.subset?Hi(e.subset):Bi,n),e.subset||e.escapeOnly)return t;return t.replace(Fi,r).replace(ji,n);function r(i,o,s){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),e)}function n(i,o,s){return e.format(i.charCodeAt(0),s.charCodeAt(o+1),e)}}function Hi(t){let e=cr.get(t);return e||(e=zi(t),cr.set(t,e)),e}function zi(t){const e=[];let r=-1;for(;++r<t.length;)e.push(t[r].replace(Ui,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const qi=/[\dA-Fa-f]/;function Xi(t,e,r){const n="&#x"+t.toString(16).toUpperCase();return r&&e&&!qi.test(String.fromCharCode(e))?n:n+";"}const Qi=/\d/;function Ji(t,e,r){const n="&#"+String(t);return r&&e&&!Qi.test(String.fromCharCode(e))?n:n+";"}const Ki=["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"],ct={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Zi=["cent","copy","divide","gt","lt","not","para","times"],rn={}.hasOwnProperty,Tt={};let Pe;for(Pe in ct)rn.call(ct,Pe)&&(Tt[ct[Pe]]=Pe);const Yi=/[^\dA-Za-z]/;function eo(t,e,r,n){const i=String.fromCharCode(t);if(rn.call(Tt,i)){const o=Tt[i],s="&"+o;return r&&Ki.includes(o)&&!Zi.includes(o)&&(!n||e&&e!==61&&Yi.test(String.fromCharCode(e)))?s:s+";"}return""}function to(t,e,r){let n=Xi(t,e,r.omitOptionalSemicolons),i;if((r.useNamedReferences||r.useShortestReferences)&&(i=eo(t,e,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!i)&&r.useShortestReferences){const o=Ji(t,e,r.omitOptionalSemicolons);o.length<n.length&&(n=o)}return i&&(!r.useShortestReferences||i.length<n.length)?i:n}function me(t,e){return Wi(t,Object.assign({format:to},e))}const ro=/^>|^->|<!--|-->|--!>|<!-$/g,no=[">"],io=["<",">"];function oo(t,e,r,n){return n.settings.bogusComments?"<?"+me(t.value,Object.assign({},n.settings.characterReferences,{subset:no}))+">":"<!--"+t.value.replace(ro,i)+"-->";function i(o){return me(o,Object.assign({},n.settings.characterReferences,{subset:io}))}}function so(t,e,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}const L=on(1),nn=on(-1),ao=[];function on(t){return e;function e(r,n,i){const o=r?r.children:ao;let s=(n||0)+t,l=o[s];if(!i)for(;l&&Mt(l);)s+=t,l=o[s];return l}}const lo={}.hasOwnProperty;function sn(t){return e;function e(r,n,i){return lo.call(t,r.tagName)&&t[r.tagName](r,n,i)}}const Ft=sn({body:co,caption:pt,colgroup:pt,dd:fo,dt:ho,head:pt,html:uo,li:mo,optgroup:go,option:_o,p:po,rp:pr,rt:pr,tbody:Eo,td:mr,tfoot:bo,th:mr,thead:yo,tr:wo});function pt(t,e,r){const n=L(r,e,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&Mt(n.value.charAt(0)))}function uo(t,e,r){const n=L(r,e);return!n||n.type!=="comment"}function co(t,e,r){const n=L(r,e);return!n||n.type!=="comment"}function po(t,e,r){const n=L(r,e);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"))}function mo(t,e,r){const n=L(r,e);return!n||n.type==="element"&&n.tagName==="li"}function ho(t,e,r){const n=L(r,e);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function fo(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function pr(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function go(t,e,r){const n=L(r,e);return!n||n.type==="element"&&n.tagName==="optgroup"}function _o(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function yo(t,e,r){const n=L(r,e);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function Eo(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function bo(t,e,r){return!L(r,e)}function wo(t,e,r){const n=L(r,e);return!n||n.type==="element"&&n.tagName==="tr"}function mr(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const Ao=sn({body:Io,colgroup:Ro,head:Co,html:vo,tbody:So});function vo(t){const e=L(t,-1);return!e||e.type!=="comment"}function Co(t){const e=new Set;for(const n of t.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(e.has(n.tagName))return!1;e.add(n.tagName)}const r=t.children[0];return!r||r.type==="element"}function Io(t){const e=L(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Mt(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Ro(t,e,r){const n=nn(r,e),i=L(t,-1,!0);return r&&n&&n.type==="element"&&n.tagName==="colgroup"&&Ft(n,r.children.indexOf(n),r)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function So(t,e,r){const n=nn(r,e),i=L(t,-1);return r&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&Ft(n,r.children.indexOf(n),r)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Oe={name:[[`
|
|
1
|
+
import{ly as Mt,lz as Br,lA as Fr,lB as qn,lC as Xn,lD as Qn,lE as tr,lF as Jn,lG as Kn,_ as u,r as ue,lH as Zn,j as V,lI as Yn,lJ as Gt}from"../datalayer-app-main.js";let I=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function ei(t){return Bt(t)}function Bt(t){return Array.isArray(t)?ti(t):t instanceof RegExp?t:typeof t=="object"?ri(t):t}function ti(t){let e=[];for(let r=0,n=t.length;r<n;r++)e[r]=Bt(t[r]);return e}function ri(t){let e={};for(let r in t)e[r]=Bt(t[r]);return e}function jr(t,...e){return e.forEach(r=>{for(let n in r)t[n]=r[n]}),t}function Ur(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Ur(t.substring(0,t.length-1)):t.substr(~e+1)}var at=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Te=class{static hasCaptures(t){return t===null?!1:(at.lastIndex=0,at.test(t))}static replaceCaptures(t,e,r){return t.replace(at,(n,i,o,s)=>{let l=r[parseInt(i||o,10)];if(l){let a=e.substring(l.start,l.end);for(;a[0]===".";)a=a.substring(1);switch(s){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return n})}};function Wr(t,e){return t<e?-1:t>e?1:0}function Hr(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let r=t.length,n=e.length;if(r===n){for(let i=0;i<r;i++){let o=Wr(t[i],e[i]);if(o!==0)return o}return 0}return r-n}function rr(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function zr(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var qr=class{constructor(t){this.fn=t}fn;cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Be=class{constructor(t,e,r){this._colorMap=t,this._defaults=e,this._root=r}_colorMap;_defaults;_root;static createFromRawTheme(t,e){return this.createFromParsedTheme(oi(t),e)}static createFromParsedTheme(t,e){return ai(t,e)}_cachedMatchRoot=new qr(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,n=this._cachedMatchRoot.get(e).find(i=>ni(t.parent,i.parentScopes));return n?new Xr(n.fontStyle,n.foreground,n.background):null}},lt=class Ve{constructor(e,r){this.parent=e,this.scopeName=r}parent;scopeName;static push(e,r){for(const n of r)e=new Ve(e,n);return e}static from(...e){let r=null;for(let n=0;n<e.length;n++)r=new Ve(r,e[n]);return r}push(e){return new Ve(this,e)}getSegments(){let e=this;const r=[];for(;e;)r.push(e.scopeName),e=e.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const r=[];let n=this;for(;n&&n!==e;)r.push(n.scopeName),n=n.parent;return n===e?r.reverse():void 0}};function ni(t,e){if(e.length===0)return!0;for(let r=0;r<e.length;r++){let n=e[r],i=!1;if(n===">"){if(r===e.length-1)return!1;n=e[++r],i=!0}for(;t&&!ii(t.scopeName,n);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function ii(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Xr=class{constructor(t,e,r){this.fontStyle=t,this.foregroundId=e,this.backgroundId=r}fontStyle;foregroundId;backgroundId};function oi(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,r=[],n=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];if(!s.settings)continue;let l;if(typeof s.scope=="string"){let m=s.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),l=m.split(",")}else Array.isArray(s.scope)?l=s.scope:l=[""];let a=-1;if(typeof s.settings.fontStyle=="string"){a=0;let m=s.settings.fontStyle.split(" ");for(let d=0,h=m.length;d<h;d++)switch(m[d]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let c=null;typeof s.settings.foreground=="string"&&rr(s.settings.foreground)&&(c=s.settings.foreground);let p=null;typeof s.settings.background=="string"&&rr(s.settings.background)&&(p=s.settings.background);for(let m=0,d=l.length;m<d;m++){let f=l[m].trim().split(" "),y=f[f.length-1],E=null;f.length>1&&(E=f.slice(0,f.length-1),E.reverse()),r[n++]=new si(y,E,i,a,c,p)}}return r}var si=class{constructor(t,e,r,n,i,o){this.scope=t,this.parentScopes=e,this.index=r,this.fontStyle=n,this.foreground=i,this.background=o}scope;parentScopes;index;fontStyle;foreground;background},x=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(x||{});function ai(t,e){t.sort((a,c)=>{let p=Wr(a.scope,c.scope);return p!==0||(p=Hr(a.parentScopes,c.parentScopes),p!==0)?p:a.index-c.index});let r=0,n="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let a=t.shift();a.fontStyle!==-1&&(r=a.fontStyle),a.foreground!==null&&(n=a.foreground),a.background!==null&&(i=a.background)}let o=new li(e),s=new Xr(r,o.getId(n),o.getId(i)),l=new ui(new vt(0,null,-1,0,0),[]);for(let a=0,c=t.length;a<c;a++){let p=t[a];l.insert(0,p.scope,p.parentScopes,p.fontStyle,o.getId(p.foreground),o.getId(p.background))}return new Be(o,s,l)}var li=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,r=t.length;e<r;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},ci=Object.freeze([]),vt=class Qr{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,r,n,i,o){this.scopeDepth=e,this.parentScopes=r||ci,this.fontStyle=n,this.foreground=i,this.background=o}clone(){return new Qr(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let r=[];for(let n=0,i=e.length;n<i;n++)r[n]=e[n].clone();return r}acceptOverwrite(e,r,n,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,r!==-1&&(this.fontStyle=r),n!==0&&(this.foreground=n),i!==0&&(this.background=i)}},ui=class Ct{constructor(e,r=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=r}_mainRule;_children;_rulesWithParentScopes;static _cmpBySpecificity(e,r){if(e.scopeDepth!==r.scopeDepth)return r.scopeDepth-e.scopeDepth;let n=0,i=0;for(;e.parentScopes[n]===">"&&n++,r.parentScopes[i]===">"&&i++,!(n>=e.parentScopes.length||i>=r.parentScopes.length);){const o=r.parentScopes[i].length-e.parentScopes[n].length;if(o!==0)return o;n++,i++}return r.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let n=e.indexOf("."),i,o;if(n===-1?(i=e,o=""):(i=e.substring(0,n),o=e.substring(n+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(Ct._cmpBySpecificity),r}insert(e,r,n,i,o,s){if(r===""){this._doInsertHere(e,n,i,o,s);return}let l=r.indexOf("."),a,c;l===-1?(a=r,c=""):(a=r.substring(0,l),c=r.substring(l+1));let p;this._children.hasOwnProperty(a)?p=this._children[a]:(p=new Ct(this._mainRule.clone(),vt.cloneArr(this._rulesWithParentScopes)),this._children[a]=p),p.insert(e+1,c,n,i,o,s)}_doInsertHere(e,r,n,i,o){if(r===null){this._mainRule.acceptOverwrite(e,n,i,o);return}for(let s=0,l=this._rulesWithParentScopes.length;s<l;s++){let a=this._rulesWithParentScopes[s];if(Hr(a.parentScopes,r)===0){a.acceptOverwrite(e,n,i,o);return}}n===-1&&(n=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new vt(e,r,n,i,o))}},de=class D{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const r=D.getLanguageId(e),n=D.getTokenType(e),i=D.getFontStyle(e),o=D.getForeground(e),s=D.getBackground(e);console.log({languageId:r,tokenType:n,fontStyle:i,foreground:o,background:s})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,r,n,i,o,s,l){let a=D.getLanguageId(e),c=D.getTokenType(e),p=D.containsBalancedBrackets(e)?1:0,m=D.getFontStyle(e),d=D.getForeground(e),h=D.getBackground(e);return r!==0&&(a=r),n!==8&&(c=n),i!==null&&(p=i?1:0),o!==-1&&(m=o),s!==0&&(d=s),l!==0&&(h=l),(a<<0|c<<8|p<<10|m<<11|d<<15|h<<24)>>>0}};function Fe(t,e){const r=[],n=pi(t);let i=n.next();for(;i!==null;){let a=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=n.next()}let c=s();if(r.push({matcher:c,priority:a}),i!==",")break;i=n.next()}return r;function o(){if(i==="-"){i=n.next();const a=o();return c=>!!a&&!a(c)}if(i==="("){i=n.next();const a=l();return i===")"&&(i=n.next()),a}if(nr(i)){const a=[];do a.push(i),i=n.next();while(nr(i));return c=>e(a,c)}return null}function s(){const a=[];let c=o();for(;c;)a.push(c),c=o();return p=>a.every(m=>m(p))}function l(){const a=[];let c=s();for(;c&&(a.push(c),i==="|"||i===",");){do i=n.next();while(i==="|"||i===",");c=s()}return p=>a.some(m=>m(p))}}function nr(t){return!!t&&!!t.match(/[\w\.:]+/)}function pi(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=e.exec(t);return{next:()=>{if(!r)return null;const n=r[0];return r=e.exec(t),n}}}function Jr(t){typeof t.dispose=="function"&&t.dispose()}var Ae=class{constructor(t){this.scopeName=t}scopeName;toKey(){return this.scopeName}},mi=class{constructor(t,e){this.scopeName=t,this.ruleName=e}scopeName;ruleName;toKey(){return`${this.scopeName}#${this.ruleName}`}},di=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},hi=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ae(this.initialScopeName)]}repo;initialScopeName;seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new di;for(const r of t)fi(r,this.initialScopeName,this.repo,e);for(const r of e.references)if(r instanceof Ae){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function fi(t,e,r,n){const i=r.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const o=r.lookup(e);t instanceof Ae?Me({baseGrammar:o,selfGrammar:i},n):It(t.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},n);const s=r.injections(t.scopeName);if(s)for(const l of s)n.add(new Ae(l))}function It(t,e,r){if(e.repository&&e.repository[t]){const n=e.repository[t];je([n],e,r)}}function Me(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&je(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&je(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function je(t,e,r){for(const n of t){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);const i=n.repository?jr({},e.repository,n.repository):e.repository;Array.isArray(n.patterns)&&je(n.patterns,{...e,repository:i},r);const o=n.include;if(!o)continue;const s=Kr(o);switch(s.kind){case 0:Me({...e,selfGrammar:e.baseGrammar},r);break;case 1:Me(e,r);break;case 2:It(s.ruleName,{...e,repository:i},r);break;case 3:case 4:const l=s.scopeName===e.selfGrammar.scopeName?e.selfGrammar:s.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(l){const a={baseGrammar:e.baseGrammar,selfGrammar:l,repository:i};s.kind===4?It(s.ruleName,a,r):Me(a,r)}else s.kind===4?r.add(new mi(s.scopeName,s.ruleName)):r.add(new Ae(s.scopeName));break}}}var gi=class{kind=0},_i=class{kind=1},yi=class{constructor(t){this.ruleName=t}ruleName;kind=2},Ei=class{constructor(t){this.scopeName=t}scopeName;kind=3},bi=class{constructor(t,e){this.scopeName=t,this.ruleName=e}scopeName;ruleName;kind=4};function Kr(t){if(t==="$base")return new gi;if(t==="$self")return new _i;const e=t.indexOf("#");if(e===-1)return new Ei(t);if(e===0)return new yi(t.substring(1));{const r=t.substring(0,e),n=t.substring(e+1);return new bi(r,n)}}var wi=/\\(\d+)/,ir=/\\(\d+)/g,Ai=-1,Zr=-2;var Se=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,r,n){this.$location=t,this.id=e,this._name=r||null,this._nameIsCapturing=Te.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=Te.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${Ur(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:Te.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Te.replaceCaptures(this._contentName,t,e)}},vi=class extends Se{retokenizeCapturedWithRuleId;constructor(t,e,r,n,i){super(t,e,r,n),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,r,n){throw new Error("Not supported!")}},Ci=class extends Se{_match;captures;_cachedCompiledPatterns;constructor(t,e,r,n,i){super(t,e,r,null),this._match=new ve(n,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ce,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},or=class extends Se{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,r,n,i){super(t,e,r,n),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const r of this.patterns)t.getRule(r).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ce,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Rt=class extends Se{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,r,n,i,o,s,l,a,c){super(t,e,r,n),this._begin=new ve(i,this.id),this.beginCaptures=o,this._end=new ve(s||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=a||!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(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t,e).compileAG(t,r,n)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ce;for(const r of this.patterns)t.getRule(r).collectPatterns(t,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,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Ue=class extends Se{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,r,n,i,o,s,l,a){super(t,e,r,n),this._begin=new ve(i,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new ve(s,Zr),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.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(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,r,n){return this._getCachedCompiledPatterns(t).compileAG(t,r,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ce;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,r,n){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,r,n)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Ce,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},Yr=class O{static createCaptureRule(e,r,n,i,o){return e.registerRule(s=>new vi(r,s,n,i,o))}static getCompiledRuleId(e,r,n){return e.id||r.registerRule(i=>{if(e.id=i,e.match)return new Ci(e.$vscodeTextmateLocation,e.id,e.name,e.match,O._compileCaptures(e.captures,r,n));if(typeof e.begin>"u"){e.repository&&(n=jr({},n,e.repository));let o=e.patterns;return typeof o>"u"&&e.include&&(o=[{include:e.include}]),new or(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,O._compilePatterns(o,r,n))}return e.while?new Ue(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,O._compileCaptures(e.beginCaptures||e.captures,r,n),e.while,O._compileCaptures(e.whileCaptures||e.captures,r,n),O._compilePatterns(e.patterns,r,n)):new Rt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,O._compileCaptures(e.beginCaptures||e.captures,r,n),e.end,O._compileCaptures(e.endCaptures||e.captures,r,n),e.applyEndPatternLast,O._compilePatterns(e.patterns,r,n))}),e.id}static _compileCaptures(e,r,n){let i=[];if(e){let o=0;for(const s in e){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);l>o&&(o=l)}for(let s=0;s<=o;s++)i[s]=null;for(const s in e){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);let a=0;e[s].patterns&&(a=O.getCompiledRuleId(e[s],r,n)),i[l]=O.createCaptureRule(r,e[s].$vscodeTextmateLocation,e[s].name,e[s].contentName,a)}}return i}static _compilePatterns(e,r,n){let i=[];if(e)for(let o=0,s=e.length;o<s;o++){const l=e[o];let a=-1;if(l.include){const c=Kr(l.include);switch(c.kind){case 0:case 1:a=O.getCompiledRuleId(n[l.include],r,n);break;case 2:let p=n[c.ruleName];p&&(a=O.getCompiledRuleId(p,r,n));break;case 3:case 4:const m=c.scopeName,d=c.kind===4?c.ruleName:null,h=r.getExternalGrammar(m,n);if(h)if(d){let f=h.repository[d];f&&(a=O.getCompiledRuleId(f,r,h.repository))}else a=O.getCompiledRuleId(h.repository.$self,r,h.repository);break}}else a=O.getCompiledRuleId(l,r,n);if(a!==-1){const c=r.getRule(a);let p=!1;if((c instanceof or||c instanceof Rt||c instanceof Ue)&&c.hasMissingPatterns&&c.patterns.length===0&&(p=!0),p)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}},ve=class en{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,r){if(e&&typeof e=="string"){const n=e.length;let i=0,o=[],s=!1;for(let l=0;l<n;l++)if(e.charAt(l)==="\\"&&l+1<n){const c=e.charAt(l+1);c==="z"?(o.push(e.substring(i,l)),o.push("$(?!\\n)(?<!\\n)"),i=l+2):(c==="A"||c==="G")&&(s=!0),l++}this.hasAnchor=s,i===0?this.source=e:(o.push(e.substring(i,n)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=wi.test(this.source):this.hasBackReferences=!1}clone(){return new en(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,r){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let n=r.map(i=>e.substring(i.start,i.end));return ir.lastIndex=0,this.source.replace(ir,(i,o)=>zr(n[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],r=[],n=[],i=[],o,s,l,a;for(o=0,s=this.source.length;o<s;o++)l=this.source.charAt(o),e[o]=l,r[o]=l,n[o]=l,i[o]=l,l==="\\"&&o+1<s&&(a=this.source.charAt(o+1),a==="A"?(e[o+1]="",r[o+1]="",n[o+1]="A",i[o+1]="A"):a==="G"?(e[o+1]="",r[o+1]="G",n[o+1]="",i[o+1]="G"):(e[o+1]=a,r[o+1]=a,n[o+1]=a,i[o+1]=a),o++);return{A0_G0:e.join(""),A0_G1:r.join(""),A1_G0:n.join(""),A1_G1:i.join("")}}resolveAnchors(e,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Ce=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(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(r=>r.source);this._cached=new sr(t,e,this._items.map(r=>r.ruleId))}return this._cached}compileAG(t,e,r){return this._hasAnchors?e?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,r)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,r){let n=this._items.map(i=>i.resolveAnchors(e,r));return new sr(t,n,this._items.map(i=>i.ruleId))}},sr=class{constructor(t,e,r){this.regExps=e,this.rules=r,this.scanner=t.createOnigScanner(e)}regExps;rules;scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,r=this.rules.length;e<r;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
2
|
+
`)}findNextMatchSync(t,e,r){const n=this.scanner.findNextMatchSync(t,e,r);return n?{ruleId:this.rules[n.index],captureIndices:n.captureIndices}:null}},ct=class{constructor(t,e){this.languageId=t,this.tokenType=e}languageId;tokenType},Ii=class St{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,r){this._defaultAttributes=new ct(e,8),this._embeddedLanguagesMatcher=new Ri(Object.entries(r||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?St._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new ct(0,0);_getBasicScopeAttributes=new qr(e=>{const r=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new ct(r,n)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const r=e.match(St.STANDARD_TOKEN_TYPE_REGEXP);if(!r)return 8;switch(r[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/},Ri=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([r,n])=>zr(r));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},ar=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}stack;stoppedEarly};function tn(t,e,r,n,i,o,s,l){const a=e.content.length;let c=!1,p=-1;if(s){const h=Si(t,e,r,n,i,o);i=h.stack,n=h.linePos,r=h.isFirstLine,p=h.anchorPosition}const m=Date.now();for(;!c;){if(l!==0&&Date.now()-m>l)return new ar(i,!0);d()}return new ar(i,!1);function d(){const h=Li(t,e,r,n,i,p);if(!h){o.produce(i,a),c=!0;return}const f=h.captureIndices,y=h.matchedRuleId,E=f&&f.length>0?f[0].end>n:!1;if(y===Ai){const g=i.getRule(t);o.produce(i,f[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ee(t,e,r,i,o,g.endCaptures,f),o.produce(i,f[0].end);const b=i;if(i=i.parent,p=b.getAnchorPos(),!E&&b.getEnterPos()===n){i=b,o.produce(i,a),c=!0;return}}else{const g=t.getRule(y);o.produce(i,f[0].start);const b=i,_=g.getName(e.content,f),w=i.contentNameScopesList.pushAttributed(_,t);if(i=i.push(y,n,p,f[0].end===a,null,w,w),g instanceof Rt){const v=g;Ee(t,e,r,i,o,v.beginCaptures,f),o.produce(i,f[0].end),p=f[0].end;const k=v.getContentName(e.content,f),N=w.pushAttributed(k,t);if(i=i.withContentNameScopesList(N),v.endHasBackReferences&&(i=i.withEndRule(v.getEndWithResolvedBackReferences(e.content,f))),!E&&b.hasSameRuleAs(i)){i=i.pop(),o.produce(i,a),c=!0;return}}else if(g instanceof Ue){const v=g;Ee(t,e,r,i,o,v.beginCaptures,f),o.produce(i,f[0].end),p=f[0].end;const k=v.getContentName(e.content,f),N=w.pushAttributed(k,t);if(i=i.withContentNameScopesList(N),v.whileHasBackReferences&&(i=i.withEndRule(v.getWhileWithResolvedBackReferences(e.content,f))),!E&&b.hasSameRuleAs(i)){i=i.pop(),o.produce(i,a),c=!0;return}}else if(Ee(t,e,r,i,o,g.captures,f),o.produce(i,f[0].end),i=i.pop(),!E){i=i.safePop(),o.produce(i,a),c=!0;return}}f[0].end>n&&(n=f[0].end,r=!1)}}function Si(t,e,r,n,i,o){let s=i.beginRuleCapturedEOL?0:-1;const l=[];for(let a=i;a;a=a.pop()){const c=a.getRule(t);c instanceof Ue&&l.push({rule:c,stack:a})}for(let a=l.pop();a;a=l.pop()){const{ruleScanner:c,findOptions:p}=Pi(a.rule,t,a.stack.endRule,r,n===s),m=c.findNextMatchSync(e,n,p);if(m){if(m.ruleId!==Zr){i=a.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(o.produce(a.stack,m.captureIndices[0].start),Ee(t,e,r,a.stack,o,a.rule.whileCaptures,m.captureIndices),o.produce(a.stack,m.captureIndices[0].end),s=m.captureIndices[0].end,m.captureIndices[0].end>n&&(n=m.captureIndices[0].end,r=!1))}else{i=a.stack.pop();break}}return{stack:i,linePos:n,anchorPosition:s,isFirstLine:r}}function Li(t,e,r,n,i,o){const s=ki(t,e,r,n,i,o),l=t.getInjections();if(l.length===0)return s;const a=Ti(l,t,e,r,n,i,o);if(!a)return s;if(!s)return a;const c=s.captureIndices[0].start,p=a.captureIndices[0].start;return p<c||a.priorityMatch&&p===c?a:s}function ki(t,e,r,n,i,o){const s=i.getRule(t),{ruleScanner:l,findOptions:a}=rn(s,t,i.endRule,r,n===o),c=l.findNextMatchSync(e,n,a);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Ti(t,e,r,n,i,o,s){let l=Number.MAX_VALUE,a=null,c,p=0;const m=o.contentNameScopesList.getScopeNames();for(let d=0,h=t.length;d<h;d++){const f=t[d];if(!f.matcher(m))continue;const y=e.getRule(f.ruleId),{ruleScanner:E,findOptions:g}=rn(y,e,null,n,i===s),b=E.findNextMatchSync(r,i,g);if(!b)continue;const _=b.captureIndices[0].start;if(!(_>=l)&&(l=_,a=b.captureIndices,c=b.ruleId,p=f.priority,l===i))break}return a?{priorityMatch:p===-1,captureIndices:a,matchedRuleId:c}:null}function rn(t,e,r,n,i){return{ruleScanner:t.compileAG(e,r,n,i),findOptions:0}}function Pi(t,e,r,n,i){return{ruleScanner:t.compileWhileAG(e,r,n,i),findOptions:0}}function Ee(t,e,r,n,i,o,s){if(o.length===0)return;const l=e.content,a=Math.min(o.length,s.length),c=[],p=s[0].end;for(let m=0;m<a;m++){const d=o[m];if(d===null)continue;const h=s[m];if(h.length===0)continue;if(h.start>p)break;for(;c.length>0&&c[c.length-1].endPos<=h.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,h.start):i.produce(n,h.start),d.retokenizeCapturedWithRuleId){const y=d.getName(l,s),E=n.contentNameScopesList.pushAttributed(y,t),g=d.getContentName(l,s),b=E.pushAttributed(g,t),_=n.push(d.retokenizeCapturedWithRuleId,h.start,-1,!1,null,E,b),w=t.createOnigString(l.substring(0,h.end));tn(t,w,r&&h.start===0,h.start,_,i,!1,0),Jr(w);continue}const f=d.getName(l,s);if(f!==null){const E=(c.length>0?c[c.length-1].scopes:n.contentNameScopesList).pushAttributed(f,t);c.push(new Oi(E,h.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Oi=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function xi(t,e,r,n,i,o,s,l){return new Di(t,e,r,n,i,o,s,l)}function lr(t,e,r,n,i){const o=Fe(e,We),s=Yr.getCompiledRuleId(r,n,i.repository);for(const l of o)t.push({debugSelector:e,matcher:l.matcher,ruleId:s,grammar:i,priority:l.priority})}function We(t,e){if(e.length<t.length)return!1;let r=0;return t.every(n=>{for(let i=r;i<e.length;i++)if(Ni(e[i],n))return r=i+1,!0;return!1})}function Ni(t,e){if(!t)return!1;if(t===e)return!0;const r=e.length;return t.length>r&&t.substr(0,r)===e&&t[r]==="."}var Di=class{constructor(t,e,r,n,i,o,s,l){if(this._rootScopeName=t,this.balancedBracketSelectors=o,this._onigLib=l,this._basicScopeAttributesProvider=new Ii(r,n),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=cr(e,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const a of Object.keys(i)){const c=Fe(a,We);for(const p of c)this._tokenTypeMatchers.push({matcher:p.matcher,type:i[a]})}}_rootScopeName;balancedBracketSelectors;_onigLib;_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},e=[],r=this._rootScopeName,n=t.lookup(r);if(n){const i=n.injections;if(i)for(let s in i)lr(e,s,i[s],this,n);const o=this._grammarRepository.injections(r);o&&o.forEach(s=>{const l=this.getExternalGrammar(s);if(l){const a=l.injectionSelector;a&&lr(e,a,l,this,l)}})}return e.sort((i,o)=>i.priority-o.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,r=t(e);return this._ruleId2desc[e]=r,r}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const r=this._grammarRepository.lookup(t);if(r)return this._includedGrammars[t]=cr(r,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,r=0){const n=this._tokenize(t,e,!1,r);return{tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}tokenizeLine2(t,e,r=0){const n=this._tokenize(t,e,!0,r);return{tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}_tokenize(t,e,r,n){this._rootId===-1&&(this._rootId=Yr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!e||e===Lt.NULL){i=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=de.set(0,c.languageId,c.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),d=this.getRule(this._rootId).getName(null,null);let h;d?h=be.createRootAndLookUpScopeName(d,m,this):h=be.createRoot("unknown",m),e=new Lt(null,this._rootId,-1,-1,!1,null,h,h)}else i=!1,e.reset();t=t+`
|
|
3
|
+
`;const o=this.createOnigString(t),s=o.content.length,l=new Vi(r,t,this._tokenTypeMatchers,this.balancedBracketSelectors),a=tn(this,o,i,0,e,l,!0,n);return Jr(o),{lineLength:s,lineTokens:l,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function cr(t,e){return t=ei(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var be=class F{constructor(e,r,n){this.parent=e,this.scopePath=r,this.tokenAttributes=n}parent;scopePath;tokenAttributes;static fromExtension(e,r){let n=e,i=e?.scopePath??null;for(const o of r)i=lt.push(i,o.scopeNames),n=new F(n,i,o.encodedTokenAttributes);return n}static createRoot(e,r){return new F(null,new lt(null,e),r)}static createRootAndLookUpScopeName(e,r,n){const i=n.getMetadataForScope(e),o=new lt(null,e),s=n.themeProvider.themeMatch(o),l=F.mergeAttributes(r,i,s);return new F(null,o,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return F.equals(this,e)}static equals(e,r){do{if(e===r||!e&&!r)return!0;if(!e||!r||e.scopeName!==r.scopeName||e.tokenAttributes!==r.tokenAttributes)return!1;e=e.parent,r=r.parent}while(!0)}static mergeAttributes(e,r,n){let i=-1,o=0,s=0;return n!==null&&(i=n.fontStyle,o=n.foregroundId,s=n.backgroundId),de.set(e,r.languageId,r.tokenType,null,i,o,s)}pushAttributed(e,r){if(e===null)return this;if(e.indexOf(" ")===-1)return F._pushAttributed(this,e,r);const n=e.split(/ /g);let i=this;for(const o of n)i=F._pushAttributed(i,o,r);return i}static _pushAttributed(e,r,n){const i=n.getMetadataForScope(r),o=e.scopePath.push(r),s=n.themeProvider.themeMatch(o),l=F.mergeAttributes(e.tokenAttributes,i,s);return new F(e,o,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const r=[];let n=this;for(;n&&n!==e;)r.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?r.reverse():void 0}},Lt=class Y{constructor(e,r,n,i,o,s,l,a){this.parent=e,this.ruleId=r,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=l,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=i}parent;ruleId;beginRuleCapturedEOL;endRule;nameScopesList;contentNameScopesList;_stackElementBrand=void 0;static NULL=new Y(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:Y._equals(this,e)}static _equals(e,r){return e===r?!0:this._structuralEquals(e,r)?be.equals(e.contentNameScopesList,r.contentNameScopesList):!1}static _structuralEquals(e,r){do{if(e===r||!e&&!r)return!0;if(!e||!r||e.depth!==r.depth||e.ruleId!==r.ruleId||e.endRule!==r.endRule)return!1;e=e.parent,r=r.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){Y._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,r,n,i,o,s,l){return new Y(this,e,r,n,i,o,s,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,r){return this.parent&&(r=this.parent._writeString(e,r)),e[r++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,r}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new Y(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let r=this;for(;r&&r._enterPos===e._enterPos;){if(r.ruleId===e.ruleId)return!0;r=r.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(e,r){const n=be.fromExtension(e?.nameScopesList??null,r.nameScopesList);return new Y(e,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,n,be.fromExtension(n,r.contentNameScopesList))}},$i=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(r=>r==="*"?(this.allowAny=!0,[]):Fe(r,We).map(n=>n.matcher)),this.unbalancedBracketScopes=e.flatMap(r=>Fe(r,We).map(n=>n.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},Vi=class{constructor(t,e,r,n){this.balancedBracketSelectors=n,this._emitBinaryTokens=t,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}balancedBracketSelectors;_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let n=t?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=t?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(o)&&(n=de.set(n,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(n=de.set(n,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=e;return}const r=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:r}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const r=new Uint32Array(this._binaryTokens.length);for(let n=0,i=this._binaryTokens.length;n<i;n++)r[n]=this._binaryTokens[n];return r}},Mi=class{constructor(t,e){this._onigLib=e,this._theme=t}_onigLib;_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,r,n,i){if(!this._grammars.has(t)){let o=this._rawGrammars.get(t);if(!o)return null;this._grammars.set(t,xi(t,o,e,r,n,i,this,this._onigLib))}return this._grammars.get(t)}},Gi=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Mi(Be.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,r){this._syncRegistry.setTheme(Be.createFromRawTheme(e,r))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,r,n){return this.loadGrammarWithConfiguration(e,r,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,r,n){return this._loadGrammar(e,r,n.embeddedLanguages,n.tokenTypes,new $i(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,r,n,i,o){const s=new hi(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(l=>this._loadSingleGrammar(l.scopeName)),s.processQueue();return this._grammarForScopeName(e,r,n,i,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const r=this._options.loadGrammar(e);if(r){const n=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(r,n)}}addGrammar(e,r=[],n=0,i=null){return this._syncRegistry.addGrammar(e,r),this._grammarForScopeName(e.scopeName,n,i)}_grammarForScopeName(e,r=0,n=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(e,r,n,i,o)}},kt=Lt.NULL;const Bi=/["&'<>`]/g,Fi=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ji=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ui=/[|\\{}()[\]^$+*?.]/g,ur=new WeakMap;function Wi(t,e){if(t=t.replace(e.subset?Hi(e.subset):Bi,n),e.subset||e.escapeOnly)return t;return t.replace(Fi,r).replace(ji,n);function r(i,o,s){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),e)}function n(i,o,s){return e.format(i.charCodeAt(0),s.charCodeAt(o+1),e)}}function Hi(t){let e=ur.get(t);return e||(e=zi(t),ur.set(t,e)),e}function zi(t){const e=[];let r=-1;for(;++r<t.length;)e.push(t[r].replace(Ui,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const qi=/[\dA-Fa-f]/;function Xi(t,e,r){const n="&#x"+t.toString(16).toUpperCase();return r&&e&&!qi.test(String.fromCharCode(e))?n:n+";"}const Qi=/\d/;function Ji(t,e,r){const n="&#"+String(t);return r&&e&&!Qi.test(String.fromCharCode(e))?n:n+";"}const Ki=["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"],ut={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Zi=["cent","copy","divide","gt","lt","not","para","times"],nn={}.hasOwnProperty,Tt={};let Pe;for(Pe in ut)nn.call(ut,Pe)&&(Tt[ut[Pe]]=Pe);const Yi=/[^\dA-Za-z]/;function eo(t,e,r,n){const i=String.fromCharCode(t);if(nn.call(Tt,i)){const o=Tt[i],s="&"+o;return r&&Ki.includes(o)&&!Zi.includes(o)&&(!n||e&&e!==61&&Yi.test(String.fromCharCode(e)))?s:s+";"}return""}function to(t,e,r){let n=Xi(t,e,r.omitOptionalSemicolons),i;if((r.useNamedReferences||r.useShortestReferences)&&(i=eo(t,e,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!i)&&r.useShortestReferences){const o=Ji(t,e,r.omitOptionalSemicolons);o.length<n.length&&(n=o)}return i&&(!r.useShortestReferences||i.length<n.length)?i:n}function me(t,e){return Wi(t,Object.assign({format:to},e))}const ro=/^>|^->|<!--|-->|--!>|<!-$/g,no=[">"],io=["<",">"];function oo(t,e,r,n){return n.settings.bogusComments?"<?"+me(t.value,Object.assign({},n.settings.characterReferences,{subset:no}))+">":"<!--"+t.value.replace(ro,i)+"-->";function i(o){return me(o,Object.assign({},n.settings.characterReferences,{subset:io}))}}function so(t,e,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}const L=sn(1),on=sn(-1),ao=[];function sn(t){return e;function e(r,n,i){const o=r?r.children:ao;let s=(n||0)+t,l=o[s];if(!i)for(;l&&Mt(l);)s+=t,l=o[s];return l}}const lo={}.hasOwnProperty;function an(t){return e;function e(r,n,i){return lo.call(t,r.tagName)&&t[r.tagName](r,n,i)}}const Ft=an({body:uo,caption:pt,colgroup:pt,dd:fo,dt:ho,head:pt,html:co,li:mo,optgroup:go,option:_o,p:po,rp:pr,rt:pr,tbody:Eo,td:mr,tfoot:bo,th:mr,thead:yo,tr:wo});function pt(t,e,r){const n=L(r,e,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&Mt(n.value.charAt(0)))}function co(t,e,r){const n=L(r,e);return!n||n.type!=="comment"}function uo(t,e,r){const n=L(r,e);return!n||n.type!=="comment"}function po(t,e,r){const n=L(r,e);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"||r.tagName.includes("-")))}function mo(t,e,r){const n=L(r,e);return!n||n.type==="element"&&n.tagName==="li"}function ho(t,e,r){const n=L(r,e);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function fo(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function pr(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function go(t,e,r){const n=L(r,e);return!n||n.type==="element"&&n.tagName==="optgroup"}function _o(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function yo(t,e,r){const n=L(r,e);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function Eo(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function bo(t,e,r){return!L(r,e)}function wo(t,e,r){const n=L(r,e);return!n||n.type==="element"&&n.tagName==="tr"}function mr(t,e,r){const n=L(r,e);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const Ao=an({body:Io,colgroup:Ro,head:Co,html:vo,tbody:So});function vo(t){const e=L(t,-1);return!e||e.type!=="comment"}function Co(t){const e=new Set;for(const n of t.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(e.has(n.tagName))return!1;e.add(n.tagName)}const r=t.children[0];return!r||r.type==="element"}function Io(t){const e=L(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Mt(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Ro(t,e,r){const n=on(r,e);if(r&&n&&n.type==="element"&&n.tagName==="colgroup"&&Ft(n,r.children.indexOf(n),r))return!1;const i=L(t,-1,!0);return!!(i&&i.type==="element"&&i.tagName==="col")}function So(t,e,r){const n=on(r,e);if(r&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&Ft(n,r.children.indexOf(n),r))return!1;const i=L(t,-1);return!!(i&&i.type==="element"&&i.tagName==="tr")}const Oe={name:[[`
|
|
4
4
|
\f\r &/=>`.split(""),`
|
|
5
5
|
\f\r "&'/=>\``.split("")],[`\0
|
|
6
6
|
\f\r "&'/<=>`.split(""),`\0
|
|
@@ -8,10 +8,10 @@ import{ly as Mt,lz as Br,lA as zn,lB as qn,lC as Xn,lD as tr,lE as Qn,lF as Jn,l
|
|
|
8
8
|
\f\r &>`.split(""),`\0
|
|
9
9
|
\f\r "&'<=>\``.split("")],[`\0
|
|
10
10
|
\f\r "&'<=>\``.split(""),`\0
|
|
11
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Lo(t,e,r,n){const i=n.schema,o=i.space==="svg"?!1:n.settings.omitOptionalTags;let s=i.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(t.tagName.toLowerCase());const l=[];let a;i.space==="html"&&t.tagName==="svg"&&(n.schema=Br);const u=ko(n,t.properties),p=n.all(i.space==="html"&&t.tagName==="template"?t.content:t);return n.schema=i,p&&(s=!1),(u||!o||!Ao(t,e,r))&&(l.push("<",t.tagName,u?" "+u:""),s&&(i.space==="svg"||n.settings.closeSelfClosing)&&(a=u.charAt(u.length-1),(!n.settings.tightSelfClosing||a==="/"||a&&a!=='"'&&a!=="'")&&l.push(" "),l.push("/")),l.push(">")),l.push(p),!s&&(!o||!Ft(t,e,r))&&l.push("</"+t.tagName+">"),l.join("")}function ko(t,e){const r=[];let n=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=To(t,i,e[i]);o&&r.push(o)}}for(;++n<r.length;){const o=t.settings.tightAttributes?r[n].charAt(r[n].length-1):void 0;n!==r.length-1&&o!=='"'&&o!=="'"&&(r[n]+=" ")}return r.join("")}function To(t,e,r){const n=zn(t.schema,e),i=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,o=t.settings.allowDangerousCharacters?0:1;let s=t.quote,l;if(n.overloadedBoolean&&(r===n.attribute||r==="")?r=!0:(n.boolean||n.overloadedBoolean)&&(typeof r!="string"||r===n.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const a=me(n.attribute,Object.assign({},t.settings.characterReferences,{subset:Oe.name[i][o]}));return r===!0||(r=Array.isArray(r)?(n.commaSeparated?qn:Xn)(r,{padLeft:!t.settings.tightCommaSeparatedLists}):String(r),t.settings.collapseEmptyAttributes&&!r)?a:(t.settings.preferUnquoted&&(l=me(r,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:Oe.unquoted[i][o]}))),l!==r&&(t.settings.quoteSmart&&tr(r,s)>tr(r,t.alternative)&&(s=t.alternative),l=s+me(r,Object.assign({},t.settings.characterReferences,{subset:(s==="'"?Oe.single:Oe.double)[i][o],attribute:!0}))+s),a+(l&&"="+l))}const Po=["<","&"];function an(t,e,r,n){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?t.value:me(t.value,Object.assign({},n.settings.characterReferences,{subset:Po}))}function Oo(t,e,r,n){return n.settings.allowDangerousHtml?t.value:an(t,e,r,n)}function xo(t,e,r,n){return n.all(t)}const No=Qn("type",{invalid:Do,unknown:$o,handlers:{comment:oo,doctype:so,element:Lo,raw:Oo,root:xo,text:an}});function Do(t){throw new Error("Expected node, not `"+t+"`")}function $o(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Vo={},Mo={},Go=[];function Bo(t,e){const r=e||Vo,n=r.quote||'"',i=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:Fo,all:jo,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||Kn,characterReferences:r.characterReferences||Mo,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?Br:Jn,quote:n,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Fo(t,e,r){return No(t,e,r,this)}function jo(t){const e=[],r=t&&t.children||Go;let n=-1;for(;++n<r.length;)e[n]=this.one(r[n],n,t);return e.join("")}function He(t,e){const r=typeof t=="string"?{}:{...t.colorReplacements},n=typeof t=="string"?t:t.name;for(const[i,o]of Object.entries(e?.colorReplacements||{}))typeof o=="string"?r[i]=o:i===n&&Object.assign(r,o);return r}function K(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function Uo(t){return Array.isArray(t)?t:[t]}async function ln(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function jt(t){return!t||["plaintext","txt","text","plain"].includes(t)}function un(t){return t==="ansi"||jt(t)}function Ut(t){return t==="none"}function cn(t){return Ut(t)}function pn(t,e){if(!e)return t;t.properties||={},t.properties.class||=[],typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const r=Array.isArray(e)?e:e.split(/\s+/g);for(const n of r)n&&!t.properties.class.includes(n)&&t.properties.class.push(n);return t}function Ke(t,e=!1){if(t.length===0)return[["",0]];const r=t.split(/(\r?\n)/g);let n=0;const i=[];for(let o=0;o<r.length;o+=2){const s=e?r[o]+(r[o+1]||""):r[o];i.push([s,n]),n+=r[o].length,n+=r[o+1]?.length||0}return i}function Wo(t){const e=Ke(t,!0).map(([i])=>i);function r(i){if(i===t.length)return{line:e.length-1,character:e[e.length-1].length};let o=i,s=0;for(const l of e){if(o<l.length)break;o-=l.length,s++}return{line:s,character:o}}function n(i,o){let s=0;for(let l=0;l<i;l++)s+=e[l].length;return s+=o,s}return{lines:e,indexToPos:r,posToIndex:n}}const Wt="light-dark()",Ho=["color","background-color"];function zo(t,e){let r=0;const n=[];for(const i of e)i>r&&n.push({...t,content:t.content.slice(r,i),offset:t.offset+r}),r=i;return r<t.content.length&&n.push({...t,content:t.content.slice(r),offset:t.offset+r}),n}function qo(t,e){const r=Array.from(e instanceof Set?e:new Set(e)).sort((n,i)=>n-i);return r.length?t.map(n=>n.flatMap(i=>{const o=r.filter(s=>i.offset<s&&s<i.offset+i.content.length).map(s=>s-i.offset).sort((s,l)=>s-l);return o.length?zo(i,o):i})):t}function Xo(t,e,r,n,i="css-vars"){const o={content:t.content,explanation:t.explanation,offset:t.offset},s=e.map(p=>ze(t.variants[p])),l=new Set(s.flatMap(p=>Object.keys(p))),a={},u=(p,m)=>{const d=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return r+e[p]+(m==="color"?"":d)};return s.forEach((p,m)=>{for(const d of l){const h=p[d]||"inherit";if(m===0&&n&&Ho.includes(d))if(n===Wt&&s.length>1){const f=e.findIndex(b=>b==="light"),y=e.findIndex(b=>b==="dark");if(f===-1||y===-1)throw new I('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const E=s[f][d]||"inherit",g=s[y][d]||"inherit";a[d]=`light-dark(${E}, ${g})`,i==="css-vars"&&(a[u(m,d)]=h)}else a[d]=h;else i==="css-vars"&&(a[u(m,d)]=h)}}),o.htmlStyle=a,o}function ze(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&x.Italic&&(e["font-style"]="italic"),t.fontStyle&x.Bold&&(e["font-weight"]="bold");const r=[];t.fontStyle&x.Underline&&r.push("underline"),t.fontStyle&x.Strikethrough&&r.push("line-through"),r.length&&(e["text-decoration"]=r.join(" "))}return e}function Pt(t){return typeof t=="string"?t:Object.entries(t).map(([e,r])=>`${e}:${r}`).join(";")}const mn=new WeakMap;function Ze(t,e){mn.set(t,e)}function Ie(t){return mn.get(t)}class he{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,r){return new he(Object.fromEntries(Uo(r).map(n=>[n,kt])),e)}constructor(...e){if(e.length===2){const[r,n]=e;this.lang=n,this._stacks=r}else{const[r,n,i]=e;this.lang=n,this._stacks={[i]:r}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Qo(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Qo(t){const e=[],r=new Set;function n(i){if(r.has(i))return;r.add(i);const o=i?.nameScopesList?.scopeName;o&&e.push(o),i.parent&&n(i.parent)}return n(t),e}function Jo(t,e){if(!(t instanceof he))throw new I("Invalid grammar state");return t.getInternalStack(e)}function Ko(){const t=new WeakMap;function e(r){if(!t.has(r.meta)){let n=function(s){if(typeof s=="number"){if(s<0||s>r.source.length)throw new I(`Invalid decoration offset: ${s}. Code length: ${r.source.length}`);return{...i.indexToPos(s),offset:s}}else{const l=i.lines[s.line];if(l===void 0)throw new I(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${i.lines.length}`);let a=s.character;if(a<0&&(a=l.length+a),a<0||a>l.length)throw new I(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${l.length}`);return{...s,character:a,offset:i.posToIndex(s.line,a)}}};const i=Wo(r.source),o=(r.options.decorations||[]).map(s=>({...s,start:n(s.start),end:n(s.end)}));Zo(o),t.set(r.meta,{decorations:o,converter:i,source:r.source})}return t.get(r.meta)}return{name:"shiki:decorations",tokens(r){if(!this.options.decorations?.length)return;const i=e(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return qo(r,i)},code(r){if(!this.options.decorations?.length)return;const n=e(this),i=Array.from(r.children).filter(p=>p.type==="element"&&p.tagName==="span");if(i.length!==n.converter.lines.length)throw new I(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function o(p,m,d,h){const f=i[p];let y="",E=-1,g=-1;if(m===0&&(E=0),d===0&&(g=0),d===Number.POSITIVE_INFINITY&&(g=f.children.length),E===-1||g===-1)for(let _=0;_<f.children.length;_++)y+=dn(f.children[_]),E===-1&&y.length===m&&(E=_+1),g===-1&&y.length===d&&(g=_+1);if(E===-1)throw new I(`Failed to find start index for decoration ${JSON.stringify(h.start)}`);if(g===-1)throw new I(`Failed to find end index for decoration ${JSON.stringify(h.end)}`);const b=f.children.slice(E,g);if(!h.alwaysWrap&&b.length===f.children.length)l(f,h,"line");else if(!h.alwaysWrap&&b.length===1&&b[0].type==="element")l(b[0],h,"token");else{const _={type:"element",tagName:"span",properties:{},children:b};l(_,h,"wrapper"),f.children.splice(E,b.length,_)}}function s(p,m){i[p]=l(i[p],m,"line")}function l(p,m,d){const h=m.properties||{},f=m.transform||(y=>y);return p.tagName=m.tagName||"span",p.properties={...p.properties,...h,class:p.properties.class},m.properties?.class&&pn(p,m.properties.class),p=f(p,d)||p,p}const a=[],u=n.decorations.sort((p,m)=>m.start.offset-p.start.offset||p.end.offset-m.end.offset);for(const p of u){const{start:m,end:d}=p;if(m.line===d.line)o(m.line,m.character,d.character,p);else if(m.line<d.line){o(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let h=m.line+1;h<d.line;h++)a.unshift(()=>s(h,p));o(d.line,0,d.character,p)}}a.forEach(p=>p())}}}function Zo(t){for(let e=0;e<t.length;e++){const r=t[e];if(r.start.offset>r.end.offset)throw new I(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let n=e+1;n<t.length;n++){const i=t[n],o=r.start.offset<=i.start.offset&&i.start.offset<r.end.offset,s=r.start.offset<i.end.offset&&i.end.offset<=r.end.offset,l=i.start.offset<=r.start.offset&&r.start.offset<i.end.offset,a=i.start.offset<r.end.offset&&r.end.offset<=i.end.offset;if(o||s||l||a){if(o&&s||l&&a||l&&r.start.offset===r.end.offset||s&&i.start.offset===i.end.offset)continue;throw new I(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function dn(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(dn).join(""):""}const Yo=[Ko()];function qe(t){const e=es(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...Yo]}function es(t){const e=[],r=[],n=[];for(const i of t)switch(i.enforce){case"pre":e.push(i);break;case"post":r.push(i);break;default:n.push(i)}return{pre:e,post:r,normal:n}}var te=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],mt={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function ts(t,e){const r=t.indexOf("\x1B",e);if(r!==-1&&t[r+1]==="["){const n=t.indexOf("m",r);if(n!==-1)return{sequence:t.substring(r+2,n).split(";"),startPosition:r,position:n+1}}return{position:t.length}}function dr(t){const e=t.shift();if(e==="2"){const r=t.splice(0,3).map(n=>Number.parseInt(n));return r.length!==3||r.some(n=>Number.isNaN(n))?void 0:{type:"rgb",rgb:r}}else if(e==="5"){const r=t.shift();if(r)return{type:"table",index:Number(r)}}}function rs(t){const e=[];for(;t.length>0;){const r=t.shift();if(!r)continue;const n=Number.parseInt(r);if(!Number.isNaN(n))if(n===0)e.push({type:"resetAll"});else if(n<=9)mt[n]&&e.push({type:"setDecoration",value:mt[n]});else if(n<=29){const i=mt[n-20];i&&(e.push({type:"resetDecoration",value:i}),i==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(n<=37)e.push({type:"setForegroundColor",value:{type:"named",name:te[n-30]}});else if(n===38){const i=dr(t);i&&e.push({type:"setForegroundColor",value:i})}else if(n===39)e.push({type:"resetForegroundColor"});else if(n<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:te[n-40]}});else if(n===48){const i=dr(t);i&&e.push({type:"setBackgroundColor",value:i})}else n===49?e.push({type:"resetBackgroundColor"}):n===53?e.push({type:"setDecoration",value:"overline"}):n===55?e.push({type:"resetDecoration",value:"overline"}):n>=90&&n<=97?e.push({type:"setForegroundColor",value:{type:"named",name:te[n-90+8]}}):n>=100&&n<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:te[n-100+8]}})}return e}function ns(){let t=null,e=null,r=new Set;return{parse(n){const i=[];let o=0;do{const s=ts(n,o),l=s.sequence?n.substring(o,s.startPosition):n.substring(o);if(l.length>0&&i.push({value:l,foreground:t,background:e,decorations:new Set(r)}),s.sequence){const a=rs(s.sequence);for(const u of a)u.type==="resetAll"?(t=null,e=null,r.clear()):u.type==="resetForegroundColor"?t=null:u.type==="resetBackgroundColor"?e=null:u.type==="resetDecoration"&&r.delete(u.value);for(const u of a)u.type==="setForegroundColor"?t=u.value:u.type==="setBackgroundColor"?e=u.value:u.type==="setDecoration"&&r.add(u.value)}o=s.position}while(o<n.length);return i}}}var is={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function os(t=is){function e(l){return t[l]}function r(l){return`#${l.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let n;function i(){if(n)return n;n=[];for(let u=0;u<te.length;u++)n.push(e(te[u]));let l=[0,95,135,175,215,255];for(let u=0;u<6;u++)for(let p=0;p<6;p++)for(let m=0;m<6;m++)n.push(r([l[u],l[p],l[m]]));let a=8;for(let u=0;u<24;u++,a+=10)n.push(r([a,a,a]));return n}function o(l){return i()[l]}function s(l){switch(l.type){case"named":return e(l.name);case"rgb":return r(l.rgb);case"table":return o(l.index)}}return{value:s}}const ss={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function as(t,e,r){const n=He(t,r),i=Ke(e),o=Object.fromEntries(te.map(a=>{const u=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`,p=t.colors?.[u];return[a,p||ss[a]]})),s=os(o),l=ns();return i.map(a=>l.parse(a[0]).map(u=>{let p,m;u.decorations.has("reverse")?(p=u.background?s.value(u.background):t.bg,m=u.foreground?s.value(u.foreground):t.fg):(p=u.foreground?s.value(u.foreground):t.fg,m=u.background?s.value(u.background):void 0),p=K(p,n),m=K(m,n),u.decorations.has("dim")&&(p=ls(p));let d=x.None;return u.decorations.has("bold")&&(d|=x.Bold),u.decorations.has("italic")&&(d|=x.Italic),u.decorations.has("underline")&&(d|=x.Underline),u.decorations.has("strikethrough")&&(d|=x.Strikethrough),{content:u.value,offset:a[1],color:p,bgColor:m,fontStyle:d}}))}function ls(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const n=e[1];if(n.length===8){const i=Math.round(Number.parseInt(n.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${n.slice(0,6)}${i}`}else{if(n.length===6)return`#${n}80`;if(n.length===4){const i=n[0],o=n[1],s=n[2],l=n[3],a=Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${o}${o}${s}${s}${a}`}else if(n.length===3){const i=n[0],o=n[1],s=n[2];return`#${i}${i}${o}${o}${s}${s}80`}}}const r=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return r?`var(${r[1]}-dim)`:t}function Ht(t,e,r={}){const{theme:n=t.getLoadedThemes()[0]}=r,i=t.resolveLangAlias(r.lang||"text");if(jt(i)||Ut(n))return Ke(e).map(a=>[{content:a[0],offset:a[1]}]);const{theme:o,colorMap:s}=t.setTheme(n);if(i==="ansi")return as(o,e,r);const l=t.getLanguage(r.lang||"text");if(r.grammarState){if(r.grammarState.lang!==l.name)throw new I(`Grammar state language "${r.grammarState.lang}" does not match highlight language "${l.name}"`);if(!r.grammarState.themes.includes(o.name))throw new I(`Grammar state themes "${r.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return cs(e,l,o,s,r)}function us(...t){if(t.length===2)return Ie(t[1]);const[e,r,n={}]=t,{lang:i="text",theme:o=e.getLoadedThemes()[0]}=n;if(jt(i)||Ut(o))throw new I("Plain language does not have grammar state");if(i==="ansi")throw new I("ANSI language does not have grammar state");const{theme:s,colorMap:l}=e.setTheme(o),a=e.getLanguage(i);return new he(zt(r,a,s,l,n).stateStack,a.name,s.name)}function cs(t,e,r,n,i){const o=zt(t,e,r,n,i),s=new he(o.stateStack,e.name,r.name);return Ze(o.tokens,s),o.tokens}function zt(t,e,r,n,i){const o=He(r,i),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:l=500}=i,a=Ke(t);let u=i.grammarState?Jo(i.grammarState,r.name)??kt:i.grammarContextCode!=null?zt(i.grammarContextCode,e,r,n,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:kt,p=[];const m=[];for(let d=0,h=a.length;d<h;d++){const[f,y]=a[d];if(f===""){p=[],m.push([]);continue}if(s>0&&f.length>=s){p=[],m.push([{content:f,offset:y,color:"",fontStyle:0}]);continue}let E,g,b;i.includeExplanation&&(E=e.tokenizeLine(f,u,l),g=E.tokens,b=0);const _=e.tokenizeLine2(f,u,l),w=_.tokens.length/2;for(let v=0;v<w;v++){const k=_.tokens[2*v],N=v+1<w?_.tokens[2*v+2]:f.length;if(k===N)continue;const U=_.tokens[2*v+1],ke=K(n[de.getForeground(U)],o),ot=de.getFontStyle(U),_e={content:f.substring(k,N),offset:y+k,color:ke,fontStyle:ot};if(i.includeExplanation){const X=[];if(i.includeExplanation!=="scopeName")for(const W of r.settings){let ie;switch(typeof W.scope){case"string":ie=W.scope.split(/,/).map(st=>st.trim());break;case"object":ie=W.scope;break;default:continue}X.push({settings:W,selectors:ie.map(st=>st.split(/ /))})}_e.explanation=[];let er=0;for(;k+er<N;){const W=g[b],ie=f.substring(W.startIndex,W.endIndex);er+=ie.length,_e.explanation.push({content:ie,scopes:i.includeExplanation==="scopeName"?ps(W.scopes):ms(X,W.scopes)}),b+=1}}p.push(_e)}m.push(p),p=[],u=_.ruleStack}return{tokens:m,stateStack:u}}function ps(t){return t.map(e=>({scopeName:e}))}function ms(t,e){const r=[];for(let n=0,i=e.length;n<i;n++){const o=e[n];r[n]={scopeName:o,themeMatches:hs(t,o,e.slice(0,n))}}return r}function hr(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function ds(t,e,r){if(!hr(t[t.length-1],e))return!1;let n=t.length-2,i=r.length-1;for(;n>=0&&i>=0;)hr(t[n],r[i])&&(n-=1),i-=1;return n===-1}function hs(t,e,r){const n=[];for(const{selectors:i,settings:o}of t)for(const s of i)if(ds(s,e,r)){n.push(o);break}return n}function hn(t,e,r){const n=Object.entries(r.themes).filter(a=>a[1]).map(a=>({color:a[0],theme:a[1]})),i=n.map(a=>{const u=Ht(t,e,{...r,theme:a.theme}),p=Ie(u),m=typeof a.theme=="string"?a.theme:a.theme.name;return{tokens:u,state:p,theme:m}}),o=fs(...i.map(a=>a.tokens)),s=o[0].map((a,u)=>a.map((p,m)=>{const d={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in r&&r.includeExplanation&&(d.explanation=p.explanation),o.forEach((h,f)=>{const{content:y,explanation:E,offset:g,...b}=h[u][m];d.variants[n[f].color]=b}),d})),l=i[0].state?new he(Object.fromEntries(i.map(a=>[a.theme,a.state?.getInternalStack(a.theme)])),i[0].state.lang):void 0;return l&&Ze(s,l),s}function fs(...t){const e=t.map(()=>[]),r=t.length;for(let n=0;n<t[0].length;n++){const i=t.map(a=>a[n]),o=e.map(()=>[]);e.forEach((a,u)=>a.push(o[u]));const s=i.map(()=>0),l=i.map(a=>a[0]);for(;l.every(a=>a);){const a=Math.min(...l.map(u=>u.content.length));for(let u=0;u<r;u++){const p=l[u];p.content.length===a?(o[u].push(p),s[u]+=1,l[u]=i[u][s[u]]):(o[u].push({...p,content:p.content.slice(0,a)}),l[u]={...p,content:p.content.slice(a),offset:p.offset+a})}}}return e}function Xe(t,e,r){let n,i,o,s,l,a;if("themes"in r){const{defaultColor:u="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=r,d=Object.entries(r.themes).filter(g=>g[1]).map(g=>({color:g[0],theme:g[1]})).sort((g,b)=>g.color===u?-1:b.color===u?1:0);if(d.length===0)throw new I("`themes` option must not be empty");const h=hn(t,e,r);if(a=Ie(h),u&&Wt!==u&&!d.find(g=>g.color===u))throw new I(`\`themes\` option must contain the defaultColor key \`${u}\``);const f=d.map(g=>t.getTheme(g.theme)),y=d.map(g=>g.color);o=h.map(g=>g.map(b=>Xo(b,y,p,u,m))),a&&Ze(o,a);const E=d.map(g=>He(g.theme,r));i=fr(d,f,E,p,u,"fg",m),n=fr(d,f,E,p,u,"bg",m),s=`shiki-themes ${f.map(g=>g.name).join(" ")}`,l=u?void 0:[i,n].join(";")}else if("theme"in r){const u=He(r.theme,r);o=Ht(t,e,r);const p=t.getTheme(r.theme);n=K(p.bg,u),i=K(p.fg,u),s=p.name,a=Ie(o)}else throw new I("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:i,bg:n,themeName:s,rootStyle:l,grammarState:a}}function fr(t,e,r,n,i,o,s){return t.map((l,a)=>{const u=K(e[a][o],r[a])||"inherit",p=`${n+l.color}${o==="bg"?"-bg":""}:${u}`;if(a===0&&i){if(i===Wt&&t.length>1){const m=t.findIndex(y=>y.color==="light"),d=t.findIndex(y=>y.color==="dark");if(m===-1||d===-1)throw new I('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const h=K(e[m][o],r[m])||"inherit",f=K(e[d][o],r[d])||"inherit";return`light-dark(${h}, ${f});${p}`}return u}return s==="css-vars"?p:null}).filter(l=>!!l).join(";")}function Qe(t,e,r,n={meta:{},options:r,codeToHast:(i,o)=>Qe(t,i,o),codeToTokens:(i,o)=>Xe(t,i,o)}){let i=e;for(const f of qe(r))i=f.preprocess?.call(n,i,r)||i;let{tokens:o,fg:s,bg:l,themeName:a,rootStyle:u,grammarState:p}=Xe(t,i,r);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:d=!1}=r;m===!0?o=_s(o):m==="never"&&(o=ys(o)),d&&(o=Es(o));const h={...n,get source(){return i}};for(const f of qe(r))o=f.tokens?.call(h,o)||o;return gs(o,{...r,fg:s,bg:l,themeName:a,rootStyle:r.rootStyle===!1?!1:r.rootStyle??u},h,p)}function gs(t,e,r,n=Ie(t)){const i=qe(e),o=[],s={type:"root",children:[]},{structure:l="classic",tabindex:a="0"}=e,u={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?u.style=e.rootStyle:u.style=`background-color:${e.bg};color:${e.fg}`),a!==!1&&a!=null&&(u.tabindex=a.toString());for(const[y,E]of Object.entries(e.meta||{}))y.startsWith("_")||(u[y]=E);let p={type:"element",tagName:"pre",properties:u,children:[],data:e.data},m={type:"element",tagName:"code",properties:{},children:o};const d=[],h={...r,structure:l,addClassToHast:pn,get source(){return r.source},get tokens(){return t},get options(){return e},get root(){return s},get pre(){return p},get code(){return m},get lines(){return d}};if(t.forEach((y,E)=>{E&&(l==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&o.push({type:"text",value:`
|
|
12
|
-
`}));let g={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const _ of y){let w={type:"element",tagName:"span",properties:{..._.htmlAttrs},children:[{type:"text",value:_.content}]};const v=Pt(_.htmlStyle||ze(_));v&&(w.properties.style=v);for(const k of i)w=k?.span?.call(h,w,E+1,b,g,_)||w;l==="inline"?s.children.push(w):l==="classic"&&g.children.push(w),b+=_.content.length}if(l==="classic"){for(const _ of i)g=_?.line?.call(h,g,E+1)||g;d.push(g),o.push(g)}else l==="inline"&&d.push(g)}),l==="classic"){for(const y of i)m=y?.code?.call(h,m)||m;p.children.push(m);for(const y of i)p=y?.pre?.call(h,p)||p;s.children.push(p)}else if(l==="inline"){const y=[];let E={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const _ of s.children)_.type==="element"&&_.tagName==="br"?(y.push(E),E={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(_.type==="element"||_.type==="text")&&E.children.push(_);y.push(E);let b={type:"element",tagName:"code",properties:{},children:y};for(const _ of i)b=_?.code?.call(h,b)||b;s.children=[];for(let _=0;_<b.children.length;_++){_>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const w=b.children[_];w.type==="element"&&s.children.push(...w.children)}}let f=s;for(const y of i)f=y?.root?.call(h,f)||f;return n&&Ze(f,n),f}function _s(t){return t.map(e=>{const r=[];let n="",i;return e.forEach((o,s)=>{const a=!(o.fontStyle&&(o.fontStyle&x.Underline||o.fontStyle&x.Strikethrough));a&&o.content.match(/^\s+$/)&&e[s+1]?(i===void 0&&(i=o.offset),n+=o.content):n?(a?r.push({...o,offset:i,content:n+o.content}):r.push({content:n,offset:i},o),i=void 0,n=""):r.push(o)}),r})}function ys(t){return t.map(e=>e.flatMap(r=>{if(r.content.match(/^\s+$/))return r;const n=r.content.match(/^(\s*)(.*?)(\s*)$/);if(!n)return r;const[,i,o,s]=n;if(!i&&!s)return r;const l=[{...r,offset:r.offset+i.length,content:o}];return i&&l.unshift({content:i,offset:r.offset}),s&&l.push({content:s,offset:r.offset+i.length+o.length}),l}))}function Es(t){return t.map(e=>{const r=[];for(const n of e){if(r.length===0){r.push({...n});continue}const i=r[r.length-1],o=Pt(i.htmlStyle||ze(i)),s=Pt(n.htmlStyle||ze(n)),l=i.fontStyle&&(i.fontStyle&x.Underline||i.fontStyle&x.Strikethrough),a=n.fontStyle&&(n.fontStyle&x.Underline||n.fontStyle&x.Strikethrough);!l&&!a&&o===s?i.content+=n.content:r.push({...n})}return r})}const bs=Bo;function ws(t,e,r){const n={meta:{},options:r,codeToHast:(o,s)=>Qe(t,o,s),codeToTokens:(o,s)=>Xe(t,o,s)};let i=bs(Qe(t,e,r,n));for(const o of qe(r))i=o.postprocess?.call(n,i,r)||i;return i}const gr={light:"#333333",dark:"#bbbbbb"},_r={light:"#fffffe",dark:"#1e1e1e"},yr="__shiki_resolved";function qt(t){if(t?.[yr])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||="dark",e.colorReplacements={...e.colorReplacements},e.settings||=[];let{bg:r,fg:n}=e;if(!r||!n){const l=e.settings?e.settings.find(a=>!a.name&&!a.scope):void 0;l?.settings?.foreground&&(n=l.settings.foreground),l?.settings?.background&&(r=l.settings.background),!n&&e?.colors?.["editor.foreground"]&&(n=e.colors["editor.foreground"]),!r&&e?.colors?.["editor.background"]&&(r=e.colors["editor.background"]),n||(n=e.type==="light"?gr.light:gr.dark),r||(r=e.type==="light"?_r.light:_r.dark),e.fg=n,e.bg=r}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let i=0;const o=new Map;function s(l){if(o.has(l))return o.get(l);i+=1;const a=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${a}`]?s(l):(o.set(l,a),a)}e.settings=e.settings.map(l=>{const a=l.settings?.foreground&&!l.settings.foreground.startsWith("#"),u=l.settings?.background&&!l.settings.background.startsWith("#");if(!a&&!u)return l;const p={...l,settings:{...l.settings}};if(a){const m=s(l.settings.foreground);e.colorReplacements[m]=l.settings.foreground,p.settings.foreground=m}if(u){const m=s(l.settings.background);e.colorReplacements[m]=l.settings.background,p.settings.background=m}return p});for(const l of Object.keys(e.colors||{}))if((l==="editor.foreground"||l==="editor.background"||l.startsWith("terminal.ansi"))&&!e.colors[l]?.startsWith("#")){const a=s(e.colors[l]);e.colorReplacements[a]=e.colors[l],e.colors[l]=a}return Object.defineProperty(e,yr,{enumerable:!1,writable:!1,value:!0}),e}async function fn(t){return Array.from(new Set((await Promise.all(t.filter(e=>!un(e)).map(async e=>await ln(e).then(r=>Array.isArray(r)?r:[r])))).flat()))}async function gn(t){return(await Promise.all(t.map(async r=>cn(r)?null:qt(await ln(r))))).filter(r=>!!r)}let As=3;function vs(t,e=3){e>As||console.trace(`[SHIKI DEPRECATE]: ${t}`)}let pe=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function _n(t,e){if(!e)return t;if(e[t]){const r=new Set([t]);for(;e[t];){if(t=e[t],r.has(t))throw new pe(`Circular alias \`${Array.from(r).join(" -> ")} -> ${t}\``);r.add(t)}}return t}class Cs extends Gi{constructor(e,r,n,i={}){super(e),this._resolver=e,this._themes=r,this._langs=n,this._alias=i,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const r=qt(e);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let r=this._textmateThemeCache.get(e);r||(r=Be.createFromRawTheme(e),this._textmateThemeCache.set(e,r)),this._syncRegistry.setTheme(r)}getGrammar(e){return e=_n(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const r=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(o=>{this._alias[o]=e.name}),this._loadedLanguagesCache=null,r.size)for(const o of r)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(const i of e)this.resolveEmbeddedLanguages(i);const r=Array.from(this._langGraph.entries()),n=r.filter(([i,o])=>!o);if(n.length){const i=r.filter(([o,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(a=>n.map(([u])=>u).includes(a)):!1).filter(o=>!n.includes(o));throw new pe(`Missing languages ${n.map(([o])=>`\`${o}\``).join(", ")}, required by ${i.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[i,o]of r)this._resolver.addLanguage(o);for(const[i,o]of r)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);const r=e.embeddedLanguages??e.embeddedLangs;if(r)for(const n of r)this._langGraph.set(n,this._langMap.get(n))}}class Is{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,r){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},r.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(r=>{this._langs.set(r,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(r=>{this._injections.get(r)||this._injections.set(r,[]),this._injections.get(r).push(e.scopeName)})}getInjections(e){const r=e.split(".");let n=[];for(let i=1;i<=r.length;i++){const o=r.slice(0,i).join(".");n=[...n,...this._injections.get(o)||[]]}return n}}let ye=0;function Rs(t){ye+=1,t.warnings!==!1&&ye>=10&&ye%10===0&&console.warn(`[Shiki] ${ye} 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 e=!1;if(!t.engine)throw new pe("`engine` option is required for synchronous mode");const r=(t.langs||[]).flat(1),n=(t.themes||[]).flat(1).map(qt),i=new Is(t.engine,r),o=new Cs(i,n,r,t.langAlias);let s;function l(_){return _n(_,t.langAlias)}function a(_){g();const w=o.getGrammar(typeof _=="string"?_:_.name);if(!w)throw new pe(`Language \`${_}\` not found, you may need to load it first`);return w}function u(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};g();const w=o.getTheme(_);if(!w)throw new pe(`Theme \`${_}\` not found, you may need to load it first`);return w}function p(_){g();const w=u(_);s!==_&&(o.setTheme(w),s=_);const v=o.getColorMap();return{theme:w,colorMap:v}}function m(){return g(),o.getLoadedThemes()}function d(){return g(),o.getLoadedLanguages()}function h(..._){g(),o.loadLanguages(_.flat(1))}async function f(..._){return h(await fn(_))}function y(..._){g();for(const w of _.flat(1))o.loadTheme(w)}async function E(..._){return g(),y(await gn(_))}function g(){if(e)throw new pe("Shiki instance has been disposed")}function b(){e||(e=!0,o.dispose(),ye-=1)}return{setTheme:p,getTheme:u,getLanguage:a,getLoadedThemes:m,getLoadedLanguages:d,resolveLangAlias:l,loadLanguage:f,loadLanguageSync:h,loadTheme:E,loadThemeSync:y,dispose:b,[Symbol.dispose]:b}}async function Ss(t){t.engine||vs("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,r,n]=await Promise.all([gn(t.themes||[]),fn(t.langs||[]),t.engine]);return Rs({...t,themes:e,langs:r,engine:n})}async function Ls(t){const e=await Ss(t);return{getLastGrammarState:(...r)=>us(e,...r),codeToTokensBase:(r,n)=>Ht(e,r,n),codeToTokensWithThemes:(r,n)=>hn(e,r,n),codeToTokens:(r,n)=>Xe(e,r,n),codeToHast:(r,n)=>Qe(e,r,n),codeToHtml:(r,n)=>ws(e,r,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function ks(t){const e=t.langs,r=t.themes,n=t.engine;async function i(o){function s(m){if(typeof m=="string"){if(m=o.langAlias?.[m]||m,un(m))return[];const d=e[m];if(!d)throw new I(`Language \`${m}\` is not included in this bundle. You may want to load it from external source.`);return d}return m}function l(m){if(cn(m))return"none";if(typeof m=="string"){const d=r[m];if(!d)throw new I(`Theme \`${m}\` is not included in this bundle. You may want to load it from external source.`);return d}return m}const a=(o.themes??[]).map(m=>l(m)),u=(o.langs??[]).map(m=>s(m)),p=await Ls({engine:o.engine??n(),...o,themes:a,langs:u});return{...p,loadLanguage(...m){return p.loadLanguage(...m.map(s))},loadTheme(...m){return p.loadTheme(...m.map(l))},getBundledLanguages(){return e},getBundledThemes(){return r}}}return i}const yn=[{id:"abap",name:"ABAP",import:(()=>c(()=>import("./abap-BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",import:(()=>c(()=>import("./actionscript-3-CoDkCxhg.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>c(()=>import("./ada-bCR0ucgS.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>c(()=>import("./angular-html-CU67Zn6k.js").then(t=>t.f),[],import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>c(()=>import("./angular-ts-BwZT4LLn.js"),[],import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>c(()=>import("./apache-Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>c(()=>import("./apex-D8_7TLub.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>c(()=>import("./apl-dKokRX4l.js"),[],import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>c(()=>import("./applescript-Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>c(()=>import("./ara-BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>c(()=>import("./asciidoc-Ve4PFQV2.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>c(()=>import("./asm-D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>c(()=>import("./astro-CbQHKStN.js"),[],import.meta.url))},{id:"awk",name:"AWK",import:(()=>c(()=>import("./awk-DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>c(()=>import("./ballerina-BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>c(()=>import("./bat-BkioyH1T.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>c(()=>import("./beancount-k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>c(()=>import("./berry-uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>c(()=>import("./bibtex-CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>c(()=>import("./bicep-Bmn6On1c.js"),[],import.meta.url))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>c(()=>import("./bird2-DPOp833l.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>c(()=>import("./blade-D4QpJJKB.js"),[],import.meta.url))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>c(()=>import("./bsl-BO_Y6i37.js"),[],import.meta.url))},{id:"c",name:"C",import:(()=>c(()=>import("./c-BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>c(()=>import("./c3-eo99z4R2.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>c(()=>import("./cadence-Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>c(()=>import("./cairo-KRGpt6FW.js"),[],import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>c(()=>import("./clarity-D53aC0YG.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>c(()=>import("./clojure-P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>c(()=>import("./cmake-D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>c(()=>import("./cobol-nwyudZeR.js"),[],import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>c(()=>import("./codeowners-Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>c(()=>import("./codeql-DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>c(()=>import("./coffee-Ch7k5sss.js"),[],import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>c(()=>import("./common-lisp-Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Coq",import:(()=>c(()=>import("./coq-DkFqJrB1.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>c(()=>import("./cpp-CofmeUqb.js"),[],import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>c(()=>import("./crystal-tKQVLTB8.js"),[],import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>c(()=>import("./csharp-COcwbKMJ.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>c(()=>import("./css-DPfMkruS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>c(()=>import("./csv-fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>c(()=>import("./cue-D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>c(()=>import("./cypher-COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>c(()=>import("./d-85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>c(()=>import("./dart-CF10PKvl.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>c(()=>import("./dax-CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>c(()=>import("./desktop-BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>c(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>c(()=>import("./docker-BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>c(()=>import("./dotenv-Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>c(()=>import("./dream-maker-BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>c(()=>import("./edge-BkV0erSs.js"),[],import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>c(()=>import("./elixir-CDX3lj18.js"),[],import.meta.url))},{id:"elm",name:"Elm",import:(()=>c(()=>import("./elm-DbKCFpqz.js"),[],import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>c(()=>import("./emacs-lisp-C9XAeP06.js"),[],import.meta.url))},{id:"erb",name:"ERB",import:(()=>c(()=>import("./erb-B12qg9BL.js"),[],import.meta.url))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>c(()=>import("./erlang-DsQrWhSR.js"),[],import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>c(()=>import("./fennel-BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>c(()=>import("./fish-BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>c(()=>import("./fluent-C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>c(()=>import("./fortran-fixed-form-CkoXwp7k.js"),[],import.meta.url))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>c(()=>import("./fortran-free-form-BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>c(()=>import("./fsharp-CXgrBDvD.js"),[],import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>c(()=>import("./gdresource-BOOCDP_w.js"),[],import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>c(()=>import("./gdscript-C5YyOfLZ.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>c(()=>import("./gdshader-DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>c(()=>import("./genie-D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>c(()=>import("./gherkin-DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>c(()=>import("./git-commit-F4YmCXRG.js"),[],import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>c(()=>import("./git-rebase-r7XF79zn.js"),[],import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>c(()=>import("./gleam-BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>c(()=>import("./glimmer-js-Rg0-pVw9.js"),[],import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>c(()=>import("./glimmer-ts-U6CK756n.js"),[],import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>c(()=>import("./glsl-DplSGwfg.js"),[],import.meta.url))},{id:"gn",name:"GN",import:(()=>c(()=>import("./gn-n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>c(()=>import("./gnuplot-DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>c(()=>import("./go-CxLEBnE3.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>c(()=>import("./graphql-ChdNCCLP.js"),[],import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>c(()=>import("./groovy-gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>c(()=>import("./hack-CaT9iCJl.js"),[],import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>c(()=>import("./haml-B8DHNrY2.js"),[],import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>c(()=>import("./handlebars-BL8al0AC.js"),[],import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>c(()=>import("./haskell-Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>c(()=>import("./haxe-CzTSHFRz.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>c(()=>import("./hcl-BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>c(()=>import("./hjson-D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>c(()=>import("./hlsl-D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>c(()=>import("./html-GMplVEZG.js"),[],import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>c(()=>import("./html-derivative-BFtXZ54Q.js"),[],import.meta.url))},{id:"http",name:"HTTP",import:(()=>c(()=>import("./http-jrhK8wxY.js"),[],import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>c(()=>import("./hurl-irOxFIW8.js"),[],import.meta.url))},{id:"hxml",name:"HXML",import:(()=>c(()=>import("./hxml-Bvhsp5Yf.js"),[],import.meta.url))},{id:"hy",name:"Hy",import:(()=>c(()=>import("./hy-DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>c(()=>import("./imba-DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>c(()=>import("./ini-BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>c(()=>import("./java-CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>c(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>c(()=>import("./jinja-4LBKfQ-Z.js"),[],import.meta.url))},{id:"jison",name:"Jison",import:(()=>c(()=>import("./jison-wvAkD_A8.js"),[],import.meta.url))},{id:"json",name:"JSON",import:(()=>c(()=>import("./json-Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>c(()=>import("./json5-C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>c(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>c(()=>import("./jsonl-DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>c(()=>import("./jsonnet-DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>c(()=>import("./jssm-C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>c(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>c(()=>import("./julia-CxzCAyBv.js"),[],import.meta.url))},{id:"just",name:"Just",import:(()=>c(()=>import("./just-Cw27pwNe.js"),[],import.meta.url))},{id:"kdl",name:"KDL",import:(()=>c(()=>import("./kdl-DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>c(()=>import("./kotlin-BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>c(()=>import("./kusto-DZf3V79B.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>c(()=>import("./latex-CWtU0Tv5.js"),[],import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>c(()=>import("./lean-BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>c(()=>import("./less-B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>c(()=>import("./liquid-DYVedYrR.js"),[],import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>c(()=>import("./llvm-DjAJT7YJ.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>c(()=>import("./log-2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>c(()=>import("./logo-BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>c(()=>import("./lua-BaeVxFsk.js"),[],import.meta.url))},{id:"luau",name:"Luau",import:(()=>c(()=>import("./luau-C-HG3fhB.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>c(()=>import("./make-CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>c(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>c(()=>import("./marko-CnJfTvn9.js"),[],import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>c(()=>import("./matlab-D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>c(()=>import("./mdc-BMNejdWA.js"),[],import.meta.url))},{id:"mdx",name:"MDX",import:(()=>c(()=>import("./mdx-Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>c(()=>import("./mermaid-mWjccvbQ.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>c(()=>import("./mipsasm-CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>c(()=>import("./mojo-rZm6bMo-.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>c(()=>import("./moonbit-_H4v1dQx.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>c(()=>import("./move-IF9eRakj.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>c(()=>import("./narrat-DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>c(()=>import("./nextflow-Zz6hmt5N.js"),[],import.meta.url))},{id:"nextflow-groovy",name:"nextflow-groovy",import:(()=>c(()=>import("./nextflow-groovy-BeH2EWoN.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>c(()=>import("./nginx-BpAMiNFr.js"),[],import.meta.url))},{id:"nim",name:"Nim",import:(()=>c(()=>import("./nim-CVrawwO9.js"),[],import.meta.url))},{id:"nix",name:"Nix",import:(()=>c(()=>import("./nix-CwoSXNpI.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>c(()=>import("./nushell-Cz2AlsmD.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>c(()=>import("./objective-c-DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>c(()=>import("./objective-cpp-CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>c(()=>import("./ocaml-C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>c(()=>import("./odin-BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>c(()=>import("./openscad-C4EeE6gA.js"),[],import.meta.url))},{id:"pascal",name:"Pascal",import:(()=>c(()=>import("./pascal-D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>c(()=>import("./perl-C0TMdlhV.js"),[],import.meta.url))},{id:"php",name:"PHP",import:(()=>c(()=>import("./php-Dhbhpdrm.js"),[],import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>c(()=>import("./pkl-u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>c(()=>import("./plsql-ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>c(()=>import("./po-BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>c(()=>import("./polar-C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>c(()=>import("./postcss-CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>c(()=>import("./powerquery-CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>c(()=>import("./powershell-Dpen1YoG.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>c(()=>import("./prisma-Dd19v3D-.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>c(()=>import("./prolog-CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>c(()=>import("./proto-C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>c(()=>import("./pug-CGlum2m_.js"),[],import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>c(()=>import("./puppet-BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>c(()=>import("./purescript-CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>c(()=>import("./python-B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>c(()=>import("./qml-3beO22l8.js"),[],import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>c(()=>import("./qmldir-C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>c(()=>import("./qss-IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>c(()=>import("./r-Dspwwk_N.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>c(()=>import("./racket-BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>c(()=>import("./raku-DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>c(()=>import("./razor-Uh8Bk_45.js"),[],import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>c(()=>import("./reg-C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>c(()=>import("./regexp-CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>c(()=>import("./rel-C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>c(()=>import("./riscv-BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>c(()=>import("./ron-D8l8udqQ.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>c(()=>import("./rosmsg-BJDFO7_C.js"),[],import.meta.url))},{id:"rst",name:"reStructuredText",import:(()=>c(()=>import("./rst-BrH8l1NY.js"),[],import.meta.url))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>c(()=>import("./ruby-Dw2BHqvy.js"),[],import.meta.url))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>c(()=>import("./rust-B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>c(()=>import("./sas-cz2c8ADy.js"),[],import.meta.url))},{id:"sass",name:"Sass",import:(()=>c(()=>import("./sass-Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>c(()=>import("./scala-C151Ov-r.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>c(()=>import("./scheme-C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>c(()=>import("./scss-OYdSNvt2.js"),[],import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>c(()=>import("./sdbl-DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>c(()=>import("./shaderlab-Dg9Lc6iA.js"),[],import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>c(()=>import("./shellscript-Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>c(()=>import("./shellsession-BADoaaVG.js"),[],import.meta.url))},{id:"smalltalk",name:"Smalltalk",import:(()=>c(()=>import("./smalltalk-BERRCDM3.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>c(()=>import("./solidity-rGO070M0.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>c(()=>import("./soy-Brmx7dQM.js"),[],import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>c(()=>import("./sparql-rVzFXLq3.js"),[],import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>c(()=>import("./splunk-BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>c(()=>import("./sql-BLtJtn59.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>c(()=>import("./ssh-config-_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>c(()=>import("./stata-BH5u7GGu.js"),[],import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>c(()=>import("./stylus-BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>c(()=>import("./surrealql-Bq5Q-fJD.js"),[],import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>c(()=>import("./svelte-C_ipcX3V.js"),[],import.meta.url))},{id:"swift",name:"Swift",import:(()=>c(()=>import("./swift-D82vCrfD.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>c(()=>import("./system-verilog-CnnmHF94.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>c(()=>import("./systemd-4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>c(()=>import("./talonscript-CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>c(()=>import("./tasl-QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>c(()=>import("./tcl-dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>c(()=>import("./templ-P3uqSqPl.js"),[],import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>c(()=>import("./terraform-BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>c(()=>import("./tex-idrVyKtj.js"),[],import.meta.url))},{id:"toml",name:"TOML",import:(()=>c(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>c(()=>import("./ts-tags-zn1MmPIZ.js"),[],import.meta.url))},{id:"tsv",name:"TSV",import:(()=>c(()=>import("./tsv-B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>c(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>c(()=>import("./turtle-BsS91CYL.js"),[],import.meta.url))},{id:"twig",name:"Twig",import:(()=>c(()=>import("./twig-DNn4PbVi.js"),[],import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>c(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>c(()=>import("./typespec-BGHnOYBU.js"),[],import.meta.url))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>c(()=>import("./typst-DHCkPAjA.js"),[],import.meta.url))},{id:"v",name:"V",import:(()=>c(()=>import("./v-BcVCzyr7.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>c(()=>import("./vala-CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>c(()=>import("./vb-D17OF-Vu.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>c(()=>import("./verilog-BQ8w6xss.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>c(()=>import("./vhdl-CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>c(()=>import("./viml-CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>c(()=>import("./vue-DN_0RTcg.js"),[],import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>c(()=>import("./vue-html-AaS7Mt5G.js"),[],import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>c(()=>import("./vue-vine-CQOfvN7w.js"),[],import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>c(()=>import("./vyper-CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>c(()=>import("./wasm-MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>c(()=>import("./wenyan-BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>c(()=>import("./wgsl-Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>c(()=>import("./wikitext-BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>c(()=>import("./wit-5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>c(()=>import("./wolfram-lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>c(()=>import("./xml-sdJ4AIDG.js"),[],import.meta.url))},{id:"xsl",name:"XSL",import:(()=>c(()=>import("./xsl-CtQFsRM5.js"),[],import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>c(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>c(()=>import("./zenscript-DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>c(()=>import("./zig-VOosw3JB.js"),[],import.meta.url))}],Ts=Object.fromEntries(yn.map(t=>[t.id,t.import])),Ps=Object.fromEntries(yn.flatMap(t=>t.aliases?.map(e=>[e,t.import])||[])),En={...Ts,...Ps},Os=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>c(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>c(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>c(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>c(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>c(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>c(()=>import("./catppuccin-frappe-DFWUc33u.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>c(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>c(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>c(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>c(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>c(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>c(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>c(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>c(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>c(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>c(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>c(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>c(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>c(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>c(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>c(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>c(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>c(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>c(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>c(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>c(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url))},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:(()=>c(()=>import("./horizon-bright-Cn-bp-IR.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>c(()=>import("./houston-DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>c(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>c(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>c(()=>import("./kanagawa-wave-DWedfzmr.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>c(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>c(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>c(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>c(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>c(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>c(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>c(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>c(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>c(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>c(()=>import("./monokai-D4h5O-jR.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>c(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>c(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>c(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>c(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>c(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>c(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>c(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>c(()=>import("./red-bN70gL4F.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>c(()=>import("./rose-pine-qdsjHGoJ.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>c(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>c(()=>import("./rose-pine-moon-D4_iv3hh.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>c(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>c(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>c(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>c(()=>import("./solarized-dark-DXbdFlpD.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>c(()=>import("./solarized-light-L9t79GZl.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>c(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>c(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>c(()=>import("./vesper-DU1UobuO.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>c(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>c(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>c(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url))}],xs=Object.fromEntries(Os.map(t=>[t.id,t.import]));class Xt extends Error{constructor(e){super(e),this.name="ShikiError"}}function Ns(){return 2147483648}function Ds(){return typeof performance<"u"?performance.now():Date.now()}const $s=(t,e)=>t+(e-t%e)%e;async function Vs(t){let e,r;const n={};function i(h){r=h,n.HEAPU8=new Uint8Array(h),n.HEAPU32=new Uint32Array(h)}function o(h,f,y){n.HEAPU8.copyWithin(h,f,f+y)}function s(h){try{return e.grow(h-r.byteLength+65535>>>16),i(e.buffer),1}catch{}}function l(h){const f=n.HEAPU8.length;h=h>>>0;const y=Ns();if(h>y)return!1;for(let E=1;E<=4;E*=2){let g=f*(1+.2/E);g=Math.min(g,h+100663296);const b=Math.min(y,$s(Math.max(h,g),65536));if(s(b))return!0}return!1}const a=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,f,y=1024){const E=f+y;let g=f;for(;h[g]&&!(g>=E);)++g;if(g-f>16&&h.buffer&&a)return a.decode(h.subarray(f,g));let b="";for(;f<g;){let _=h[f++];if(!(_&128)){b+=String.fromCharCode(_);continue}const w=h[f++]&63;if((_&224)===192){b+=String.fromCharCode((_&31)<<6|w);continue}const v=h[f++]&63;if((_&240)===224?_=(_&15)<<12|w<<6|v:_=(_&7)<<18|w<<12|v<<6|h[f++]&63,_<65536)b+=String.fromCharCode(_);else{const k=_-65536;b+=String.fromCharCode(55296|k>>10,56320|k&1023)}}return b}function p(h,f){return h?u(n.HEAPU8,h,f):""}const m={emscripten_get_now:Ds,emscripten_memcpy_big:o,emscripten_resize_heap:l,fd_write:()=>0};async function d(){const f=await t({env:m,wasi_snapshot_preview1:m});e=f.memory,i(e.buffer),Object.assign(n,f),n.UTF8ToString=p}return await d(),n}var Ms=Object.defineProperty,Gs=(t,e,r)=>e in t?Ms(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,R=(t,e,r)=>Gs(t,typeof e!="symbol"?e+"":e,r);let T=null;function Bs(t){throw new Xt(t.UTF8ToString(t.getLastOnigError()))}class Ye{constructor(e){R(this,"utf16Length"),R(this,"utf8Length"),R(this,"utf16Value"),R(this,"utf8Value"),R(this,"utf16OffsetToUtf8"),R(this,"utf8OffsetToUtf16");const r=e.length,n=Ye._utf8ByteLength(e),i=n!==r,o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const s=i?new Uint32Array(n+1):null;i&&(s[n]=r);const l=new Uint8Array(n);let a=0;for(let u=0;u<r;u++){const p=e.charCodeAt(u);let m=p,d=!1;if(p>=55296&&p<=56319&&u+1<r){const h=e.charCodeAt(u+1);h>=56320&&h<=57343&&(m=(p-55296<<10)+65536|h-56320,d=!0)}i&&(o[u]=a,d&&(o[u+1]=a),m<=127?s[a+0]=u:m<=2047?(s[a+0]=u,s[a+1]=u):m<=65535?(s[a+0]=u,s[a+1]=u,s[a+2]=u):(s[a+0]=u,s[a+1]=u,s[a+2]=u,s[a+3]=u)),m<=127?l[a++]=m:m<=2047?(l[a++]=192|(m&1984)>>>6,l[a++]=128|(m&63)>>>0):m<=65535?(l[a++]=224|(m&61440)>>>12,l[a++]=128|(m&4032)>>>6,l[a++]=128|(m&63)>>>0):(l[a++]=240|(m&1835008)>>>18,l[a++]=128|(m&258048)>>>12,l[a++]=128|(m&4032)>>>6,l[a++]=128|(m&63)>>>0),d&&u++}this.utf16Length=r,this.utf8Length=n,this.utf16Value=e,this.utf8Value=l,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(e){let r=0;for(let n=0,i=e.length;n<i;n++){const o=e.charCodeAt(n);let s=o,l=!1;if(o>=55296&&o<=56319&&n+1<i){const a=e.charCodeAt(n+1);a>=56320&&a<=57343&&(s=(o-55296<<10)+65536|a-56320,l=!0)}s<=127?r+=1:s<=2047?r+=2:s<=65535?r+=3:r+=4,l&&n++}return r}createString(e){const r=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,r),r}}const et=class j{constructor(e){if(R(this,"id",++j.LAST_ID),R(this,"_onigBinding"),R(this,"content"),R(this,"utf16Length"),R(this,"utf8Length"),R(this,"utf16OffsetToUtf8"),R(this,"utf8OffsetToUtf16"),R(this,"ptr"),!T)throw new Xt("Must invoke loadWasm first.");this._onigBinding=T,this.content=e;const r=new Ye(e);this.utf16Length=r.utf16Length,this.utf8Length=r.utf8Length,this.utf16OffsetToUtf8=r.utf16OffsetToUtf8,this.utf8OffsetToUtf16=r.utf8OffsetToUtf16,this.utf8Length<1e4&&!j._sharedPtrInUse?(j._sharedPtr||(j._sharedPtr=T.omalloc(1e4)),j._sharedPtrInUse=!0,T.HEAPU8.set(r.utf8Value,j._sharedPtr),this.ptr=j._sharedPtr):this.ptr=r.createString(T)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===j._sharedPtr?j._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};R(et,"LAST_ID",0);R(et,"_sharedPtr",0);R(et,"_sharedPtrInUse",!1);let bn=et;class Fs{constructor(e){if(R(this,"_onigBinding"),R(this,"_ptr"),!T)throw new Xt("Must invoke loadWasm first.");const r=[],n=[];for(let l=0,a=e.length;l<a;l++){const u=new Ye(e[l]);r[l]=u.createString(T),n[l]=u.utf8Length}const i=T.omalloc(4*e.length);T.HEAPU32.set(r,i/4);const o=T.omalloc(4*e.length);T.HEAPU32.set(n,o/4);const s=T.createOnigScanner(i,o,e.length);for(let l=0,a=e.length;l<a;l++)T.ofree(r[l]);T.ofree(o),T.ofree(i),s===0&&Bs(T),this._onigBinding=T,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,r,n){let i=0;if(typeof n=="number"&&(i=n),typeof e=="string"){e=new bn(e);const o=this._findNextMatchSync(e,r,!1,i);return e.dispose(),o}return this._findNextMatchSync(e,r,!1,i)}_findNextMatchSync(e,r,n,i){const o=this._onigBinding,s=o.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(r),i);if(s===0)return null;const l=o.HEAPU32;let a=s/4;const u=l[a++],p=l[a++],m=[];for(let d=0;d<p;d++){const h=e.convertUtf8OffsetToUtf16(l[a++]),f=e.convertUtf8OffsetToUtf16(l[a++]);m[d]={start:h,end:f,length:f-h}}return{index:u,captureIndices:m}}}function js(t){return typeof t.instantiator=="function"}function Us(t){return typeof t.default=="function"}function Ws(t){return typeof t.data<"u"}function Hs(t){return typeof Response<"u"&&t instanceof Response}function zs(t){return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&Buffer.isBuffer?.(t)||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}let xe;function qs(t){if(xe)return xe;async function e(){T=await Vs(async r=>{let n=t;return n=await n,typeof n=="function"&&(n=await n(r)),typeof n=="function"&&(n=await n(r)),js(n)?n=await n.instantiator(r):Us(n)?n=await n.default(r):(Ws(n)&&(n=n.data),Hs(n)?typeof WebAssembly.instantiateStreaming=="function"?n=await Xs(n)(r):n=await Qs(n)(r):zs(n)?n=await dt(n)(r):n instanceof WebAssembly.Module?n=await dt(n)(r):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await dt(n.default)(r))),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}return xe=e(),xe}function dt(t){return e=>WebAssembly.instantiate(t,e)}function Xs(t){return e=>WebAssembly.instantiateStreaming(t,e)}function Qs(t){return async e=>{const r=await t.arrayBuffer();return WebAssembly.instantiate(r,e)}}async function Js(t){return t&&await qs(t),{createScanner(e){return new Fs(e.map(r=>typeof r=="string"?r:r.source))},createString(e){return new bn(e)}}}const Ks=ks({langs:En,themes:xs,engine:()=>Js(c(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url))});function fe(t){if([...t].length!==1)throw new Error(`Expected "${t}" to be a single code point`);return t.codePointAt(0)}function Zs(t,e,r){return t.has(e)||t.set(e,r),t.get(e)}const Qt=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),P=String.raw;function ge(t,e){if(t==null)throw new Error(e??"Value expected");return t}const wn=P`\[\^?`,An=`c.? | C(?:-.?)?|${P`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${P`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${P`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${P`o\{[^\}]*\}?`}|${P`\d{1,3}`}`,Jt=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Ne=new RegExp(P`
|
|
11
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]},Lo=new Set(["desc","foreignObject","title"]);function ko(t,e,r,n){const{schema:i}=n,o=i.space==="svg"?!1:n.settings.omitOptionalTags;let s=i.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(t.tagName.toLowerCase());const l=[];i.space==="html"&&t.tagName==="svg"&&(n.schema=Br);const a=To(n,t.properties);n.schema.space==="svg"&&Lo.has(t.tagName)&&(n.schema=Fr);const c=n.all(i.space==="html"&&t.tagName==="template"?t.content:t);if(n.schema=i,c&&(s=!1),a||!o||!Ao(t,e,r)){if(l.push("<",t.tagName,a?" "+a:""),s&&(i.space==="svg"||n.settings.closeSelfClosing)){const p=a.charAt(a.length-1);(!n.settings.tightSelfClosing||p==="/"||p&&p!=='"'&&p!=="'")&&l.push(" "),l.push("/")}l.push(">")}return l.push(c),!s&&(!o||!Ft(t,e,r))&&l.push("</"+t.tagName+">"),l.join("")}function To(t,e){const r=[];let n=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=Po(t,i,e[i]);o&&r.push(o)}}for(;++n<r.length;){const o=t.settings.tightAttributes?r[n].charAt(r[n].length-1):void 0;n!==r.length-1&&o!=='"'&&o!=="'"&&(r[n]+=" ")}return r.join("")}function Po(t,e,r){const n=qn(t.schema,e),i=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,o=t.settings.allowDangerousCharacters?0:1;if(n.overloadedBoolean&&(r===n.attribute||r==="")?r=!0:(n.boolean||n.overloadedBoolean)&&(typeof r!="string"||r===n.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const s=me(n.attribute,Object.assign({},t.settings.characterReferences,{subset:Oe.name[i][o]}));if(r===!0||(r=Array.isArray(r)?(n.commaSeparated?Xn:Qn)(r,{padLeft:!t.settings.tightCommaSeparatedLists}):String(r),t.settings.collapseEmptyAttributes&&!r))return s;let l;if(t.settings.preferUnquoted&&(l=me(r,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:Oe.unquoted[i][o]}))),l!==r){let{quote:a}=t;t.settings.quoteSmart&&tr(r,a)>tr(r,t.alternative)&&(a=t.alternative),l=a+me(r,Object.assign({},t.settings.characterReferences,{subset:(a==="'"?Oe.single:Oe.double)[i][o],attribute:!0}))+a}return s+(l&&"="+l)}const Oo=["<","&"];function ln(t,e,r,n){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?t.value:me(t.value,Object.assign({},n.settings.characterReferences,{subset:Oo}))}function xo(t,e,r,n){return n.settings.allowDangerousHtml?t.value:ln(t,e,r,n)}function No(t,e,r,n){return n.all(t)}const Do=Jn("type",{invalid:$o,unknown:Vo,handlers:{comment:oo,doctype:so,element:ko,raw:xo,root:No,text:ln}});function $o(t){throw new Error("Expected node, not `"+t+"`")}function Vo(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Mo={},Go={},Bo=[];function Fo(t,e){const r=e||Mo,n=r.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");const i=n==='"'?"'":'"';return{one:jo,all:Uo,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||Kn,characterReferences:r.characterReferences||Go,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?Br:Fr,quote:n,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function jo(t,e,r){return Do(t,e,r,this)}function Uo(t){const e=[],r=t&&t.children||Bo;let n=-1;for(;++n<r.length;)e[n]=this.one(r[n],n,t);return e.join("")}function He(t,e){const r=typeof t=="string"?{}:{...t.colorReplacements},n=typeof t=="string"?t:t.name;for(const[i,o]of Object.entries(e?.colorReplacements||{}))typeof o=="string"?r[i]=o:i===n&&Object.assign(r,o);return r}function K(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function Wo(t){return Array.isArray(t)?t:[t]}async function cn(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function jt(t){return!t||["plaintext","txt","text","plain"].includes(t)}function un(t){return t==="ansi"||jt(t)}function Ut(t){return t==="none"}function pn(t){return Ut(t)}function mn(t,e){if(!e)return t;t.properties||={},t.properties.class||=[],typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const r=Array.isArray(e)?e:e.split(/\s+/g);for(const n of r)n&&!t.properties.class.includes(n)&&t.properties.class.push(n);return t}function Ke(t,e=!1){if(t.length===0)return[["",0]];const r=t.split(/(\r?\n)/g);let n=0;const i=[];for(let o=0;o<r.length;o+=2){const s=e?r[o]+(r[o+1]||""):r[o];i.push([s,n]),n+=r[o].length,n+=r[o+1]?.length||0}return i}function Ho(t){const e=Ke(t,!0).map(([i])=>i);function r(i){if(i===t.length)return{line:e.length-1,character:e[e.length-1].length};let o=i,s=0;for(const l of e){if(o<l.length)break;o-=l.length,s++}return{line:s,character:o}}function n(i,o){let s=0;for(let l=0;l<i;l++)s+=e[l].length;return s+=o,s}return{lines:e,indexToPos:r,posToIndex:n}}const Wt="light-dark()",zo=["color","background-color"];function qo(t,e){let r=0;const n=[];for(const i of e)i>r&&n.push({...t,content:t.content.slice(r,i),offset:t.offset+r}),r=i;return r<t.content.length&&n.push({...t,content:t.content.slice(r),offset:t.offset+r}),n}function Xo(t,e){const r=Array.from(e instanceof Set?e:new Set(e)).sort((n,i)=>n-i);return r.length?t.map(n=>n.flatMap(i=>{const o=r.filter(s=>i.offset<s&&s<i.offset+i.content.length).map(s=>s-i.offset).sort((s,l)=>s-l);return o.length?qo(i,o):i})):t}function Qo(t,e,r,n,i="css-vars"){const o={content:t.content,explanation:t.explanation,offset:t.offset},s=e.map(p=>ze(t.variants[p])),l=new Set(s.flatMap(p=>Object.keys(p))),a={},c=(p,m)=>{const d=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return r+e[p]+(m==="color"?"":d)};return s.forEach((p,m)=>{for(const d of l){const h=p[d]||"inherit";if(m===0&&n&&zo.includes(d))if(n===Wt&&s.length>1){const f=e.findIndex(b=>b==="light"),y=e.findIndex(b=>b==="dark");if(f===-1||y===-1)throw new I('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const E=s[f][d]||"inherit",g=s[y][d]||"inherit";a[d]=`light-dark(${E}, ${g})`,i==="css-vars"&&(a[c(m,d)]=h)}else a[d]=h;else i==="css-vars"&&(a[c(m,d)]=h)}}),o.htmlStyle=a,o}function ze(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&x.Italic&&(e["font-style"]="italic"),t.fontStyle&x.Bold&&(e["font-weight"]="bold");const r=[];t.fontStyle&x.Underline&&r.push("underline"),t.fontStyle&x.Strikethrough&&r.push("line-through"),r.length&&(e["text-decoration"]=r.join(" "))}return e}function Pt(t){return typeof t=="string"?t:Object.entries(t).map(([e,r])=>`${e}:${r}`).join(";")}const dn=new WeakMap;function Ze(t,e){dn.set(t,e)}function Ie(t){return dn.get(t)}class he{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,r){return new he(Object.fromEntries(Wo(r).map(n=>[n,kt])),e)}constructor(...e){if(e.length===2){const[r,n]=e;this.lang=n,this._stacks=r}else{const[r,n,i]=e;this.lang=n,this._stacks={[i]:r}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Jo(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Jo(t){const e=[],r=new Set;function n(i){if(r.has(i))return;r.add(i);const o=i?.nameScopesList?.scopeName;o&&e.push(o),i.parent&&n(i.parent)}return n(t),e}function Ko(t,e){if(!(t instanceof he))throw new I("Invalid grammar state");return t.getInternalStack(e)}function Zo(){const t=new WeakMap;function e(r){if(!t.has(r.meta)){let n=function(s){if(typeof s=="number"){if(s<0||s>r.source.length)throw new I(`Invalid decoration offset: ${s}. Code length: ${r.source.length}`);return{...i.indexToPos(s),offset:s}}else{const l=i.lines[s.line];if(l===void 0)throw new I(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${i.lines.length}`);let a=s.character;if(a<0&&(a=l.length+a),a<0||a>l.length)throw new I(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${l.length}`);return{...s,character:a,offset:i.posToIndex(s.line,a)}}};const i=Ho(r.source),o=(r.options.decorations||[]).map(s=>({...s,start:n(s.start),end:n(s.end)}));Yo(o),t.set(r.meta,{decorations:o,converter:i,source:r.source})}return t.get(r.meta)}return{name:"shiki:decorations",tokens(r){if(!this.options.decorations?.length)return;const i=e(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return Xo(r,i)},code(r){if(!this.options.decorations?.length)return;const n=e(this),i=Array.from(r.children).filter(p=>p.type==="element"&&p.tagName==="span");if(i.length!==n.converter.lines.length)throw new I(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function o(p,m,d,h){const f=i[p];let y="",E=-1,g=-1;if(m===0&&(E=0),d===0&&(g=0),d===Number.POSITIVE_INFINITY&&(g=f.children.length),E===-1||g===-1)for(let _=0;_<f.children.length;_++)y+=hn(f.children[_]),E===-1&&y.length===m&&(E=_+1),g===-1&&y.length===d&&(g=_+1);if(E===-1)throw new I(`Failed to find start index for decoration ${JSON.stringify(h.start)}`);if(g===-1)throw new I(`Failed to find end index for decoration ${JSON.stringify(h.end)}`);const b=f.children.slice(E,g);if(!h.alwaysWrap&&b.length===f.children.length)l(f,h,"line");else if(!h.alwaysWrap&&b.length===1&&b[0].type==="element")l(b[0],h,"token");else{const _={type:"element",tagName:"span",properties:{},children:b};l(_,h,"wrapper"),f.children.splice(E,b.length,_)}}function s(p,m){i[p]=l(i[p],m,"line")}function l(p,m,d){const h=m.properties||{},f=m.transform||(y=>y);return p.tagName=m.tagName||"span",p.properties={...p.properties,...h,class:p.properties.class},m.properties?.class&&mn(p,m.properties.class),p=f(p,d)||p,p}const a=[],c=n.decorations.sort((p,m)=>m.start.offset-p.start.offset||p.end.offset-m.end.offset);for(const p of c){const{start:m,end:d}=p;if(m.line===d.line)o(m.line,m.character,d.character,p);else if(m.line<d.line){o(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let h=m.line+1;h<d.line;h++)a.unshift(()=>s(h,p));o(d.line,0,d.character,p)}}a.forEach(p=>p())}}}function Yo(t){for(let e=0;e<t.length;e++){const r=t[e];if(r.start.offset>r.end.offset)throw new I(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let n=e+1;n<t.length;n++){const i=t[n],o=r.start.offset<=i.start.offset&&i.start.offset<r.end.offset,s=r.start.offset<i.end.offset&&i.end.offset<=r.end.offset,l=i.start.offset<=r.start.offset&&r.start.offset<i.end.offset,a=i.start.offset<r.end.offset&&r.end.offset<=i.end.offset;if(o||s||l||a){if(o&&s||l&&a||l&&r.start.offset===r.end.offset||s&&i.start.offset===i.end.offset)continue;throw new I(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function hn(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(hn).join(""):""}const es=[Zo()];function qe(t){const e=ts(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...es]}function ts(t){const e=[],r=[],n=[];for(const i of t)switch(i.enforce){case"pre":e.push(i);break;case"post":r.push(i);break;default:n.push(i)}return{pre:e,post:r,normal:n}}var te=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],mt={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function rs(t,e){const r=t.indexOf("\x1B",e);if(r!==-1&&t[r+1]==="["){const n=t.indexOf("m",r);if(n!==-1)return{sequence:t.substring(r+2,n).split(";"),startPosition:r,position:n+1}}return{position:t.length}}function dr(t){const e=t.shift();if(e==="2"){const r=t.splice(0,3).map(n=>Number.parseInt(n));return r.length!==3||r.some(n=>Number.isNaN(n))?void 0:{type:"rgb",rgb:r}}else if(e==="5"){const r=t.shift();if(r)return{type:"table",index:Number(r)}}}function ns(t){const e=[];for(;t.length>0;){const r=t.shift();if(!r)continue;const n=Number.parseInt(r);if(!Number.isNaN(n))if(n===0)e.push({type:"resetAll"});else if(n<=9)mt[n]&&e.push({type:"setDecoration",value:mt[n]});else if(n<=29){const i=mt[n-20];i&&(e.push({type:"resetDecoration",value:i}),i==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(n<=37)e.push({type:"setForegroundColor",value:{type:"named",name:te[n-30]}});else if(n===38){const i=dr(t);i&&e.push({type:"setForegroundColor",value:i})}else if(n===39)e.push({type:"resetForegroundColor"});else if(n<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:te[n-40]}});else if(n===48){const i=dr(t);i&&e.push({type:"setBackgroundColor",value:i})}else n===49?e.push({type:"resetBackgroundColor"}):n===53?e.push({type:"setDecoration",value:"overline"}):n===55?e.push({type:"resetDecoration",value:"overline"}):n>=90&&n<=97?e.push({type:"setForegroundColor",value:{type:"named",name:te[n-90+8]}}):n>=100&&n<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:te[n-100+8]}})}return e}function is(){let t=null,e=null,r=new Set;return{parse(n){const i=[];let o=0;do{const s=rs(n,o),l=s.sequence?n.substring(o,s.startPosition):n.substring(o);if(l.length>0&&i.push({value:l,foreground:t,background:e,decorations:new Set(r)}),s.sequence){const a=ns(s.sequence);for(const c of a)c.type==="resetAll"?(t=null,e=null,r.clear()):c.type==="resetForegroundColor"?t=null:c.type==="resetBackgroundColor"?e=null:c.type==="resetDecoration"&&r.delete(c.value);for(const c of a)c.type==="setForegroundColor"?t=c.value:c.type==="setBackgroundColor"?e=c.value:c.type==="setDecoration"&&r.add(c.value)}o=s.position}while(o<n.length);return i}}}var os={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function ss(t=os){function e(l){return t[l]}function r(l){return`#${l.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let n;function i(){if(n)return n;n=[];for(let c=0;c<te.length;c++)n.push(e(te[c]));let l=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let p=0;p<6;p++)for(let m=0;m<6;m++)n.push(r([l[c],l[p],l[m]]));let a=8;for(let c=0;c<24;c++,a+=10)n.push(r([a,a,a]));return n}function o(l){return i()[l]}function s(l){switch(l.type){case"named":return e(l.name);case"rgb":return r(l.rgb);case"table":return o(l.index)}}return{value:s}}const as={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function ls(t,e,r){const n=He(t,r),i=Ke(e),o=Object.fromEntries(te.map(a=>{const c=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`,p=t.colors?.[c];return[a,p||as[a]]})),s=ss(o),l=is();return i.map(a=>l.parse(a[0]).map(c=>{let p,m;c.decorations.has("reverse")?(p=c.background?s.value(c.background):t.bg,m=c.foreground?s.value(c.foreground):t.fg):(p=c.foreground?s.value(c.foreground):t.fg,m=c.background?s.value(c.background):void 0),p=K(p,n),m=K(m,n),c.decorations.has("dim")&&(p=cs(p));let d=x.None;return c.decorations.has("bold")&&(d|=x.Bold),c.decorations.has("italic")&&(d|=x.Italic),c.decorations.has("underline")&&(d|=x.Underline),c.decorations.has("strikethrough")&&(d|=x.Strikethrough),{content:c.value,offset:a[1],color:p,bgColor:m,fontStyle:d}}))}function cs(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const n=e[1];if(n.length===8){const i=Math.round(Number.parseInt(n.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${n.slice(0,6)}${i}`}else{if(n.length===6)return`#${n}80`;if(n.length===4){const i=n[0],o=n[1],s=n[2],l=n[3],a=Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${o}${o}${s}${s}${a}`}else if(n.length===3){const i=n[0],o=n[1],s=n[2];return`#${i}${i}${o}${o}${s}${s}80`}}}const r=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return r?`var(${r[1]}-dim)`:t}function Ht(t,e,r={}){const{theme:n=t.getLoadedThemes()[0]}=r,i=t.resolveLangAlias(r.lang||"text");if(jt(i)||Ut(n))return Ke(e).map(a=>[{content:a[0],offset:a[1]}]);const{theme:o,colorMap:s}=t.setTheme(n);if(i==="ansi")return ls(o,e,r);const l=t.getLanguage(r.lang||"text");if(r.grammarState){if(r.grammarState.lang!==l.name)throw new I(`Grammar state language "${r.grammarState.lang}" does not match highlight language "${l.name}"`);if(!r.grammarState.themes.includes(o.name))throw new I(`Grammar state themes "${r.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return ps(e,l,o,s,r)}function us(...t){if(t.length===2)return Ie(t[1]);const[e,r,n={}]=t,{lang:i="text",theme:o=e.getLoadedThemes()[0]}=n;if(jt(i)||Ut(o))throw new I("Plain language does not have grammar state");if(i==="ansi")throw new I("ANSI language does not have grammar state");const{theme:s,colorMap:l}=e.setTheme(o),a=e.getLanguage(i);return new he(zt(r,a,s,l,n).stateStack,a.name,s.name)}function ps(t,e,r,n,i){const o=zt(t,e,r,n,i),s=new he(o.stateStack,e.name,r.name);return Ze(o.tokens,s),o.tokens}function zt(t,e,r,n,i){const o=He(r,i),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:l=500}=i,a=Ke(t);let c=i.grammarState?Ko(i.grammarState,r.name)??kt:i.grammarContextCode!=null?zt(i.grammarContextCode,e,r,n,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:kt,p=[];const m=[];for(let d=0,h=a.length;d<h;d++){const[f,y]=a[d];if(f===""){p=[],m.push([]);continue}if(s>0&&f.length>=s){p=[],m.push([{content:f,offset:y,color:"",fontStyle:0}]);continue}let E,g,b;i.includeExplanation&&(E=e.tokenizeLine(f,c,l),g=E.tokens,b=0);const _=e.tokenizeLine2(f,c,l),w=_.tokens.length/2;for(let v=0;v<w;v++){const k=_.tokens[2*v],N=v+1<w?_.tokens[2*v+2]:f.length;if(k===N)continue;const U=_.tokens[2*v+1],ke=K(n[de.getForeground(U)],o),ot=de.getFontStyle(U),_e={content:f.substring(k,N),offset:y+k,color:ke,fontStyle:ot};if(i.includeExplanation){const X=[];if(i.includeExplanation!=="scopeName")for(const W of r.settings){let ie;switch(typeof W.scope){case"string":ie=W.scope.split(/,/).map(st=>st.trim());break;case"object":ie=W.scope;break;default:continue}X.push({settings:W,selectors:ie.map(st=>st.split(/ /))})}_e.explanation=[];let er=0;for(;k+er<N;){const W=g[b],ie=f.substring(W.startIndex,W.endIndex);er+=ie.length,_e.explanation.push({content:ie,scopes:i.includeExplanation==="scopeName"?ms(W.scopes):ds(X,W.scopes)}),b+=1}}p.push(_e)}m.push(p),p=[],c=_.ruleStack}return{tokens:m,stateStack:c}}function ms(t){return t.map(e=>({scopeName:e}))}function ds(t,e){const r=[];for(let n=0,i=e.length;n<i;n++){const o=e[n];r[n]={scopeName:o,themeMatches:fs(t,o,e.slice(0,n))}}return r}function hr(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function hs(t,e,r){if(!hr(t[t.length-1],e))return!1;let n=t.length-2,i=r.length-1;for(;n>=0&&i>=0;)hr(t[n],r[i])&&(n-=1),i-=1;return n===-1}function fs(t,e,r){const n=[];for(const{selectors:i,settings:o}of t)for(const s of i)if(hs(s,e,r)){n.push(o);break}return n}function fn(t,e,r){const n=Object.entries(r.themes).filter(a=>a[1]).map(a=>({color:a[0],theme:a[1]})),i=n.map(a=>{const c=Ht(t,e,{...r,theme:a.theme}),p=Ie(c),m=typeof a.theme=="string"?a.theme:a.theme.name;return{tokens:c,state:p,theme:m}}),o=gs(...i.map(a=>a.tokens)),s=o[0].map((a,c)=>a.map((p,m)=>{const d={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in r&&r.includeExplanation&&(d.explanation=p.explanation),o.forEach((h,f)=>{const{content:y,explanation:E,offset:g,...b}=h[c][m];d.variants[n[f].color]=b}),d})),l=i[0].state?new he(Object.fromEntries(i.map(a=>[a.theme,a.state?.getInternalStack(a.theme)])),i[0].state.lang):void 0;return l&&Ze(s,l),s}function gs(...t){const e=t.map(()=>[]),r=t.length;for(let n=0;n<t[0].length;n++){const i=t.map(a=>a[n]),o=e.map(()=>[]);e.forEach((a,c)=>a.push(o[c]));const s=i.map(()=>0),l=i.map(a=>a[0]);for(;l.every(a=>a);){const a=Math.min(...l.map(c=>c.content.length));for(let c=0;c<r;c++){const p=l[c];p.content.length===a?(o[c].push(p),s[c]+=1,l[c]=i[c][s[c]]):(o[c].push({...p,content:p.content.slice(0,a)}),l[c]={...p,content:p.content.slice(a),offset:p.offset+a})}}}return e}function Xe(t,e,r){let n,i,o,s,l,a;if("themes"in r){const{defaultColor:c="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=r,d=Object.entries(r.themes).filter(g=>g[1]).map(g=>({color:g[0],theme:g[1]})).sort((g,b)=>g.color===c?-1:b.color===c?1:0);if(d.length===0)throw new I("`themes` option must not be empty");const h=fn(t,e,r);if(a=Ie(h),c&&Wt!==c&&!d.find(g=>g.color===c))throw new I(`\`themes\` option must contain the defaultColor key \`${c}\``);const f=d.map(g=>t.getTheme(g.theme)),y=d.map(g=>g.color);o=h.map(g=>g.map(b=>Qo(b,y,p,c,m))),a&&Ze(o,a);const E=d.map(g=>He(g.theme,r));i=fr(d,f,E,p,c,"fg",m),n=fr(d,f,E,p,c,"bg",m),s=`shiki-themes ${f.map(g=>g.name).join(" ")}`,l=c?void 0:[i,n].join(";")}else if("theme"in r){const c=He(r.theme,r);o=Ht(t,e,r);const p=t.getTheme(r.theme);n=K(p.bg,c),i=K(p.fg,c),s=p.name,a=Ie(o)}else throw new I("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:i,bg:n,themeName:s,rootStyle:l,grammarState:a}}function fr(t,e,r,n,i,o,s){return t.map((l,a)=>{const c=K(e[a][o],r[a])||"inherit",p=`${n+l.color}${o==="bg"?"-bg":""}:${c}`;if(a===0&&i){if(i===Wt&&t.length>1){const m=t.findIndex(y=>y.color==="light"),d=t.findIndex(y=>y.color==="dark");if(m===-1||d===-1)throw new I('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const h=K(e[m][o],r[m])||"inherit",f=K(e[d][o],r[d])||"inherit";return`light-dark(${h}, ${f});${p}`}return c}return s==="css-vars"?p:null}).filter(l=>!!l).join(";")}function Qe(t,e,r,n={meta:{},options:r,codeToHast:(i,o)=>Qe(t,i,o),codeToTokens:(i,o)=>Xe(t,i,o)}){let i=e;for(const f of qe(r))i=f.preprocess?.call(n,i,r)||i;let{tokens:o,fg:s,bg:l,themeName:a,rootStyle:c,grammarState:p}=Xe(t,i,r);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:d=!1}=r;m===!0?o=ys(o):m==="never"&&(o=Es(o)),d&&(o=bs(o));const h={...n,get source(){return i}};for(const f of qe(r))o=f.tokens?.call(h,o)||o;return _s(o,{...r,fg:s,bg:l,themeName:a,rootStyle:r.rootStyle===!1?!1:r.rootStyle??c},h,p)}function _s(t,e,r,n=Ie(t)){const i=qe(e),o=[],s={type:"root",children:[]},{structure:l="classic",tabindex:a="0"}=e,c={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?c.style=e.rootStyle:c.style=`background-color:${e.bg};color:${e.fg}`),a!==!1&&a!=null&&(c.tabindex=a.toString());for(const[y,E]of Object.entries(e.meta||{}))y.startsWith("_")||(c[y]=E);let p={type:"element",tagName:"pre",properties:c,children:[],data:e.data},m={type:"element",tagName:"code",properties:{},children:o};const d=[],h={...r,structure:l,addClassToHast:mn,get source(){return r.source},get tokens(){return t},get options(){return e},get root(){return s},get pre(){return p},get code(){return m},get lines(){return d}};if(t.forEach((y,E)=>{E&&(l==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&o.push({type:"text",value:`
|
|
12
|
+
`}));let g={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const _ of y){let w={type:"element",tagName:"span",properties:{..._.htmlAttrs},children:[{type:"text",value:_.content}]};const v=Pt(_.htmlStyle||ze(_));v&&(w.properties.style=v);for(const k of i)w=k?.span?.call(h,w,E+1,b,g,_)||w;l==="inline"?s.children.push(w):l==="classic"&&g.children.push(w),b+=_.content.length}if(l==="classic"){for(const _ of i)g=_?.line?.call(h,g,E+1)||g;d.push(g),o.push(g)}else l==="inline"&&d.push(g)}),l==="classic"){for(const y of i)m=y?.code?.call(h,m)||m;p.children.push(m);for(const y of i)p=y?.pre?.call(h,p)||p;s.children.push(p)}else if(l==="inline"){const y=[];let E={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const _ of s.children)_.type==="element"&&_.tagName==="br"?(y.push(E),E={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(_.type==="element"||_.type==="text")&&E.children.push(_);y.push(E);let b={type:"element",tagName:"code",properties:{},children:y};for(const _ of i)b=_?.code?.call(h,b)||b;s.children=[];for(let _=0;_<b.children.length;_++){_>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const w=b.children[_];w.type==="element"&&s.children.push(...w.children)}}let f=s;for(const y of i)f=y?.root?.call(h,f)||f;return n&&Ze(f,n),f}function ys(t){return t.map(e=>{const r=[];let n="",i;return e.forEach((o,s)=>{const a=!(o.fontStyle&&(o.fontStyle&x.Underline||o.fontStyle&x.Strikethrough));a&&o.content.match(/^\s+$/)&&e[s+1]?(i===void 0&&(i=o.offset),n+=o.content):n?(a?r.push({...o,offset:i,content:n+o.content}):r.push({content:n,offset:i},o),i=void 0,n=""):r.push(o)}),r})}function Es(t){return t.map(e=>e.flatMap(r=>{if(r.content.match(/^\s+$/))return r;const n=r.content.match(/^(\s*)(.*?)(\s*)$/);if(!n)return r;const[,i,o,s]=n;if(!i&&!s)return r;const l=[{...r,offset:r.offset+i.length,content:o}];return i&&l.unshift({content:i,offset:r.offset}),s&&l.push({content:s,offset:r.offset+i.length+o.length}),l}))}function bs(t){return t.map(e=>{const r=[];for(const n of e){if(r.length===0){r.push({...n});continue}const i=r[r.length-1],o=Pt(i.htmlStyle||ze(i)),s=Pt(n.htmlStyle||ze(n)),l=i.fontStyle&&(i.fontStyle&x.Underline||i.fontStyle&x.Strikethrough),a=n.fontStyle&&(n.fontStyle&x.Underline||n.fontStyle&x.Strikethrough);!l&&!a&&o===s?i.content+=n.content:r.push({...n})}return r})}const ws=Fo;function As(t,e,r){const n={meta:{},options:r,codeToHast:(o,s)=>Qe(t,o,s),codeToTokens:(o,s)=>Xe(t,o,s)};let i=ws(Qe(t,e,r,n));for(const o of qe(r))i=o.postprocess?.call(n,i,r)||i;return i}const gr={light:"#333333",dark:"#bbbbbb"},_r={light:"#fffffe",dark:"#1e1e1e"},yr="__shiki_resolved";function qt(t){if(t?.[yr])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||="dark",e.colorReplacements={...e.colorReplacements},e.settings||=[];let{bg:r,fg:n}=e;if(!r||!n){const l=e.settings?e.settings.find(a=>!a.name&&!a.scope):void 0;l?.settings?.foreground&&(n=l.settings.foreground),l?.settings?.background&&(r=l.settings.background),!n&&e?.colors?.["editor.foreground"]&&(n=e.colors["editor.foreground"]),!r&&e?.colors?.["editor.background"]&&(r=e.colors["editor.background"]),n||(n=e.type==="light"?gr.light:gr.dark),r||(r=e.type==="light"?_r.light:_r.dark),e.fg=n,e.bg=r}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let i=0;const o=new Map;function s(l){if(o.has(l))return o.get(l);i+=1;const a=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${a}`]?s(l):(o.set(l,a),a)}e.settings=e.settings.map(l=>{const a=l.settings?.foreground&&!l.settings.foreground.startsWith("#"),c=l.settings?.background&&!l.settings.background.startsWith("#");if(!a&&!c)return l;const p={...l,settings:{...l.settings}};if(a){const m=s(l.settings.foreground);e.colorReplacements[m]=l.settings.foreground,p.settings.foreground=m}if(c){const m=s(l.settings.background);e.colorReplacements[m]=l.settings.background,p.settings.background=m}return p});for(const l of Object.keys(e.colors||{}))if((l==="editor.foreground"||l==="editor.background"||l.startsWith("terminal.ansi"))&&!e.colors[l]?.startsWith("#")){const a=s(e.colors[l]);e.colorReplacements[a]=e.colors[l],e.colors[l]=a}return Object.defineProperty(e,yr,{enumerable:!1,writable:!1,value:!0}),e}async function gn(t){return Array.from(new Set((await Promise.all(t.filter(e=>!un(e)).map(async e=>await cn(e).then(r=>Array.isArray(r)?r:[r])))).flat()))}async function _n(t){return(await Promise.all(t.map(async r=>pn(r)?null:qt(await cn(r))))).filter(r=>!!r)}let vs=3;function Cs(t,e=3){e>vs||console.trace(`[SHIKI DEPRECATE]: ${t}`)}let pe=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function yn(t,e){if(!e)return t;if(e[t]){const r=new Set([t]);for(;e[t];){if(t=e[t],r.has(t))throw new pe(`Circular alias \`${Array.from(r).join(" -> ")} -> ${t}\``);r.add(t)}}return t}class Is extends Gi{constructor(e,r,n,i={}){super(e),this._resolver=e,this._themes=r,this._langs=n,this._alias=i,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const r=qt(e);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let r=this._textmateThemeCache.get(e);r||(r=Be.createFromRawTheme(e),this._textmateThemeCache.set(e,r)),this._syncRegistry.setTheme(r)}getGrammar(e){return e=yn(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const r=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(o=>{this._alias[o]=e.name}),this._loadedLanguagesCache=null,r.size)for(const o of r)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(const i of e)this.resolveEmbeddedLanguages(i);const r=Array.from(this._langGraph.entries()),n=r.filter(([i,o])=>!o);if(n.length){const i=r.filter(([o,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(a=>n.map(([c])=>c).includes(a)):!1).filter(o=>!n.includes(o));throw new pe(`Missing languages ${n.map(([o])=>`\`${o}\``).join(", ")}, required by ${i.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[i,o]of r)this._resolver.addLanguage(o);for(const[i,o]of r)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);const r=e.embeddedLanguages??e.embeddedLangs;if(r)for(const n of r)this._langGraph.set(n,this._langMap.get(n))}}class Rs{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,r){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},r.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(r=>{this._langs.set(r,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(r=>{this._injections.get(r)||this._injections.set(r,[]),this._injections.get(r).push(e.scopeName)})}getInjections(e){const r=e.split(".");let n=[];for(let i=1;i<=r.length;i++){const o=r.slice(0,i).join(".");n=[...n,...this._injections.get(o)||[]]}return n}}let ye=0;function Ss(t){ye+=1,t.warnings!==!1&&ye>=10&&ye%10===0&&console.warn(`[Shiki] ${ye} 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 e=!1;if(!t.engine)throw new pe("`engine` option is required for synchronous mode");const r=(t.langs||[]).flat(1),n=(t.themes||[]).flat(1).map(qt),i=new Rs(t.engine,r),o=new Is(i,n,r,t.langAlias);let s;function l(_){return yn(_,t.langAlias)}function a(_){g();const w=o.getGrammar(typeof _=="string"?_:_.name);if(!w)throw new pe(`Language \`${_}\` not found, you may need to load it first`);return w}function c(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};g();const w=o.getTheme(_);if(!w)throw new pe(`Theme \`${_}\` not found, you may need to load it first`);return w}function p(_){g();const w=c(_);s!==_&&(o.setTheme(w),s=_);const v=o.getColorMap();return{theme:w,colorMap:v}}function m(){return g(),o.getLoadedThemes()}function d(){return g(),o.getLoadedLanguages()}function h(..._){g(),o.loadLanguages(_.flat(1))}async function f(..._){return h(await gn(_))}function y(..._){g();for(const w of _.flat(1))o.loadTheme(w)}async function E(..._){return g(),y(await _n(_))}function g(){if(e)throw new pe("Shiki instance has been disposed")}function b(){e||(e=!0,o.dispose(),ye-=1)}return{setTheme:p,getTheme:c,getLanguage:a,getLoadedThemes:m,getLoadedLanguages:d,resolveLangAlias:l,loadLanguage:f,loadLanguageSync:h,loadTheme:E,loadThemeSync:y,dispose:b,[Symbol.dispose]:b}}async function Ls(t){t.engine||Cs("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,r,n]=await Promise.all([_n(t.themes||[]),gn(t.langs||[]),t.engine]);return Ss({...t,themes:e,langs:r,engine:n})}async function ks(t){const e=await Ls(t);return{getLastGrammarState:(...r)=>us(e,...r),codeToTokensBase:(r,n)=>Ht(e,r,n),codeToTokensWithThemes:(r,n)=>fn(e,r,n),codeToTokens:(r,n)=>Xe(e,r,n),codeToHast:(r,n)=>Qe(e,r,n),codeToHtml:(r,n)=>As(e,r,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function Ts(t){const e=t.langs,r=t.themes,n=t.engine;async function i(o){function s(m){if(typeof m=="string"){if(m=o.langAlias?.[m]||m,un(m))return[];const d=e[m];if(!d)throw new I(`Language \`${m}\` is not included in this bundle. You may want to load it from external source.`);return d}return m}function l(m){if(pn(m))return"none";if(typeof m=="string"){const d=r[m];if(!d)throw new I(`Theme \`${m}\` is not included in this bundle. You may want to load it from external source.`);return d}return m}const a=(o.themes??[]).map(m=>l(m)),c=(o.langs??[]).map(m=>s(m)),p=await ks({engine:o.engine??n(),...o,themes:a,langs:c});return{...p,loadLanguage(...m){return p.loadLanguage(...m.map(s))},loadTheme(...m){return p.loadTheme(...m.map(l))},getBundledLanguages(){return e},getBundledThemes(){return r}}}return i}const En=[{id:"abap",name:"ABAP",import:(()=>u(()=>import("./abap-BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",import:(()=>u(()=>import("./actionscript-3-CoDkCxhg.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>u(()=>import("./ada-bCR0ucgS.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>u(()=>import("./angular-html-CU67Zn6k.js").then(t=>t.f),[],import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>u(()=>import("./angular-ts-BwZT4LLn.js"),[],import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>u(()=>import("./apache-Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>u(()=>import("./apex-D8_7TLub.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>u(()=>import("./apl-dKokRX4l.js"),[],import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>u(()=>import("./applescript-Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>u(()=>import("./ara-BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>u(()=>import("./asciidoc-Ve4PFQV2.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>u(()=>import("./asm-D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>u(()=>import("./astro-CbQHKStN.js"),[],import.meta.url))},{id:"awk",name:"AWK",import:(()=>u(()=>import("./awk-DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>u(()=>import("./ballerina-BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>u(()=>import("./bat-BkioyH1T.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>u(()=>import("./beancount-k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>u(()=>import("./berry-uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>u(()=>import("./bibtex-CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>u(()=>import("./bicep-Bmn6On1c.js"),[],import.meta.url))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>u(()=>import("./bird2-DPOp833l.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>u(()=>import("./blade-D4QpJJKB.js"),[],import.meta.url))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>u(()=>import("./bsl-BO_Y6i37.js"),[],import.meta.url))},{id:"c",name:"C",import:(()=>u(()=>import("./c-BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>u(()=>import("./c3-eo99z4R2.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>u(()=>import("./cadence-Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>u(()=>import("./cairo-KRGpt6FW.js"),[],import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>u(()=>import("./clarity-D53aC0YG.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>u(()=>import("./clojure-P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>u(()=>import("./cmake-D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>u(()=>import("./cobol-nwyudZeR.js"),[],import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>u(()=>import("./codeowners-Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>u(()=>import("./codeql-DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>u(()=>import("./coffee-Ch7k5sss.js"),[],import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>u(()=>import("./common-lisp-Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Coq",import:(()=>u(()=>import("./coq-DkFqJrB1.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>u(()=>import("./cpp-CofmeUqb.js"),[],import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>u(()=>import("./crystal-tKQVLTB8.js"),[],import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>u(()=>import("./csharp-COcwbKMJ.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>u(()=>import("./css-DPfMkruS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>u(()=>import("./csv-fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>u(()=>import("./cue-D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>u(()=>import("./cypher-COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>u(()=>import("./d-85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>u(()=>import("./dart-CF10PKvl.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>u(()=>import("./dax-CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>u(()=>import("./desktop-BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>u(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>u(()=>import("./docker-BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>u(()=>import("./dotenv-Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>u(()=>import("./dream-maker-BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>u(()=>import("./edge-BkV0erSs.js"),[],import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>u(()=>import("./elixir-CDX3lj18.js"),[],import.meta.url))},{id:"elm",name:"Elm",import:(()=>u(()=>import("./elm-DbKCFpqz.js"),[],import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>u(()=>import("./emacs-lisp-C9XAeP06.js"),[],import.meta.url))},{id:"erb",name:"ERB",import:(()=>u(()=>import("./erb-B12qg9BL.js"),[],import.meta.url))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>u(()=>import("./erlang-DsQrWhSR.js"),[],import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>u(()=>import("./fennel-BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>u(()=>import("./fish-BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>u(()=>import("./fluent-C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>u(()=>import("./fortran-fixed-form-CkoXwp7k.js"),[],import.meta.url))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>u(()=>import("./fortran-free-form-BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>u(()=>import("./fsharp-CXgrBDvD.js"),[],import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>u(()=>import("./gdresource-BOOCDP_w.js"),[],import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>u(()=>import("./gdscript-C5YyOfLZ.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>u(()=>import("./gdshader-DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>u(()=>import("./genie-D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>u(()=>import("./gherkin-DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>u(()=>import("./git-commit-F4YmCXRG.js"),[],import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>u(()=>import("./git-rebase-r7XF79zn.js"),[],import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>u(()=>import("./gleam-BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>u(()=>import("./glimmer-js-Rg0-pVw9.js"),[],import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>u(()=>import("./glimmer-ts-U6CK756n.js"),[],import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>u(()=>import("./glsl-DplSGwfg.js"),[],import.meta.url))},{id:"gn",name:"GN",import:(()=>u(()=>import("./gn-n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>u(()=>import("./gnuplot-DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>u(()=>import("./go-CxLEBnE3.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>u(()=>import("./graphql-ChdNCCLP.js"),[],import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>u(()=>import("./groovy-gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>u(()=>import("./hack-CaT9iCJl.js"),[],import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>u(()=>import("./haml-B8DHNrY2.js"),[],import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>u(()=>import("./handlebars-BL8al0AC.js"),[],import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>u(()=>import("./haskell-Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>u(()=>import("./haxe-CzTSHFRz.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>u(()=>import("./hcl-BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>u(()=>import("./hjson-D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>u(()=>import("./hlsl-D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>u(()=>import("./html-GMplVEZG.js"),[],import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>u(()=>import("./html-derivative-BFtXZ54Q.js"),[],import.meta.url))},{id:"http",name:"HTTP",import:(()=>u(()=>import("./http-jrhK8wxY.js"),[],import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>u(()=>import("./hurl-irOxFIW8.js"),[],import.meta.url))},{id:"hxml",name:"HXML",import:(()=>u(()=>import("./hxml-Bvhsp5Yf.js"),[],import.meta.url))},{id:"hy",name:"Hy",import:(()=>u(()=>import("./hy-DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>u(()=>import("./imba-DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>u(()=>import("./ini-BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>u(()=>import("./java-CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>u(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>u(()=>import("./jinja-4LBKfQ-Z.js"),[],import.meta.url))},{id:"jison",name:"Jison",import:(()=>u(()=>import("./jison-wvAkD_A8.js"),[],import.meta.url))},{id:"json",name:"JSON",import:(()=>u(()=>import("./json-Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>u(()=>import("./json5-C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>u(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>u(()=>import("./jsonl-DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>u(()=>import("./jsonnet-DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>u(()=>import("./jssm-C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>u(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>u(()=>import("./julia-CxzCAyBv.js"),[],import.meta.url))},{id:"just",name:"Just",import:(()=>u(()=>import("./just-Cw27pwNe.js"),[],import.meta.url))},{id:"kdl",name:"KDL",import:(()=>u(()=>import("./kdl-DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>u(()=>import("./kotlin-BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>u(()=>import("./kusto-DZf3V79B.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>u(()=>import("./latex-CWtU0Tv5.js"),[],import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>u(()=>import("./lean-BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>u(()=>import("./less-B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>u(()=>import("./liquid-DYVedYrR.js"),[],import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>u(()=>import("./llvm-DjAJT7YJ.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>u(()=>import("./log-2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>u(()=>import("./logo-BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>u(()=>import("./lua-BaeVxFsk.js"),[],import.meta.url))},{id:"luau",name:"Luau",import:(()=>u(()=>import("./luau-C-HG3fhB.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>u(()=>import("./make-CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>u(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>u(()=>import("./marko-CnJfTvn9.js"),[],import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>u(()=>import("./matlab-D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>u(()=>import("./mdc-BMNejdWA.js"),[],import.meta.url))},{id:"mdx",name:"MDX",import:(()=>u(()=>import("./mdx-Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>u(()=>import("./mermaid-mWjccvbQ.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>u(()=>import("./mipsasm-CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>u(()=>import("./mojo-rZm6bMo-.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>u(()=>import("./moonbit-_H4v1dQx.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>u(()=>import("./move-IF9eRakj.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>u(()=>import("./narrat-DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>u(()=>import("./nextflow-Zz6hmt5N.js"),[],import.meta.url))},{id:"nextflow-groovy",name:"nextflow-groovy",import:(()=>u(()=>import("./nextflow-groovy-BeH2EWoN.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>u(()=>import("./nginx-BpAMiNFr.js"),[],import.meta.url))},{id:"nim",name:"Nim",import:(()=>u(()=>import("./nim-CVrawwO9.js"),[],import.meta.url))},{id:"nix",name:"Nix",import:(()=>u(()=>import("./nix-CwoSXNpI.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>u(()=>import("./nushell-Cz2AlsmD.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>u(()=>import("./objective-c-DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>u(()=>import("./objective-cpp-CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>u(()=>import("./ocaml-C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>u(()=>import("./odin-BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>u(()=>import("./openscad-C4EeE6gA.js"),[],import.meta.url))},{id:"pascal",name:"Pascal",import:(()=>u(()=>import("./pascal-D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>u(()=>import("./perl-C0TMdlhV.js"),[],import.meta.url))},{id:"php",name:"PHP",import:(()=>u(()=>import("./php-Dhbhpdrm.js"),[],import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>u(()=>import("./pkl-u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>u(()=>import("./plsql-ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>u(()=>import("./po-BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>u(()=>import("./polar-C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>u(()=>import("./postcss-CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>u(()=>import("./powerquery-CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>u(()=>import("./powershell-Dpen1YoG.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>u(()=>import("./prisma-Dd19v3D-.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>u(()=>import("./prolog-CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>u(()=>import("./proto-C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>u(()=>import("./pug-CGlum2m_.js"),[],import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>u(()=>import("./puppet-BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>u(()=>import("./purescript-CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>u(()=>import("./python-B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>u(()=>import("./qml-3beO22l8.js"),[],import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>u(()=>import("./qmldir-C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>u(()=>import("./qss-IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>u(()=>import("./r-Dspwwk_N.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>u(()=>import("./racket-BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>u(()=>import("./raku-DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>u(()=>import("./razor-Uh8Bk_45.js"),[],import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>u(()=>import("./reg-C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>u(()=>import("./regexp-CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>u(()=>import("./rel-C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>u(()=>import("./riscv-BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>u(()=>import("./ron-D8l8udqQ.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>u(()=>import("./rosmsg-BJDFO7_C.js"),[],import.meta.url))},{id:"rst",name:"reStructuredText",import:(()=>u(()=>import("./rst-BrH8l1NY.js"),[],import.meta.url))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>u(()=>import("./ruby-Dw2BHqvy.js"),[],import.meta.url))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>u(()=>import("./rust-B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>u(()=>import("./sas-cz2c8ADy.js"),[],import.meta.url))},{id:"sass",name:"Sass",import:(()=>u(()=>import("./sass-Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>u(()=>import("./scala-C151Ov-r.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>u(()=>import("./scheme-C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>u(()=>import("./scss-OYdSNvt2.js"),[],import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>u(()=>import("./sdbl-DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>u(()=>import("./shaderlab-Dg9Lc6iA.js"),[],import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>u(()=>import("./shellscript-Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>u(()=>import("./shellsession-BADoaaVG.js"),[],import.meta.url))},{id:"smalltalk",name:"Smalltalk",import:(()=>u(()=>import("./smalltalk-BERRCDM3.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>u(()=>import("./solidity-rGO070M0.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>u(()=>import("./soy-Brmx7dQM.js"),[],import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>u(()=>import("./sparql-rVzFXLq3.js"),[],import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>u(()=>import("./splunk-BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>u(()=>import("./sql-BLtJtn59.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>u(()=>import("./ssh-config-_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>u(()=>import("./stata-BH5u7GGu.js"),[],import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>u(()=>import("./stylus-BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>u(()=>import("./surrealql-Bq5Q-fJD.js"),[],import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>u(()=>import("./svelte-C_ipcX3V.js"),[],import.meta.url))},{id:"swift",name:"Swift",import:(()=>u(()=>import("./swift-D82vCrfD.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>u(()=>import("./system-verilog-CnnmHF94.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>u(()=>import("./systemd-4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>u(()=>import("./talonscript-CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>u(()=>import("./tasl-QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>u(()=>import("./tcl-dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>u(()=>import("./templ-P3uqSqPl.js"),[],import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>u(()=>import("./terraform-BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>u(()=>import("./tex-idrVyKtj.js"),[],import.meta.url))},{id:"toml",name:"TOML",import:(()=>u(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>u(()=>import("./ts-tags-zn1MmPIZ.js"),[],import.meta.url))},{id:"tsv",name:"TSV",import:(()=>u(()=>import("./tsv-B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>u(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>u(()=>import("./turtle-BsS91CYL.js"),[],import.meta.url))},{id:"twig",name:"Twig",import:(()=>u(()=>import("./twig-DNn4PbVi.js"),[],import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>u(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>u(()=>import("./typespec-BGHnOYBU.js"),[],import.meta.url))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>u(()=>import("./typst-DHCkPAjA.js"),[],import.meta.url))},{id:"v",name:"V",import:(()=>u(()=>import("./v-BcVCzyr7.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>u(()=>import("./vala-CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>u(()=>import("./vb-D17OF-Vu.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>u(()=>import("./verilog-BQ8w6xss.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>u(()=>import("./vhdl-CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>u(()=>import("./viml-CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>u(()=>import("./vue-DN_0RTcg.js"),[],import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>u(()=>import("./vue-html-AaS7Mt5G.js"),[],import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>u(()=>import("./vue-vine-CQOfvN7w.js"),[],import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>u(()=>import("./vyper-CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>u(()=>import("./wasm-MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>u(()=>import("./wenyan-BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>u(()=>import("./wgsl-Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>u(()=>import("./wikitext-BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>u(()=>import("./wit-5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>u(()=>import("./wolfram-lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>u(()=>import("./xml-sdJ4AIDG.js"),[],import.meta.url))},{id:"xsl",name:"XSL",import:(()=>u(()=>import("./xsl-CtQFsRM5.js"),[],import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>u(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>u(()=>import("./zenscript-DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>u(()=>import("./zig-VOosw3JB.js"),[],import.meta.url))}],Ps=Object.fromEntries(En.map(t=>[t.id,t.import])),Os=Object.fromEntries(En.flatMap(t=>t.aliases?.map(e=>[e,t.import])||[])),bn={...Ps,...Os},xs=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>u(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>u(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>u(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>u(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>u(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>u(()=>import("./catppuccin-frappe-DFWUc33u.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>u(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>u(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>u(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>u(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>u(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>u(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>u(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>u(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>u(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>u(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>u(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>u(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>u(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>u(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>u(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>u(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>u(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>u(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>u(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>u(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>u(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>u(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url))},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:(()=>u(()=>import("./horizon-bright-Cn-bp-IR.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>u(()=>import("./houston-DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>u(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>u(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>u(()=>import("./kanagawa-wave-DWedfzmr.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>u(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>u(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>u(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>u(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>u(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>u(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>u(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>u(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>u(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>u(()=>import("./monokai-D4h5O-jR.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>u(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>u(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>u(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>u(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>u(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>u(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>u(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>u(()=>import("./red-bN70gL4F.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>u(()=>import("./rose-pine-qdsjHGoJ.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>u(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>u(()=>import("./rose-pine-moon-D4_iv3hh.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>u(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>u(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>u(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>u(()=>import("./solarized-dark-DXbdFlpD.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>u(()=>import("./solarized-light-L9t79GZl.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>u(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>u(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>u(()=>import("./vesper-DU1UobuO.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>u(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>u(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>u(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url))}],Ns=Object.fromEntries(xs.map(t=>[t.id,t.import]));class Xt extends Error{constructor(e){super(e),this.name="ShikiError"}}function Ds(){return 2147483648}function $s(){return typeof performance<"u"?performance.now():Date.now()}const Vs=(t,e)=>t+(e-t%e)%e;async function Ms(t){let e,r;const n={};function i(h){r=h,n.HEAPU8=new Uint8Array(h),n.HEAPU32=new Uint32Array(h)}function o(h,f,y){n.HEAPU8.copyWithin(h,f,f+y)}function s(h){try{return e.grow(h-r.byteLength+65535>>>16),i(e.buffer),1}catch{}}function l(h){const f=n.HEAPU8.length;h=h>>>0;const y=Ds();if(h>y)return!1;for(let E=1;E<=4;E*=2){let g=f*(1+.2/E);g=Math.min(g,h+100663296);const b=Math.min(y,Vs(Math.max(h,g),65536));if(s(b))return!0}return!1}const a=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(h,f,y=1024){const E=f+y;let g=f;for(;h[g]&&!(g>=E);)++g;if(g-f>16&&h.buffer&&a)return a.decode(h.subarray(f,g));let b="";for(;f<g;){let _=h[f++];if(!(_&128)){b+=String.fromCharCode(_);continue}const w=h[f++]&63;if((_&224)===192){b+=String.fromCharCode((_&31)<<6|w);continue}const v=h[f++]&63;if((_&240)===224?_=(_&15)<<12|w<<6|v:_=(_&7)<<18|w<<12|v<<6|h[f++]&63,_<65536)b+=String.fromCharCode(_);else{const k=_-65536;b+=String.fromCharCode(55296|k>>10,56320|k&1023)}}return b}function p(h,f){return h?c(n.HEAPU8,h,f):""}const m={emscripten_get_now:$s,emscripten_memcpy_big:o,emscripten_resize_heap:l,fd_write:()=>0};async function d(){const f=await t({env:m,wasi_snapshot_preview1:m});e=f.memory,i(e.buffer),Object.assign(n,f),n.UTF8ToString=p}return await d(),n}var Gs=Object.defineProperty,Bs=(t,e,r)=>e in t?Gs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,R=(t,e,r)=>Bs(t,typeof e!="symbol"?e+"":e,r);let T=null;function Fs(t){throw new Xt(t.UTF8ToString(t.getLastOnigError()))}class Ye{constructor(e){R(this,"utf16Length"),R(this,"utf8Length"),R(this,"utf16Value"),R(this,"utf8Value"),R(this,"utf16OffsetToUtf8"),R(this,"utf8OffsetToUtf16");const r=e.length,n=Ye._utf8ByteLength(e),i=n!==r,o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const s=i?new Uint32Array(n+1):null;i&&(s[n]=r);const l=new Uint8Array(n);let a=0;for(let c=0;c<r;c++){const p=e.charCodeAt(c);let m=p,d=!1;if(p>=55296&&p<=56319&&c+1<r){const h=e.charCodeAt(c+1);h>=56320&&h<=57343&&(m=(p-55296<<10)+65536|h-56320,d=!0)}i&&(o[c]=a,d&&(o[c+1]=a),m<=127?s[a+0]=c:m<=2047?(s[a+0]=c,s[a+1]=c):m<=65535?(s[a+0]=c,s[a+1]=c,s[a+2]=c):(s[a+0]=c,s[a+1]=c,s[a+2]=c,s[a+3]=c)),m<=127?l[a++]=m:m<=2047?(l[a++]=192|(m&1984)>>>6,l[a++]=128|(m&63)>>>0):m<=65535?(l[a++]=224|(m&61440)>>>12,l[a++]=128|(m&4032)>>>6,l[a++]=128|(m&63)>>>0):(l[a++]=240|(m&1835008)>>>18,l[a++]=128|(m&258048)>>>12,l[a++]=128|(m&4032)>>>6,l[a++]=128|(m&63)>>>0),d&&c++}this.utf16Length=r,this.utf8Length=n,this.utf16Value=e,this.utf8Value=l,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(e){let r=0;for(let n=0,i=e.length;n<i;n++){const o=e.charCodeAt(n);let s=o,l=!1;if(o>=55296&&o<=56319&&n+1<i){const a=e.charCodeAt(n+1);a>=56320&&a<=57343&&(s=(o-55296<<10)+65536|a-56320,l=!0)}s<=127?r+=1:s<=2047?r+=2:s<=65535?r+=3:r+=4,l&&n++}return r}createString(e){const r=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,r),r}}const et=class j{constructor(e){if(R(this,"id",++j.LAST_ID),R(this,"_onigBinding"),R(this,"content"),R(this,"utf16Length"),R(this,"utf8Length"),R(this,"utf16OffsetToUtf8"),R(this,"utf8OffsetToUtf16"),R(this,"ptr"),!T)throw new Xt("Must invoke loadWasm first.");this._onigBinding=T,this.content=e;const r=new Ye(e);this.utf16Length=r.utf16Length,this.utf8Length=r.utf8Length,this.utf16OffsetToUtf8=r.utf16OffsetToUtf8,this.utf8OffsetToUtf16=r.utf8OffsetToUtf16,this.utf8Length<1e4&&!j._sharedPtrInUse?(j._sharedPtr||(j._sharedPtr=T.omalloc(1e4)),j._sharedPtrInUse=!0,T.HEAPU8.set(r.utf8Value,j._sharedPtr),this.ptr=j._sharedPtr):this.ptr=r.createString(T)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===j._sharedPtr?j._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};R(et,"LAST_ID",0);R(et,"_sharedPtr",0);R(et,"_sharedPtrInUse",!1);let wn=et;class js{constructor(e){if(R(this,"_onigBinding"),R(this,"_ptr"),!T)throw new Xt("Must invoke loadWasm first.");const r=[],n=[];for(let l=0,a=e.length;l<a;l++){const c=new Ye(e[l]);r[l]=c.createString(T),n[l]=c.utf8Length}const i=T.omalloc(4*e.length);T.HEAPU32.set(r,i/4);const o=T.omalloc(4*e.length);T.HEAPU32.set(n,o/4);const s=T.createOnigScanner(i,o,e.length);for(let l=0,a=e.length;l<a;l++)T.ofree(r[l]);T.ofree(o),T.ofree(i),s===0&&Fs(T),this._onigBinding=T,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,r,n){let i=0;if(typeof n=="number"&&(i=n),typeof e=="string"){e=new wn(e);const o=this._findNextMatchSync(e,r,!1,i);return e.dispose(),o}return this._findNextMatchSync(e,r,!1,i)}_findNextMatchSync(e,r,n,i){const o=this._onigBinding,s=o.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(r),i);if(s===0)return null;const l=o.HEAPU32;let a=s/4;const c=l[a++],p=l[a++],m=[];for(let d=0;d<p;d++){const h=e.convertUtf8OffsetToUtf16(l[a++]),f=e.convertUtf8OffsetToUtf16(l[a++]);m[d]={start:h,end:f,length:f-h}}return{index:c,captureIndices:m}}}function Us(t){return typeof t.instantiator=="function"}function Ws(t){return typeof t.default=="function"}function Hs(t){return typeof t.data<"u"}function zs(t){return typeof Response<"u"&&t instanceof Response}function qs(t){return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&Buffer.isBuffer?.(t)||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}let xe;function Xs(t){if(xe)return xe;async function e(){T=await Ms(async r=>{let n=t;return n=await n,typeof n=="function"&&(n=await n(r)),typeof n=="function"&&(n=await n(r)),Us(n)?n=await n.instantiator(r):Ws(n)?n=await n.default(r):(Hs(n)&&(n=n.data),zs(n)?typeof WebAssembly.instantiateStreaming=="function"?n=await Qs(n)(r):n=await Js(n)(r):qs(n)?n=await dt(n)(r):n instanceof WebAssembly.Module?n=await dt(n)(r):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await dt(n.default)(r))),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}return xe=e(),xe}function dt(t){return e=>WebAssembly.instantiate(t,e)}function Qs(t){return e=>WebAssembly.instantiateStreaming(t,e)}function Js(t){return async e=>{const r=await t.arrayBuffer();return WebAssembly.instantiate(r,e)}}async function Ks(t){return t&&await Xs(t),{createScanner(e){return new js(e.map(r=>typeof r=="string"?r:r.source))},createString(e){return new wn(e)}}}const Zs=Ts({langs:bn,themes:Ns,engine:()=>Ks(u(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url))});function fe(t){if([...t].length!==1)throw new Error(`Expected "${t}" to be a single code point`);return t.codePointAt(0)}function Ys(t,e,r){return t.has(e)||t.set(e,r),t.get(e)}const Qt=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),P=String.raw;function ge(t,e){if(t==null)throw new Error(e??"Value expected");return t}const An=P`\[\^?`,vn=`c.? | C(?:-.?)?|${P`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${P`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${P`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${P`o\{[^\}]*\}?`}|${P`\d{1,3}`}`,Jt=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Ne=new RegExp(P`
|
|
13
13
|
\\ (?:
|
|
14
|
-
${
|
|
14
|
+
${vn}
|
|
15
15
|
| [gk]<[^>]*>?
|
|
16
16
|
| [gk]'[^']*'?
|
|
17
17
|
| .
|
|
@@ -29,19 +29,19 @@ import{ly as Mt,lz as Br,lA as zn,lB as qn,lC as Xn,lD as tr,lE as Qn,lF as Jn,l
|
|
|
29
29
|
| \*[^\)]*\)?
|
|
30
30
|
)?
|
|
31
31
|
| (?:${Jt.source})+
|
|
32
|
-
| ${
|
|
32
|
+
| ${An}
|
|
33
33
|
| .
|
|
34
34
|
`.replace(/\s+/g,""),"gsu"),ht=new RegExp(P`
|
|
35
35
|
\\ (?:
|
|
36
|
-
${
|
|
36
|
+
${vn}
|
|
37
37
|
| .
|
|
38
38
|
)
|
|
39
39
|
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
40
|
-
| ${
|
|
40
|
+
| ${An}
|
|
41
41
|
| &&
|
|
42
42
|
| .
|
|
43
|
-
`.replace(/\s+/g,""),"gsu");function
|
|
44
|
-
`,n);return{lastIndex:s===-1?e.length:s}}if(/^\s$/.test(r)){const s=/\s+/y;return s.lastIndex=n,{lastIndex:s.exec(e)?s.lastIndex:n}}}if(r===".")return{token:re("dot",r)};if(r==="^"||r==="$"){const s=t.singleline?{"^":P`\A`,$:P`\Z`}[r]:r;return{token:Er(s,r)}}return r==="|"?{token:na(r)}:Jt.test(r)?{tokens:wa(r)}:{token:q(fe(r),r)}}function ta(t,e,r){const n=[br(e[1]==="^",e)];let i=1,o;for(ht.lastIndex=r;o=ht.exec(t);){const s=o[0];if(s[0]==="["&&s[1]!==":")i++,n.push(br(s[1]==="^",s));else if(s==="]"){if(n.at(-1).type==="CharacterClassOpen")n.push(q(93,s));else if(i--,n.push(ia(s)),!i)break}else{const l=ra(s);Array.isArray(l)?n.push(...l):n.push(l)}}return{tokens:n,lastIndex:ht.lastIndex||t.length}}function ra(t){if(t[0]==="\\")return vn(t,{inCharClass:!0});if(t[0]==="["){const e=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);if(!e||!Qt.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return re("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?oa(t):t==="&&"?sa(t):q(fe(t),t)}function vn(t,{inCharClass:e}){const r=t[1];if(r==="c"||r==="C")return da(t);if("dDhHsSwW".includes(r))return ga(t);if(t.startsWith(P`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${t}"`);if(/^\\[pP]\{/.test(t)){if(t.length===3)throw new Error(`Incomplete or invalid Unicode property "${t}"`);return _a(t)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(t))try{const n=t.split(/\\x/).slice(1).map(s=>parseInt(s,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(n)),o=new TextEncoder;return[...i].map(s=>{const l=[...o.encode(s)].map(a=>`\\x${a.toString(16)}`).join("");return q(fe(s),l)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(r==="u"||r==="x")return q(Ea(t),t);if(wr.has(r))return q(wr.get(r),t);if(/\d/.test(r))return aa(e,t);if(t==="\\")throw new Error(P`Incomplete escape "\"`);if(r==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return q(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function na(t){return{type:"Alternator",raw:t}}function Er(t,e){return{type:"Assertion",kind:t,raw:e}}function Cn(t){return{type:"Backreference",raw:t}}function q(t,e){return{type:"Character",value:t,raw:e}}function ia(t){return{type:"CharacterClassClose",raw:t}}function oa(t){return{type:"CharacterClassHyphen",raw:t}}function sa(t){return{type:"CharacterClassIntersector",raw:t}}function br(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function re(t,e,r={}){return{type:"CharacterSet",kind:t,...r,raw:e}}function In(t,e,r={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:ge(r.flags),raw:e}}function aa(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function la(t){return{type:"GroupClose",raw:t}}function le(t,e,r={}){return{type:"GroupOpen",kind:t,...r,raw:e}}function ua(t,e,r,n){return{type:"NamedCallout",kind:t,tag:e,arguments:r,raw:n}}function ca(t,e,r,n){return{type:"Quantifier",kind:t,min:e,max:r,raw:n}}function pa(t){return{type:"Subroutine",raw:t}}const ma=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),wr=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function da(t){const e=t[1]==="c"?t[2]:t[3];if(!e||!/[A-Za-z]/.test(e))throw new Error(`Unsupported control character "${t}"`);return q(fe(e.toUpperCase())-64,t)}function ha(t,e){let{on:r,off:n}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;n??="";const i=(e.getCurrentModX()||r.includes("x"))&&!n.includes("x"),o=vr(r),s=vr(n),l={};if(o&&(l.enable=o),s&&(l.disable=s),t.endsWith(")"))return e.replaceCurrentModX(i),In("flags",t,{flags:l});if(t.endsWith(":"))return e.pushModX(i),e.numOpenGroups++,le("group",t,{...(o||s)&&{flags:l}});throw new Error(`Unexpected flag modifier "${t}"`)}function fa(t){const e=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(t);if(!e)throw new Error(`Incomplete or invalid named callout "${t}"`);const{name:r,tag:n,args:i}=e.groups;if(!r)throw new Error(`Invalid named callout "${t}"`);if(n==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);const o=i?i.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[s,l,a]=o,u=ma.has(r)?r.toLowerCase():"custom";switch(u){case"fail":case"mismatch":case"skip":if(o.length>0)throw new Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(typeof s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!o.length||o.length>2)throw new Error(`Named callout must have one or two arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(o.length===2&&(typeof l=="number"||!/^[<>X]$/.test(l)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${l}"`);break;case"count":case"total_count":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(o.length===1&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(o.length!==3)throw new Error(`Named callout must have three arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(typeof l=="number"||!/^(?:[<>!=]=|[<>])$/.test(l))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${l}"`);if(typeof a=="string"&&!/^[A-Za-z_]\w*$/.test(a))throw new Error(`Named callout argument three must be a tag or number "${a}"`);break;case"custom":throw new Error(`Undefined callout name "${r}"`);default:throw new Error(`Unexpected named callout kind "${u}"`)}return ua(u,n??null,i?.split(",")??null,t)}function Ar(t){let e=null,r,n;if(t[0]==="{"){const{minStr:i,maxStr:o}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(t).groups,s=1e5;if(+i>s||o&&+o>s)throw new Error("Quantifier value unsupported in Oniguruma");if(r=+i,n=o===void 0?+i:o===""?1/0:+o,r>n&&(e="possessive",[r,n]=[n,r]),t.endsWith("?")){if(e==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');e="lazy"}else e||(e="greedy")}else r=t[0]==="+"?1:0,n=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return ca(e,r,n,t)}function ga(t){const e=t[1].toLowerCase();return re({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function _a(t){const{p:e,neg:r,value:n}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;return re("property",t,{value:n,negate:e==="P"&&!r||e==="p"&&!!r})}function vr(t){const e={};return t.includes("i")&&(e.ignoreCase=!0),t.includes("m")&&(e.dotAll=!0),t.includes("x")&&(e.extended=!0),Object.keys(e).length?e:null}function ya(t){const e={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let r=0;r<t.length;r++){const n=t[r];if(!"imxDPSWy".includes(n))throw new Error(`Invalid flag "${n}"`);if(n==="y"){if(!/^y{[gw]}/.test(t.slice(r)))throw new Error('Invalid or unspecified flag "y" mode');e.textSegmentMode=t[r+2]==="g"?"grapheme":"word",r+=3;continue}e[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[n]]=!0}return e}function Ea(t){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(t))throw new Error(`Incomplete or invalid escape "${t}"`);const e=t[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function ba(t,e){const{raw:r,inCharClass:n}=t,i=r.slice(1);if(!n&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=e))return[Cn(r)];const o=[],s=i.match(/^[0-7]+|\d/g);for(let l=0;l<s.length;l++){const a=s[l];let u;if(l===0&&a!=="8"&&a!=="9"){if(u=parseInt(a,8),u>127)throw new Error(P`Octal encoded byte above 177 unsupported "${r}"`)}else u=fe(a);o.push(q(u,(l===0?"\\":"")+a))}return o}function wa(t){const e=[],r=new RegExp(Jt,"gy");let n;for(;n=r.exec(t);){const i=n[0];if(i[0]==="{"){const o=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(o){const{min:s,max:l}=o.groups;if(+s>+l&&i.endsWith("?")){r.lastIndex--,e.push(Ar(i.slice(0,-1)));continue}}}e.push(Ar(i))}return e}function Rn(t,e){if(!Array.isArray(t.body))throw new Error("Expected node with body array");if(t.body.length!==1)return!1;const r=t.body[0];return!e||Object.keys(e).every(n=>e[n]===r[n])}function Aa(t){return va.has(t.type)}const va=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Sn(t,e={}){const r={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},n=Ys(t,{flags:r.flags,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline}}),i=(d,h)=>{const f=n.tokens[o.nextIndex];switch(o.parent=d,o.nextIndex++,f.type){case"Alternator":return ne();case"Assertion":return Ca(f);case"Backreference":return Ia(f,o);case"Character":return tt(f.value,{useLastValid:!!h.isCheckingRangeEnd});case"CharacterClassHyphen":return Ra(f,o,h);case"CharacterClassOpen":return Sa(f,o,h);case"CharacterSet":return La(f,o);case"Directive":return Na(f.kind,{flags:f.flags});case"GroupOpen":return ka(f,o,h);case"NamedCallout":return $a(f.kind,f.tag,f.arguments);case"Quantifier":return Ta(f,o);case"Subroutine":return Pa(f,o);default:throw new Error(`Unexpected token type "${f.type}"`)}},o={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:r.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:r.skipBackrefValidation,skipLookbehindValidation:r.skipLookbehindValidation,skipPropertyNameValidation:r.skipPropertyNameValidation,subroutines:[],tokens:n.tokens,unicodePropertyMap:r.unicodePropertyMap,walk:i},s=Ma(Da(n.flags));let l=s.body[0];for(;o.nextIndex<n.tokens.length;){const d=i(l,{});d.type==="Alternative"?(s.body.push(d),l=d):l.body.push(d)}const{capturingGroups:a,hasNumberedRef:u,namedGroupsByName:p,subroutines:m}=o;if(u&&p.size&&!r.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:d}of m)if(typeof d=="number"){if(d>a.length)throw new Error("Subroutine uses a group number that's not defined");d&&(a[d-1].isSubroutined=!0)}else if(p.has(d)){if(p.get(d).length>1)throw new Error(P`Subroutine uses a duplicate group name "\g<${d}>"`);p.get(d)[0].isSubroutined=!0}else throw new Error(P`Subroutine uses a group name that's not defined "\g<${d}>"`);return s}function Ca({kind:t}){return Ot(ge({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[t],`Unexpected assertion kind "${t}"`),{negate:t===P`\B`||t===P`\Y`})}function Ia({raw:t},e){const r=/^\\k[<']/.test(t),n=r?t.slice(3,-1):t.slice(1),i=(o,s=!1)=>{const l=e.capturingGroups.length;let a=!1;if(o>l)if(e.skipBackrefValidation)a=!0;else throw new Error(`Not enough capturing groups defined to the left "${t}"`);return e.hasNumberedRef=!0,xt(s?l+1-o:o,{orphan:a})};if(r){const o=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(o)return i(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(n))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(n))throw new Error(`Group name not defined to the left "${t}"`);return xt(n)}return i(+n)}function Ra(t,e,r){const{tokens:n,walk:i}=e,o=e.parent,s=o.body.at(-1),l=n[e.nextIndex];if(!r.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&l&&l.type!=="CharacterClassOpen"&&l.type!=="CharacterClassClose"&&l.type!=="CharacterClassIntersector"){const a=i(o,{...r,isCheckingRangeEnd:!0});if(s.type==="Character"&&a.type==="Character")return o.body.pop(),xa(s,a);throw new Error("Invalid character class range")}return tt(fe("-"))}function Sa({negate:t},e,r){const{tokens:n,walk:i}=e,o=[Ge()],s=n[e.nextIndex];let l=Rr(s);for(;l.type!=="CharacterClassClose";){if(l.type==="CharacterClassIntersector")o.push(Ge()),e.nextIndex++;else{const u=o.at(-1);u.body.push(i(u,r))}l=Rr(n[e.nextIndex],s)}const a=Ge({negate:t});return o.length===1?a.body=o[0].body:(a.kind="intersection",a.body=o.map(u=>u.body.length===1?u.body[0]:u)),e.nextIndex++,a}function La({kind:t,negate:e,value:r},n){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:o,unicodePropertyMap:s}=n;if(t==="property"){const l=rt(r);if(Qt.has(l)&&!s?.has(l))t="posix",r=l;else return ue(r,{negate:e,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:o,unicodePropertyMap:s})}return t==="posix"?Va(r,{negate:e}):Nt(t,{negate:e})}function ka(t,e,r){const{tokens:n,capturingGroups:i,namedGroupsByName:o,skipLookbehindValidation:s,walk:l}=e,a=Ga(t),u=a.type==="AbsenceFunction",p=Ir(a),m=p&&a.negate;if(a.type==="CapturingGroup"&&(i.push(a),a.name&&Zs(o,a.name,[]).push(a)),u&&r.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let d=Sr(n[e.nextIndex]);for(;d.type!=="GroupClose";){if(d.type==="Alternator")a.body.push(ne()),e.nextIndex++;else{const h=a.body.at(-1),f=l(h,{...r,isInAbsenceFunction:r.isInAbsenceFunction||u,isInLookbehind:r.isInLookbehind||p,isInNegLookbehind:r.isInNegLookbehind||m});if(h.body.push(f),(p||r.isInLookbehind)&&!s){const y="Lookbehind includes a pattern not allowed by Oniguruma";if(m||r.isInNegLookbehind){if(Cr(f)||f.type==="CapturingGroup")throw new Error(y)}else if(Cr(f)||Ir(f)&&f.negate)throw new Error(y)}}d=Sr(n[e.nextIndex])}return e.nextIndex++,a}function Ta({kind:t,min:e,max:r},n){const i=n.parent,o=i.body.at(-1);if(!o||!Aa(o))throw new Error("Quantifier requires a repeatable token");const s=kn(t,e,r,o);return i.body.pop(),s}function Pa({raw:t},e){const{capturingGroups:r,subroutines:n}=e;let i=t.slice(3,-1);const o=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(o){const l=+o.groups.num,a=r.length;if(e.hasNumberedRef=!0,i={"":l,"+":a+l,"-":a+1-l}[o.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const s=Tn(i);return n.push(s),s}function Oa(t,e){return{type:"AbsenceFunction",kind:t,body:Le(e?.body)}}function ne(t){return{type:"Alternative",body:Pn(t?.body)}}function Ot(t,e){const r={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(r.negate=!!e?.negate),r}function xt(t,e){const r=!!e?.orphan;return{type:"Backreference",ref:t,...r&&{orphan:r}}}function Ln(t,e){const r={name:void 0,isSubroutined:!1,...e};if(r.name!==void 0&&!Ba(r.name))throw new Error(`Group name "${r.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:t,...r.name&&{name:r.name},...r.isSubroutined&&{isSubroutined:r.isSubroutined},body:Le(e?.body)}}function tt(t,e){const r={useLastValid:!1,...e};if(t>1114111){const n=t.toString(16);if(r.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${n}}"`):new Error(`Invalid code point out of range in JS "\\x{${n}}"`)}return{type:"Character",value:t}}function Ge(t){const e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:Pn(t?.body)}}function xa(t,e){if(e.value<t.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:t,max:e}}function Nt(t,e){const r=!!e?.negate,n={type:"CharacterSet",kind:t};return(t==="digit"||t==="hex"||t==="newline"||t==="space"||t==="word")&&(n.negate=r),(t==="text_segment"||t==="newline"&&!r)&&(n.variableLength=!0),n}function Na(t,e={}){if(t==="keep")return{type:"Directive",kind:t};if(t==="flags")return{type:"Directive",kind:t,flags:ge(e.flags)};throw new Error(`Unexpected directive kind "${t}"`)}function Da(t){return{type:"Flags",...t}}function G(t){const e=t?.atomic,r=t?.flags;if(e&&r)throw new Error("Atomic group cannot have flags");return{type:"Group",...e&&{atomic:e},...r&&{flags:r},body:Le(t?.body)}}function ee(t){const e={behind:!1,negate:!1,...t};return{type:"LookaroundAssertion",kind:e.behind?"lookbehind":"lookahead",negate:e.negate,body:Le(t?.body)}}function $a(t,e,r){return{type:"NamedCallout",kind:t,tag:e,arguments:r}}function Va(t,e){const r=!!e?.negate;if(!Qt.has(t))throw new Error(`Invalid POSIX class "${t}"`);return{type:"CharacterSet",kind:"posix",value:t,negate:r}}function kn(t,e,r,n){if(e>r)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:r,body:n}}function Ma(t,e){return{type:"Regex",body:Le(e?.body),flags:t}}function Tn(t){return{type:"Subroutine",ref:t}}function ue(t,e){const r={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e};let n=r.unicodePropertyMap?.get(rt(t));if(!n){if(r.normalizeUnknownPropertyNames)n=Fa(t);else if(r.unicodePropertyMap&&!r.skipPropertyNameValidation)throw new Error(P`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:n??t,negate:r.negate}}function Ga({flags:t,kind:e,name:r,negate:n,number:i}){switch(e){case"absence_repeater":return Oa("repeater");case"atomic":return G({atomic:!0});case"capturing":return Ln(i,{name:r});case"group":return G({flags:t});case"lookahead":case"lookbehind":return ee({behind:e==="lookbehind",negate:n});default:throw new Error(`Unexpected group kind "${e}"`)}}function Le(t){if(t===void 0)t=[ne()];else if(!Array.isArray(t)||!t.length||!t.every(e=>e.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return t}function Pn(t){if(t===void 0)t=[];else if(!Array.isArray(t)||!t.every(e=>!!e.type))throw new Error("Invalid body; expected array of nodes");return t}function Cr(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function Ir(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function Ba(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function Fa(t){return t.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function rt(t){return t.replace(/[- _]+/g,"").toLowerCase()}function Rr(t,e){const r=e;return ge(t,`Unclosed character class${r?.type==="Character"&&r.value===93&&r.raw==="]"?' (started with "]")':""}`)}function Sr(t){return ge(t,"Unclosed group")}function we(t,e,r=null){function n(o,s){for(let l=0;l<o.length;l++){const a=i(o[l],s,l,o);l=Math.max(-1,l+a)}}function i(o,s=null,l=null,a=null){let u=0,p=!1;const m={node:o,parent:s,key:l,container:a,root:t,remove(){De(a).splice(Math.max(0,oe(l)+u),1),u--,p=!0},removeAllNextSiblings(){return De(a).splice(oe(l)+1)},removeAllPrevSiblings(){const g=oe(l)+u;return u-=g,De(a).splice(0,Math.max(0,g))},replaceWith(g,b={}){const _=!!b.traverse;a?a[Math.max(0,oe(l)+u)]=g:ge(s,"Can't replace root node")[l]=g,_&&i(g,s,l,a),p=!0},replaceWithMultiple(g,b={}){const _=!!b.traverse;if(De(a).splice(Math.max(0,oe(l)+u),1,...g),u+=g.length-1,_){let w=0;for(let v=0;v<g.length;v++)w+=i(g[v],s,oe(l)+v+w,a)}p=!0},skip(){p=!0}},{type:d}=o,h=e["*"],f=e[d],y=typeof h=="function"?h:h?.enter,E=typeof f=="function"?f:f?.enter;if(y?.(m,r),E?.(m,r),!p)switch(d){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":n(o.body,o);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(o.min,o,"min"),i(o.max,o,"max");break;case"Quantifier":i(o.body,o,"body");break;case"Regex":n(o.body,o),i(o.flags,o,"flags");break;default:throw new Error(`Unexpected node type "${d}"`)}return f?.exit?.(m,r),h?.exit?.(m,r),u}return i(t),t}function De(t){if(!Array.isArray(t))throw new Error("Container expected");return t}function oe(t){if(typeof t!="number")throw new Error("Numeric key expected");return t}const ja=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Ua(t,e){for(let r=0;r<t.length;r++)t[r]>=e&&t[r]++}function Wa(t,e,r,n){return t.slice(0,e)+n+t.slice(e+r.length)}const M=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Kt(t,e,r,n){const i=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let s=0,l="";for(const a of t.matchAll(i)){const{0:u,groups:{$skip:p}}=a;if(!p&&(!n||n===M.DEFAULT==!s)){r instanceof Function?l+=r(a,{context:s?M.CHAR_CLASS:M.DEFAULT,negated:o[o.length-1]}):l+=r;continue}u[0]==="["?(s++,o.push(u[1]==="^")):u==="]"&&s&&(s--,o.pop()),l+=u}return l}function On(t,e,r,n){Kt(t,e,r,n)}function Ha(t,e,r=0,n){if(!new RegExp(e,"su").test(t))return null;const i=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=r;let o=0,s;for(;s=i.exec(t);){const{0:l,groups:{$skip:a}}=s;if(!a&&(!n||n===M.DEFAULT==!o))return s;l==="["?o++:l==="]"&&o&&o--,i.lastIndex==s.index&&i.lastIndex++}return null}function $e(t,e,r){return!!Ha(t,e,0,r)}function za(t,e){const r=/\\?./gsu;r.lastIndex=e;let n=t.length,i=0,o=1,s;for(;s=r.exec(t);){const[l]=s;if(l==="[")i++;else if(i)l==="]"&&i--;else if(l==="(")o++;else if(l===")"&&(o--,!o)){n=s.index;break}}return t.slice(e,n)}const Lr=new RegExp(String.raw`(?<noncapturingStart>${ja})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function qa(t,e){const r=e?.hiddenCaptures??[];let n=e?.captureTransfers??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:n,hiddenCaptures:r};const i="(?>",o="(?:(?=(",s=[0],l=[];let a=0,u=0,p=NaN,m;do{m=!1;let d=0,h=0,f=!1,y;for(Lr.lastIndex=Number.isNaN(p)?0:p+o.length;y=Lr.exec(t);){const{0:E,index:g,groups:{capturingStart:b,noncapturingStart:_}}=y;if(E==="[")d++;else if(d)E==="]"&&d--;else if(E===i&&!f)p=g,f=!0;else if(f&&_)h++;else if(b)f?h++:(a++,s.push(a+u));else if(E===")"&&f){if(!h){u++;const w=a+u;if(t=`${t.slice(0,p)}${o}${t.slice(p+i.length,g)}))<$$${w}>)${t.slice(g+1)}`,m=!0,l.push(w),Ua(r,w),n.size){const v=new Map;n.forEach((k,N)=>{v.set(N>=w?N+1:N,k.map(U=>U>=w?U+1:U))}),n=v}break}h--}}}while(m);return r.push(...l),t=Kt(t,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:d,groups:{backrefNum:h,wrappedBackrefNum:f}})=>{if(h){const y=+h;if(y>s.length-1)throw new Error(`Backref "${d}" greater than number of captures`);return`\\${s[y]}`}return`\\${f}`},M.DEFAULT),{pattern:t,captureTransfers:n,hiddenCaptures:r}}const xn=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,ft=new RegExp(String.raw`
|
|
43
|
+
`.replace(/\s+/g,""),"gsu");function ea(t,e={}){const r={flags:"",...e,rules:{captureGroup:!1,singleline:!1,...e.rules}};if(typeof t!="string")throw new Error("String expected as pattern");const n=Ea(r.flags),i=[n.extended],o={captureGroup:r.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(m){i.push(m)},replaceCurrentModX(m){i[i.length-1]=m},singleline:r.rules.singleline};let s=[],l;for(Ne.lastIndex=0;l=Ne.exec(t);){const m=ta(o,t,l[0],Ne.lastIndex);m.tokens?s.push(...m.tokens):m.token&&s.push(m.token),m.lastIndex!==void 0&&(Ne.lastIndex=m.lastIndex)}const a=[];let c=0;s.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++c:m.raw==="("&&a.push(m)}),c||a.forEach((m,d)=>{m.kind="capturing",m.number=d+1});const p=c||a.length;return{tokens:s.map(m=>m.type==="EscapedNumber"?wa(m,p):m).flat(),flags:n}}function ta(t,e,r,n){const[i,o]=r;if(r==="["||r==="[^"){const s=ra(e,r,n);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(o))return{token:Er(r,r)};if(/^\\g[<']/.test(r)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(r))throw new Error(`Invalid group name "${r}"`);return{token:ma(r)}}if(/^\\k[<']/.test(r)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(r))throw new Error(`Invalid group name "${r}"`);return{token:In(r)}}if(o==="K")return{token:Rn("keep",r)};if(o==="N"||o==="R")return{token:re("newline",r,{negate:o==="N"})};if(o==="O")return{token:re("any",r)};if(o==="X")return{token:re("text_segment",r)};const s=Cn(r,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(i==="("){if(o==="*")return{token:ga(r)};if(r==="(?{")throw new Error(`Unsupported callout "${r}"`);if(r.startsWith("(?#")){if(e[n]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:n+1}}if(/^\(\?[-imx]+[:)]$/.test(r))return{token:fa(r,t)};if(t.pushModX(t.getCurrentModX()),t.numOpenGroups++,r==="("&&!t.captureGroup||r==="(?:")return{token:le("group",r)};if(r==="(?>")return{token:le("atomic",r)};if(r==="(?="||r==="(?!"||r==="(?<="||r==="(?<!")return{token:le(r[2]==="<"?"lookbehind":"lookahead",r,{negate:r.endsWith("!")})};if(r==="("&&t.captureGroup||r.startsWith("(?<")&&r.endsWith(">")||r.startsWith("(?'")&&r.endsWith("'"))return{token:le("capturing",r,{...r!=="("&&{name:r.slice(3,-1)}})};if(r.startsWith("(?~")){if(r==="(?~|")throw new Error(`Unsupported absence function kind "${r}"`);return{token:le("absence_repeater",r)}}throw r==="(?("?new Error(`Unsupported conditional "${r}"`):new Error(`Invalid or unsupported group option "${r}"`)}if(r===")"){if(t.popModX(),t.numOpenGroups--,t.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:ca(r)}}if(t.getCurrentModX()){if(r==="#"){const s=e.indexOf(`
|
|
44
|
+
`,n);return{lastIndex:s===-1?e.length:s}}if(/^\s$/.test(r)){const s=/\s+/y;return s.lastIndex=n,{lastIndex:s.exec(e)?s.lastIndex:n}}}if(r===".")return{token:re("dot",r)};if(r==="^"||r==="$"){const s=t.singleline?{"^":P`\A`,$:P`\Z`}[r]:r;return{token:Er(s,r)}}return r==="|"?{token:ia(r)}:Jt.test(r)?{tokens:Aa(r)}:{token:q(fe(r),r)}}function ra(t,e,r){const n=[br(e[1]==="^",e)];let i=1,o;for(ht.lastIndex=r;o=ht.exec(t);){const s=o[0];if(s[0]==="["&&s[1]!==":")i++,n.push(br(s[1]==="^",s));else if(s==="]"){if(n.at(-1).type==="CharacterClassOpen")n.push(q(93,s));else if(i--,n.push(oa(s)),!i)break}else{const l=na(s);Array.isArray(l)?n.push(...l):n.push(l)}}return{tokens:n,lastIndex:ht.lastIndex||t.length}}function na(t){if(t[0]==="\\")return Cn(t,{inCharClass:!0});if(t[0]==="["){const e=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);if(!e||!Qt.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return re("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?sa(t):t==="&&"?aa(t):q(fe(t),t)}function Cn(t,{inCharClass:e}){const r=t[1];if(r==="c"||r==="C")return ha(t);if("dDhHsSwW".includes(r))return _a(t);if(t.startsWith(P`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${t}"`);if(/^\\[pP]\{/.test(t)){if(t.length===3)throw new Error(`Incomplete or invalid Unicode property "${t}"`);return ya(t)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(t))try{const n=t.split(/\\x/).slice(1).map(s=>parseInt(s,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(n)),o=new TextEncoder;return[...i].map(s=>{const l=[...o.encode(s)].map(a=>`\\x${a.toString(16)}`).join("");return q(fe(s),l)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(r==="u"||r==="x")return q(ba(t),t);if(wr.has(r))return q(wr.get(r),t);if(/\d/.test(r))return la(e,t);if(t==="\\")throw new Error(P`Incomplete escape "\"`);if(r==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return q(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function ia(t){return{type:"Alternator",raw:t}}function Er(t,e){return{type:"Assertion",kind:t,raw:e}}function In(t){return{type:"Backreference",raw:t}}function q(t,e){return{type:"Character",value:t,raw:e}}function oa(t){return{type:"CharacterClassClose",raw:t}}function sa(t){return{type:"CharacterClassHyphen",raw:t}}function aa(t){return{type:"CharacterClassIntersector",raw:t}}function br(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function re(t,e,r={}){return{type:"CharacterSet",kind:t,...r,raw:e}}function Rn(t,e,r={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:ge(r.flags),raw:e}}function la(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function ca(t){return{type:"GroupClose",raw:t}}function le(t,e,r={}){return{type:"GroupOpen",kind:t,...r,raw:e}}function ua(t,e,r,n){return{type:"NamedCallout",kind:t,tag:e,arguments:r,raw:n}}function pa(t,e,r,n){return{type:"Quantifier",kind:t,min:e,max:r,raw:n}}function ma(t){return{type:"Subroutine",raw:t}}const da=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),wr=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function ha(t){const e=t[1]==="c"?t[2]:t[3];if(!e||!/[A-Za-z]/.test(e))throw new Error(`Unsupported control character "${t}"`);return q(fe(e.toUpperCase())-64,t)}function fa(t,e){let{on:r,off:n}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;n??="";const i=(e.getCurrentModX()||r.includes("x"))&&!n.includes("x"),o=vr(r),s=vr(n),l={};if(o&&(l.enable=o),s&&(l.disable=s),t.endsWith(")"))return e.replaceCurrentModX(i),Rn("flags",t,{flags:l});if(t.endsWith(":"))return e.pushModX(i),e.numOpenGroups++,le("group",t,{...(o||s)&&{flags:l}});throw new Error(`Unexpected flag modifier "${t}"`)}function ga(t){const e=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(t);if(!e)throw new Error(`Incomplete or invalid named callout "${t}"`);const{name:r,tag:n,args:i}=e.groups;if(!r)throw new Error(`Invalid named callout "${t}"`);if(n==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);const o=i?i.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[s,l,a]=o,c=da.has(r)?r.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(o.length>0)throw new Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(typeof s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!o.length||o.length>2)throw new Error(`Named callout must have one or two arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(o.length===2&&(typeof l=="number"||!/^[<>X]$/.test(l)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${l}"`);break;case"count":case"total_count":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(o.length===1&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(o.length!==3)throw new Error(`Named callout must have three arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(typeof l=="number"||!/^(?:[<>!=]=|[<>])$/.test(l))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${l}"`);if(typeof a=="string"&&!/^[A-Za-z_]\w*$/.test(a))throw new Error(`Named callout argument three must be a tag or number "${a}"`);break;case"custom":throw new Error(`Undefined callout name "${r}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return ua(c,n??null,i?.split(",")??null,t)}function Ar(t){let e=null,r,n;if(t[0]==="{"){const{minStr:i,maxStr:o}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(t).groups,s=1e5;if(+i>s||o&&+o>s)throw new Error("Quantifier value unsupported in Oniguruma");if(r=+i,n=o===void 0?+i:o===""?1/0:+o,r>n&&(e="possessive",[r,n]=[n,r]),t.endsWith("?")){if(e==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');e="lazy"}else e||(e="greedy")}else r=t[0]==="+"?1:0,n=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return pa(e,r,n,t)}function _a(t){const e=t[1].toLowerCase();return re({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function ya(t){const{p:e,neg:r,value:n}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;return re("property",t,{value:n,negate:e==="P"&&!r||e==="p"&&!!r})}function vr(t){const e={};return t.includes("i")&&(e.ignoreCase=!0),t.includes("m")&&(e.dotAll=!0),t.includes("x")&&(e.extended=!0),Object.keys(e).length?e:null}function Ea(t){const e={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let r=0;r<t.length;r++){const n=t[r];if(!"imxDPSWy".includes(n))throw new Error(`Invalid flag "${n}"`);if(n==="y"){if(!/^y{[gw]}/.test(t.slice(r)))throw new Error('Invalid or unspecified flag "y" mode');e.textSegmentMode=t[r+2]==="g"?"grapheme":"word",r+=3;continue}e[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[n]]=!0}return e}function ba(t){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(t))throw new Error(`Incomplete or invalid escape "${t}"`);const e=t[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function wa(t,e){const{raw:r,inCharClass:n}=t,i=r.slice(1);if(!n&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=e))return[In(r)];const o=[],s=i.match(/^[0-7]+|\d/g);for(let l=0;l<s.length;l++){const a=s[l];let c;if(l===0&&a!=="8"&&a!=="9"){if(c=parseInt(a,8),c>127)throw new Error(P`Octal encoded byte above 177 unsupported "${r}"`)}else c=fe(a);o.push(q(c,(l===0?"\\":"")+a))}return o}function Aa(t){const e=[],r=new RegExp(Jt,"gy");let n;for(;n=r.exec(t);){const i=n[0];if(i[0]==="{"){const o=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(i);if(o){const{min:s,max:l}=o.groups;if(+s>+l&&i.endsWith("?")){r.lastIndex--,e.push(Ar(i.slice(0,-1)));continue}}}e.push(Ar(i))}return e}function Sn(t,e){if(!Array.isArray(t.body))throw new Error("Expected node with body array");if(t.body.length!==1)return!1;const r=t.body[0];return!e||Object.keys(e).every(n=>e[n]===r[n])}function va(t){return Ca.has(t.type)}const Ca=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Ln(t,e={}){const r={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},n=ea(t,{flags:r.flags,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline}}),i=(d,h)=>{const f=n.tokens[o.nextIndex];switch(o.parent=d,o.nextIndex++,f.type){case"Alternator":return ne();case"Assertion":return Ia(f);case"Backreference":return Ra(f,o);case"Character":return tt(f.value,{useLastValid:!!h.isCheckingRangeEnd});case"CharacterClassHyphen":return Sa(f,o,h);case"CharacterClassOpen":return La(f,o,h);case"CharacterSet":return ka(f,o);case"Directive":return Da(f.kind,{flags:f.flags});case"GroupOpen":return Ta(f,o,h);case"NamedCallout":return Va(f.kind,f.tag,f.arguments);case"Quantifier":return Pa(f,o);case"Subroutine":return Oa(f,o);default:throw new Error(`Unexpected token type "${f.type}"`)}},o={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:r.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:r.skipBackrefValidation,skipLookbehindValidation:r.skipLookbehindValidation,skipPropertyNameValidation:r.skipPropertyNameValidation,subroutines:[],tokens:n.tokens,unicodePropertyMap:r.unicodePropertyMap,walk:i},s=Ga($a(n.flags));let l=s.body[0];for(;o.nextIndex<n.tokens.length;){const d=i(l,{});d.type==="Alternative"?(s.body.push(d),l=d):l.body.push(d)}const{capturingGroups:a,hasNumberedRef:c,namedGroupsByName:p,subroutines:m}=o;if(c&&p.size&&!r.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:d}of m)if(typeof d=="number"){if(d>a.length)throw new Error("Subroutine uses a group number that's not defined");d&&(a[d-1].isSubroutined=!0)}else if(p.has(d)){if(p.get(d).length>1)throw new Error(P`Subroutine uses a duplicate group name "\g<${d}>"`);p.get(d)[0].isSubroutined=!0}else throw new Error(P`Subroutine uses a group name that's not defined "\g<${d}>"`);return s}function Ia({kind:t}){return Ot(ge({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[t],`Unexpected assertion kind "${t}"`),{negate:t===P`\B`||t===P`\Y`})}function Ra({raw:t},e){const r=/^\\k[<']/.test(t),n=r?t.slice(3,-1):t.slice(1),i=(o,s=!1)=>{const l=e.capturingGroups.length;let a=!1;if(o>l)if(e.skipBackrefValidation)a=!0;else throw new Error(`Not enough capturing groups defined to the left "${t}"`);return e.hasNumberedRef=!0,xt(s?l+1-o:o,{orphan:a})};if(r){const o=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(o)return i(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(n))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(n))throw new Error(`Group name not defined to the left "${t}"`);return xt(n)}return i(+n)}function Sa(t,e,r){const{tokens:n,walk:i}=e,o=e.parent,s=o.body.at(-1),l=n[e.nextIndex];if(!r.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&l&&l.type!=="CharacterClassOpen"&&l.type!=="CharacterClassClose"&&l.type!=="CharacterClassIntersector"){const a=i(o,{...r,isCheckingRangeEnd:!0});if(s.type==="Character"&&a.type==="Character")return o.body.pop(),Na(s,a);throw new Error("Invalid character class range")}return tt(fe("-"))}function La({negate:t},e,r){const{tokens:n,walk:i}=e,o=[Ge()],s=n[e.nextIndex];let l=Rr(s);for(;l.type!=="CharacterClassClose";){if(l.type==="CharacterClassIntersector")o.push(Ge()),e.nextIndex++;else{const c=o.at(-1);c.body.push(i(c,r))}l=Rr(n[e.nextIndex],s)}const a=Ge({negate:t});return o.length===1?a.body=o[0].body:(a.kind="intersection",a.body=o.map(c=>c.body.length===1?c.body[0]:c)),e.nextIndex++,a}function ka({kind:t,negate:e,value:r},n){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:o,unicodePropertyMap:s}=n;if(t==="property"){const l=rt(r);if(Qt.has(l)&&!s?.has(l))t="posix",r=l;else return ce(r,{negate:e,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:o,unicodePropertyMap:s})}return t==="posix"?Ma(r,{negate:e}):Nt(t,{negate:e})}function Ta(t,e,r){const{tokens:n,capturingGroups:i,namedGroupsByName:o,skipLookbehindValidation:s,walk:l}=e,a=Ba(t),c=a.type==="AbsenceFunction",p=Ir(a),m=p&&a.negate;if(a.type==="CapturingGroup"&&(i.push(a),a.name&&Ys(o,a.name,[]).push(a)),c&&r.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let d=Sr(n[e.nextIndex]);for(;d.type!=="GroupClose";){if(d.type==="Alternator")a.body.push(ne()),e.nextIndex++;else{const h=a.body.at(-1),f=l(h,{...r,isInAbsenceFunction:r.isInAbsenceFunction||c,isInLookbehind:r.isInLookbehind||p,isInNegLookbehind:r.isInNegLookbehind||m});if(h.body.push(f),(p||r.isInLookbehind)&&!s){const y="Lookbehind includes a pattern not allowed by Oniguruma";if(m||r.isInNegLookbehind){if(Cr(f)||f.type==="CapturingGroup")throw new Error(y)}else if(Cr(f)||Ir(f)&&f.negate)throw new Error(y)}}d=Sr(n[e.nextIndex])}return e.nextIndex++,a}function Pa({kind:t,min:e,max:r},n){const i=n.parent,o=i.body.at(-1);if(!o||!va(o))throw new Error("Quantifier requires a repeatable token");const s=Tn(t,e,r,o);return i.body.pop(),s}function Oa({raw:t},e){const{capturingGroups:r,subroutines:n}=e;let i=t.slice(3,-1);const o=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(o){const l=+o.groups.num,a=r.length;if(e.hasNumberedRef=!0,i={"":l,"+":a+l,"-":a+1-l}[o.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const s=Pn(i);return n.push(s),s}function xa(t,e){return{type:"AbsenceFunction",kind:t,body:Le(e?.body)}}function ne(t){return{type:"Alternative",body:On(t?.body)}}function Ot(t,e){const r={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(r.negate=!!e?.negate),r}function xt(t,e){const r=!!e?.orphan;return{type:"Backreference",ref:t,...r&&{orphan:r}}}function kn(t,e){const r={name:void 0,isSubroutined:!1,...e};if(r.name!==void 0&&!Fa(r.name))throw new Error(`Group name "${r.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:t,...r.name&&{name:r.name},...r.isSubroutined&&{isSubroutined:r.isSubroutined},body:Le(e?.body)}}function tt(t,e){const r={useLastValid:!1,...e};if(t>1114111){const n=t.toString(16);if(r.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${n}}"`):new Error(`Invalid code point out of range in JS "\\x{${n}}"`)}return{type:"Character",value:t}}function Ge(t){const e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:On(t?.body)}}function Na(t,e){if(e.value<t.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:t,max:e}}function Nt(t,e){const r=!!e?.negate,n={type:"CharacterSet",kind:t};return(t==="digit"||t==="hex"||t==="newline"||t==="space"||t==="word")&&(n.negate=r),(t==="text_segment"||t==="newline"&&!r)&&(n.variableLength=!0),n}function Da(t,e={}){if(t==="keep")return{type:"Directive",kind:t};if(t==="flags")return{type:"Directive",kind:t,flags:ge(e.flags)};throw new Error(`Unexpected directive kind "${t}"`)}function $a(t){return{type:"Flags",...t}}function G(t){const e=t?.atomic,r=t?.flags;if(e&&r)throw new Error("Atomic group cannot have flags");return{type:"Group",...e&&{atomic:e},...r&&{flags:r},body:Le(t?.body)}}function ee(t){const e={behind:!1,negate:!1,...t};return{type:"LookaroundAssertion",kind:e.behind?"lookbehind":"lookahead",negate:e.negate,body:Le(t?.body)}}function Va(t,e,r){return{type:"NamedCallout",kind:t,tag:e,arguments:r}}function Ma(t,e){const r=!!e?.negate;if(!Qt.has(t))throw new Error(`Invalid POSIX class "${t}"`);return{type:"CharacterSet",kind:"posix",value:t,negate:r}}function Tn(t,e,r,n){if(e>r)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:r,body:n}}function Ga(t,e){return{type:"Regex",body:Le(e?.body),flags:t}}function Pn(t){return{type:"Subroutine",ref:t}}function ce(t,e){const r={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e};let n=r.unicodePropertyMap?.get(rt(t));if(!n){if(r.normalizeUnknownPropertyNames)n=ja(t);else if(r.unicodePropertyMap&&!r.skipPropertyNameValidation)throw new Error(P`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:n??t,negate:r.negate}}function Ba({flags:t,kind:e,name:r,negate:n,number:i}){switch(e){case"absence_repeater":return xa("repeater");case"atomic":return G({atomic:!0});case"capturing":return kn(i,{name:r});case"group":return G({flags:t});case"lookahead":case"lookbehind":return ee({behind:e==="lookbehind",negate:n});default:throw new Error(`Unexpected group kind "${e}"`)}}function Le(t){if(t===void 0)t=[ne()];else if(!Array.isArray(t)||!t.length||!t.every(e=>e.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return t}function On(t){if(t===void 0)t=[];else if(!Array.isArray(t)||!t.every(e=>!!e.type))throw new Error("Invalid body; expected array of nodes");return t}function Cr(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function Ir(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function Fa(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function ja(t){return t.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function rt(t){return t.replace(/[- _]+/g,"").toLowerCase()}function Rr(t,e){const r=e;return ge(t,`Unclosed character class${r?.type==="Character"&&r.value===93&&r.raw==="]"?' (started with "]")':""}`)}function Sr(t){return ge(t,"Unclosed group")}function we(t,e,r=null){function n(o,s){for(let l=0;l<o.length;l++){const a=i(o[l],s,l,o);l=Math.max(-1,l+a)}}function i(o,s=null,l=null,a=null){let c=0,p=!1;const m={node:o,parent:s,key:l,container:a,root:t,remove(){De(a).splice(Math.max(0,oe(l)+c),1),c--,p=!0},removeAllNextSiblings(){return De(a).splice(oe(l)+1)},removeAllPrevSiblings(){const g=oe(l)+c;return c-=g,De(a).splice(0,Math.max(0,g))},replaceWith(g,b={}){const _=!!b.traverse;a?a[Math.max(0,oe(l)+c)]=g:ge(s,"Can't replace root node")[l]=g,_&&i(g,s,l,a),p=!0},replaceWithMultiple(g,b={}){const _=!!b.traverse;if(De(a).splice(Math.max(0,oe(l)+c),1,...g),c+=g.length-1,_){let w=0;for(let v=0;v<g.length;v++)w+=i(g[v],s,oe(l)+v+w,a)}p=!0},skip(){p=!0}},{type:d}=o,h=e["*"],f=e[d],y=typeof h=="function"?h:h?.enter,E=typeof f=="function"?f:f?.enter;if(y?.(m,r),E?.(m,r),!p)switch(d){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":n(o.body,o);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":i(o.min,o,"min"),i(o.max,o,"max");break;case"Quantifier":i(o.body,o,"body");break;case"Regex":n(o.body,o),i(o.flags,o,"flags");break;default:throw new Error(`Unexpected node type "${d}"`)}return f?.exit?.(m,r),h?.exit?.(m,r),c}return i(t),t}function De(t){if(!Array.isArray(t))throw new Error("Container expected");return t}function oe(t){if(typeof t!="number")throw new Error("Numeric key expected");return t}const Ua=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Wa(t,e){for(let r=0;r<t.length;r++)t[r]>=e&&t[r]++}function Ha(t,e,r,n){return t.slice(0,e)+n+t.slice(e+r.length)}const M=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Kt(t,e,r,n){const i=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let s=0,l="";for(const a of t.matchAll(i)){const{0:c,groups:{$skip:p}}=a;if(!p&&(!n||n===M.DEFAULT==!s)){r instanceof Function?l+=r(a,{context:s?M.CHAR_CLASS:M.DEFAULT,negated:o[o.length-1]}):l+=r;continue}c[0]==="["?(s++,o.push(c[1]==="^")):c==="]"&&s&&(s--,o.pop()),l+=c}return l}function xn(t,e,r,n){Kt(t,e,r,n)}function za(t,e,r=0,n){if(!new RegExp(e,"su").test(t))return null;const i=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=r;let o=0,s;for(;s=i.exec(t);){const{0:l,groups:{$skip:a}}=s;if(!a&&(!n||n===M.DEFAULT==!o))return s;l==="["?o++:l==="]"&&o&&o--,i.lastIndex==s.index&&i.lastIndex++}return null}function $e(t,e,r){return!!za(t,e,0,r)}function qa(t,e){const r=/\\?./gsu;r.lastIndex=e;let n=t.length,i=0,o=1,s;for(;s=r.exec(t);){const[l]=s;if(l==="[")i++;else if(i)l==="]"&&i--;else if(l==="(")o++;else if(l===")"&&(o--,!o)){n=s.index;break}}return t.slice(e,n)}const Lr=new RegExp(String.raw`(?<noncapturingStart>${Ua})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Xa(t,e){const r=e?.hiddenCaptures??[];let n=e?.captureTransfers??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:n,hiddenCaptures:r};const i="(?>",o="(?:(?=(",s=[0],l=[];let a=0,c=0,p=NaN,m;do{m=!1;let d=0,h=0,f=!1,y;for(Lr.lastIndex=Number.isNaN(p)?0:p+o.length;y=Lr.exec(t);){const{0:E,index:g,groups:{capturingStart:b,noncapturingStart:_}}=y;if(E==="[")d++;else if(d)E==="]"&&d--;else if(E===i&&!f)p=g,f=!0;else if(f&&_)h++;else if(b)f?h++:(a++,s.push(a+c));else if(E===")"&&f){if(!h){c++;const w=a+c;if(t=`${t.slice(0,p)}${o}${t.slice(p+i.length,g)}))<$$${w}>)${t.slice(g+1)}`,m=!0,l.push(w),Wa(r,w),n.size){const v=new Map;n.forEach((k,N)=>{v.set(N>=w?N+1:N,k.map(U=>U>=w?U+1:U))}),n=v}break}h--}}}while(m);return r.push(...l),t=Kt(t,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:d,groups:{backrefNum:h,wrappedBackrefNum:f}})=>{if(h){const y=+h;if(y>s.length-1)throw new Error(`Backref "${d}" greater than number of captures`);return`\\${s[y]}`}return`\\${f}`},M.DEFAULT),{pattern:t,captureTransfers:n,hiddenCaptures:r}}const Nn=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,ft=new RegExp(String.raw`
|
|
45
45
|
\\(?: \d+
|
|
46
46
|
| c[A-Za-z]
|
|
47
47
|
| [gk]<[^>]+>
|
|
@@ -54,9 +54,9 @@ import{ly as Mt,lz as Br,lA as zn,lB as qn,lC as Xn,lD as tr,lE as Qn,lF as Jn,l
|
|
|
54
54
|
| [A-Za-z\-]+:
|
|
55
55
|
| \(DEFINE\)
|
|
56
56
|
))?
|
|
57
|
-
| (?<qBase>${
|
|
57
|
+
| (?<qBase>${Nn})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
58
58
|
| \\?.
|
|
59
|
-
`.replace(/\s+/g,""),"gsu");function
|
|
59
|
+
`.replace(/\s+/g,""),"gsu");function Qa(t){if(!new RegExp(`${Nn}\\+`).test(t))return{pattern:t};const e=[];let r=null,n=null,i="",o=0,s;for(ft.lastIndex=0;s=ft.exec(t);){const{0:l,index:a,groups:{qBase:c,qMod:p,invalidQ:m}}=s;if(l==="[")o||(n=a),o++;else if(l==="]")o?o--:n=null;else if(!o)if(p==="+"&&i&&!i.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${l}"`);let d=-1;if(/^\{\d+\}$/.test(c))t=Ha(t,a+c.length,p,"");else{if(i===")"||i==="]"){const h=i===")"?r:n;if(h===null)throw new Error(`Invalid unmatched "${i}"`);t=`${t.slice(0,h)}(?>${t.slice(h,a)}${c})${t.slice(a+l.length)}`}else t=`${t.slice(0,a-i.length)}(?>${i}${c})${t.slice(a+l.length)}`;d+=4}ft.lastIndex+=d}else l[0]==="("?e.push(a):l===")"&&(r=e.length?e.pop():null);i=l}return{pattern:t}}const $=String.raw,Ja=$`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Dt=$`\(\?R=(?<rDepth>[^\)]+)\)|${Ja}`,nt=$`\(\?<(?![=!])(?<captureName>[^>]+)>`,Dn=$`${nt}|(?<unnamed>\()(?!\?)`,Z=new RegExp($`${nt}|${Dt}|\(\?|\\?.`,"gsu"),gt="Cannot use multiple overlapping recursions";function Ka(t,e){const{hiddenCaptures:r,mode:n}={hiddenCaptures:[],mode:"plugin",...e};let i=e?.captureTransfers??new Map;if(!new RegExp(Dt,"su").test(t))return{pattern:t,captureTransfers:i,hiddenCaptures:r};if(n==="plugin"&&$e(t,$`\(\?\(DEFINE\)`,M.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],s=$e(t,$`\\[1-9]`,M.DEFAULT),l=new Map,a=[];let c=!1,p=0,m=0,d;for(Z.lastIndex=0;d=Z.exec(t);){const{0:h,groups:{captureName:f,rDepth:y,gRNameOrNum:E,gRDepth:g}}=d;if(h==="[")p++;else if(p)h==="]"&&p--;else if(y){if(kr(y),c)throw new Error(gt);if(s)throw new Error(`${n==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const b=t.slice(0,d.index),_=t.slice(Z.lastIndex);if($e(_,Dt,M.DEFAULT))throw new Error(gt);const w=+y-1;t=Tr(b,_,w,!1,r,o,m),i=Or(i,b,w,o.length,0,m);break}else if(E){kr(g);let b=!1;for(const X of a)if(X.name===E||X.num===+E){if(b=!0,X.hasRecursedWithin)throw new Error(gt);break}if(!b)throw new Error($`Recursive \g cannot be used outside the referenced group "${n==="external"?E:$`\g<${E}&R=${g}>`}"`);const _=l.get(E),w=qa(t,_);if(s&&$e(w,$`${nt}|\((?!\?)`,M.DEFAULT))throw new Error(`${n==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const v=t.slice(_,d.index),k=w.slice(v.length+h.length),N=o.length,U=+g-1,ke=Tr(v,k,U,!0,r,o,m);i=Or(i,v,U,o.length-N,N,m);const ot=t.slice(0,_),_e=t.slice(_+w.length);t=`${ot}${ke}${_e}`,Z.lastIndex+=ke.length-h.length-v.length-k.length,a.forEach(X=>X.hasRecursedWithin=!0),c=!0}else if(f)m++,l.set(String(m),Z.lastIndex),l.set(f,Z.lastIndex),a.push({num:m,name:f});else if(h[0]==="("){const b=h==="(";b&&(m++,l.set(String(m),Z.lastIndex)),a.push(b?{num:m}:{})}else h===")"&&a.pop()}return r.push(...o),{pattern:t,captureTransfers:i,hiddenCaptures:r}}function kr(t){const e=`Max depth must be integer between 2 and 100; used ${t}`;if(!/^[1-9]\d*$/.test(t))throw new Error(e);if(t=+t,t<2||t>100)throw new Error(e)}function Tr(t,e,r,n,i,o,s){const l=new Set;n&&xn(t+e,nt,({groups:{captureName:c}})=>{l.add(c)},M.DEFAULT);const a=[r,n?l:null,i,o,s];return`${t}${Pr(`(?:${t}`,"forward",...a)}(?:)${Pr(`${e})`,"backward",...a)}${e}`}function Pr(t,e,r,n,i,o,s){const a=p=>e==="forward"?p+2:r-p+2-1;let c="";for(let p=0;p<r;p++){const m=a(p);c+=Kt(t,$`${Dn}|\\k<(?<backref>[^>]+)>`,({0:d,groups:{captureName:h,unnamed:f,backref:y}})=>{if(y&&n&&!n.has(y))return d;const E=`_$${m}`;if(f||h){const g=s+o.length+1;return o.push(g),Za(i,g),f?d:`(?<${h}${E}>`}return $`\k<${y}${E}>`},M.DEFAULT)}return c}function Za(t,e){for(let r=0;r<t.length;r++)t[r]>=e&&t[r]++}function Or(t,e,r,n,i,o){if(t.size&&n){let s=0;xn(e,Dn,()=>s++,M.DEFAULT);const l=o-s+i,a=new Map;return t.forEach((c,p)=>{const m=(n-s*r)/r,d=s*r,h=p>l+s?p+n:p,f=[];for(const y of c)if(y<=l)f.push(y);else if(y>l+s+m)f.push(y+n);else if(y<=l+s)for(let E=0;E<=r;E++)f.push(y+s*E);else for(let E=0;E<=r;E++)f.push(y+d+m*E);a.set(h,f)}),a}return t}var S=String.fromCodePoint,A=String.raw,B={},it=globalThis.RegExp;B.flagGroups=(()=>{try{new it("(?i:)")}catch{return!1}return!0})();B.unicodeSets=(()=>{try{new it("[[]]","v")}catch{return!1}return!0})();B.bugFlagVLiteralHyphenIsRange=B.unicodeSets?(()=>{try{new it(A`[\d\-a]`,"v")}catch{return!0}return!1})():!1;B.bugNestedClassIgnoresNegation=B.unicodeSets&&new it("[[^a]]","v").test("a");function Je(t,{enable:e,disable:r}){return{dotAll:!r?.dotAll&&!!(e?.dotAll||t.dotAll),ignoreCase:!r?.ignoreCase&&!!(e?.ignoreCase||t.ignoreCase)}}function Re(t,e,r){return t.has(e)||t.set(e,r),t.get(e)}function $t(t,e){return xr[t]>=xr[e]}function Ya(t,e){if(t==null)throw new Error(e??"Value expected");return t}var xr={ES2025:2025,ES2024:2024,ES2018:2018},el={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function $n(t={}){if({}.toString.call(t)!=="[object Object]")throw new Error("Unexpected options");if(t.target!==void 0&&!el[t.target])throw new Error(`Unexpected target "${t.target}"`);const e={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...t,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...t.rules}};return e.target==="auto"&&(e.target=B.flagGroups?"ES2025":B.unicodeSets?"ES2024":"ES2018"),e}var tl="[ -\r ]",rl=new Set([S(304),S(305)]),H=A`[\p{L}\p{M}\p{N}\p{Pc}]`;function Vn(t){if(rl.has(t))return[t];const e=new Set,r=t.toLowerCase(),n=r.toUpperCase(),i=ol.get(r),o=nl.get(r),s=il.get(r);return[...n].length===1&&e.add(n),s&&e.add(s),i&&e.add(i),e.add(r),o&&e.add(o),[...e]}var Zt=new Map(`C Other
|
|
60
60
|
Cc Control cntrl
|
|
61
61
|
Cf Format
|
|
62
62
|
Cn Unassigned
|
|
@@ -146,8 +146,8 @@ Uppercase Upper
|
|
|
146
146
|
Variation_Selector VS
|
|
147
147
|
White_Space space
|
|
148
148
|
XID_Continue XIDC
|
|
149
|
-
XID_Start XIDS`.split(/\s/).map(t=>[rt(t),t])),
|
|
149
|
+
XID_Start XIDS`.split(/\s/).map(t=>[rt(t),t])),nl=new Map([["s",S(383)],[S(383),"s"]]),il=new Map([[S(223),S(7838)],[S(107),S(8490)],[S(229),S(8491)],[S(969),S(8486)]]),ol=new Map([Q(453),Q(456),Q(459),Q(498),..._t(8072,8079),..._t(8088,8095),..._t(8104,8111),Q(8124),Q(8140),Q(8188)]),sl=new Map([["alnum",A`[\p{Alpha}\p{Nd}]`],["alpha",A`\p{Alpha}`],["ascii",A`\p{ASCII}`],["blank",A`[\p{Zs}\t]`],["cntrl",A`\p{Cc}`],["digit",A`\p{Nd}`],["graph",A`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",A`\p{Lower}`],["print",A`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",A`[\p{P}\p{S}]`],["space",A`\p{space}`],["upper",A`\p{Upper}`],["word",A`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",A`\p{AHex}`]]);function al(t,e){const r=[];for(let n=t;n<=e;n++)r.push(n);return r}function Q(t){const e=S(t);return[e.toLowerCase(),e]}function _t(t,e){return al(t,e).map(r=>Q(r))}var Mn=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function ll(t,e){const r={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...e};Gn(t);const n={accuracy:r.accuracy,asciiWordBoundaries:r.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:$t(r.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:t.flags.digitIsAscii,spaceIsAscii:t.flags.spaceIsAscii,wordIsAscii:t.flags.wordIsAscii};we(t,cl,n);const i={dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},o={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:n.subroutineRefMap};we(t,ul,o);const s={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return we(t,pl,s),t._originMap=o.groupOriginByCopy,t._strategy=n.strategy,t}var cl={AbsenceFunction({node:t,parent:e,replaceWith:r}){const{body:n,kind:i}=t;if(i==="repeater"){const o=G();o.body[0].body.push(ee({negate:!0,body:n}),ce("Any"));const s=G();s.body[0].body.push(Tn("greedy",0,1/0,o)),r(C(s,e),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:t,parent:e,key:r},{flagDirectivesByAlt:n}){const i=t.body.filter(o=>o.kind==="flags");for(let o=r+1;o<e.body.length;o++){const s=e.body[o];Re(n,s,[]).push(...i)}},exit({node:t},{flagDirectivesByAlt:e}){if(e.get(t)?.length){const r=Fn(e.get(t));if(r){const n=G({flags:r});n.body[0].body=t.body,t.body=[C(n,t)]}}}},Assertion({node:t,parent:e,key:r,container:n,root:i,remove:o,replaceWith:s},l){const{kind:a,negate:c}=t,{asciiWordBoundaries:p,avoidSubclass:m,supportedGNodes:d,wordIsAscii:h}=l;if(a==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if(a==="line_end")s(C(ee({body:[ne({body:[Ot("string_end")]}),ne({body:[tt(10)]})]}),e));else if(a==="line_start")s(C(z(A`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),e));else if(a==="search_start")if(d.has(t))i.flags.sticky=!0,o();else{const f=n[r-1];if(f&&_l(f))s(C(ee({negate:!0}),e));else{if(m)throw new Error(A`Uses "\G" in a way that requires a subclass`);s(J(Ot("string_start"),e)),l.strategy="clip_search"}}else if(!(a==="string_end"||a==="string_start"))if(a==="string_end_newline")s(C(z(A`(?=\n?\z)`),e));else if(a==="word_boundary"){if(!h&&!p){const f=`(?:(?<=${H})(?!${H})|(?<!${H})(?=${H}))`,y=`(?:(?<=${H})(?=${H})|(?<!${H})(?!${H}))`;s(C(z(c?y:f),e))}}else throw new Error(`Unexpected assertion kind "${a}"`)},Backreference({node:t},{jsGroupNameMap:e}){let{ref:r}=t;typeof r=="string"&&!Et(r)&&(r=yt(r,e),t.ref=r)},CapturingGroup({node:t},{jsGroupNameMap:e,subroutineRefMap:r}){let{name:n}=t;n&&!Et(n)&&(n=yt(n,e),t.name=n),r.set(t.number,t),n&&r.set(n,t)},CharacterClassRange({node:t,parent:e,replaceWith:r}){if(e.kind==="intersection"){const n=Ge({body:[t]});r(C(n,e),{traverse:!0})}},CharacterSet({node:t,parent:e,replaceWith:r},{accuracy:n,minTargetEs2024:i,digitIsAscii:o,spaceIsAscii:s,wordIsAscii:l}){const{kind:a,negate:c,value:p}=t;if(o&&(a==="digit"||p==="digit")){r(J(Nt("digit",{negate:c}),e));return}if(s&&(a==="space"||p==="space")){r(C(bt(z(tl),c),e));return}if(l&&(a==="word"||p==="word")){r(J(Nt("word",{negate:c}),e));return}if(a==="any")r(J(ce("Any"),e));else if(a==="digit")r(J(ce("Nd",{negate:c}),e));else if(a!=="dot")if(a==="text_segment"){if(n==="strict")throw new Error(A`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",d=A`\p{RI}{2}|${m}(?:\u200D${m})*`;r(C(z(A`(?>\r\n|${i?A`\p{RGI_Emoji}`:d}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),e))}else if(a==="hex")r(J(ce("AHex",{negate:c}),e));else if(a==="newline")r(C(z(c?`[^
|
|
150
150
|
]`:`(?>\r
|
|
151
151
|
?|[
|
|
152
|
-
\v\f
\u2028\u2029])`),e));else if(a==="posix")if(!i&&(p==="graph"||p==="print")){if(n==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[p];u&&(m=`\0-${S(m.codePointAt(0)-1)}${S(m.codePointAt(2)+1)}-`),r(C(z(`[${m}]`),e))}else r(C(bt(z(ol.get(p)),u),e));else if(a==="property")Zt.has(rt(p))||(t.key="sc");else if(a==="space")r(J(ue("space",{negate:u}),e));else if(a==="word")r(C(bt(z(H),u),e));else throw new Error(`Unexpected character set kind "${a}"`)},Directive({node:t,parent:e,root:r,remove:n,replaceWith:i,removeAllPrevSiblings:o,removeAllNextSiblings:s}){const{kind:l,flags:a}=t;if(l==="flags")if(!a.enable&&!a.disable)n();else{const u=G({flags:a});u.body[0].body=s(),i(C(u,e),{traverse:!0})}else if(l==="keep"){const u=r.body[0],m=r.body.length===1&&Rn(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:r;if(e.parent!==m||m.body.length>1)throw new Error(A`Uses "\K" in a way that's unsupported`);const d=ee({behind:!0});d.body[0].body=o(),i(C(d,e))}else throw new Error(`Unexpected directive kind "${l}"`)},Flags({node:t,parent:e}){if(t.posixIsAscii)throw new Error('Unsupported flag "P"');if(t.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete t[r]),Object.assign(t,{global:!1,hasIndices:!1,multiline:!1,sticky:t.sticky??!1}),e.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:t}){if(!t.flags)return;const{enable:e,disable:r}=t.flags;e?.extended&&delete e.extended,r?.extended&&delete r.extended,e?.dotAll&&r?.dotAll&&delete e.dotAll,e?.ignoreCase&&r?.ignoreCase&&delete e.ignoreCase,e&&!Object.keys(e).length&&delete t.flags.enable,r&&!Object.keys(r).length&&delete t.flags.disable,!t.flags.enable&&!t.flags.disable&&delete t.flags},LookaroundAssertion({node:t},e){const{kind:r}=t;r==="lookbehind"&&(e.passedLookbehind=!0)},NamedCallout({node:t,parent:e,replaceWith:r}){const{kind:n}=t;if(n==="fail")r(C(ee({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){const e=G();e.body[0].body.push(t.body),t.body=C(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){const r=[];let n=!1,i=!1;for(const o of t.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const s=jn(o.body);s?(n=!0,Array.isArray(s)?r.push(...s):r.push(s)):i=!0}n&&!i&&r.forEach(o=>e.add(o))},exit(t,{accuracy:e,passedLookbehind:r,strategy:n}){if(e==="strict"&&r&&n)throw new Error(A`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:r}=t;typeof r=="string"&&!Et(r)&&(r=yt(r,e),t.ref=r)}},ul={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:r}){const{orphan:n,ref:i}=t;n||r.set(t,[...e.get(i).map(({node:o})=>o)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:r,skip:n},{groupOriginByCopy:i,groupsByName:o,multiplexCapturesToLeftByRef:s,openRefs:l,reffedNodesByReferencer:a}){const u=i.get(t);if(u&&l.has(t.number)){const m=J(Nr(t.number),e);a.set(m,l.get(t.number)),r(m);return}l.set(t.number,t),s.set(t.number,[]),t.name&&Re(s,t.name,[]);const p=s.get(t.name??t.number);for(let m=0;m<p.length;m++){const d=p[m];if(u===d.node||u&&u===d.origin||t===d.origin){p.splice(m,1);break}}if(s.get(t.number).push({node:t,origin:u}),t.name&&s.get(t.name).push({node:t,origin:u}),t.name){const m=Re(o,t.name,new Map);let d=!1;if(u)d=!0;else for(const h of m.values())if(!h.hasDuplicateNameToRemove){d=!0;break}o.get(t.name).set(t,{node:t,hasDuplicateNameToRemove:d})}},exit({node:t},{openRefs:e}){e.get(t.number)===t&&e.delete(t.number)}},Group:{enter({node:t},e){e.prevFlags=e.currentFlags,t.flags&&(e.currentFlags=Je(e.currentFlags,t.flags))},exit(t,e){e.currentFlags=e.prevFlags}},Subroutine({node:t,parent:e,replaceWith:r},n){const{isRecursive:i,ref:o}=t;if(i){let p=e;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===o||p.number===o)););n.reffedNodesByReferencer.set(t,p);return}const s=n.subroutineRefMap.get(o),l=o===0,a=l?Nr(0):Gn(s,n.groupOriginByCopy,null);let u=a;if(!l){const p=Bn(dl(s,d=>d.type==="Group"&&!!d.flags)),m=p?Je(n.globalFlags,p):n.globalFlags;pl(m,n.currentFlags)||(u=G({flags:hl(m)}),u.body[0].body.push(a))}r(C(u,e),{traverse:!l})}},cl={Backreference({node:t,parent:e,replaceWith:r},n){if(t.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,t.ref);return}const o=n.reffedNodesByReferencer.get(t).filter(s=>ml(s,t));if(!o.length)r(C(ee({negate:!0}),e));else if(o.length>1){const s=G({atomic:!0,body:o.reverse().map(l=>ne({body:[xt(l.number)]}))});r(C(s,e))}else t.ref=o[0].number},CapturingGroup({node:t},e){t.number=++e.numCapturesToLeft,t.name&&e.groupsByName.get(t.name).get(t).hasDuplicateNameToRemove&&delete t.name},Regex:{exit({node:t},e){const r=Math.max(e.highestOrphanBackref-e.numCapturesToLeft,0);for(let n=0;n<r;n++){const i=Ln();t.body.at(-1).body.push(i)}}},Subroutine({node:t},e){!t.isRecursive||t.ref===0||(t.ref=e.reffedNodesByReferencer.get(t).number)}};function Mn(t){we(t,{"*"({node:e,parent:r}){e.parent=r}})}function pl(t,e){return t.dotAll===e.dotAll&&t.ignoreCase===e.ignoreCase}function ml(t,e){let r=e;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===t)return!1;const n=Fn(r.parent);for(const i of n){if(i===r)break;if(i===t||Un(i,t))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function Gn(t,e,r,n){const i=Array.isArray(t)?[]:{};for(const[o,s]of Object.entries(t))o==="parent"?i.parent=Array.isArray(r)?n:r:s&&typeof s=="object"?i[o]=Gn(s,e,i,r):(o==="type"&&s==="CapturingGroup"&&e.set(i,e.get(t)??t),i[o]=s);return i}function Nr(t){const e=Tn(t);return e.isRecursive=!0,e}function dl(t,e){const r=[];for(;t=t.parent;)(!e||e(t))&&r.push(t);return r}function yt(t,e){if(e.has(t))return e.get(t);const r=`$${e.size}_${t.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return e.set(t,r),r}function Bn(t){const e=["dotAll","ignoreCase"],r={enable:{},disable:{}};return t.forEach(({flags:n})=>{e.forEach(i=>{n.enable?.[i]&&(delete r.disable[i],r.enable[i]=!0),n.disable?.[i]&&(r.disable[i]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function hl({dotAll:t,ignoreCase:e}){const r={};return(t||e)&&(r.enable={},t&&(r.enable.dotAll=!0),e&&(r.enable.ignoreCase=!0)),(!t||!e)&&(r.disable={},!t&&(r.disable.dotAll=!0),!e&&(r.disable.ignoreCase=!0)),r}function Fn(t){if(!t)throw new Error("Node expected");const{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function jn(t){const e=t.find(r=>r.kind==="search_start"||_l(r,{negate:!1})||!fl(r));if(!e)return null;if(e.kind==="search_start")return e;if(e.type==="LookaroundAssertion")return e.body[0].body[0];if(e.type==="CapturingGroup"||e.type==="Group"){const r=[];for(const n of e.body){const i=jn(n.body);if(!i)return null;Array.isArray(i)?r.push(...i):r.push(i)}return r}return null}function Un(t,e){const r=Fn(t)??[];for(const n of r)if(n===e||Un(n,e))return!0;return!1}function fl({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function gl(t){const e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function _l(t,e){const r={negate:null,...e};return t.type==="LookaroundAssertion"&&(r.negate===null||t.negate===r.negate)&&t.body.length===1&&Rn(t.body[0],{type:"Assertion",kind:"search_start"})}function Et(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function z(t,e){const n=Sn(t,{...e,unicodePropertyMap:Zt}).body;return n.length>1||n[0].body.length>1?G({body:n}):n[0].body[0]}function bt(t,e){return t.negate=e,t}function J(t,e){return t.parent=e,t}function C(t,e){return Mn(t),t.parent=e,t}function yl(t,e){const r=Dn(e),n=$t(r.target,"ES2024"),i=$t(r.target,"ES2025"),o=r.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw new Error("Invalid recursionLimit; use 2-20");let s=null,l=null;if(!i){const h=[t.flags.ignoreCase];we(t,El,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(f){h.push(f)},setHasCasedChar(){h.at(-1)?s=!0:l=!0}})}const a={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||s)&&!l)};let u=t;const p={accuracy:r.accuracy,appliedGlobalFlags:a,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:t._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!i&&s&&l),useFlagMods:i,useFlagV:n,verbose:r.verbose};function m(h){return p.lastNode=u,u=h,Za(bl[h.type],`Unexpected node type "${h.type}"`)(h,p,m)}const d={pattern:t.body.map(m).join("|"),flags:m(t.flags),options:{...t.options}};return n||(delete d.options.force.v,d.options.disable.v=!0,d.options.unicodeSetsPlugin=null),d._captureTransfers=new Map,d._hiddenCaptures=[],p.captureMap.forEach((h,f)=>{h.hidden&&d._hiddenCaptures.push(f),h.transferTo&&Re(d._captureTransfers,h.transferTo,[]).push(f)}),d}var El={"*":{enter({node:t},e){if($r(t)){const r=e.getCurrentModI();e.pushModI(t.flags?Je({ignoreCase:r},t.flags).ignoreCase:r)}},exit({node:t},e){$r(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){Yt(S(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},r){e(),Wn(t,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&Vn.has(t.value)&&e.setHasCasedChar()}},bl={Alternative({body:t},e,r){return t.map(r).join("")},Assertion({kind:t,negate:e}){if(t==="string_end")return"$";if(t==="string_start")return"^";if(t==="word_boundary")return e?A`\B`:A`\b`;throw new Error(`Unexpected assertion kind "${t}"`)},Backreference({ref:t},e){if(typeof t!="number")throw new Error("Unexpected named backref in transformed AST");if(!e.useFlagMods&&e.accuracy==="strict"&&e.currentFlags.ignoreCase&&!e.captureMap.get(t).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+t},CapturingGroup(t,e,r){const{body:n,name:i,number:o}=t,s={ignoreCase:e.currentFlags.ignoreCase},l=e.originMap.get(t);return l&&(s.hidden=!0,o>l.number&&(s.transferTo=l.number)),e.captureMap.set(o,s),`(${i?`?<${i}>`:""}${n.map(r).join("|")})`},Character({value:t},e){const r=S(t),n=se(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(n!==r)return n;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&Yt(r)){const i=$n(r);return e.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return r},CharacterClass(t,e,r){const{kind:n,negate:i,parent:o}=t;let{body:s}=t;if(n==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");B.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&s.some(Vr)&&(s=[tt(45),...s.filter(u=>!Vr(u))]);const l=()=>`[${i?"^":""}${s.map(r).join(n==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||B.bugNestedClassIgnoresNegation)&&!i){const p=s.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=G(),d=m.body[0];return m.parent=o,d.parent=m,s=s.filter(h=>!p.includes(h)),t.body=s,s.length?(t.parent=d,d.body.push(t)):m.body.pop(),p.forEach(h=>{const f=ne({body:[h]});h.parent=f,f.parent=m,m.body.push(f)}),r(m)}}e.inCharClass=!0;const u=l();return e.inCharClass=!1,u}const a=s[0];if(n==="union"&&!i&&a&&((!e.useFlagV||!e.verbose)&&o.kind==="union"&&!(B.bugFlagVLiteralHyphenIsRange&&e.useFlagV)||!e.verbose&&o.kind==="intersection"&&s.length===1&&a.type!=="CharacterClassRange"))return s.map(r).join("");if(!e.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return l()},CharacterClassRange(t,e){const r=t.min.value,n=t.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},o=se(r,i),s=se(n,i),l=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){const a=Wn(t);Il(a).forEach(p=>{l.add(Array.isArray(p)?`${se(p[0],i)}-${se(p[1],i)}`:se(p,i))})}return`${o}-${s}${[...l].join("")}`},CharacterSet({kind:t,negate:e,value:r,key:n},i){if(t==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":A`[^\n]`;if(t==="digit")return e?A`\D`:A`\d`;if(t==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Vn.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${e?A`\P`:A`\p`}{${n?`${n}=`:""}${r}}`}if(t==="word")return e?A`\W`:A`\w`;throw new Error(`Unexpected character set kind "${t}"`)},Flags(t,e){return(e.appliedGlobalFlags.ignoreCase?"i":"")+(t.dotAll?"s":"")+(t.sticky?"y":"")},Group({atomic:t,body:e,flags:r,parent:n},i,o){const s=i.currentFlags;r&&(i.currentFlags=Je(s,r));const l=e.map(o).join("|"),a=!i.verbose&&e.length===1&&n.type!=="Quantifier"&&!t&&(!i.useFlagMods||!r)?l:`(?${Rl(t,r,i.useFlagMods)}${l})`;return i.currentFlags=s,a},LookaroundAssertion({body:t,kind:e,negate:r},n,i){return`(?${`${e==="lookahead"?"":"<"}${r?"!":"="}`}${t.map(i).join("|")})`},Quantifier(t,e,r){return r(t.body)+Sl(t)},Subroutine({isRecursive:t,ref:e},r){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=r.recursionLimit;return e===0?`(?R=${n})`:A`\g<${e}&R=${n}>`}},wl=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Al=new Set(["-","\\","]","^","["]),vl=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Dr=new Map([[9,A`\t`],[10,A`\n`],[11,A`\v`],[12,A`\f`],[13,A`\r`],[8232,A`\u2028`],[8233,A`\u2029`],[65279,A`\uFEFF`]]),Cl=/^\p{Cased}$/u;function Yt(t){return Cl.test(t)}function Wn(t,e){const r=!!e?.firstOnly,n=t.min.value,i=t.max.value,o=[];if(n<65&&(i===65535||i>=131071)||n===65536&&i>=131071)return o;for(let s=n;s<=i;s++){const l=S(s);if(!Yt(l))continue;const a=$n(l).filter(u=>{const p=u.codePointAt(0);return p<n||p>i});if(a.length&&(o.push(...a),r))break}return o}function se(t,{escDigit:e,inCharClass:r,useFlagV:n}){if(Dr.has(t))return Dr.get(t);if(t<32||t>126&&t<160||t>262143||e&&Ll(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;const i=r?n?vl:Al:wl,o=S(t);return(i.has(o)?"\\":"")+o}function Il(t){const e=t.map(i=>i.codePointAt(0)).sort((i,o)=>i-o),r=[];let n=null;for(let i=0;i<e.length;i++)e[i+1]===e[i]+1?n??=e[i]:n===null?r.push(e[i]):(r.push([n,e[i]]),n=null);return r}function Rl(t,e,r){if(t)return">";let n="";if(e&&r){const{enable:i,disable:o}=e;n=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${n}:`}function Sl({kind:t,max:e,min:r}){let n;return!r&&e===1?n="?":!r&&e===1/0?n="*":r===1&&e===1/0?n="+":r===e?n=`{${r}}`:n=`{${r},${e===1/0?"":e}}`,n+{greedy:"",lazy:"?",possessive:"+"}[t]}function $r({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function Ll(t){return t>47&&t<58}function Vr({type:t,value:e}){return t==="Character"&&e===45}var kl=class Vt extends RegExp{#t=new Map;#e=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(e,r,n){const i=!!n?.lazyCompile;if(e instanceof RegExp){if(n)throw new Error("Cannot provide options when copying a regexp");const o=e;super(o,r),this.#n=o.source,o instanceof Vt&&(this.#t=o.#t,this.#r=o.#r,this.#i=o.#i,this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...n};super(i?"":e,r),this.#n=e,this.#t=Pl(o.hiddenCaptures,o.transfers),this.#i=o.strategy,this.rawOptions=n??{}}i||(this.#e=this)}exec(e){if(!this.#e){const{lazyCompile:i,...o}=this.rawOptions;this.#e=new Vt(this.#n,this.flags,o)}const r=this.global||this.sticky,n=this.lastIndex;if(this.#i==="clip_search"&&r&&n){this.lastIndex=0;const i=this.#o(e.slice(n));return i&&(Tl(i,n,e,this.hasIndices),this.lastIndex+=n),i}return this.#o(e)}#o(e){this.#e.lastIndex=this.lastIndex;const r=super.exec.call(this.#e,e);if(this.lastIndex=this.#e.lastIndex,!r||!this.#t.size)return r;const n=[...r];r.length=1;let i;this.hasIndices&&(i=[...r.indices],r.indices.length=1);const o=[0];for(let s=1;s<n.length;s++){const{hidden:l,transferTo:a}=this.#t.get(s)??{};if(l?o.push(null):(o.push(r.length),r.push(n[s]),this.hasIndices&&r.indices.push(i[s])),a&&n[s]!==void 0){const u=o[a];if(!u)throw new Error(`Invalid capture transfer to "${u}"`);if(r[u]=n[s],this.hasIndices&&(r.indices[u]=i[s]),r.groups){this.#r||(this.#r=Ol(this.source));const p=this.#r.get(a);p&&(r.groups[p]=n[s],this.hasIndices&&(r.indices.groups[p]=i[s]))}}}return r}};function Tl(t,e,r,n){if(t.index+=e,t.input=r,n){const i=t.indices;for(let s=0;s<i.length;s++){const l=i[s];l&&(i[s]=[l[0]+e,l[1]+e])}const o=i.groups;o&&Object.keys(o).forEach(s=>{const l=o[s];l&&(o[s]=[l[0]+e,l[1]+e])})}}function Pl(t,e){const r=new Map;for(const n of t)r.set(n,{hidden:!0});for(const[n,i]of e)for(const o of i)Re(r,o,{}).transferTo=n;return r}function Ol(t){const e=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map;let n=0,i=0,o;for(;o=e.exec(t);){const{0:s,groups:{capture:l,name:a}}=o;s==="["?n++:n?s==="]"&&n--:l&&(i++,a&&r.set(i,a))}return r}function xl(t,e){const r=Nl(t,e);return r.options?new kl(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function Nl(t,e){const r=Dn(e),n=Sn(t,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:Zt}),i=al(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),o=yl(i,r),s=Ja(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),l=Xa(s.pattern),a=qa(l.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),u={pattern:a.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=a.hiddenCaptures.sort((f,y)=>f-y),m=Array.from(a.captureTransfers),d=i._strategy,h=u.pattern.length>=r.lazyCompileLength;(p.length||m.length||d||h)&&(u.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},...d&&{strategy:d},...h&&{lazyCompile:h}})}return u}const Mr=4294967295;class Dl{constructor(e,r={}){this.patterns=e,this.options=r;const{forgiving:n=!1,cache:i,regexConstructor:o}=r;if(!o)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(s=>{if(typeof s!="string")return s;const l=i?.get(s);if(l){if(l instanceof RegExp)return l;if(n)return null;throw l}try{const a=o(s);return i?.set(s,a),a}catch(a){if(i?.set(s,a),n)return null;throw a}})}regexps;findNextMatchSync(e,r,n){const i=typeof e=="string"?e:e.content,o=[];function s(l,a,u=0){return{index:l,captureIndices:a.indices.map(p=>p==null?{start:Mr,end:Mr,length:0}:{start:p[0]+u,end:p[1]+u,length:p[1]-p[0]})}}for(let l=0;l<this.regexps.length;l++){const a=this.regexps[l];if(a)try{a.lastIndex=r;const u=a.exec(i);if(!u)continue;if(u.index===r)return s(l,u,0);o.push([l,u,0])}catch(u){if(this.options.forgiving)continue;throw u}}if(o.length){const l=Math.min(...o.map(a=>a[1].index));for(const[a,u,p]of o)if(u.index===l)return s(a,u,p)}return null}}function $l(t,e){return xl(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function Vl(t={}){const e=Object.assign({target:"auto",cache:new Map},t);return e.regexConstructor||=r=>$l(r,{target:e.target}),{createScanner(r){return new Dl(r,e)},createString(r){return{content:r}}}}var Ml=Gt("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-4","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),Gl=ce.memo(({children:t,result:e,language:r,className:n,...i})=>{let o=ce.useMemo(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]);return V.jsx("pre",{className:Gt(n,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":r,"data-streamdown":"code-block-body",style:o,...i,children:V.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:e.tokens.map((s,l)=>V.jsx("span",{className:Ml,children:s.map((a,u)=>V.jsx("span",{className:"dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!",style:{color:a.color,backgroundColor:a.bgColor,...a.htmlStyle},...a.htmlAttrs,children:a.content},u))},l))})})},(t,e)=>t.result===e.result&&t.language===e.language&&t.className===e.className),Bl=({className:t,language:e,style:r,...n})=>V.jsx("div",{className:Gt("my-4 w-full overflow-hidden rounded-xl border border-border",t),"data-language":e,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...r},...n}),Fl=({language:t,children:e})=>V.jsxs("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-language":t,"data-streamdown":"code-block-header",children:[V.jsx("span",{className:"ml-1 font-mono lowercase",children:t}),V.jsx("div",{className:"flex items-center gap-2",children:e})]}),jl=Vl({forgiving:!0}),wt=new Map,At=new Map,ae=new Map,Ul=(t,e)=>`${t}-${e[0]}-${e[1]}`,Wl=(t,e,r)=>{let n=t.slice(0,100),i=t.length>100?t.slice(-100):"";return`${e}:${r[0]}:${r[1]}:${t.length}:${n}:${i}`},Hn=t=>Object.hasOwn(En,t),Hl=(t,e)=>{let r=Hn(t)?t:"text",n=Ul(r,e);if(wt.has(n))return wt.get(n);let i=Ks({themes:e,langs:[r],engine:jl});return wt.set(n,i),i},Gr=(t,e,r,n)=>{let i=Hn(e)?e:"text",o=Wl(t,i,r);return At.has(o)?At.get(o):(n&&(ae.has(o)||ae.set(o,new Set),ae.get(o).add(n)),Hl(i,r).then(s=>{let l=s.codeToTokens(t,{lang:i,themes:{light:r[0],dark:r[1]}});At.set(o,l);let a=ae.get(o);if(a){for(let u of a)u(l);ae.delete(o)}}).catch(s=>{console.error("Failed to highlight code:",s),ae.delete(o)}),null)},Jl=({code:t,language:e,className:r,children:n,...i})=>{let{shikiTheme:o}=ce.useContext(Zn),s=ce.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:t.split(`
|
|
153
|
-
`).map(
|
|
152
|
+
\v\f
\u2028\u2029])`),e));else if(a==="posix")if(!i&&(p==="graph"||p==="print")){if(n==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[p];c&&(m=`\0-${S(m.codePointAt(0)-1)}${S(m.codePointAt(2)+1)}-`),r(C(z(`[${m}]`),e))}else r(C(bt(z(sl.get(p)),c),e));else if(a==="property")Zt.has(rt(p))||(t.key="sc");else if(a==="space")r(J(ce("space",{negate:c}),e));else if(a==="word")r(C(bt(z(H),c),e));else throw new Error(`Unexpected character set kind "${a}"`)},Directive({node:t,parent:e,root:r,remove:n,replaceWith:i,removeAllPrevSiblings:o,removeAllNextSiblings:s}){const{kind:l,flags:a}=t;if(l==="flags")if(!a.enable&&!a.disable)n();else{const c=G({flags:a});c.body[0].body=s(),i(C(c,e),{traverse:!0})}else if(l==="keep"){const c=r.body[0],m=r.body.length===1&&Sn(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:r;if(e.parent!==m||m.body.length>1)throw new Error(A`Uses "\K" in a way that's unsupported`);const d=ee({behind:!0});d.body[0].body=o(),i(C(d,e))}else throw new Error(`Unexpected directive kind "${l}"`)},Flags({node:t,parent:e}){if(t.posixIsAscii)throw new Error('Unsupported flag "P"');if(t.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete t[r]),Object.assign(t,{global:!1,hasIndices:!1,multiline:!1,sticky:t.sticky??!1}),e.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:t}){if(!t.flags)return;const{enable:e,disable:r}=t.flags;e?.extended&&delete e.extended,r?.extended&&delete r.extended,e?.dotAll&&r?.dotAll&&delete e.dotAll,e?.ignoreCase&&r?.ignoreCase&&delete e.ignoreCase,e&&!Object.keys(e).length&&delete t.flags.enable,r&&!Object.keys(r).length&&delete t.flags.disable,!t.flags.enable&&!t.flags.disable&&delete t.flags},LookaroundAssertion({node:t},e){const{kind:r}=t;r==="lookbehind"&&(e.passedLookbehind=!0)},NamedCallout({node:t,parent:e,replaceWith:r}){const{kind:n}=t;if(n==="fail")r(C(ee({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){const e=G();e.body[0].body.push(t.body),t.body=C(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){const r=[];let n=!1,i=!1;for(const o of t.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const s=Un(o.body);s?(n=!0,Array.isArray(s)?r.push(...s):r.push(s)):i=!0}n&&!i&&r.forEach(o=>e.add(o))},exit(t,{accuracy:e,passedLookbehind:r,strategy:n}){if(e==="strict"&&r&&n)throw new Error(A`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:r}=t;typeof r=="string"&&!Et(r)&&(r=yt(r,e),t.ref=r)}},ul={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:r}){const{orphan:n,ref:i}=t;n||r.set(t,[...e.get(i).map(({node:o})=>o)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:r,skip:n},{groupOriginByCopy:i,groupsByName:o,multiplexCapturesToLeftByRef:s,openRefs:l,reffedNodesByReferencer:a}){const c=i.get(t);if(c&&l.has(t.number)){const m=J(Nr(t.number),e);a.set(m,l.get(t.number)),r(m);return}l.set(t.number,t),s.set(t.number,[]),t.name&&Re(s,t.name,[]);const p=s.get(t.name??t.number);for(let m=0;m<p.length;m++){const d=p[m];if(c===d.node||c&&c===d.origin||t===d.origin){p.splice(m,1);break}}if(s.get(t.number).push({node:t,origin:c}),t.name&&s.get(t.name).push({node:t,origin:c}),t.name){const m=Re(o,t.name,new Map);let d=!1;if(c)d=!0;else for(const h of m.values())if(!h.hasDuplicateNameToRemove){d=!0;break}o.get(t.name).set(t,{node:t,hasDuplicateNameToRemove:d})}},exit({node:t},{openRefs:e}){e.get(t.number)===t&&e.delete(t.number)}},Group:{enter({node:t},e){e.prevFlags=e.currentFlags,t.flags&&(e.currentFlags=Je(e.currentFlags,t.flags))},exit(t,e){e.currentFlags=e.prevFlags}},Subroutine({node:t,parent:e,replaceWith:r},n){const{isRecursive:i,ref:o}=t;if(i){let p=e;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===o||p.number===o)););n.reffedNodesByReferencer.set(t,p);return}const s=n.subroutineRefMap.get(o),l=o===0,a=l?Nr(0):Bn(s,n.groupOriginByCopy,null);let c=a;if(!l){const p=Fn(hl(s,d=>d.type==="Group"&&!!d.flags)),m=p?Je(n.globalFlags,p):n.globalFlags;ml(m,n.currentFlags)||(c=G({flags:fl(m)}),c.body[0].body.push(a))}r(C(c,e),{traverse:!l})}},pl={Backreference({node:t,parent:e,replaceWith:r},n){if(t.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,t.ref);return}const o=n.reffedNodesByReferencer.get(t).filter(s=>dl(s,t));if(!o.length)r(C(ee({negate:!0}),e));else if(o.length>1){const s=G({atomic:!0,body:o.reverse().map(l=>ne({body:[xt(l.number)]}))});r(C(s,e))}else t.ref=o[0].number},CapturingGroup({node:t},e){t.number=++e.numCapturesToLeft,t.name&&e.groupsByName.get(t.name).get(t).hasDuplicateNameToRemove&&delete t.name},Regex:{exit({node:t},e){const r=Math.max(e.highestOrphanBackref-e.numCapturesToLeft,0);for(let n=0;n<r;n++){const i=kn();t.body.at(-1).body.push(i)}}},Subroutine({node:t},e){!t.isRecursive||t.ref===0||(t.ref=e.reffedNodesByReferencer.get(t).number)}};function Gn(t){we(t,{"*"({node:e,parent:r}){e.parent=r}})}function ml(t,e){return t.dotAll===e.dotAll&&t.ignoreCase===e.ignoreCase}function dl(t,e){let r=e;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===t)return!1;const n=jn(r.parent);for(const i of n){if(i===r)break;if(i===t||Wn(i,t))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function Bn(t,e,r,n){const i=Array.isArray(t)?[]:{};for(const[o,s]of Object.entries(t))o==="parent"?i.parent=Array.isArray(r)?n:r:s&&typeof s=="object"?i[o]=Bn(s,e,i,r):(o==="type"&&s==="CapturingGroup"&&e.set(i,e.get(t)??t),i[o]=s);return i}function Nr(t){const e=Pn(t);return e.isRecursive=!0,e}function hl(t,e){const r=[];for(;t=t.parent;)(!e||e(t))&&r.push(t);return r}function yt(t,e){if(e.has(t))return e.get(t);const r=`$${e.size}_${t.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return e.set(t,r),r}function Fn(t){const e=["dotAll","ignoreCase"],r={enable:{},disable:{}};return t.forEach(({flags:n})=>{e.forEach(i=>{n.enable?.[i]&&(delete r.disable[i],r.enable[i]=!0),n.disable?.[i]&&(r.disable[i]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function fl({dotAll:t,ignoreCase:e}){const r={};return(t||e)&&(r.enable={},t&&(r.enable.dotAll=!0),e&&(r.enable.ignoreCase=!0)),(!t||!e)&&(r.disable={},!t&&(r.disable.dotAll=!0),!e&&(r.disable.ignoreCase=!0)),r}function jn(t){if(!t)throw new Error("Node expected");const{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function Un(t){const e=t.find(r=>r.kind==="search_start"||yl(r,{negate:!1})||!gl(r));if(!e)return null;if(e.kind==="search_start")return e;if(e.type==="LookaroundAssertion")return e.body[0].body[0];if(e.type==="CapturingGroup"||e.type==="Group"){const r=[];for(const n of e.body){const i=Un(n.body);if(!i)return null;Array.isArray(i)?r.push(...i):r.push(i)}return r}return null}function Wn(t,e){const r=jn(t)??[];for(const n of r)if(n===e||Wn(n,e))return!0;return!1}function gl({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function _l(t){const e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function yl(t,e){const r={negate:null,...e};return t.type==="LookaroundAssertion"&&(r.negate===null||t.negate===r.negate)&&t.body.length===1&&Sn(t.body[0],{type:"Assertion",kind:"search_start"})}function Et(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function z(t,e){const n=Ln(t,{...e,unicodePropertyMap:Zt}).body;return n.length>1||n[0].body.length>1?G({body:n}):n[0].body[0]}function bt(t,e){return t.negate=e,t}function J(t,e){return t.parent=e,t}function C(t,e){return Gn(t),t.parent=e,t}function El(t,e){const r=$n(e),n=$t(r.target,"ES2024"),i=$t(r.target,"ES2025"),o=r.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw new Error("Invalid recursionLimit; use 2-20");let s=null,l=null;if(!i){const h=[t.flags.ignoreCase];we(t,bl,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(f){h.push(f)},setHasCasedChar(){h.at(-1)?s=!0:l=!0}})}const a={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||s)&&!l)};let c=t;const p={accuracy:r.accuracy,appliedGlobalFlags:a,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:t._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!i&&s&&l),useFlagMods:i,useFlagV:n,verbose:r.verbose};function m(h){return p.lastNode=c,c=h,Ya(wl[h.type],`Unexpected node type "${h.type}"`)(h,p,m)}const d={pattern:t.body.map(m).join("|"),flags:m(t.flags),options:{...t.options}};return n||(delete d.options.force.v,d.options.disable.v=!0,d.options.unicodeSetsPlugin=null),d._captureTransfers=new Map,d._hiddenCaptures=[],p.captureMap.forEach((h,f)=>{h.hidden&&d._hiddenCaptures.push(f),h.transferTo&&Re(d._captureTransfers,h.transferTo,[]).push(f)}),d}var bl={"*":{enter({node:t},e){if($r(t)){const r=e.getCurrentModI();e.pushModI(t.flags?Je({ignoreCase:r},t.flags).ignoreCase:r)}},exit({node:t},e){$r(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){Yt(S(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},r){e(),Hn(t,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&Mn.has(t.value)&&e.setHasCasedChar()}},wl={Alternative({body:t},e,r){return t.map(r).join("")},Assertion({kind:t,negate:e}){if(t==="string_end")return"$";if(t==="string_start")return"^";if(t==="word_boundary")return e?A`\B`:A`\b`;throw new Error(`Unexpected assertion kind "${t}"`)},Backreference({ref:t},e){if(typeof t!="number")throw new Error("Unexpected named backref in transformed AST");if(!e.useFlagMods&&e.accuracy==="strict"&&e.currentFlags.ignoreCase&&!e.captureMap.get(t).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+t},CapturingGroup(t,e,r){const{body:n,name:i,number:o}=t,s={ignoreCase:e.currentFlags.ignoreCase},l=e.originMap.get(t);return l&&(s.hidden=!0,o>l.number&&(s.transferTo=l.number)),e.captureMap.set(o,s),`(${i?`?<${i}>`:""}${n.map(r).join("|")})`},Character({value:t},e){const r=S(t),n=se(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(n!==r)return n;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&Yt(r)){const i=Vn(r);return e.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return r},CharacterClass(t,e,r){const{kind:n,negate:i,parent:o}=t;let{body:s}=t;if(n==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");B.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&s.some(Vr)&&(s=[tt(45),...s.filter(c=>!Vr(c))]);const l=()=>`[${i?"^":""}${s.map(r).join(n==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||B.bugNestedClassIgnoresNegation)&&!i){const p=s.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=G(),d=m.body[0];return m.parent=o,d.parent=m,s=s.filter(h=>!p.includes(h)),t.body=s,s.length?(t.parent=d,d.body.push(t)):m.body.pop(),p.forEach(h=>{const f=ne({body:[h]});h.parent=f,f.parent=m,m.body.push(f)}),r(m)}}e.inCharClass=!0;const c=l();return e.inCharClass=!1,c}const a=s[0];if(n==="union"&&!i&&a&&((!e.useFlagV||!e.verbose)&&o.kind==="union"&&!(B.bugFlagVLiteralHyphenIsRange&&e.useFlagV)||!e.verbose&&o.kind==="intersection"&&s.length===1&&a.type!=="CharacterClassRange"))return s.map(r).join("");if(!e.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return l()},CharacterClassRange(t,e){const r=t.min.value,n=t.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},o=se(r,i),s=se(n,i),l=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){const a=Hn(t);Rl(a).forEach(p=>{l.add(Array.isArray(p)?`${se(p[0],i)}-${se(p[1],i)}`:se(p,i))})}return`${o}-${s}${[...l].join("")}`},CharacterSet({kind:t,negate:e,value:r,key:n},i){if(t==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":A`[^\n]`;if(t==="digit")return e?A`\D`:A`\d`;if(t==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Mn.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${e?A`\P`:A`\p`}{${n?`${n}=`:""}${r}}`}if(t==="word")return e?A`\W`:A`\w`;throw new Error(`Unexpected character set kind "${t}"`)},Flags(t,e){return(e.appliedGlobalFlags.ignoreCase?"i":"")+(t.dotAll?"s":"")+(t.sticky?"y":"")},Group({atomic:t,body:e,flags:r,parent:n},i,o){const s=i.currentFlags;r&&(i.currentFlags=Je(s,r));const l=e.map(o).join("|"),a=!i.verbose&&e.length===1&&n.type!=="Quantifier"&&!t&&(!i.useFlagMods||!r)?l:`(?${Sl(t,r,i.useFlagMods)}${l})`;return i.currentFlags=s,a},LookaroundAssertion({body:t,kind:e,negate:r},n,i){return`(?${`${e==="lookahead"?"":"<"}${r?"!":"="}`}${t.map(i).join("|")})`},Quantifier(t,e,r){return r(t.body)+Ll(t)},Subroutine({isRecursive:t,ref:e},r){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=r.recursionLimit;return e===0?`(?R=${n})`:A`\g<${e}&R=${n}>`}},Al=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),vl=new Set(["-","\\","]","^","["]),Cl=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Dr=new Map([[9,A`\t`],[10,A`\n`],[11,A`\v`],[12,A`\f`],[13,A`\r`],[8232,A`\u2028`],[8233,A`\u2029`],[65279,A`\uFEFF`]]),Il=/^\p{Cased}$/u;function Yt(t){return Il.test(t)}function Hn(t,e){const r=!!e?.firstOnly,n=t.min.value,i=t.max.value,o=[];if(n<65&&(i===65535||i>=131071)||n===65536&&i>=131071)return o;for(let s=n;s<=i;s++){const l=S(s);if(!Yt(l))continue;const a=Vn(l).filter(c=>{const p=c.codePointAt(0);return p<n||p>i});if(a.length&&(o.push(...a),r))break}return o}function se(t,{escDigit:e,inCharClass:r,useFlagV:n}){if(Dr.has(t))return Dr.get(t);if(t<32||t>126&&t<160||t>262143||e&&kl(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;const i=r?n?Cl:vl:Al,o=S(t);return(i.has(o)?"\\":"")+o}function Rl(t){const e=t.map(i=>i.codePointAt(0)).sort((i,o)=>i-o),r=[];let n=null;for(let i=0;i<e.length;i++)e[i+1]===e[i]+1?n??=e[i]:n===null?r.push(e[i]):(r.push([n,e[i]]),n=null);return r}function Sl(t,e,r){if(t)return">";let n="";if(e&&r){const{enable:i,disable:o}=e;n=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${n}:`}function Ll({kind:t,max:e,min:r}){let n;return!r&&e===1?n="?":!r&&e===1/0?n="*":r===1&&e===1/0?n="+":r===e?n=`{${r}}`:n=`{${r},${e===1/0?"":e}}`,n+{greedy:"",lazy:"?",possessive:"+"}[t]}function $r({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function kl(t){return t>47&&t<58}function Vr({type:t,value:e}){return t==="Character"&&e===45}var Tl=class Vt extends RegExp{#t=new Map;#e=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(e,r,n){const i=!!n?.lazyCompile;if(e instanceof RegExp){if(n)throw new Error("Cannot provide options when copying a regexp");const o=e;super(o,r),this.#n=o.source,o instanceof Vt&&(this.#t=o.#t,this.#r=o.#r,this.#i=o.#i,this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...n};super(i?"":e,r),this.#n=e,this.#t=Ol(o.hiddenCaptures,o.transfers),this.#i=o.strategy,this.rawOptions=n??{}}i||(this.#e=this)}exec(e){if(!this.#e){const{lazyCompile:i,...o}=this.rawOptions;this.#e=new Vt(this.#n,this.flags,o)}const r=this.global||this.sticky,n=this.lastIndex;if(this.#i==="clip_search"&&r&&n){this.lastIndex=0;const i=this.#o(e.slice(n));return i&&(Pl(i,n,e,this.hasIndices),this.lastIndex+=n),i}return this.#o(e)}#o(e){this.#e.lastIndex=this.lastIndex;const r=super.exec.call(this.#e,e);if(this.lastIndex=this.#e.lastIndex,!r||!this.#t.size)return r;const n=[...r];r.length=1;let i;this.hasIndices&&(i=[...r.indices],r.indices.length=1);const o=[0];for(let s=1;s<n.length;s++){const{hidden:l,transferTo:a}=this.#t.get(s)??{};if(l?o.push(null):(o.push(r.length),r.push(n[s]),this.hasIndices&&r.indices.push(i[s])),a&&n[s]!==void 0){const c=o[a];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(r[c]=n[s],this.hasIndices&&(r.indices[c]=i[s]),r.groups){this.#r||(this.#r=xl(this.source));const p=this.#r.get(a);p&&(r.groups[p]=n[s],this.hasIndices&&(r.indices.groups[p]=i[s]))}}}return r}};function Pl(t,e,r,n){if(t.index+=e,t.input=r,n){const i=t.indices;for(let s=0;s<i.length;s++){const l=i[s];l&&(i[s]=[l[0]+e,l[1]+e])}const o=i.groups;o&&Object.keys(o).forEach(s=>{const l=o[s];l&&(o[s]=[l[0]+e,l[1]+e])})}}function Ol(t,e){const r=new Map;for(const n of t)r.set(n,{hidden:!0});for(const[n,i]of e)for(const o of i)Re(r,o,{}).transferTo=n;return r}function xl(t){const e=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map;let n=0,i=0,o;for(;o=e.exec(t);){const{0:s,groups:{capture:l,name:a}}=o;s==="["?n++:n?s==="]"&&n--:l&&(i++,a&&r.set(i,a))}return r}function Nl(t,e){const r=Dl(t,e);return r.options?new Tl(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function Dl(t,e){const r=$n(e),n=Ln(t,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:Zt}),i=ll(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),o=El(i,r),s=Ka(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),l=Qa(s.pattern),a=Xa(l.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),c={pattern:a.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=a.hiddenCaptures.sort((f,y)=>f-y),m=Array.from(a.captureTransfers),d=i._strategy,h=c.pattern.length>=r.lazyCompileLength;(p.length||m.length||d||h)&&(c.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},...d&&{strategy:d},...h&&{lazyCompile:h}})}return c}const Mr=4294967295;class $l{constructor(e,r={}){this.patterns=e,this.options=r;const{forgiving:n=!1,cache:i,regexConstructor:o}=r;if(!o)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(s=>{if(typeof s!="string")return s;const l=i?.get(s);if(l){if(l instanceof RegExp)return l;if(n)return null;throw l}try{const a=o(s);return i?.set(s,a),a}catch(a){if(i?.set(s,a),n)return null;throw a}})}regexps;findNextMatchSync(e,r,n){const i=typeof e=="string"?e:e.content,o=[];function s(l,a,c=0){return{index:l,captureIndices:a.indices.map(p=>p==null?{start:Mr,end:Mr,length:0}:{start:p[0]+c,end:p[1]+c,length:p[1]-p[0]})}}for(let l=0;l<this.regexps.length;l++){const a=this.regexps[l];if(a)try{a.lastIndex=r;const c=a.exec(i);if(!c)continue;if(c.index===r)return s(l,c,0);o.push([l,c,0])}catch(c){if(this.options.forgiving)continue;throw c}}if(o.length){const l=Math.min(...o.map(a=>a[1].index));for(const[a,c,p]of o)if(c.index===l)return s(a,c,p)}return null}}function Vl(t,e){return Nl(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function Ml(t={}){const e=Object.assign({target:"auto",cache:new Map},t);return e.regexConstructor||=r=>Vl(r,{target:e.target}),{createScanner(r){return new $l(r,e)},createString(r){return{content:r}}}}var Gl=Gt("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-4","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),Bl=ue.memo(({children:t,result:e,language:r,className:n,...i})=>{let o=ue.useMemo(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]);return V.jsx("pre",{className:Gt(n,"p-4 text-sm dark:bg-(--shiki-dark-bg)!"),"data-language":r,"data-streamdown":"code-block-body",style:o,...i,children:V.jsx("code",{className:"[counter-increment:line_0] [counter-reset:line]",children:e.tokens.map((s,l)=>V.jsx("span",{className:Gl,children:s.map((a,c)=>V.jsx("span",{className:"dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!",style:{color:a.color,backgroundColor:a.bgColor,...a.htmlStyle},...a.htmlAttrs,children:a.content},c))},l))})})},(t,e)=>t.result===e.result&&t.language===e.language&&t.className===e.className),Fl=({className:t,language:e,style:r,...n})=>V.jsx("div",{className:Gt("my-4 w-full overflow-hidden rounded-xl border border-border",t),"data-language":e,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...r},...n}),jl=({language:t,children:e})=>V.jsxs("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-language":t,"data-streamdown":"code-block-header",children:[V.jsx("span",{className:"ml-1 font-mono lowercase",children:t}),V.jsx("div",{className:"flex items-center gap-2",children:e})]}),Ul=Ml({forgiving:!0}),wt=new Map,At=new Map,ae=new Map,Wl=(t,e)=>`${t}-${e[0]}-${e[1]}`,Hl=(t,e,r)=>{let n=t.slice(0,100),i=t.length>100?t.slice(-100):"";return`${e}:${r[0]}:${r[1]}:${t.length}:${n}:${i}`},zn=t=>Object.hasOwn(bn,t),zl=(t,e)=>{let r=zn(t)?t:"text",n=Wl(r,e);if(wt.has(n))return wt.get(n);let i=Zs({themes:e,langs:[r],engine:Ul});return wt.set(n,i),i},Gr=(t,e,r,n)=>{let i=zn(e)?e:"text",o=Hl(t,i,r);return At.has(o)?At.get(o):(n&&(ae.has(o)||ae.set(o,new Set),ae.get(o).add(n)),zl(i,r).then(s=>{let l=s.codeToTokens(t,{lang:i,themes:{light:r[0],dark:r[1]}});At.set(o,l);let a=ae.get(o);if(a){for(let c of a)c(l);ae.delete(o)}}).catch(s=>{console.error("Failed to highlight code:",s),ae.delete(o)}),null)},Kl=({code:t,language:e,className:r,children:n,...i})=>{let{shikiTheme:o}=ue.useContext(Zn),s=ue.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:t.split(`
|
|
153
|
+
`).map(c=>[{content:c,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[t]),[l,a]=ue.useState(s);return ue.useEffect(()=>{let c=Gr(t,e,o);if(c){a(c);return}Gr(t,e,o,p=>{a(p)})},[t,e,o]),V.jsx(Yn.Provider,{value:{code:t},children:V.jsxs(Fl,{language:e,children:[V.jsx(jl,{language:e,children:n}),V.jsx(Bl,{className:r,language:e,result:l,...i})]})})};export{Kl as CodeBlock};
|