@dogsbay/artifact-viewer 0.2.0-beta.162 → 0.2.0-beta.163
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/viewer/chunks/chunk-JJBJP4KD.mjs +10 -0
- package/dist/viewer/chunks/highlight-3DK3SV7G-7T6AMANK.mjs +154 -0
- package/dist/viewer/files.json +2 -2
- package/dist/viewer/viewer.mjs +201 -201
- package/dist/viewer.version +1 -1
- package/package.json +2 -2
- package/dist/viewer/chunks/chunk-BWUOKSP3.mjs +0 -10
- package/dist/viewer/chunks/highlight-RH4Q5TXN-PIAFRDV4.mjs +0 -154
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import{a as hr,h as mt,k as gr,l as pr,m as Po,o as bt}from"./chunk-JJBJP4KD.mjs";import{b as fr}from"./chunk-J554WTEZ.mjs";var E=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Lo(e){return tr(e)}function tr(e){return Array.isArray(e)?Ro(e):e instanceof RegExp?e:typeof e=="object"?To(e):e}function Ro(e){let t=[];for(let r=0,n=e.length;r<n;r++)t[r]=tr(e[r]);return t}function To(e){let t={};for(let r in e)t[r]=tr(e[r]);return t}function pn(e,...t){return t.forEach(r=>{for(let n in r)e[n]=r[n]}),e}function fn(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?fn(e.substring(0,e.length-1)):e.substr(~t+1)}var yt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Oe=class{static hasCaptures(e){return e===null?!1:(yt.lastIndex=0,yt.test(e))}static replaceCaptures(e,t,r){return e.replace(yt,(n,o,a,i)=>{let s=r[parseInt(o||a,10)];if(s){let l=t.substring(s.start,s.end);for(;l[0]===".";)l=l.substring(1);switch(i){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return n})}};function mn(e,t){return e<t?-1:e>t?1:0}function bn(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let r=e.length,n=t.length;if(r===n){for(let o=0;o<r;o++){let a=mn(e[o],t[o]);if(a!==0)return a}return 0}return r-n}function mr(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function yn(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var kn=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Ie=class{constructor(e,t,r){this._colorMap=e,this._defaults=t,this._root=r}static createFromRawTheme(e,t){return this.createFromParsedTheme(Do(e),t)}static createFromParsedTheme(e,t){return jo(e,t)}_cachedMatchRoot=new kn(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(n=>Mo(e.parent,n.parentScopes));return r?new wn(r.fontStyle,r.foreground,r.background):null}},kt=class We{constructor(t,r){this.parent=t,this.scopeName=r}static push(t,r){for(let n of r)t=new We(t,n);return t}static from(...t){let r=null;for(let n=0;n<t.length;n++)r=new We(r,t[n]);return r}push(t){return new We(this,t)}getSegments(){let t=this,r=[];for(;t;)r.push(t.scopeName),t=t.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){let r=[],n=this;for(;n&&n!==t;)r.push(n.scopeName),n=n.parent;return n===t?r.reverse():void 0}};function Mo(e,t){if(t.length===0)return!0;for(let r=0;r<t.length;r++){let n=t[r],o=!1;if(n===">"){if(r===t.length-1)return!1;n=t[++r],o=!0}for(;e&&!Oo(e.scopeName,n);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Oo(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var wn=class{constructor(e,t,r){this.fontStyle=e,this.foregroundId=t,this.backgroundId=r}};function Do(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,r=[],n=0;for(let o=0,a=t.length;o<a;o++){let i=t[o];if(!i.settings)continue;let s;if(typeof i.scope=="string"){let d=i.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),s=d.split(",")}else Array.isArray(i.scope)?s=i.scope:s=[""];let l=-1;if(typeof i.settings.fontStyle=="string"){l=0;let d=i.settings.fontStyle.split(" ");for(let g=0,h=d.length;g<h;g++)switch(d[g]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let u=null;typeof i.settings.foreground=="string"&&mr(i.settings.foreground)&&(u=i.settings.foreground);let c=null;typeof i.settings.background=="string"&&mr(i.settings.background)&&(c=i.settings.background);for(let d=0,g=s.length;d<g;d++){let h=s[d].trim().split(" "),p=h[h.length-1],b=null;h.length>1&&(b=h.slice(0,h.length-1),b.reverse()),r[n++]=new Go(p,b,o,l,u,c)}}return r}var Go=class{constructor(e,t,r,n,o,a){this.scope=e,this.parentScopes=t,this.index=r,this.fontStyle=n,this.foreground=o,this.background=a}},M=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(M||{});function jo(e,t){e.sort((l,u)=>{let c=mn(l.scope,u.scope);return c!==0||(c=bn(l.parentScopes,u.parentScopes),c!==0)?c:l.index-u.index});let r=0,n="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(r=l.fontStyle),l.foreground!==null&&(n=l.foreground),l.background!==null&&(o=l.background)}let a=new Uo(t),i=new wn(r,a.getId(n),a.getId(o)),s=new Wo(new Rt(0,null,-1,0,0),[]);for(let l=0,u=e.length;l<u;l++){let c=e[l];s.insert(0,c.scope,c.parentScopes,c.fontStyle,a.getId(c.foreground),a.getId(c.background))}return new Ie(a,i,s)}var Uo=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,r=e.length;t<r;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Ho=Object.freeze([]),Rt=class vn{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,r,n,o,a){this.scopeDepth=t,this.parentScopes=r||Ho,this.fontStyle=n,this.foreground=o,this.background=a}clone(){return new vn(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let r=[];for(let n=0,o=t.length;n<o;n++)r[n]=t[n].clone();return r}acceptOverwrite(t,r,n,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,r!==-1&&(this.fontStyle=r),n!==0&&(this.foreground=n),o!==0&&(this.background=o)}},Wo=class Tt{constructor(t,r=[],n={}){this._mainRule=t,this._children=n,this._rulesWithParentScopes=r}_rulesWithParentScopes;static _cmpBySpecificity(t,r){if(t.scopeDepth!==r.scopeDepth)return r.scopeDepth-t.scopeDepth;let n=0,o=0;for(;t.parentScopes[n]===">"&&n++,r.parentScopes[o]===">"&&o++,!(n>=t.parentScopes.length||o>=r.parentScopes.length);){let a=r.parentScopes[o].length-t.parentScopes[n].length;if(a!==0)return a;n++,o++}return r.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let n=t.indexOf("."),o,a;if(n===-1?(o=t,a=""):(o=t.substring(0,n),a=t.substring(n+1)),this._children.hasOwnProperty(o))return this._children[o].match(a)}let r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(Tt._cmpBySpecificity),r}insert(t,r,n,o,a,i){if(r===""){this._doInsertHere(t,n,o,a,i);return}let s=r.indexOf("."),l,u;s===-1?(l=r,u=""):(l=r.substring(0,s),u=r.substring(s+1));let c;this._children.hasOwnProperty(l)?c=this._children[l]:(c=new Tt(this._mainRule.clone(),Rt.cloneArr(this._rulesWithParentScopes)),this._children[l]=c),c.insert(t+1,u,n,o,a,i)}_doInsertHere(t,r,n,o,a){if(r===null){this._mainRule.acceptOverwrite(t,n,o,a);return}for(let i=0,s=this._rulesWithParentScopes.length;i<s;i++){let l=this._rulesWithParentScopes[i];if(bn(l.parentScopes,r)===0){l.acceptOverwrite(t,n,o,a);return}}n===-1&&(n=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),a===0&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new Rt(t,r,n,o,a))}},le=class W{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let r=W.getLanguageId(t),n=W.getTokenType(t),o=W.getFontStyle(t),a=W.getForeground(t),i=W.getBackground(t);console.log({languageId:r,tokenType:n,fontStyle:o,foreground:a,background:i})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,r,n,o,a,i,s){let l=W.getLanguageId(t),u=W.getTokenType(t),c=W.containsBalancedBrackets(t)?1:0,d=W.getFontStyle(t),g=W.getForeground(t),h=W.getBackground(t);return r!==0&&(l=r),n!==8&&(u=n),o!==null&&(c=o?1:0),a!==-1&&(d=a),i!==0&&(g=i),s!==0&&(h=s),(l<<0|u<<8|c<<10|d<<11|g<<15|h<<24)>>>0}};function Ve(e,t){let r=[],n=zo(e),o=n.next();for(;o!==null;){let l=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=n.next()}let u=i();if(r.push({matcher:u,priority:l}),o!==",")break;o=n.next()}return r;function a(){if(o==="-"){o=n.next();let l=a();return u=>!!l&&!l(u)}if(o==="("){o=n.next();let l=s();return o===")"&&(o=n.next()),l}if(br(o)){let l=[];do l.push(o),o=n.next();while(br(o));return u=>t(l,u)}return null}function i(){let l=[],u=a();for(;u;)l.push(u),u=a();return c=>l.every(d=>d(c))}function s(){let l=[],u=i();for(;u&&(l.push(u),o==="|"||o===",");){do o=n.next();while(o==="|"||o===",");u=i()}return c=>l.some(d=>d(c))}}function br(e){return!!e&&!!e.match(/[\w\.:]+/)}function zo(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=t.exec(e);return{next:()=>{if(!r)return null;let n=r[0];return r=t.exec(e),n}}}function Cn(e){typeof e.dispose=="function"&&e.dispose()}var Ee=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},qo=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Vo=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Xo=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ee(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Vo;for(let r of e)Qo(r,this.initialScopeName,this.repo,t);for(let r of t.references)if(r instanceof Ee){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 Qo(e,t,r,n){let o=r.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}let a=r.lookup(t);e instanceof Ee?ze({baseGrammar:a,selfGrammar:o},n):Mt(e.ruleName,{baseGrammar:a,selfGrammar:o,repository:o.repository},n);let i=r.injections(e.scopeName);if(i)for(let s of i)n.add(new Ee(s))}function Mt(e,t,r){if(t.repository&&t.repository[e]){let n=t.repository[e];Xe([n],t,r)}}function ze(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Xe(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Xe(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Xe(e,t,r){for(let n of e){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);let o=n.repository?pn({},t.repository,n.repository):t.repository;Array.isArray(n.patterns)&&Xe(n.patterns,{...t,repository:o},r);let a=n.include;if(!a)continue;let i=xn(a);switch(i.kind){case 0:ze({...t,selfGrammar:t.baseGrammar},r);break;case 1:ze(t,r);break;case 2:Mt(i.ruleName,{...t,repository:o},r);break;case 3:case 4:let s=i.scopeName===t.selfGrammar.scopeName?t.selfGrammar:i.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(s){let l={baseGrammar:t.baseGrammar,selfGrammar:s,repository:o};i.kind===4?Mt(i.ruleName,l,r):ze(l,r)}else i.kind===4?r.add(new qo(i.scopeName,i.ruleName)):r.add(new Ee(i.scopeName));break}}}var Yo=class{kind=0},Ko=class{kind=1},Zo=class{constructor(e){this.ruleName=e}kind=2},Jo=class{constructor(e){this.scopeName=e}kind=3},ea=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function xn(e){if(e==="$base")return new Yo;if(e==="$self")return new Ko;let t=e.indexOf("#");if(t===-1)return new Jo(e);if(t===0)return new Zo(e.substring(1));{let r=e.substring(0,t),n=e.substring(t+1);return new ea(r,n)}}var ta=/\\(\d+)/,yr=/\\(\d+)/g,Qu=Symbol("RuleId"),ra=-1,Sn=-2,Le=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,r,n){this.$location=e,this.id=t,this._name=r||null,this._nameIsCapturing=Oe.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=Oe.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${fn(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Oe.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Oe.replaceCaptures(this._contentName,e,t)}},na=class extends Le{retokenizeCapturedWithRuleId;constructor(e,t,r,n,o){super(e,t,r,n),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,r,n){throw new Error("Not supported!")}},oa=class extends Le{_match;captures;_cachedCompiledPatterns;constructor(e,t,r,n,o){super(e,t,r,null),this._match=new Be(n,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,n){return this._getCachedCompiledPatterns(e).compileAG(e,r,n)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ne,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},kr=class extends Le{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,r,n,o){super(e,t,r,n),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let r of this.patterns)e.getRule(r).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,n){return this._getCachedCompiledPatterns(e).compileAG(e,r,n)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ne,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ot=class extends Le{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,r,n,o,a,i,s,l,u){super(e,t,r,n),this._begin=new Be(o,this.id),this.beginCaptures=a,this._end=new Be(i||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=l||!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(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,r,n){return this._getCachedCompiledPatterns(e,t).compileAG(e,r,n)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ne;for(let r of this.patterns)e.getRule(r).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Qe=class extends Le{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,r,n,o,a,i,s,l){super(e,t,r,n),this._begin=new Be(o,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Be(i,Sn),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,r,n){return this._getCachedCompiledPatterns(e).compileAG(e,r,n)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ne;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,r,n){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,r,n)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Ne,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},_n=class T{static createCaptureRule(t,r,n,o,a){return t.registerRule(i=>new na(r,i,n,o,a))}static getCompiledRuleId(t,r,n){return t.id||r.registerRule(o=>{if(t.id=o,t.match)return new oa(t.$vscodeTextmateLocation,t.id,t.name,t.match,T._compileCaptures(t.captures,r,n));if(typeof t.begin>"u"){t.repository&&(n=pn({},n,t.repository));let a=t.patterns;return typeof a>"u"&&t.include&&(a=[{include:t.include}]),new kr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,T._compilePatterns(a,r,n))}return t.while?new Qe(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,T._compileCaptures(t.beginCaptures||t.captures,r,n),t.while,T._compileCaptures(t.whileCaptures||t.captures,r,n),T._compilePatterns(t.patterns,r,n)):new Ot(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,T._compileCaptures(t.beginCaptures||t.captures,r,n),t.end,T._compileCaptures(t.endCaptures||t.captures,r,n),t.applyEndPatternLast,T._compilePatterns(t.patterns,r,n))}),t.id}static _compileCaptures(t,r,n){let o=[];if(t){let a=0;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let s=parseInt(i,10);s>a&&(a=s)}for(let i=0;i<=a;i++)o[i]=null;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let s=parseInt(i,10),l=0;t[i].patterns&&(l=T.getCompiledRuleId(t[i],r,n)),o[s]=T.createCaptureRule(r,t[i].$vscodeTextmateLocation,t[i].name,t[i].contentName,l)}}return o}static _compilePatterns(t,r,n){let o=[];if(t)for(let a=0,i=t.length;a<i;a++){let s=t[a],l=-1;if(s.include){let u=xn(s.include);switch(u.kind){case 0:case 1:l=T.getCompiledRuleId(n[s.include],r,n);break;case 2:let c=n[u.ruleName];c&&(l=T.getCompiledRuleId(c,r,n));break;case 3:case 4:let d=u.scopeName,g=u.kind===4?u.ruleName:null,h=r.getExternalGrammar(d,n);if(h)if(g){let p=h.repository[g];p&&(l=T.getCompiledRuleId(p,r,h.repository))}else l=T.getCompiledRuleId(h.repository.$self,r,h.repository);break}}else l=T.getCompiledRuleId(s,r,n);if(l!==-1){let u=r.getRule(l),c=!1;if((u instanceof kr||u instanceof Ot||u instanceof Qe)&&u.hasMissingPatterns&&u.patterns.length===0&&(c=!0),c)continue;o.push(l)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Be=class An{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,r){if(t&&typeof t=="string"){let n=t.length,o=0,a=[],i=!1;for(let s=0;s<n;s++)if(t.charAt(s)==="\\"&&s+1<n){let l=t.charAt(s+1);l==="z"?(a.push(t.substring(o,s)),a.push("$(?!\\n)(?<!\\n)"),o=s+2):(l==="A"||l==="G")&&(i=!0),s++}this.hasAnchor=i,o===0?this.source=t:(a.push(t.substring(o,n)),this.source=a.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=ta.test(this.source):this.hasBackReferences=!1}clone(){return new An(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,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(o=>t.substring(o.start,o.end));return yr.lastIndex=0,this.source.replace(yr,(o,a)=>yn(n[parseInt(a,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],r=[],n=[],o=[],a,i,s,l;for(a=0,i=this.source.length;a<i;a++)s=this.source.charAt(a),t[a]=s,r[a]=s,n[a]=s,o[a]=s,s==="\\"&&a+1<i&&(l=this.source.charAt(a+1),l==="A"?(t[a+1]="\uFFFF",r[a+1]="\uFFFF",n[a+1]="A",o[a+1]="A"):l==="G"?(t[a+1]="\uFFFF",r[a+1]="G",n[a+1]="\uFFFF",o[a+1]="G"):(t[a+1]=l,r[a+1]=l,n[a+1]=l,o[a+1]=l),a++);return{A0_G0:t.join(""),A0_G1:r.join(""),A1_G0:n.join(""),A1_G1:o.join("")}}resolveAnchors(t,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Ne=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(r=>r.source);this._cached=new wr(e,t,this._items.map(r=>r.ruleId))}return this._cached}compileAG(e,t,r){return this._hasAnchors?t?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,r){let n=this._items.map(o=>o.resolveAnchors(t,r));return new wr(e,n,this._items.map(o=>o.ruleId))}},wr=class{constructor(e,t,r){this.regExps=t,this.rules=r,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,r=this.rules.length;t<r;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
2
|
+
`)}findNextMatchSync(e,t,r){let n=this.scanner.findNextMatchSync(e,t,r);return n?{ruleId:this.rules[n.index],captureIndices:n.captureIndices}:null}},wt=class{constructor(e,t){this.languageId=e,this.tokenType=t}},aa=class Dt{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,r){this._defaultAttributes=new wt(t,8),this._embeddedLanguagesMatcher=new ia(Object.entries(r||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Dt._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new wt(0,0);_getBasicScopeAttributes=new kn(t=>{let r=this._scopeToLanguage(t),n=this._toStandardTokenType(t);return new wt(r,n)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){let r=t.match(Dt.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/},ia=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([r,n])=>yn(r));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Yu={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},In=!1,vr=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function En(e,t,r,n,o,a,i,s){let l=t.content.length,u=!1,c=-1;if(i){let h=sa(e,t,r,n,o,a);o=h.stack,n=h.linePos,r=h.isFirstLine,c=h.anchorPosition}let d=Date.now();for(;!u;){if(s!==0&&Date.now()-d>s)return new vr(o,!0);g()}return new vr(o,!1);function g(){let h=la(e,t,r,n,o,c);if(!h){a.produce(o,l),u=!0;return}let p=h.captureIndices,b=h.matchedRuleId,y=p&&p.length>0?p[0].end>n:!1;if(b===ra){let m=o.getRule(e);a.produce(o,p[0].start),o=o.withContentNameScopesList(o.nameScopesList),Se(e,t,r,o,a,m.endCaptures,p),a.produce(o,p[0].end);let f=o;if(o=o.parent,c=f.getAnchorPos(),!y&&f.getEnterPos()===n){o=f,a.produce(o,l),u=!0;return}}else{let m=e.getRule(b);a.produce(o,p[0].start);let f=o,w=m.getName(t.content,p),v=o.contentNameScopesList.pushAttributed(w,e);if(o=o.push(b,n,c,p[0].end===l,null,v,v),m instanceof Ot){let x=m;Se(e,t,r,o,a,x.beginCaptures,p),a.produce(o,p[0].end),c=p[0].end;let _=x.getContentName(t.content,p),B=v.pushAttributed(_,e);if(o=o.withContentNameScopesList(B),x.endHasBackReferences&&(o=o.withEndRule(x.getEndWithResolvedBackReferences(t.content,p))),!y&&f.hasSameRuleAs(o)){o=o.pop(),a.produce(o,l),u=!0;return}}else if(m instanceof Qe){let x=m;Se(e,t,r,o,a,x.beginCaptures,p),a.produce(o,p[0].end),c=p[0].end;let _=x.getContentName(t.content,p),B=v.pushAttributed(_,e);if(o=o.withContentNameScopesList(B),x.whileHasBackReferences&&(o=o.withEndRule(x.getWhileWithResolvedBackReferences(t.content,p))),!y&&f.hasSameRuleAs(o)){o=o.pop(),a.produce(o,l),u=!0;return}}else if(Se(e,t,r,o,a,m.captures,p),a.produce(o,p[0].end),o=o.pop(),!y){o=o.safePop(),a.produce(o,l),u=!0;return}}p[0].end>n&&(n=p[0].end,r=!1)}}function sa(e,t,r,n,o,a){let i=o.beginRuleCapturedEOL?0:-1,s=[];for(let l=o;l;l=l.pop()){let u=l.getRule(e);u instanceof Qe&&s.push({rule:u,stack:l})}for(let l=s.pop();l;l=s.pop()){let{ruleScanner:u,findOptions:c}=da(l.rule,e,l.stack.endRule,r,n===i),d=u.findNextMatchSync(t,n,c);if(d){if(d.ruleId!==Sn){o=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(a.produce(l.stack,d.captureIndices[0].start),Se(e,t,r,l.stack,a,l.rule.whileCaptures,d.captureIndices),a.produce(l.stack,d.captureIndices[0].end),i=d.captureIndices[0].end,d.captureIndices[0].end>n&&(n=d.captureIndices[0].end,r=!1))}else{o=l.stack.pop();break}}return{stack:o,linePos:n,anchorPosition:i,isFirstLine:r}}function la(e,t,r,n,o,a){let i=ua(e,t,r,n,o,a),s=e.getInjections();if(s.length===0)return i;let l=ca(s,e,t,r,n,o,a);if(!l)return i;if(!i)return l;let u=i.captureIndices[0].start,c=l.captureIndices[0].start;return c<u||l.priorityMatch&&c===u?l:i}function ua(e,t,r,n,o,a){let i=o.getRule(e),{ruleScanner:s,findOptions:l}=Bn(i,e,o.endRule,r,n===a),u=s.findNextMatchSync(t,n,l);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function ca(e,t,r,n,o,a,i){let s=Number.MAX_VALUE,l=null,u,c=0,d=a.contentNameScopesList.getScopeNames();for(let g=0,h=e.length;g<h;g++){let p=e[g];if(!p.matcher(d))continue;let b=t.getRule(p.ruleId),{ruleScanner:y,findOptions:m}=Bn(b,t,null,n,o===i),f=y.findNextMatchSync(r,o,m);if(!f)continue;let w=f.captureIndices[0].start;if(!(w>=s)&&(s=w,l=f.captureIndices,u=f.ruleId,c=p.priority,s===o))break}return l?{priorityMatch:c===-1,captureIndices:l,matchedRuleId:u}:null}function Bn(e,t,r,n,o){if(In){let a=e.compile(t,r),i=Nn(n,o);return{ruleScanner:a,findOptions:i}}return{ruleScanner:e.compileAG(t,r,n,o),findOptions:0}}function da(e,t,r,n,o){if(In){let a=e.compileWhile(t,r),i=Nn(n,o);return{ruleScanner:a,findOptions:i}}return{ruleScanner:e.compileWhileAG(t,r,n,o),findOptions:0}}function Nn(e,t){let r=0;return e||(r|=1),t||(r|=4),r}function Se(e,t,r,n,o,a,i){if(a.length===0)return;let s=t.content,l=Math.min(a.length,i.length),u=[],c=i[0].end;for(let d=0;d<l;d++){let g=a[d];if(g===null)continue;let h=i[d];if(h.length===0)continue;if(h.start>c)break;for(;u.length>0&&u[u.length-1].endPos<=h.start;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?o.produceFromScopes(u[u.length-1].scopes,h.start):o.produce(n,h.start),g.retokenizeCapturedWithRuleId){let b=g.getName(s,i),y=n.contentNameScopesList.pushAttributed(b,e),m=g.getContentName(s,i),f=y.pushAttributed(m,e),w=n.push(g.retokenizeCapturedWithRuleId,h.start,-1,!1,null,y,f),v=e.createOnigString(s.substring(0,h.end));En(e,v,r&&h.start===0,h.start,w,o,!1,0),Cn(v);continue}let p=g.getName(s,i);if(p!==null){let b=(u.length>0?u[u.length-1].scopes:n.contentNameScopesList).pushAttributed(p,e);u.push(new ha(b,h.end))}}for(;u.length>0;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var ha=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ga(e,t,r,n,o,a,i,s){return new fa(e,t,r,n,o,a,i,s)}function Cr(e,t,r,n,o){let a=Ve(t,Ye),i=_n.getCompiledRuleId(r,n,o.repository);for(let s of a)e.push({debugSelector:t,matcher:s.matcher,ruleId:i,grammar:o,priority:s.priority})}function Ye(e,t){if(t.length<e.length)return!1;let r=0;return e.every(n=>{for(let o=r;o<t.length;o++)if(pa(t[o],n))return r=o+1,!0;return!1})}function pa(e,t){if(!e)return!1;if(e===t)return!0;let r=t.length;return e.length>r&&e.substr(0,r)===t&&e[r]==="."}var fa=class{constructor(e,t,r,n,o,a,i,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new aa(r,n),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=xr(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(let l of Object.keys(o)){let u=Ve(l,Ye);for(let c of u)this._tokenTypeMatchers.push({matcher:c.matcher,type:o[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],r=this._rootScopeName,n=e.lookup(r);if(n){let o=n.injections;if(o)for(let i in o)Cr(t,i,o[i],this,n);let a=this._grammarRepository.injections(r);a&&a.forEach(i=>{let s=this.getExternalGrammar(i);if(s){let l=s.injectionSelector;l&&Cr(t,l,s,this,s)}})}return t.sort((o,a)=>o.priority-a.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,r=e(t);return this._ruleId2desc[t]=r,r}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let r=this._grammarRepository.lookup(e);if(r)return this._includedGrammars[e]=xr(r,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,r=0){let n=this._tokenize(e,t,!1,r);return{tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}tokenizeLine2(e,t,r=0){let n=this._tokenize(e,t,!0,r);return{tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}_tokenize(e,t,r,n){this._rootId===-1&&(this._rootId=_n.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===Gt.NULL){o=!0;let u=this._basicScopeAttributesProvider.getDefaultAttributes(),c=this.themeProvider.getDefaults(),d=le.set(0,u.languageId,u.tokenType,null,c.fontStyle,c.foregroundId,c.backgroundId),g=this.getRule(this._rootId).getName(null,null),h;g?h=_e.createRootAndLookUpScopeName(g,d,this):h=_e.createRoot("unknown",d),t=new Gt(null,this._rootId,-1,-1,!1,null,h,h)}else o=!1,t.reset();e=e+`
|
|
3
|
+
`;let a=this.createOnigString(e),i=a.content.length,s=new ba(r,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=En(this,a,o,0,t,s,!0,n);return Cn(a),{lineLength:i,lineTokens:s,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function xr(e,t){return e=Lo(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var _e=class Y{constructor(t,r,n){this.parent=t,this.scopePath=r,this.tokenAttributes=n}static fromExtension(t,r){let n=t,o=t?.scopePath??null;for(let a of r)o=kt.push(o,a.scopeNames),n=new Y(n,o,a.encodedTokenAttributes);return n}static createRoot(t,r){return new Y(null,new kt(null,t),r)}static createRootAndLookUpScopeName(t,r,n){let o=n.getMetadataForScope(t),a=new kt(null,t),i=n.themeProvider.themeMatch(a),s=Y.mergeAttributes(r,o,i);return new Y(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Y.equals(this,t)}static equals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.scopeName!==r.scopeName||t.tokenAttributes!==r.tokenAttributes)return!1;t=t.parent,r=r.parent}while(!0)}static mergeAttributes(t,r,n){let o=-1,a=0,i=0;return n!==null&&(o=n.fontStyle,a=n.foregroundId,i=n.backgroundId),le.set(t,r.languageId,r.tokenType,null,o,a,i)}pushAttributed(t,r){if(t===null)return this;if(t.indexOf(" ")===-1)return Y._pushAttributed(this,t,r);let n=t.split(/ /g),o=this;for(let a of n)o=Y._pushAttributed(o,a,r);return o}static _pushAttributed(t,r,n){let o=n.getMetadataForScope(r),a=t.scopePath.push(r),i=n.themeProvider.themeMatch(a),s=Y.mergeAttributes(t.tokenAttributes,o,i);return new Y(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){let r=[],n=this;for(;n&&n!==t;)r.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===t?r.reverse():void 0}},Gt=class oe{constructor(t,r,n,o,a,i,s,l){this.parent=t,this.ruleId=r,this.beginRuleCapturedEOL=a,this.endRule=i,this.nameScopesList=s,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new oe(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:oe._equals(this,t)}static _equals(t,r){return t===r?!0:this._structuralEquals(t,r)?_e.equals(t.contentNameScopesList,r.contentNameScopesList):!1}static _structuralEquals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.depth!==r.depth||t.ruleId!==r.ruleId||t.endRule!==r.endRule)return!1;t=t.parent,r=r.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){oe._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,r,n,o,a,i,s){return new oe(this,t,r,n,o,a,i,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){let t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,r){return this.parent&&(r=this.parent._writeString(t,r)),t[r++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,r}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new oe(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let r=this;for(;r&&r._enterPos===t._enterPos;){if(r.ruleId===t.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(t,r){let n=_e.fromExtension(t?.nameScopesList??null,r.nameScopesList);return new oe(t,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,n,_e.fromExtension(n,r.contentNameScopesList))}},ma=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(r=>r==="*"?(this.allowAny=!0,[]):Ve(r,Ye).map(n=>n.matcher)),this.unbalancedBracketScopes=t.flatMap(r=>Ve(r,Ye).map(n=>n.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},ba=class{constructor(e,t,r,n){this.balancedBracketSelectors=n,this._emitBinaryTokens=e,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let a=e?.getScopeNames()??[];for(let i of this._tokenTypeOverrides)i.matcher(a)&&(n=le.set(n,0,i.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(a))}if(o&&(n=le.set(n,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let r=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:r}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let r=new Uint32Array(this._binaryTokens.length);for(let n=0,o=this._binaryTokens.length;n<o;n++)r[n]=this._binaryTokens[n];return r}},ya=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,r,n,o){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,ga(e,a,t,r,n,o,this,this._onigLib))}return this._grammars.get(e)}},ka=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new ya(Ie.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Ie.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,r){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,t,r){return this._loadGrammar(e,t,r.embeddedLanguages,r.tokenTypes,new ma(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,r,n,o){let a=new Xo(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(i=>this._loadSingleGrammar(i.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,r,n,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,r)}}addGrammar(e,t=[],r=0,n=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,r,n)}_grammarForScopeName(e,t=0,r=null,n=null,o=null){return this._syncRegistry.grammarForScopeName(e,t,r,n,o)}},Ke=Gt.NULL;function $e(e,t){let r=typeof e=="string"?{}:{...e.colorReplacements},n=typeof e=="string"?e:e.name;for(let[o,a]of Object.entries(t?.colorReplacements||{}))typeof a=="string"?r[o]=a:o===n&&Object.assign(r,a);return r}function X(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function wa(e){return Array.isArray(e)?e:[e]}async function $n(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function at(e){return!e||["plaintext","txt","text","plain"].includes(e)}function va(e){return e==="ansi"||at(e)}function it(e){return e==="none"}function Ca(e){return it(e)}var xa=/(\r?\n)/g;function Re(e,t=!1){if(e.length===0)return[["",0]];let r=e.split(xa),n=0,o=[];for(let a=0;a<r.length;a+=2){let i=t?r[a]+(r[a+1]||""):r[a];o.push([i,n]),n+=r[a].length,n+=r[a+1]?.length||0}return o}var Sr={light:"#333333",dark:"#bbbbbb"},_r={light:"#fffffe",dark:"#1e1e1e"},Ar="__shiki_resolved";function rr(e){if(e?.[Ar])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:r,fg:n}=t;if(!r||!n){let s=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;s?.settings?.foreground&&(n=s.settings.foreground),s?.settings?.background&&(r=s.settings.background),!n&&t?.colors?.["editor.foreground"]&&(n=t.colors["editor.foreground"]),!r&&t?.colors?.["editor.background"]&&(r=t.colors["editor.background"]),n||(n=t.type==="light"?Sr.light:Sr.dark),r||(r=t.type==="light"?_r.light:_r.dark),t.fg=n,t.bg=r}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0,a=new Map;function i(s){if(a.has(s))return a.get(s);o+=1;let l=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?i(s):(a.set(s,l),l)}t.settings=t.settings.map(s=>{let l=s.settings?.foreground&&!s.settings.foreground.startsWith("#"),u=s.settings?.background&&!s.settings.background.startsWith("#");if(!l&&!u)return s;let c={...s,settings:{...s.settings}};if(l){let d=i(s.settings.foreground);t.colorReplacements[d]=s.settings.foreground,c.settings.foreground=d}if(u){let d=i(s.settings.background);t.colorReplacements[d]=s.settings.background,c.settings.background=d}return c});for(let s of Object.keys(t.colors||{}))if((s==="editor.foreground"||s==="editor.background"||s.startsWith("terminal.ansi"))&&!t.colors[s]?.startsWith("#")){let l=i(t.colors[s]);t.colorReplacements[l]=t.colors[s],t.colors[s]=l}return Object.defineProperty(t,Ar,{enumerable:!1,writable:!1,value:!0}),t}async function Fn(e){return[...new Set((await Promise.all(e.filter(t=>!va(t)).map(async t=>await $n(t).then(r=>Array.isArray(r)?r:[r])))).flat())]}async function Pn(e){return(await Promise.all(e.map(async t=>Ca(t)?null:rr(await $n(t))))).filter(t=>!!t)}function Ln(e,t){if(!t)return e;if(t[e]){let r=new Set([e]);for(;t[e];){if(e=t[e],r.has(e))throw new E(`Circular alias \`${[...r].join(" -> ")} -> ${e}\``);r.add(e)}}return e}var Sa=class extends ka{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,r,n={}){super(e),this._resolver=e,this._themes=t,this._langs=r,this._alias=n,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=rr(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Ie.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Ln(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let n=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(n.name=e.name,this._resolvedGrammars.set(e.name,n),e.aliases&&e.aliases.forEach(o=>{this._alias[o]=e.name}),this._loadedLanguagesCache=null,t.size)for(let o of t)this._resolvedGrammars.delete(o.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(o.scopeName),this._syncRegistry?._grammars?.delete(o.scopeName),this.loadLanguage(this._langMap.get(o.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let n of e)this.resolveEmbeddedLanguages(n);let t=[...this._langGraph.entries()],r=t.filter(([n,o])=>!o);if(r.length){let n=t.filter(([o,a])=>a?(a.embeddedLanguages||a.embeddedLangs)?.some(i=>r.map(([s])=>s).includes(i)):!1).filter(o=>!r.includes(o));throw new E(`Missing languages ${r.map(([o])=>`\`${o}\``).join(", ")}, required by ${n.map(([o])=>`\`${o}\``).join(", ")}`)}for(let[n,o]of t)this._resolver.addLanguage(o);for(let[n,o]of t)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let r of t)this._langGraph.set(r,this._langMap.get(r))}},_a=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},t.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split("."),r=[];for(let n=1;n<=t.length;n++){let o=t.slice(0,n).join(".");r=[...r,...this._injections.get(o)||[]]}return r}},xe=0;function Aa(e){xe+=1,e.warnings!==!1&&xe>=10&&xe%10===0&&console.warn(`[Shiki] ${xe} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new E("`engine` option is required for synchronous mode");let r=(e.langs||[]).flat(1),n=(e.themes||[]).flat(1).map(rr),o=new Sa(new _a(e.engine,r),n,r,e.langAlias),a;function i(f){return Ln(f,e.langAlias)}function s(f){y();let w=o.getGrammar(typeof f=="string"?f:f.name);if(!w)throw new E(`Language \`${f}\` not found, you may need to load it first`);return w}function l(f){if(f==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();let w=o.getTheme(f);if(!w)throw new E(`Theme \`${f}\` not found, you may need to load it first`);return w}function u(f){y();let w=l(f);return a!==f&&(o.setTheme(w),a=f),{theme:w,colorMap:o.getColorMap()}}function c(){return y(),o.getLoadedThemes()}function d(){return y(),o.getLoadedLanguages()}function g(...f){y(),o.loadLanguages(f.flat(1))}async function h(...f){return g(await Fn(f))}function p(...f){y();for(let w of f.flat(1))o.loadTheme(w)}async function b(...f){return y(),p(await Pn(f))}function y(){if(t)throw new E("Shiki instance has been disposed")}function m(){t||(t=!0,o.dispose(),xe-=1)}return{setTheme:u,getTheme:l,getLanguage:s,getLoadedThemes:c,getLoadedLanguages:d,resolveLangAlias:i,loadLanguage:h,loadLanguageSync:g,loadTheme:b,loadThemeSync:p,dispose:m,[Symbol.dispose]:m}}async function Ia(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,r,n]=await Promise.all([Pn(e.themes||[]),Fn(e.langs||[]),e.engine]);return Aa({...e,themes:t,langs:r,engine:n})}var Rn=new WeakMap;function st(e,t){Rn.set(e,t)}function Fe(e){return Rn.get(e)}var lt=class Tn{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,r){return new Tn(Object.fromEntries(wa(r).map(n=>[n,Ke])),t)}constructor(...t){if(t.length===2){let[r,n]=t;this.lang=n,this._stacks=r}else{let[r,n,o]=t;this.lang=n,this._stacks={[o]:r}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Ea(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Ea(e){let t=[],r=new Set;function n(o){if(r.has(o))return;r.add(o);let a=o?.nameScopesList?.scopeName;a&&t.push(a),o.parent&&n(o.parent)}return n(e),t}function Ba(e,t){if(!(e instanceof lt))throw new E("Invalid grammar state");return e.getInternalStack(t)}var Na=/,/,$a=/ /;function Mn(e,t,r={}){let{theme:n=e.getLoadedThemes()[0]}=r;if(at(e.resolveLangAlias(r.lang||"text"))||it(n))return Re(t).map(s=>[{content:s[0],offset:s[1]}]);let{theme:o,colorMap:a}=e.setTheme(n),i=e.getLanguage(r.lang||"text");if(r.grammarState){if(r.grammarState.lang!==i.name)throw new E(`Grammar state language "${r.grammarState.lang}" does not match highlight language "${i.name}"`);if(!r.grammarState.themes.includes(o.name))throw new E(`Grammar state themes "${r.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return Pa(t,i,o,a,r)}function Fa(...e){if(e.length===2)return Fe(e[1]);let[t,r,n={}]=e,{lang:o="text",theme:a=t.getLoadedThemes()[0]}=n;if(at(o)||it(a))throw new E("Plain language does not have grammar state");if(o==="ansi")throw new E("ANSI language does not have grammar state");let{theme:i,colorMap:s}=t.setTheme(a),l=t.getLanguage(o);return new lt(nr(r,l,i,s,n).stateStack,l.name,i.name)}function Pa(e,t,r,n,o){let a=nr(e,t,r,n,o),i=new lt(a.stateStack,t.name,r.name);return st(a.tokens,i),a.tokens}function nr(e,t,r,n,o){let a=$e(r,o),{tokenizeMaxLineLength:i=0,tokenizeTimeLimit:s=500,includeExplanation:l=!1}=o,u=Re(e),c=o.grammarState?Ba(o.grammarState,r.name)??Ke:o.grammarContextCode!=null?nr(o.grammarContextCode,t,r,n,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:Ke,d=[],g=[];for(let h=0,p=u.length;h<p;h++){let[b,y]=u[h];if(b===""){d=[],g.push([]);continue}if(i>0&&b.length>=i){d=[],g.push([{content:b,offset:y,color:"",fontStyle:0}]);continue}let m,f,w;l&&l!=="tokenType"&&(m=t.tokenizeLine(b,c,s),f=m.tokens,w=0);let v=t.tokenizeLine2(b,c,s),x=v.tokens.length/2;for(let _=0;_<x;_++){let B=v.tokens[2*_],A=_+1<x?v.tokens[2*_+2]:b.length;if(B===A)continue;let U=v.tokens[2*_+1],G=X(n[le.getForeground(U)],a),H=le.getFontStyle(U),$={content:b.substring(B,A),offset:y+B,color:G,fontStyle:H};if(l==="tokenType")$.type=le.getTokenType(U);else if(l){let O=[];if(l!=="scopeName")for(let K of r.settings){let he;switch(typeof K.scope){case"string":he=K.scope.split(Na).map(ft=>ft.trim());break;case"object":he=K.scope;break;default:continue}O.push({settings:K,selectors:he.map(ft=>ft.split($a))})}$.explanation=[];let Ce=0;for(;B+Ce<A;){let K=f[w],he=b.substring(K.startIndex,K.endIndex);Ce+=he.length,$.explanation.push({content:he,scopes:l==="scopeName"?La(K.scopes):Ra(O,K.scopes)}),w+=1}}d.push($)}g.push(d),d=[],c=v.ruleStack}return{tokens:g,stateStack:c}}function La(e){return e.map(t=>({scopeName:t}))}function Ra(e,t){let r=[];for(let n=0,o=t.length;n<o;n++){let a=t[n];r[n]={scopeName:a,themeMatches:Ma(e,a,t.slice(0,n))}}return r}function Ir(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Ta(e,t,r){if(!Ir(e.at(-1),t))return!1;let n=e.length-2,o=r.length-1;for(;n>=0&&o>=0;)Ir(e[n],r[o])&&(n-=1),o-=1;return n===-1}function Ma(e,t,r){let n=[];for(let{selectors:o,settings:a}of e)for(let i of o)if(Ta(i,t,r)){n.push(a);break}return n}function On(e,t,r,n=Mn){let o=Object.entries(r.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),a=o.map(u=>{let c=n(e,t,{...r,theme:u.theme});return{tokens:c,state:Fe(c),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),i=Oa(...a.map(u=>u.tokens)),s=i[0].map((u,c)=>u.map((d,g)=>{let h={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in r&&r.includeExplanation&&(h.explanation=d.explanation),i.forEach((p,b)=>{let{content:y,explanation:m,offset:f,...w}=p[c][g];h.variants[o[b].color]=w}),h})),l=a[0].state?new lt(Object.fromEntries(a.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),a[0].state.lang):void 0;return l&&st(s,l),s}function Oa(...e){let t=e.map(()=>[]),r=e.length;for(let n=0;n<e[0].length;n++){let o=e.map(l=>l[n]),a=t.map(()=>[]);t.forEach((l,u)=>l.push(a[u]));let i=o.map(()=>0),s=o.map(l=>l[0]);for(;s.every(l=>l);){let l=Math.min(...s.map(u=>u.content.length));for(let u=0;u<r;u++){let c=s[u];c.content.length===l?(a[u].push(c),i[u]+=1,s[u]=o[u][i[u]]):(a[u].push({...c,content:c.content.slice(0,l)}),s[u]={...c,content:c.content.slice(l),offset:c.offset+l})}}}return t}var Da=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Te=class{constructor(e,t,r){this.normal=t,this.property=e,r&&(this.space=r)}};Te.prototype.normal={};Te.prototype.property={};Te.prototype.space=void 0;function Dn(e,t){let r={},n={};for(let o of e)Object.assign(r,o.property),Object.assign(n,o.normal);return new Te(r,n,t)}function jt(e){return e.toLowerCase()}var D=class{constructor(e,t){this.attribute=t,this.property=e}};D.prototype.attribute="";D.prototype.booleanish=!1;D.prototype.boolean=!1;D.prototype.commaOrSpaceSeparated=!1;D.prototype.commaSeparated=!1;D.prototype.defined=!1;D.prototype.mustUseProperty=!1;D.prototype.number=!1;D.prototype.overloadedBoolean=!1;D.prototype.property="";D.prototype.spaceSeparated=!1;D.prototype.space=void 0;var Ze={};fr(Ze,{boolean:()=>C,booleanish:()=>F,commaOrSpaceSeparated:()=>j,commaSeparated:()=>ue,number:()=>k,overloadedBoolean:()=>Ut,spaceSeparated:()=>I});var Ga=0,C=de(),F=de(),Ut=de(),k=de(),I=de(),ue=de(),j=de();function de(){return 2**++Ga}var vt=Object.keys(Ze),or=class extends D{constructor(e,t,r,n){let o=-1;if(super(e,t),Er(this,"space",n),typeof r=="number")for(;++o<vt.length;){let a=vt[o];Er(this,vt[o],(r&Ze[a])===Ze[a])}}};or.prototype.defined=!0;function Er(e,t,r){r&&(e[t]=r)}function ke(e){let t={},r={};for(let[n,o]of Object.entries(e.properties)){let a=new or(n,e.transform(e.attributes||{},n),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(a.mustUseProperty=!0),t[n]=a,r[jt(n)]=n,r[jt(a.attribute)]=n}return new Te(t,r,e.space)}var Gn=ke({properties:{ariaActiveDescendant:null,ariaAtomic:F,ariaAutoComplete:null,ariaBusy:F,ariaChecked:F,ariaColCount:k,ariaColIndex:k,ariaColSpan:k,ariaControls:I,ariaCurrent:null,ariaDescribedBy:I,ariaDetails:null,ariaDisabled:F,ariaDropEffect:I,ariaErrorMessage:null,ariaExpanded:F,ariaFlowTo:I,ariaGrabbed:F,ariaHasPopup:null,ariaHidden:F,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:I,ariaLevel:k,ariaLive:null,ariaModal:F,ariaMultiLine:F,ariaMultiSelectable:F,ariaOrientation:null,ariaOwns:I,ariaPlaceholder:null,ariaPosInSet:k,ariaPressed:F,ariaReadOnly:F,ariaRelevant:null,ariaRequired:F,ariaRoleDescription:I,ariaRowCount:k,ariaRowIndex:k,ariaRowSpan:k,ariaSelected:F,ariaSetSize:k,ariaSort:null,ariaValueMax:k,ariaValueMin:k,ariaValueNow:k,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function jn(e,t){return t in e?e[t]:t}function Un(e,t){return jn(e,t.toLowerCase())}var ja=ke({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ue,acceptCharset:I,accessKey:I,action:null,allow:null,allowFullScreen:C,allowPaymentRequest:C,allowUserMedia:C,alpha:C,alt:null,as:null,async:C,autoCapitalize:null,autoComplete:I,autoFocus:C,autoPlay:C,blocking:I,capture:null,charSet:null,checked:C,cite:null,className:I,closedBy:null,colorSpace:null,cols:k,colSpan:k,command:null,commandFor:null,content:null,contentEditable:F,controls:C,controlsList:I,coords:k|ue,crossOrigin:null,data:null,dateTime:null,decoding:null,default:C,defer:C,dir:null,dirName:null,disabled:C,download:Ut,draggable:F,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:C,formTarget:null,headers:I,height:k,hidden:Ut,high:k,href:null,hrefLang:null,htmlFor:I,httpEquiv:I,id:null,imageSizes:null,imageSrcSet:null,inert:C,inputMode:null,integrity:null,is:null,isMap:C,itemId:null,itemProp:I,itemRef:I,itemScope:C,itemType:I,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:C,low:k,manifest:null,max:null,maxLength:k,media:null,method:null,min:null,minLength:k,multiple:C,muted:C,name:null,nonce:null,noModule:C,noValidate:C,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:C,optimum:k,pattern:null,ping:I,placeholder:null,playsInline:C,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:C,referrerPolicy:null,rel:I,required:C,reversed:C,rows:k,rowSpan:k,sandbox:I,scope:null,scoped:C,seamless:C,selected:C,shadowRootClonable:C,shadowRootCustomElementRegistry:C,shadowRootDelegatesFocus:C,shadowRootMode:null,shadowRootSerializable:C,shape:null,size:k,sizes:null,slot:null,span:k,spellCheck:F,src:null,srcDoc:null,srcLang:null,srcSet:null,start:k,step:null,style:null,tabIndex:k,target:null,title:null,translate:null,type:null,typeMustMatch:C,useMap:null,value:F,width:k,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:I,axis:null,background:null,bgColor:null,border:k,borderColor:null,bottomMargin:k,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:C,declare:C,event:null,face:null,frame:null,frameBorder:null,hSpace:k,leftMargin:k,link:null,longDesc:null,lowSrc:null,marginHeight:k,marginWidth:k,noResize:C,noHref:C,noShade:C,noWrap:C,object:null,profile:null,prompt:null,rev:null,rightMargin:k,rules:null,scheme:null,scrolling:F,standby:null,summary:null,text:null,topMargin:k,valueType:null,version:null,vAlign:null,vLink:null,vSpace:k,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:C,disablePictureInPicture:C,disableRemotePlayback:C,exportParts:ue,part:I,prefix:null,property:null,results:k,security:null,unselectable:null},space:"html",transform:Un}),Ua=ke({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:j,accentHeight:k,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:k,amplitude:k,arabicForm:null,ascent:k,attributeName:null,attributeType:null,azimuth:k,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:k,by:null,calcMode:null,capHeight:k,className:I,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:k,diffuseConstant:k,direction:null,display:null,dur:null,divisor:k,dominantBaseline:null,download:C,dx:null,dy:null,edgeMode:null,editable:null,elevation:k,enableBackground:null,end:null,event:null,exponent:k,externalResourcesRequired:null,fill:null,fillOpacity:k,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ue,g2:ue,glyphName:ue,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:k,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:k,horizOriginX:k,horizOriginY:k,id:null,ideographic:k,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:k,k,k1:k,k2:k,k3:k,k4:k,kernelMatrix:j,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:k,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:k,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:k,overlineThickness:k,paintOrder:null,panose1:null,path:null,pathLength:k,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:I,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:k,pointsAtY:k,pointsAtZ:k,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:j,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:j,rev:j,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:j,requiredFeatures:j,requiredFonts:j,requiredFormats:j,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:k,specularExponent:k,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:k,strikethroughThickness:k,string:null,stroke:null,strokeDashArray:j,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:k,strokeOpacity:k,strokeWidth:null,style:null,surfaceScale:k,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:j,tabIndex:k,tableValues:null,target:null,targetX:k,targetY:k,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:j,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:k,underlineThickness:k,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:k,values:null,vAlphabetic:k,vMathematical:k,vectorEffect:null,vHanging:k,vIdeographic:k,version:null,vertAdvY:k,vertOriginX:k,vertOriginY:k,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:k,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:jn}),Hn=ke({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Wn=ke({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Un}),zn=ke({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ha=/[A-Z]/g,Br=/-[a-z]/g,Wa=/^data[-\w.:]+$/i;function za(e,t){let r=jt(t),n=t,o=D;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&Wa.test(t)){if(t.charAt(4)==="-"){let a=t.slice(5).replace(Br,Va);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{let a=t.slice(4);if(!Br.test(a)){let i=a.replace(Ha,qa);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}o=or}return new o(n,t)}function qa(e){return"-"+e.toLowerCase()}function Va(e){return e.charAt(1).toUpperCase()}var Xa=Dn([Gn,ja,Hn,Wn,zn],"html"),qn=Dn([Gn,Ua,Hn,Wn,zn],"svg"),Nr={}.hasOwnProperty;function Qa(e,t){let r=t||{};function n(o,...a){let i=n.invalid,s=n.handlers;if(o&&Nr.call(o,e)){let l=String(o[e]);i=Nr.call(s,l)?s[l]:n.unknown}if(i)return i.call(this,o,...a)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}var Ya=/["&'<>`]/g,Ka=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Za=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ja=/[|\\{}()[\]^$+*?.]/g,$r=new WeakMap;function ei(e,t){if(e=e.replace(t.subset?ti(t.subset):Ya,n),t.subset||t.escapeOnly)return e;return e.replace(Ka,r).replace(Za,n);function r(o,a,i){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,i.charCodeAt(a+2),t)}function n(o,a,i){return t.format(o.charCodeAt(0),i.charCodeAt(a+1),t)}}function ti(e){let t=$r.get(e);return t||(t=ri(e),$r.set(e,t)),t}function ri(e){let t=[],r=-1;for(;++r<e.length;)t.push(e[r].replace(Ja,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}var ni=/[\dA-Fa-f]/;function oi(e,t,r){let n="&#x"+e.toString(16).toUpperCase();return r&&t&&!ni.test(String.fromCharCode(t))?n:n+";"}var ai=/\d/;function ii(e,t,r){let n="&#"+String(e);return r&&t&&!ai.test(String.fromCharCode(t))?n:n+";"}var si=["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:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",fnof:"\u0192",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",bull:"\u2022",hellip:"\u2026",prime:"\u2032",Prime:"\u2033",oline:"\u203E",frasl:"\u2044",weierp:"\u2118",image:"\u2111",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",quot:'"',amp:"&",lt:"<",gt:">",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"},li=["cent","copy","divide","gt","lt","not","para","times"],Vn={}.hasOwnProperty,Ht={},De;for(De in Ct)Vn.call(Ct,De)&&(Ht[Ct[De]]=De);var ui=/[^\dA-Za-z]/;function ci(e,t,r,n){let o=String.fromCharCode(e);if(Vn.call(Ht,o)){let a=Ht[o],i="&"+a;return r&&si.includes(a)&&!li.includes(a)&&(!n||t&&t!==61&&ui.test(String.fromCharCode(t)))?i:i+";"}return""}function di(e,t,r){let n=oi(e,t,r.omitOptionalSemicolons),o;if((r.useNamedReferences||r.useShortestReferences)&&(o=ci(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!o)&&r.useShortestReferences){let a=ii(e,t,r.omitOptionalSemicolons);a.length<n.length&&(n=a)}return o&&(!r.useShortestReferences||o.length<n.length)?o:n}function be(e,t){return ei(e,Object.assign({format:di},t))}var hi=/^>|^->|<!--|-->|--!>|<!-$/g,gi=[">"],pi=["<",">"];function fi(e,t,r,n){return n.settings.bogusComments?"<?"+be(e.value,Object.assign({},n.settings.characterReferences,{subset:gi}))+">":"<!--"+e.value.replace(hi,o)+"-->";function o(a){return be(a,Object.assign({},n.settings.characterReferences,{subset:pi}))}}function mi(e,t,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}function Fr(e,t){let r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,o=r.indexOf(t);for(;o!==-1;)n++,o=r.indexOf(t,o+t.length);return n}function bi(e,t){let r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}function yi(e){return e.join(" ").trim()}var ki=/[ \t\n\f\r]/g;function ar(e){return typeof e=="object"?e.type==="text"?Pr(e.value):!1:Pr(e)}function Pr(e){return e.replace(ki,"")===""}var L=Qn(1),Xn=Qn(-1),wi=[];function Qn(e){return t;function t(r,n,o){let a=r?r.children:wi,i=(n||0)+e,s=a[i];if(!o)for(;s&&ar(s);)i+=e,s=a[i];return s}}var vi={}.hasOwnProperty;function Yn(e){return t;function t(r,n,o){return vi.call(e,r.tagName)&&e[r.tagName](r,n,o)}}var ir=Yn({body:xi,caption:xt,colgroup:xt,dd:Ii,dt:Ai,head:xt,html:Ci,li:_i,optgroup:Ei,option:Bi,p:Si,rp:Lr,rt:Lr,tbody:$i,td:Rr,tfoot:Fi,th:Rr,thead:Ni,tr:Pi});function xt(e,t,r){let n=L(r,t,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&ar(n.value.charAt(0)))}function Ci(e,t,r){let n=L(r,t);return!n||n.type!=="comment"}function xi(e,t,r){let n=L(r,t);return!n||n.type!=="comment"}function Si(e,t,r){let n=L(r,t);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 _i(e,t,r){let n=L(r,t);return!n||n.type==="element"&&n.tagName==="li"}function Ai(e,t,r){let n=L(r,t);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function Ii(e,t,r){let n=L(r,t);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function Lr(e,t,r){let n=L(r,t);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function Ei(e,t,r){let n=L(r,t);return!n||n.type==="element"&&n.tagName==="optgroup"}function Bi(e,t,r){let n=L(r,t);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function Ni(e,t,r){let n=L(r,t);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function $i(e,t,r){let n=L(r,t);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function Fi(e,t,r){return!L(r,t)}function Pi(e,t,r){let n=L(r,t);return!n||n.type==="element"&&n.tagName==="tr"}function Rr(e,t,r){let n=L(r,t);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}var Li=Yn({body:Mi,colgroup:Oi,head:Ti,html:Ri,tbody:Di});function Ri(e){let t=L(e,-1);return!t||t.type!=="comment"}function Ti(e){let t=new Set;for(let n of e.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(t.has(n.tagName))return!1;t.add(n.tagName)}let r=e.children[0];return!r||r.type==="element"}function Mi(e){let t=L(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&ar(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Oi(e,t,r){let n=Xn(r,t),o=L(e,-1,!0);return r&&n&&n.type==="element"&&n.tagName==="colgroup"&&ir(n,r.children.indexOf(n),r)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function Di(e,t,r){let n=Xn(r,t),o=L(e,-1);return r&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&ir(n,r.children.indexOf(n),r)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}var Ge={name:[[`
|
|
4
|
+
\f\r &/=>`.split(""),`
|
|
5
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
6
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
7
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
8
|
+
\f\r &>`.split(""),`\0
|
|
9
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
10
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
11
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Gi(e,t,r,n){let o=n.schema,a=o.space==="svg"?!1:n.settings.omitOptionalTags,i=o.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(e.tagName.toLowerCase()),s=[],l;o.space==="html"&&e.tagName==="svg"&&(n.schema=qn);let u=ji(n,e.properties),c=n.all(o.space==="html"&&e.tagName==="template"?e.content:e);return n.schema=o,c&&(i=!1),(u||!a||!Li(e,t,r))&&(s.push("<",e.tagName,u?" "+u:""),i&&(o.space==="svg"||n.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!n.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&s.push(" "),s.push("/")),s.push(">")),s.push(c),!i&&(!a||!ir(e,t,r))&&s.push("</"+e.tagName+">"),s.join("")}function ji(e,t){let r=[],n=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){let a=Ui(e,o,t[o]);a&&r.push(a)}}for(;++n<r.length;){let a=e.settings.tightAttributes?r[n].charAt(r[n].length-1):void 0;n!==r.length-1&&a!=='"'&&a!=="'"&&(r[n]+=" ")}return r.join("")}function Ui(e,t,r){let n=za(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,a=e.settings.allowDangerousCharacters?0:1,i=e.quote,s;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"";let l=be(n.attribute,Object.assign({},e.settings.characterReferences,{subset:Ge.name[o][a]}));return r===!0||(r=Array.isArray(r)?(n.commaSeparated?bi:yi)(r,{padLeft:!e.settings.tightCommaSeparatedLists}):String(r),e.settings.collapseEmptyAttributes&&!r)?l:(e.settings.preferUnquoted&&(s=be(r,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ge.unquoted[o][a]}))),s!==r&&(e.settings.quoteSmart&&Fr(r,i)>Fr(r,e.alternative)&&(i=e.alternative),s=i+be(r,Object.assign({},e.settings.characterReferences,{subset:(i==="'"?Ge.single:Ge.double)[o][a],attribute:!0}))+i),l+(s&&"="+s))}var Hi=["<","&"];function Kn(e,t,r,n){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?e.value:be(e.value,Object.assign({},n.settings.characterReferences,{subset:Hi}))}function Wi(e,t,r,n){return n.settings.allowDangerousHtml?e.value:Kn(e,t,r,n)}function zi(e,t,r,n){return n.all(e)}var qi=Qa("type",{invalid:Vi,unknown:Xi,handlers:{comment:fi,doctype:mi,element:Gi,raw:Wi,root:zi,text:Kn}});function Vi(e){throw new Error("Expected node, not `"+e+"`")}function Xi(e){let t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}var Qi={},Yi={},Ki=[];function Zi(e,t){let r=t||Qi,n=r.quote||'"',o=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:Ji,all:es,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||Da,characterReferences:r.characterReferences||Yi,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?qn:Xa,quote:n,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Ji(e,t,r){return qi(e,t,r,this)}function es(e){let t=[],r=e&&e.children||Ki,n=-1;for(;++n<r.length;)t[n]=this.one(r[n],n,e);return t.join("")}var Tr=/\s+/g;function Zn(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(Tr)),Array.isArray(e.properties.class)||(e.properties.class=[]);let r=Array.isArray(t)?t:t.split(Tr);for(let n of r)n&&!e.properties.class.includes(n)&&e.properties.class.push(n);return e}function ts(e){let t=Re(e,!0).map(([o])=>o);function r(o){if(o===e.length)return{line:t.length-1,character:t.at(-1).length};let a=o,i=0;for(let s of t){if(a<s.length)break;a-=s.length,i++}return{line:i,character:a}}function n(o,a){let i=0;for(let s=0;s<o;s++)i+=t[s].length;return i+=a,i}return{lines:t,indexToPos:r,posToIndex:n}}var rs=["color","background-color"];function ns(e,t){let r=0,n=[];for(let o of t)o>r&&n.push({...e,content:e.content.slice(r,o),offset:e.offset+r}),r=o;return r<e.content.length&&n.push({...e,content:e.content.slice(r),offset:e.offset+r}),n}function os(e,t){let r=[...t instanceof Set?t:new Set(t)].sort((n,o)=>n-o);return r.length?e.map(n=>n.flatMap(o=>{let a=r.filter(i=>o.offset<i&&i<o.offset+o.content.length).map(i=>i-o.offset).sort((i,s)=>i-s);return a.length?ns(o,a):o})):e}function Wt(e,t,r,n,o="css-vars"){let a={content:e.content,explanation:e.explanation,offset:e.offset},i=t.map(c=>Je(e.variants[c])),s=new Set(i.flatMap(c=>Object.keys(c))),l={},u=(c,d)=>{let g=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return r+t[c]+(d==="color"?"":g)};return i.forEach((c,d)=>{for(let g of s){let h=c[g]||"inherit";if(d===0&&n&&rs.includes(g))if(n==="light-dark()"&&i.length>1){let p=t.findIndex(y=>y==="light"),b=t.findIndex(y=>y==="dark");if(p===-1||b===-1)throw new E('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');l[g]=`light-dark(${i[p][g]||"inherit"}, ${i[b][g]||"inherit"})`,o==="css-vars"&&(l[u(d,g)]=h)}else l[g]=h;else o==="css-vars"&&(l[u(d,g)]=h)}}),a.htmlStyle=l,a}function Je(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&M.Italic&&(t["font-style"]="italic"),e.fontStyle&M.Bold&&(t["font-weight"]="bold");let r=[];e.fontStyle&M.Underline&&r.push("underline"),e.fontStyle&M.Strikethrough&&r.push("line-through"),r.length&&(t["text-decoration"]=r.join(" "))}return t}function zt(e){return typeof e=="string"?e:Object.entries(e).map(([t,r])=>`${t}:${r}`).join(";")}function as(){let e=new WeakMap;function t(r){if(!e.has(r.meta)){let n=function(i){if(typeof i=="number"){if(i<0||i>r.source.length)throw new E(`Invalid decoration offset: ${i}. Code length: ${r.source.length}`);return{...o.indexToPos(i),offset:i}}else{let s=o.lines[i.line];if(s===void 0)throw new E(`Invalid decoration position ${JSON.stringify(i)}. Lines length: ${o.lines.length}`);let l=i.character;if(l<0&&(l=s.length+l),l<0||l>s.length)throw new E(`Invalid decoration position ${JSON.stringify(i)}. Line ${i.line} length: ${s.length}`);return{...i,character:l,offset:o.posToIndex(i.line,l)}}},o=ts(r.source),a=(r.options.decorations||[]).map(i=>({...i,start:n(i.start),end:n(i.end)}));is(a),e.set(r.meta,{decorations:a,converter:o,source:r.source})}return e.get(r.meta)}return{name:"shiki:decorations",tokens(r){if(this.options.decorations?.length)return os(r,t(this).decorations.flatMap(n=>[n.start.offset,n.end.offset]))},code(r){if(!this.options.decorations?.length)return;let n=t(this),o=[...r.children].filter(c=>c.type==="element"&&c.tagName==="span");if(o.length!==n.converter.lines.length)throw new E(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function a(c,d,g,h){let p=o[c],b="",y=-1,m=-1;if(d===0&&(y=0),g===0&&(m=0),g===Number.POSITIVE_INFINITY&&(m=p.children.length),y===-1||m===-1)for(let w=0;w<p.children.length;w++)b+=Jn(p.children[w]),y===-1&&b.length===d&&(y=w+1),m===-1&&b.length===g&&(m=w+1);if(y===-1)throw new E(`Failed to find start index for decoration ${JSON.stringify(h.start)}`);if(m===-1)throw new E(`Failed to find end index for decoration ${JSON.stringify(h.end)}`);let f=p.children.slice(y,m);if(!h.alwaysWrap&&f.length===p.children.length)s(p,h,"line");else if(!h.alwaysWrap&&f.length===1&&f[0].type==="element")s(f[0],h,"token");else{let w={type:"element",tagName:"span",properties:{},children:f};s(w,h,"wrapper"),p.children.splice(y,f.length,w)}}function i(c,d){o[c]=s(o[c],d,"line")}function s(c,d,g){let h=d.properties||{},p=d.transform||(b=>b);return c.tagName=d.tagName||"span",c.properties={...c.properties,...h,class:c.properties.class},d.properties?.class&&Zn(c,d.properties.class),c=p(c,g)||c,c}let l=[],u=n.decorations.sort((c,d)=>d.start.offset-c.start.offset||c.end.offset-d.end.offset);for(let c of u){let{start:d,end:g}=c;if(d.line===g.line)a(d.line,d.character,g.character,c);else if(d.line<g.line){a(d.line,d.character,Number.POSITIVE_INFINITY,c);for(let h=d.line+1;h<g.line;h++)l.unshift(()=>i(h,c));a(g.line,0,g.character,c)}}l.forEach(c=>c())}}}function is(e){for(let t=0;t<e.length;t++){let r=e[t];if(r.start.offset>r.end.offset)throw new E(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let n=t+1;n<e.length;n++){let o=e[n],a=r.start.offset<=o.start.offset&&o.start.offset<r.end.offset,i=r.start.offset<o.end.offset&&o.end.offset<=r.end.offset,s=o.start.offset<=r.start.offset&&r.start.offset<o.end.offset,l=o.start.offset<r.end.offset&&r.end.offset<=o.end.offset;if(a||i||s||l){if(a&&i||s&&l||s&&r.start.offset===r.end.offset||i&&o.start.offset===o.end.offset)continue;throw new E(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function Jn(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Jn).join(""):""}var ss=[as()];function et(e){let t=ls(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...ss]}function ls(e){let t=[],r=[],n=[];for(let o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":r.push(o);break;default:n.push(o)}return{pre:t,post:r,normal:n}}var ie=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],St={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function us(e,t){let r=e.indexOf("\x1B",t);if(r!==-1&&e[r+1]==="["){let n=e.indexOf("m",r);if(n!==-1)return{sequence:e.substring(r+2,n).split(";"),startPosition:r,position:n+1}}return{position:e.length}}function Mr(e){let t=e.shift();if(t==="2"){let r=e.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(t==="5"){let r=e.shift();if(r)return{type:"table",index:Number(r)}}}function cs(e){let t=[];for(;e.length>0;){let r=e.shift();if(!r)continue;let n=Number.parseInt(r);if(!Number.isNaN(n))if(n===0)t.push({type:"resetAll"});else if(n<=9)St[n]&&t.push({type:"setDecoration",value:St[n]});else if(n<=29){let o=St[n-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(n<=37)t.push({type:"setForegroundColor",value:{type:"named",name:ie[n-30]}});else if(n===38){let o=Mr(e);o&&t.push({type:"setForegroundColor",value:o})}else if(n===39)t.push({type:"resetForegroundColor"});else if(n<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:ie[n-40]}});else if(n===48){let o=Mr(e);o&&t.push({type:"setBackgroundColor",value:o})}else n===49?t.push({type:"resetBackgroundColor"}):n===53?t.push({type:"setDecoration",value:"overline"}):n===55?t.push({type:"resetDecoration",value:"overline"}):n>=90&&n<=97?t.push({type:"setForegroundColor",value:{type:"named",name:ie[n-90+8]}}):n>=100&&n<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:ie[n-100+8]}})}return t}function ds(){let e=null,t=null,r=new Set;return{parse(n){let o=[],a=0;do{let i=us(n,a),s=i.sequence?n.substring(a,i.startPosition):n.substring(a);if(s.length>0&&o.push({value:s,foreground:e,background:t,decorations:new Set(r)}),i.sequence){let l=cs(i.sequence);for(let u of l)u.type==="resetAll"?(e=null,t=null,r.clear()):u.type==="resetForegroundColor"?e=null:u.type==="resetBackgroundColor"?t=null:u.type==="resetDecoration"&&r.delete(u.value);for(let u of l)u.type==="setForegroundColor"?e=u.value:u.type==="setBackgroundColor"?t=u.value:u.type==="setDecoration"&&r.add(u.value)}a=i.position}while(a<n.length);return o}}}var hs={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 gs(e=hs){function t(s){return e[s]}function r(s){return`#${s.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let n;function o(){if(n)return n;n=[];for(let u=0;u<ie.length;u++)n.push(t(ie[u]));let s=[0,95,135,175,215,255];for(let u=0;u<6;u++)for(let c=0;c<6;c++)for(let d=0;d<6;d++)n.push(r([s[u],s[c],s[d]]));let l=8;for(let u=0;u<24;u++,l+=10)n.push(r([l,l,l]));return n}function a(s){return o()[s]}function i(s){switch(s.type){case"named":return t(s.name);case"rgb":return r(s.rgb);case"table":return a(s.index)}}return{value:i}}var ps=/#([0-9a-f]{3,8})/i,fs=/var\((--[\w-]+-ansi-[\w-]+)\)/,ms={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 bs(e,t,r){let n=$e(e,r),o=Re(t),a=gs(Object.fromEntries(ie.map(s=>{let l=`terminal.ansi${s[0].toUpperCase()}${s.substring(1)}`;return[s,e.colors?.[l]||ms[s]]}))),i=ds();return o.map(s=>i.parse(s[0]).map(l=>{let u,c;l.decorations.has("reverse")?(u=l.background?a.value(l.background):e.bg,c=l.foreground?a.value(l.foreground):e.fg):(u=l.foreground?a.value(l.foreground):e.fg,c=l.background?a.value(l.background):void 0),u=X(u,n),c=X(c,n),l.decorations.has("dim")&&(u=ys(u));let d=M.None;return l.decorations.has("bold")&&(d|=M.Bold),l.decorations.has("italic")&&(d|=M.Italic),l.decorations.has("underline")&&(d|=M.Underline),l.decorations.has("strikethrough")&&(d|=M.Strikethrough),{content:l.value,offset:s[1],color:u,bgColor:c,fontStyle:d}}))}function ys(e){let t=e.match(ps);if(t){let n=t[1];if(n.length===8){let o=Math.round(Number.parseInt(n.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${n.slice(0,6)}${o}`}else{if(n.length===6)return`#${n}80`;if(n.length===4){let o=n[0],a=n[1],i=n[2],s=n[3];return`#${o}${o}${a}${a}${i}${i}${Math.round(Number.parseInt(`${s}${s}`,16)/2).toString(16).padStart(2,"0")}`}else if(n.length===3){let o=n[0],a=n[1],i=n[2];return`#${o}${o}${a}${a}${i}${i}80`}}}let r=e.match(fs);return r?`var(${r[1]}-dim)`:e}function qt(e,t,r={}){let n=e.resolveLangAlias(r.lang||"text"),{theme:o=e.getLoadedThemes()[0]}=r;if(!at(n)&&!it(o)&&n==="ansi"){let{theme:a}=e.setTheme(o);return bs(a,t,r)}return Mn(e,t,r)}function tt(e,t,r){let n,o,a,i,s,l;if("themes"in r){let{defaultColor:u="light",cssVariablePrefix:c="--shiki-",colorsRendering:d="css-vars"}=r,g=Object.entries(r.themes).filter(m=>m[1]).map(m=>({color:m[0],theme:m[1]})).sort((m,f)=>m.color===u?-1:f.color===u?1:0);if(g.length===0)throw new E("`themes` option must not be empty");let h=On(e,t,r,qt);if(l=Fe(h),u&&u!=="light-dark()"&&!g.some(m=>m.color===u))throw new E(`\`themes\` option must contain the defaultColor key \`${u}\``);let p=g.map(m=>e.getTheme(m.theme)),b=g.map(m=>m.color);a=h.map(m=>m.map(f=>Wt(f,b,c,u,d))),l&&st(a,l);let y=g.map(m=>$e(m.theme,r));o=Or(g,p,y,c,u,"fg",d),n=Or(g,p,y,c,u,"bg",d),i=`shiki-themes ${p.map(m=>m.name).join(" ")}`,s=u?void 0:[o,n].join(";")}else if("theme"in r){let u=$e(r.theme,r);a=qt(e,t,r);let c=e.getTheme(r.theme);n=X(c.bg,u),o=X(c.fg,u),i=c.name,l=Fe(a)}else throw new E("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:o,bg:n,themeName:i,rootStyle:s,grammarState:l}}function Or(e,t,r,n,o,a,i){return e.map((s,l)=>{let u=X(t[l][a],r[l])||"inherit",c=`${n+s.color}${a==="bg"?"-bg":""}:${u}`;if(l===0&&o){if(o==="light-dark()"&&e.length>1){let d=e.findIndex(h=>h.color==="light"),g=e.findIndex(h=>h.color==="dark");if(d===-1||g===-1)throw new E('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${X(t[d][a],r[d])||"inherit"}, ${X(t[g][a],r[g])||"inherit"});${c}`}return u}return i==="css-vars"?c:null}).filter(s=>!!s).join(";")}var eo=/^\s+$/,ks=/^(\s*)(.*?)(\s*)$/;function rt(e,t,r,n={meta:{},options:r,codeToHast:(o,a)=>rt(e,o,a),codeToTokens:(o,a)=>tt(e,o,a)}){let o=t;for(let p of et(r))o=p.preprocess?.call(n,o,r)||o;let{tokens:a,fg:i,bg:s,themeName:l,rootStyle:u,grammarState:c}=tt(e,o,r),{mergeWhitespaces:d=!0,mergeSameStyleTokens:g=!1}=r;d===!0?a=ws(a):d==="never"&&(a=vs(a)),g&&(a=Cs(a));let h={...n,get source(){return o}};for(let p of et(r))a=p.tokens?.call(h,a)||a;return to(a,{...r,fg:i,bg:s,themeName:l,rootStyle:r.rootStyle===!1?!1:r.rootStyle??u},h,c)}function to(e,t,r,n=Fe(e)){let o=et(t),a=[],i={type:"root",children:[]},{structure:s="classic",tabindex:l="0"}=t,u={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?u.style=t.rootStyle:u.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(u.tabindex=l.toString());for(let[b,y]of Object.entries(t.meta||{}))b.startsWith("_")||(u[b]=y);let c={type:"element",tagName:"pre",properties:u,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:a},g=[],h={...r,structure:s,addClassToHast:Zn,get source(){return r.source},get tokens(){return e},get options(){return t},get root(){return i},get pre(){return c},get code(){return d},get lines(){return g}};if(e.forEach((b,y)=>{y&&(s==="inline"?i.children.push({type:"element",tagName:"br",properties:{},children:[]}):s==="classic"&&a.push({type:"text",value:`
|
|
12
|
+
`}));let m={type:"element",tagName:"span",properties:{class:"line"},children:[]},f=0;for(let w of b){let v={type:"element",tagName:"span",properties:{...w.htmlAttrs},children:[{type:"text",value:w.content}]},x=zt(w.htmlStyle||Je(w));x&&(v.properties.style=x);for(let _ of o)v=_?.span?.call(h,v,y+1,f,m,w)||v;s==="inline"?i.children.push(v):s==="classic"&&m.children.push(v),f+=w.content.length}if(s==="classic"){for(let w of o)m=w?.line?.call(h,m,y+1)||m;g.push(m),a.push(m)}else s==="inline"&&g.push(m)}),s==="classic"){for(let b of o)d=b?.code?.call(h,d)||d;c.children.push(d);for(let b of o)c=b?.pre?.call(h,c)||c;i.children.push(c)}else if(s==="inline"){let b=[],y={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let f of i.children)f.type==="element"&&f.tagName==="br"?(b.push(y),y={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(f.type==="element"||f.type==="text")&&y.children.push(f);b.push(y);let m={type:"element",tagName:"code",properties:{},children:b};for(let f of o)m=f?.code?.call(h,m)||m;i.children=[];for(let f=0;f<m.children.length;f++){f>0&&i.children.push({type:"element",tagName:"br",properties:{},children:[]});let w=m.children[f];w.type==="element"&&i.children.push(...w.children)}}let p=i;for(let b of o)p=b?.root?.call(h,p)||p;return n&&st(p,n),p}function ws(e){return e.map(t=>{let r=[],n="",o;return t.forEach((a,i)=>{let s=!(a.fontStyle&&(a.fontStyle&M.Underline||a.fontStyle&M.Strikethrough));s&&eo.test(a.content)&&t[i+1]?(o===void 0&&(o=a.offset),n+=a.content):n?(s?r.push({...a,offset:o,content:n+a.content}):r.push({content:n,offset:o},a),o=void 0,n=""):r.push(a)}),r})}function vs(e){return e.map(t=>t.flatMap(r=>{if(eo.test(r.content))return r;let n=r.content.match(ks);if(!n)return r;let[,o,a,i]=n;if(!o&&!i)return r;let s=[{...r,offset:r.offset+o.length,content:a}];return o&&s.unshift({content:o,offset:r.offset}),i&&s.push({content:i,offset:r.offset+o.length+a.length}),s}))}function Cs(e){return e.map(t=>{let r=[];for(let n of t){if(r.length===0){r.push({...n});continue}let o=r.at(-1),a=zt(o.htmlStyle||Je(o)),i=zt(n.htmlStyle||Je(n)),s=o.fontStyle&&(o.fontStyle&M.Underline||o.fontStyle&M.Strikethrough),l=n.fontStyle&&(n.fontStyle&M.Underline||n.fontStyle&M.Strikethrough);!s&&!l&&a===i?o.content+=n.content:r.push({...n})}return r})}var ro=Zi;function xs(e,t,r){let n={meta:{},options:r,codeToHast:(a,i)=>rt(e,a,i),codeToTokens:(a,i)=>tt(e,a,i)},o=ro(rt(e,t,r,n));for(let a of et(r))o=a.postprocess?.call(n,o,r)||o;return o}async function Ss(e){let t=await Ia(e);return{getLastGrammarState:(...r)=>Fa(t,...r),codeToTokensBase:(r,n)=>qt(t,r,n),codeToTokensWithThemes:(r,n)=>On(t,r,n),codeToTokens:(r,n)=>tt(t,r,n),codeToHast:(r,n)=>rt(t,r,n),codeToHtml:(r,n)=>xs(t,r,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var _s=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:r=!1,cache:n,regexConstructor:o}=t;if(!o)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(a=>{if(typeof a!="string")return a;let i=n?.get(a);if(i){if(i instanceof RegExp)return i;if(r)return null;throw i}try{let s=o(a);return n?.set(a,s),s}catch(s){if(n?.set(a,s),r)return null;throw s}})}findNextMatchSync(e,t,r){let n=typeof e=="string"?e:e.content,o=[];function a(i,s,l=0){return{index:i,captureIndices:s.indices.map(u=>u==null?{start:4294967295,end:4294967295,length:0}:{start:u[0]+l,end:u[1]+l,length:u[1]-u[0]})}}for(let i=0;i<this.regexps.length;i++){let s=this.regexps[i];if(s)try{s.lastIndex=t;let l=s.exec(n);if(!l)continue;if(l.index===t)return a(i,l,0);o.push([i,l,0])}catch(l){if(this.options.forgiving)continue;throw l}}if(o.length){let i=Math.min(...o.map(s=>s[1].index));for(let[s,l,u]of o)if(l.index===i)return a(s,l,u)}return null}};function we(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function As(e,t,r){return e.has(t)||e.set(t,r),e.get(t)}var sr=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),R=String.raw;function ve(e,t){if(e==null)throw new Error(t??"Value expected");return e}var no=R`\[\^?`,oo=`c.? | C(?:-.?)?|${R`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${R`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${R`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${R`o\{[^\}]*\}?`}|${R`\d{1,3}`}`,lr=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,je=new RegExp(R`
|
|
13
|
+
\\ (?:
|
|
14
|
+
${oo}
|
|
15
|
+
| [gk]<[^>]*>?
|
|
16
|
+
| [gk]'[^']*'?
|
|
17
|
+
| .
|
|
18
|
+
)
|
|
19
|
+
| \( (?:
|
|
20
|
+
\? (?:
|
|
21
|
+
[:=!>({]
|
|
22
|
+
| <[=!]
|
|
23
|
+
| <[^>]*>
|
|
24
|
+
| '[^']*'
|
|
25
|
+
| ~\|?
|
|
26
|
+
| #(?:[^)\\]|\\.?)*
|
|
27
|
+
| [^:)]*[:)]
|
|
28
|
+
)?
|
|
29
|
+
| \*[^\)]*\)?
|
|
30
|
+
)?
|
|
31
|
+
| (?:${lr.source})+
|
|
32
|
+
| ${no}
|
|
33
|
+
| .
|
|
34
|
+
`.replace(/\s+/g,""),"gsu"),_t=new RegExp(R`
|
|
35
|
+
\\ (?:
|
|
36
|
+
${oo}
|
|
37
|
+
| .
|
|
38
|
+
)
|
|
39
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
40
|
+
| ${no}
|
|
41
|
+
| &&
|
|
42
|
+
| .
|
|
43
|
+
`.replace(/\s+/g,""),"gsu");function Is(e,t={}){let r={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");let n=qs(r.flags),o=[n.extended],a={captureGroup:r.rules.captureGroup,getCurrentModX(){return o.at(-1)},numOpenGroups:0,popModX(){o.pop()},pushModX(d){o.push(d)},replaceCurrentModX(d){o[o.length-1]=d},singleline:r.rules.singleline},i=[],s;for(je.lastIndex=0;s=je.exec(e);){let d=Es(a,e,s[0],je.lastIndex);d.tokens?i.push(...d.tokens):d.token&&i.push(d.token),d.lastIndex!==void 0&&(je.lastIndex=d.lastIndex)}let l=[],u=0;i.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++u:d.raw==="("&&l.push(d)}),u||l.forEach((d,g)=>{d.kind="capturing",d.number=g+1});let c=u||l.length;return{tokens:i.map(d=>d.type==="EscapedNumber"?Xs(d,c):d).flat(),flags:n}}function Es(e,t,r,n){let[o,a]=r;if(r==="["||r==="[^"){let i=Bs(t,r,n);return{tokens:i.tokens,lastIndex:i.lastIndex}}if(o==="\\"){if("AbBGyYzZ".includes(a))return{token:Dr(r,r)};if(/^\\g[<']/.test(r)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(r))throw new Error(`Invalid group name "${r}"`);return{token:Ds(r)}}if(/^\\k[<']/.test(r)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(r))throw new Error(`Invalid group name "${r}"`);return{token:io(r)}}if(a==="K")return{token:so("keep",r)};if(a==="N"||a==="R")return{token:se("newline",r,{negate:a==="N"})};if(a==="O")return{token:se("any",r)};if(a==="X")return{token:se("text_segment",r)};let i=ao(r,{inCharClass:!1});return Array.isArray(i)?{tokens:i}:{token:i}}if(o==="("){if(a==="*")return{token:Hs(r)};if(r==="(?{")throw new Error(`Unsupported callout "${r}"`);if(r.startsWith("(?#")){if(t[n]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:n+1}}if(/^\(\?[-imx]+[:)]$/.test(r))return{token:Us(r,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,r==="("&&!e.captureGroup||r==="(?:")return{token:fe("group",r)};if(r==="(?>")return{token:fe("atomic",r)};if(r==="(?="||r==="(?!"||r==="(?<="||r==="(?<!")return{token:fe(r[2]==="<"?"lookbehind":"lookahead",r,{negate:r.endsWith("!")})};if(r==="("&&e.captureGroup||r.startsWith("(?<")&&r.endsWith(">")||r.startsWith("(?'")&&r.endsWith("'"))return{token:fe("capturing",r,{...r!=="("&&{name:r.slice(3,-1)}})};if(r.startsWith("(?~")){if(r==="(?~|")throw new Error(`Unsupported absence function kind "${r}"`);return{token:fe("absence_repeater",r)}}throw r==="(?("?new Error(`Unsupported conditional "${r}"`):new Error(`Invalid or unsupported group option "${r}"`)}if(r===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:Ts(r)}}if(e.getCurrentModX()){if(r==="#"){let i=t.indexOf(`
|
|
44
|
+
`,n);return{lastIndex:i===-1?t.length:i}}if(/^\s$/.test(r)){let i=/\s+/y;return i.lastIndex=n,{lastIndex:i.exec(t)?i.lastIndex:n}}}if(r===".")return{token:se("dot",r)};if(r==="^"||r==="$"){let i=e.singleline?{"^":R`\A`,$:R`\Z`}[r]:r;return{token:Dr(i,r)}}return r==="|"?{token:$s(r)}:lr.test(r)?{tokens:Qs(r)}:{token:ee(we(r),r)}}function Bs(e,t,r){let n=[Gr(t[1]==="^",t)],o=1,a;for(_t.lastIndex=r;a=_t.exec(e);){let i=a[0];if(i[0]==="["&&i[1]!==":")o++,n.push(Gr(i[1]==="^",i));else if(i==="]"){if(n.at(-1).type==="CharacterClassOpen")n.push(ee(93,i));else if(o--,n.push(Fs(i)),!o)break}else{let s=Ns(i);Array.isArray(s)?n.push(...s):n.push(s)}}return{tokens:n,lastIndex:_t.lastIndex||e.length}}function Ns(e){if(e[0]==="\\")return ao(e,{inCharClass:!0});if(e[0]==="["){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!sr.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return se("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?Ps(e):e==="&&"?Ls(e):ee(we(e),e)}function ao(e,{inCharClass:t}){let r=e[1];if(r==="c"||r==="C")return js(e);if("dDhHsSwW".includes(r))return Ws(e);if(e.startsWith(R`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return zs(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{let n=e.split(/\\x/).slice(1).map(i=>parseInt(i,16)),o=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(n)),a=new TextEncoder;return[...o].map(i=>{let s=[...a.encode(i)].map(l=>`\\x${l.toString(16)}`).join("");return ee(we(i),s)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(r==="u"||r==="x")return ee(Vs(e),e);if(jr.has(r))return ee(jr.get(r),e);if(/\d/.test(r))return Rs(t,e);if(e==="\\")throw new Error(R`Incomplete escape "\"`);if(r==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return ee(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function $s(e){return{type:"Alternator",raw:e}}function Dr(e,t){return{type:"Assertion",kind:e,raw:t}}function io(e){return{type:"Backreference",raw:e}}function ee(e,t){return{type:"Character",value:e,raw:t}}function Fs(e){return{type:"CharacterClassClose",raw:e}}function Ps(e){return{type:"CharacterClassHyphen",raw:e}}function Ls(e){return{type:"CharacterClassIntersector",raw:e}}function Gr(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function se(e,t,r={}){return{type:"CharacterSet",kind:e,...r,raw:t}}function so(e,t,r={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:ve(r.flags),raw:t}}function Rs(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function Ts(e){return{type:"GroupClose",raw:e}}function fe(e,t,r={}){return{type:"GroupOpen",kind:e,...r,raw:t}}function Ms(e,t,r,n){return{type:"NamedCallout",kind:e,tag:t,arguments:r,raw:n}}function Os(e,t,r,n){return{type:"Quantifier",kind:e,min:t,max:r,raw:n}}function Ds(e){return{type:"Subroutine",raw:e}}var Gs=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),jr=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function js(e){let t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return ee(we(t.toUpperCase())-64,e)}function Us(e,t){let{on:r,off:n}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;n??="";let o=(t.getCurrentModX()||r.includes("x"))&&!n.includes("x"),a=Hr(r),i=Hr(n),s={};if(a&&(s.enable=a),i&&(s.disable=i),e.endsWith(")"))return t.replaceCurrentModX(o),so("flags",e,{flags:s});if(e.endsWith(":"))return t.pushModX(o),t.numOpenGroups++,fe("group",e,{...(a||i)&&{flags:s}});throw new Error(`Unexpected flag modifier "${e}"`)}function Hs(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);let{name:r,tag:n,args:o}=t.groups;if(!r)throw new Error(`Invalid named callout "${e}"`);if(n==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);let a=o?o.split(",").filter(c=>c!=="").map(c=>/^[+-]?\d+$/.test(c)?+c:c):[],[i,s,l]=a,u=Gs.has(r)?r.toLowerCase():"custom";switch(u){case"fail":case"mismatch":case"skip":if(a.length>0)throw new Error(`Named callout arguments not allowed "${a}"`);break;case"error":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if(typeof i=="string")throw new Error(`Named callout argument must be a number "${i}"`);break;case"max":if(!a.length||a.length>2)throw new Error(`Named callout must have one or two arguments "${a}"`);if(typeof i=="string"&&!/^[A-Za-z_]\w*$/.test(i))throw new Error(`Named callout argument one must be a tag or number "${i}"`);if(a.length===2&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case"count":case"total_count":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof i=="number"||!/^[<>X]$/.test(i)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${i}"`);break;case"cmp":if(a.length!==3)throw new Error(`Named callout must have three arguments "${a}"`);if(typeof i=="string"&&!/^[A-Za-z_]\w*$/.test(i))throw new Error(`Named callout argument one must be a tag or number "${i}"`);if(typeof s=="number"||!/^(?:[<>!=]=|[<>])$/.test(s))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${r}"`);default:throw new Error(`Unexpected named callout kind "${u}"`)}return Ms(u,n??null,o?.split(",")??null,e)}function Ur(e){let t=null,r,n;if(e[0]==="{"){let{minStr:o,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,i=1e5;if(+o>i||a&&+a>i)throw new Error("Quantifier value unsupported in Oniguruma");if(r=+o,n=a===void 0?+o:a===""?1/0:+a,r>n&&(t="possessive",[r,n]=[n,r]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else r=e[0]==="+"?1:0,n=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Os(t,r,n,e)}function Ws(e){let t=e[1].toLowerCase();return se({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function zs(e){let{p:t,neg:r,value:n}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return se("property",e,{value:n,negate:t==="P"&&!r||t==="p"&&!!r})}function Hr(e){let t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function qs(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let r=0;r<e.length;r++){let n=e[r];if(!"imxDPSWy".includes(n))throw new Error(`Invalid flag "${n}"`);if(n==="y"){if(!/^y{[gw]}/.test(e.slice(r)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[r+2]==="g"?"grapheme":"word",r+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[n]]=!0}return t}function Vs(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);let t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Xs(e,t){let{raw:r,inCharClass:n}=e,o=r.slice(1);if(!n&&(o!=="0"&&o.length===1||o[0]!=="0"&&+o<=t))return[io(r)];let a=[],i=o.match(/^[0-7]+|\d/g);for(let s=0;s<i.length;s++){let l=i[s],u;if(s===0&&l!=="8"&&l!=="9"){if(u=parseInt(l,8),u>127)throw new Error(R`Octal encoded byte above 177 unsupported "${r}"`)}else u=we(l);a.push(ee(u,(s===0?"\\":"")+l))}return a}function Qs(e){let t=[],r=new RegExp(lr,"gy"),n;for(;n=r.exec(e);){let o=n[0];if(o[0]==="{"){let a=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(o);if(a){let{min:i,max:s}=a.groups;if(+i>+s&&o.endsWith("?")){r.lastIndex--,t.push(Ur(o.slice(0,-1)));continue}}}t.push(Ur(o))}return t}function lo(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;let r=e.body[0];return!t||Object.keys(t).every(n=>t[n]===r[n])}function Ys(e){return Ks.has(e.type)}var Ks=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function uo(e,t={}){let r={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},n=Is(e,{flags:r.flags,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline}}),o=(g,h)=>{let p=n.tokens[a.nextIndex];switch(a.parent=g,a.nextIndex++,p.type){case"Alternator":return ce();case"Assertion":return Zs(p);case"Backreference":return Js(p,a);case"Character":return ut(p.value,{useLastValid:!!h.isCheckingRangeEnd});case"CharacterClassHyphen":return el(p,a,h);case"CharacterClassOpen":return tl(p,a,h);case"CharacterSet":return rl(p,a);case"Directive":return ll(p.kind,{flags:p.flags});case"GroupOpen":return nl(p,a,h);case"NamedCallout":return cl(p.kind,p.tag,p.arguments);case"Quantifier":return ol(p,a);case"Subroutine":return al(p,a);default:throw new Error(`Unexpected token type "${p.type}"`)}},a={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:o},i=hl(ul(n.flags)),s=i.body[0];for(;a.nextIndex<n.tokens.length;){let g=o(s,{});g.type==="Alternative"?(i.body.push(g),s=g):s.body.push(g)}let{capturingGroups:l,hasNumberedRef:u,namedGroupsByName:c,subroutines:d}=a;if(u&&c.size&&!r.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(let{ref:g}of d)if(typeof g=="number"){if(g>l.length)throw new Error("Subroutine uses a group number that's not defined");g&&(l[g-1].isSubroutined=!0)}else if(c.has(g)){if(c.get(g).length>1)throw new Error(R`Subroutine uses a duplicate group name "\g<${g}>"`);c.get(g)[0].isSubroutined=!0}else throw new Error(R`Subroutine uses a group name that's not defined "\g<${g}>"`);return i}function Zs({kind:e}){return Vt(ve({"^":"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"}[e],`Unexpected assertion kind "${e}"`),{negate:e===R`\B`||e===R`\Y`})}function Js({raw:e},t){let r=/^\\k[<']/.test(e),n=r?e.slice(3,-1):e.slice(1),o=(a,i=!1)=>{let s=t.capturingGroups.length,l=!1;if(a>s)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Xt(i?s+1-a:a,{orphan:l})};if(r){let a=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(a)return o(+a.groups.num,!!a.groups.sign);if(/[-+]/.test(n))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(n))throw new Error(`Group name not defined to the left "${e}"`);return Xt(n)}return o(+n)}function el(e,t,r){let{tokens:n,walk:o}=t,a=t.parent,i=a.body.at(-1),s=n[t.nextIndex];if(!r.isCheckingRangeEnd&&i&&i.type!=="CharacterClass"&&i.type!=="CharacterClassRange"&&s&&s.type!=="CharacterClassOpen"&&s.type!=="CharacterClassClose"&&s.type!=="CharacterClassIntersector"){let l=o(a,{...r,isCheckingRangeEnd:!0});if(i.type==="Character"&&l.type==="Character")return a.body.pop(),sl(i,l);throw new Error("Invalid character class range")}return ut(we("-"))}function tl({negate:e},t,r){let{tokens:n,walk:o}=t,a=[qe()],i=n[t.nextIndex],s=qr(i);for(;s.type!=="CharacterClassClose";){if(s.type==="CharacterClassIntersector")a.push(qe()),t.nextIndex++;else{let u=a.at(-1);u.body.push(o(u,r))}s=qr(n[t.nextIndex],i)}let l=qe({negate:e});return a.length===1?l.body=a[0].body:(l.kind="intersection",l.body=a.map(u=>u.body.length===1?u.body[0]:u)),t.nextIndex++,l}function rl({kind:e,negate:t,value:r},n){let{normalizeUnknownPropertyNames:o,skipPropertyNameValidation:a,unicodePropertyMap:i}=n;if(e==="property"){let s=ct(r);if(sr.has(s)&&!i?.has(s))e="posix",r=s;else return me(r,{negate:t,normalizeUnknownPropertyNames:o,skipPropertyNameValidation:a,unicodePropertyMap:i})}return e==="posix"?dl(r,{negate:t}):Qt(e,{negate:t})}function nl(e,t,r){let{tokens:n,capturingGroups:o,namedGroupsByName:a,skipLookbehindValidation:i,walk:s}=t,l=gl(e),u=l.type==="AbsenceFunction",c=zr(l),d=c&&l.negate;if(l.type==="CapturingGroup"&&(o.push(l),l.name&&As(a,l.name,[]).push(l)),u&&r.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let g=Vr(n[t.nextIndex]);for(;g.type!=="GroupClose";){if(g.type==="Alternator")l.body.push(ce()),t.nextIndex++;else{let h=l.body.at(-1),p=s(h,{...r,isInAbsenceFunction:r.isInAbsenceFunction||u,isInLookbehind:r.isInLookbehind||c,isInNegLookbehind:r.isInNegLookbehind||d});if(h.body.push(p),(c||r.isInLookbehind)&&!i){let b="Lookbehind includes a pattern not allowed by Oniguruma";if(d||r.isInNegLookbehind){if(Wr(p)||p.type==="CapturingGroup")throw new Error(b)}else if(Wr(p)||zr(p)&&p.negate)throw new Error(b)}}g=Vr(n[t.nextIndex])}return t.nextIndex++,l}function ol({kind:e,min:t,max:r},n){let o=n.parent,a=o.body.at(-1);if(!a||!Ys(a))throw new Error("Quantifier requires a repeatable token");let i=ho(e,t,r,a);return o.body.pop(),i}function al({raw:e},t){let{capturingGroups:r,subroutines:n}=t,o=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(o);if(a){let s=+a.groups.num,l=r.length;if(t.hasNumberedRef=!0,o={"":s,"+":l+s,"-":l+1-s}[a.groups.sign],o<1)throw new Error("Invalid subroutine number")}else o==="0"&&(o=0);let i=go(o);return n.push(i),i}function il(e,t){if(e!=="repeater")throw new Error(`Unexpected absence function kind "${e}"`);return{type:"AbsenceFunction",kind:e,body:Me(t?.body)}}function ce(e){return{type:"Alternative",body:po(e?.body)}}function Vt(e,t){let r={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(r.negate=!!t?.negate),r}function Xt(e,t){let r=!!t?.orphan;return{type:"Backreference",ref:e,...r&&{orphan:r}}}function co(e,t){let r={name:void 0,isSubroutined:!1,...t};if(r.name!==void 0&&!pl(r.name))throw new Error(`Group name "${r.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...r.name&&{name:r.name},...r.isSubroutined&&{isSubroutined:r.isSubroutined},body:Me(t?.body)}}function ut(e,t){let r={useLastValid:!1,...t};if(e>1114111){let n=e.toString(16);if(r.useLastValid)e=1114111;else throw e>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:e}}function qe(e){let t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:po(e?.body)}}function sl(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Qt(e,t){let r=!!t?.negate,n={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(n.negate=r),(e==="text_segment"||e==="newline"&&!r)&&(n.variableLength=!0),n}function ll(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:ve(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function ul(e){return{type:"Flags",...e}}function V(e){let t=e?.atomic,r=e?.flags;if(t&&r)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...r&&{flags:r},body:Me(e?.body)}}function ae(e){let t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:Me(e?.body)}}function cl(e,t,r){return{type:"NamedCallout",kind:e,tag:t,arguments:r}}function dl(e,t){let r=!!t?.negate;if(!sr.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:r}}function ho(e,t,r,n){if(t>r)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:r,body:n}}function hl(e,t){return{type:"Regex",body:Me(t?.body),flags:e}}function go(e){return{type:"Subroutine",ref:e}}function me(e,t){let r={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},n=r.unicodePropertyMap?.get(ct(e));if(!n){if(r.normalizeUnknownPropertyNames)n=fl(e);else if(r.unicodePropertyMap&&!r.skipPropertyNameValidation)throw new Error(R`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:n??e,negate:r.negate}}function gl({flags:e,kind:t,name:r,negate:n,number:o}){switch(t){case"absence_repeater":return il("repeater");case"atomic":return V({atomic:!0});case"capturing":return co(o,{name:r});case"group":return V({flags:e});case"lookahead":case"lookbehind":return ae({behind:t==="lookbehind",negate:n});default:throw new Error(`Unexpected group kind "${t}"`)}}function Me(e){if(e===void 0)e=[ce()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function po(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function Wr(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function zr(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function pl(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function fl(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function ct(e){return e.replace(/[- _]+/g,"").toLowerCase()}function qr(e,t){let r=t;return ve(e,`Unclosed character class${r?.type==="Character"&&r.value===93&&r.raw==="]"?' (started with "]")':""}`)}function Vr(e){return ve(e,"Unclosed group")}function Ae(e,t,r=null){function n(a,i){for(let s=0;s<a.length;s++){let l=o(a[s],i,s,a);s=Math.max(-1,s+l)}}function o(a,i=null,s=null,l=null){let u=0,c=!1,d={node:a,parent:i,key:s,container:l,root:e,remove(){Ue(l).splice(Math.max(0,ge(s)+u),1),u--,c=!0},removeAllNextSiblings(){return Ue(l).splice(ge(s)+1)},removeAllPrevSiblings(){let m=ge(s)+u;return u-=m,Ue(l).splice(0,Math.max(0,m))},replaceWith(m,f={}){let w=!!f.traverse;l?l[Math.max(0,ge(s)+u)]=m:ve(i,"Can't replace root node")[s]=m,w&&o(m,i,s,l),c=!0},replaceWithMultiple(m,f={}){let w=!!f.traverse;if(Ue(l).splice(Math.max(0,ge(s)+u),1,...m),u+=m.length-1,w){let v=0;for(let x=0;x<m.length;x++)v+=o(m[x],i,ge(s)+x+v,l)}c=!0},skip(){c=!0}},{type:g}=a,h=t["*"],p=t[g],b=typeof h=="function"?h:h?.enter,y=typeof p=="function"?p:p?.enter;if(b?.(d,r),y?.(d,r),!c)switch(g){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":n(a.body,a);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":o(a.min,a,"min"),o(a.max,a,"max");break;case"Quantifier":o(a.body,a,"body");break;case"Regex":n(a.body,a),o(a.flags,a,"flags");break;default:throw new Error(`Unexpected node type "${g}"`)}return p?.exit?.(d,r),h?.exit?.(d,r),u}return o(e),e}function Ue(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function ge(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}var ml=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function bl(e,t){for(let r=0;r<e.length;r++)e[r]>=t&&e[r]++}function yl(e,t,r,n){return e.slice(0,t)+n+e.slice(t+r.length)}var q=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function ur(e,t,r,n){let o=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),a=[!1],i=0,s="";for(let l of e.matchAll(o)){let{0:u,groups:{$skip:c}}=l;if(!c&&(!n||n===q.DEFAULT==!i)){r instanceof Function?s+=r(l,{context:i?q.CHAR_CLASS:q.DEFAULT,negated:a[a.length-1]}):s+=r;continue}u[0]==="["?(i++,a.push(u[1]==="^")):u==="]"&&i&&(i--,a.pop()),s+=u}return s}function fo(e,t,r,n){ur(e,t,r,n)}function kl(e,t,r=0,n){if(!new RegExp(t,"su").test(e))return null;let o=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");o.lastIndex=r;let a=0,i;for(;i=o.exec(e);){let{0:s,groups:{$skip:l}}=i;if(!l&&(!n||n===q.DEFAULT==!a))return i;s==="["?a++:s==="]"&&a&&a--,o.lastIndex==i.index&&o.lastIndex++}return null}function He(e,t,r){return!!kl(e,t,0,r)}function wl(e,t){let r=/\\?./gsu;r.lastIndex=t;let n=e.length,o=0,a=1,i;for(;i=r.exec(e);){let[s]=i;if(s==="[")o++;else if(o)s==="]"&&o--;else if(s==="(")a++;else if(s===")"&&(a--,!a)){n=i.index;break}}return e.slice(t,n)}var Xr=new RegExp(String.raw`(?<noncapturingStart>${ml})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function vl(e,t){let r=t?.hiddenCaptures??[],n=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:n,hiddenCaptures:r};let o="(?>",a="(?:(?=(",i=[0],s=[],l=0,u=0,c=NaN,d;do{d=!1;let g=0,h=0,p=!1,b;for(Xr.lastIndex=Number.isNaN(c)?0:c+a.length;b=Xr.exec(e);){let{0:y,index:m,groups:{capturingStart:f,noncapturingStart:w}}=b;if(y==="[")g++;else if(g)y==="]"&&g--;else if(y===o&&!p)c=m,p=!0;else if(p&&w)h++;else if(f)p?h++:(l++,i.push(l+u));else if(y===")"&&p){if(!h){u++;let v=l+u;if(e=`${e.slice(0,c)}${a}${e.slice(c+o.length,m)}))<$$${v}>)${e.slice(m+1)}`,d=!0,s.push(v),bl(r,v),n.size){let x=new Map;n.forEach((_,B)=>{x.set(B>=v?B+1:B,_.map(A=>A>=v?A+1:A))}),n=x}break}h--}}}while(d);return r.push(...s),e=ur(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:g,groups:{backrefNum:h,wrappedBackrefNum:p}})=>{if(h){let b=+h;if(b>i.length-1)throw new Error(`Backref "${g}" greater than number of captures`);return`\\${i[b]}`}return`\\${p}`},q.DEFAULT),{pattern:e,captureTransfers:n,hiddenCaptures:r}}var mo=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,At=new RegExp(String.raw`
|
|
45
|
+
\\(?: \d+
|
|
46
|
+
| c[A-Za-z]
|
|
47
|
+
| [gk]<[^>]+>
|
|
48
|
+
| [pPu]\{[^\}]+\}
|
|
49
|
+
| u[A-Fa-f\d]{4}
|
|
50
|
+
| x[A-Fa-f\d]{2}
|
|
51
|
+
)
|
|
52
|
+
| \((?: \? (?: [:=!>]
|
|
53
|
+
| <(?:[=!]|[^>]+>)
|
|
54
|
+
| [A-Za-z\-]+:
|
|
55
|
+
| \(DEFINE\)
|
|
56
|
+
))?
|
|
57
|
+
| (?<qBase>${mo})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
58
|
+
| \\?.
|
|
59
|
+
`.replace(/\s+/g,""),"gsu");function Cl(e){if(!new RegExp(`${mo}\\+`).test(e))return{pattern:e};let t=[],r=null,n=null,o="",a=0,i;for(At.lastIndex=0;i=At.exec(e);){let{0:s,index:l,groups:{qBase:u,qMod:c,invalidQ:d}}=i;if(s==="[")a||(n=l),a++;else if(s==="]")a?a--:n=null;else if(!a)if(c==="+"&&o&&!o.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${s}"`);let g=-1;if(/^\{\d+\}$/.test(u))e=yl(e,l+u.length,c,"");else{if(o===")"||o==="]"){let h=o===")"?r:n;if(h===null)throw new Error(`Invalid unmatched "${o}"`);e=`${e.slice(0,h)}(?>${e.slice(h,l)}${u})${e.slice(l+s.length)}`}else e=`${e.slice(0,l-o.length)}(?>${o}${u})${e.slice(l+s.length)}`;g+=4}At.lastIndex+=g}else s[0]==="("?t.push(l):s===")"&&(r=t.length?t.pop():null);o=s}return{pattern:e}}var z=String.raw,xl=z`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Yt=z`\(\?R=(?<rDepth>[^\)]+)\)|${xl}`,dt=z`\(\?<(?![=!])(?<captureName>[^>]+)>`,bo=z`${dt}|(?<unnamed>\()(?!\?)`,ne=new RegExp(z`${dt}|${Yt}|\(\?|\\?.`,"gsu"),It="Cannot use multiple overlapping recursions";function Sl(e,t){let{hiddenCaptures:r,mode:n}={hiddenCaptures:[],mode:"plugin",...t},o=t?.captureTransfers??new Map;if(!new RegExp(Yt,"su").test(e))return{pattern:e,captureTransfers:o,hiddenCaptures:r};if(n==="plugin"&&He(e,z`\(\?\(DEFINE\)`,q.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");let a=[],i=He(e,z`\\[1-9]`,q.DEFAULT),s=new Map,l=[],u=!1,c=0,d=0,g;for(ne.lastIndex=0;g=ne.exec(e);){let{0:h,groups:{captureName:p,rDepth:b,gRNameOrNum:y,gRDepth:m}}=g;if(h==="[")c++;else if(c)h==="]"&&c--;else if(b){if(Qr(b),u)throw new Error(It);if(i)throw new Error(`${n==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);let f=e.slice(0,g.index),w=e.slice(ne.lastIndex);if(He(w,Yt,q.DEFAULT))throw new Error(It);let v=+b-1;e=Yr(f,w,v,!1,r,a,d),o=Zr(o,f,v,a.length,0,d);break}else if(y){Qr(m);let f=!1;for(let $ of l)if($.name===y||$.num===+y){if(f=!0,$.hasRecursedWithin)throw new Error(It);break}if(!f)throw new Error(z`Recursive \g cannot be used outside the referenced group "${n==="external"?y:z`\g<${y}&R=${m}>`}"`);let w=s.get(y),v=wl(e,w);if(i&&He(v,z`${dt}|\((?!\?)`,q.DEFAULT))throw new Error(`${n==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);let x=e.slice(w,g.index),_=v.slice(x.length+h.length),B=a.length,A=+m-1,U=Yr(x,_,A,!0,r,a,d);o=Zr(o,x,A,a.length-B,B,d);let G=e.slice(0,w),H=e.slice(w+v.length);e=`${G}${U}${H}`,ne.lastIndex+=U.length-h.length-x.length-_.length,l.forEach($=>$.hasRecursedWithin=!0),u=!0}else if(p)d++,s.set(String(d),ne.lastIndex),s.set(p,ne.lastIndex),l.push({num:d,name:p});else if(h[0]==="("){let f=h==="(";f&&(d++,s.set(String(d),ne.lastIndex)),l.push(f?{num:d}:{})}else h===")"&&l.pop()}return r.push(...a),{pattern:e,captureTransfers:o,hiddenCaptures:r}}function Qr(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function Yr(e,t,r,n,o,a,i){let s=new Set;n&&fo(e+t,dt,({groups:{captureName:u}})=>{s.add(u)},q.DEFAULT);let l=[r,n?s:null,o,a,i];return`${e}${Kr(`(?:${e}`,"forward",...l)}(?:)${Kr(`${t})`,"backward",...l)}${t}`}function Kr(e,t,r,n,o,a,i){let s=u=>t==="forward"?u+2:r-u+2-1,l="";for(let u=0;u<r;u++){let c=s(u);l+=ur(e,z`${bo}|\\k<(?<backref>[^>]+)>`,({0:d,groups:{captureName:g,unnamed:h,backref:p}})=>{if(p&&n&&!n.has(p))return d;let b=`_$${c}`;if(h||g){let y=i+a.length+1;return a.push(y),_l(o,y),h?d:`(?<${g}${b}>`}return z`\k<${p}${b}>`},q.DEFAULT)}return l}function _l(e,t){for(let r=0;r<e.length;r++)e[r]>=t&&e[r]++}function Zr(e,t,r,n,o,a){if(e.size&&n){let i=0;fo(t,bo,()=>i++,q.DEFAULT);let s=a-i+o,l=new Map;return e.forEach((u,c)=>{let d=(n-i*r)/r,g=i*r,h=c>s+i?c+n:c,p=[];for(let b of u)if(b<=s)p.push(b);else if(b>s+i+d)p.push(b+n);else if(b<=s+i)for(let y=0;y<=r;y++)p.push(b+i*y);else for(let y=0;y<=r;y++)p.push(b+g+d*y);l.set(h,p)}),l}return e}var P=String.fromCodePoint,S=String.raw,Q={},ht=globalThis.RegExp;Q.flagGroups=(()=>{try{new ht("(?i:)")}catch{return!1}return!0})();Q.unicodeSets=(()=>{try{new ht("[[]]","v")}catch{return!1}return!0})();Q.bugFlagVLiteralHyphenIsRange=Q.unicodeSets?(()=>{try{new ht(S`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Q.bugNestedClassIgnoresNegation=Q.unicodeSets&&new ht("[[^a]]","v").test("a");function nt(e,{enable:t,disable:r}){return{dotAll:!r?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!r?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Pe(e,t,r){return e.has(t)||e.set(t,r),e.get(t)}function Kt(e,t){return Jr[e]>=Jr[t]}function Al(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Jr={ES2025:2025,ES2024:2024,ES2018:2018},Il={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function yo(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!Il[e.target])throw new Error(`Unexpected target "${e.target}"`);let t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=Q.flagGroups?"ES2025":Q.unicodeSets?"ES2024":"ES2018"),t}var El="[ -\r ]",Bl=new Set([P(304),P(305)]),Z=S`[\p{L}\p{M}\p{N}\p{Pc}]`;function ko(e){if(Bl.has(e))return[e];let t=new Set,r=e.toLowerCase(),n=r.toUpperCase(),o=Fl.get(r),a=Nl.get(r),i=$l.get(r);return[...n].length===1&&t.add(n),i&&t.add(i),o&&t.add(o),t.add(r),a&&t.add(a),[...t]}var cr=new Map(`C Other
|
|
60
|
+
Cc Control cntrl
|
|
61
|
+
Cf Format
|
|
62
|
+
Cn Unassigned
|
|
63
|
+
Co Private_Use
|
|
64
|
+
Cs Surrogate
|
|
65
|
+
L Letter
|
|
66
|
+
LC Cased_Letter
|
|
67
|
+
Ll Lowercase_Letter
|
|
68
|
+
Lm Modifier_Letter
|
|
69
|
+
Lo Other_Letter
|
|
70
|
+
Lt Titlecase_Letter
|
|
71
|
+
Lu Uppercase_Letter
|
|
72
|
+
M Mark Combining_Mark
|
|
73
|
+
Mc Spacing_Mark
|
|
74
|
+
Me Enclosing_Mark
|
|
75
|
+
Mn Nonspacing_Mark
|
|
76
|
+
N Number
|
|
77
|
+
Nd Decimal_Number digit
|
|
78
|
+
Nl Letter_Number
|
|
79
|
+
No Other_Number
|
|
80
|
+
P Punctuation punct
|
|
81
|
+
Pc Connector_Punctuation
|
|
82
|
+
Pd Dash_Punctuation
|
|
83
|
+
Pe Close_Punctuation
|
|
84
|
+
Pf Final_Punctuation
|
|
85
|
+
Pi Initial_Punctuation
|
|
86
|
+
Po Other_Punctuation
|
|
87
|
+
Ps Open_Punctuation
|
|
88
|
+
S Symbol
|
|
89
|
+
Sc Currency_Symbol
|
|
90
|
+
Sk Modifier_Symbol
|
|
91
|
+
Sm Math_Symbol
|
|
92
|
+
So Other_Symbol
|
|
93
|
+
Z Separator
|
|
94
|
+
Zl Line_Separator
|
|
95
|
+
Zp Paragraph_Separator
|
|
96
|
+
Zs Space_Separator
|
|
97
|
+
ASCII
|
|
98
|
+
ASCII_Hex_Digit AHex
|
|
99
|
+
Alphabetic Alpha
|
|
100
|
+
Any
|
|
101
|
+
Assigned
|
|
102
|
+
Bidi_Control Bidi_C
|
|
103
|
+
Bidi_Mirrored Bidi_M
|
|
104
|
+
Case_Ignorable CI
|
|
105
|
+
Cased
|
|
106
|
+
Changes_When_Casefolded CWCF
|
|
107
|
+
Changes_When_Casemapped CWCM
|
|
108
|
+
Changes_When_Lowercased CWL
|
|
109
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
110
|
+
Changes_When_Titlecased CWT
|
|
111
|
+
Changes_When_Uppercased CWU
|
|
112
|
+
Dash
|
|
113
|
+
Default_Ignorable_Code_Point DI
|
|
114
|
+
Deprecated Dep
|
|
115
|
+
Diacritic Dia
|
|
116
|
+
Emoji
|
|
117
|
+
Emoji_Component EComp
|
|
118
|
+
Emoji_Modifier EMod
|
|
119
|
+
Emoji_Modifier_Base EBase
|
|
120
|
+
Emoji_Presentation EPres
|
|
121
|
+
Extended_Pictographic ExtPict
|
|
122
|
+
Extender Ext
|
|
123
|
+
Grapheme_Base Gr_Base
|
|
124
|
+
Grapheme_Extend Gr_Ext
|
|
125
|
+
Hex_Digit Hex
|
|
126
|
+
IDS_Binary_Operator IDSB
|
|
127
|
+
IDS_Trinary_Operator IDST
|
|
128
|
+
ID_Continue IDC
|
|
129
|
+
ID_Start IDS
|
|
130
|
+
Ideographic Ideo
|
|
131
|
+
Join_Control Join_C
|
|
132
|
+
Logical_Order_Exception LOE
|
|
133
|
+
Lowercase Lower
|
|
134
|
+
Math
|
|
135
|
+
Noncharacter_Code_Point NChar
|
|
136
|
+
Pattern_Syntax Pat_Syn
|
|
137
|
+
Pattern_White_Space Pat_WS
|
|
138
|
+
Quotation_Mark QMark
|
|
139
|
+
Radical
|
|
140
|
+
Regional_Indicator RI
|
|
141
|
+
Sentence_Terminal STerm
|
|
142
|
+
Soft_Dotted SD
|
|
143
|
+
Terminal_Punctuation Term
|
|
144
|
+
Unified_Ideograph UIdeo
|
|
145
|
+
Uppercase Upper
|
|
146
|
+
Variation_Selector VS
|
|
147
|
+
White_Space space
|
|
148
|
+
XID_Continue XIDC
|
|
149
|
+
XID_Start XIDS`.split(/\s/).map(e=>[ct(e),e])),Nl=new Map([["s",P(383)],[P(383),"s"]]),$l=new Map([[P(223),P(7838)],[P(107),P(8490)],[P(229),P(8491)],[P(969),P(8486)]]),Fl=new Map([te(453),te(456),te(459),te(498),...Et(8072,8079),...Et(8088,8095),...Et(8104,8111),te(8124),te(8140),te(8188)]),Pl=new Map([["alnum",S`[\p{Alpha}\p{Nd}]`],["alpha",S`\p{Alpha}`],["ascii",S`\p{ASCII}`],["blank",S`[\p{Zs}\t]`],["cntrl",S`\p{Cc}`],["digit",S`\p{Nd}`],["graph",S`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",S`\p{Lower}`],["print",S`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",S`[\p{P}\p{S}]`],["space",S`\p{space}`],["upper",S`\p{Upper}`],["word",S`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",S`\p{AHex}`]]);function Ll(e,t){let r=[];for(let n=e;n<=t;n++)r.push(n);return r}function te(e){let t=P(e);return[t.toLowerCase(),t]}function Et(e,t){return Ll(e,t).map(r=>te(r))}var wo=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Rl(e,t){let r={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};vo(e);let n={accuracy:r.accuracy,asciiWordBoundaries:r.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Kt(r.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Ae(e,Tl,n);let o={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:o,prevFlags:null,globalFlags:o,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:n.subroutineRefMap};Ae(e,Ml,a);let i={groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer};return Ae(e,Ol,i),e._originMap=a.groupOriginByCopy,e._strategy=n.strategy,e}var Tl={AbsenceFunction({node:e,parent:t,replaceWith:r}){let{body:n,kind:o}=e;if(o==="repeater"){let a=V();a.body[0].body.push(ae({negate:!0,body:n}),me("Any"));let i=V();i.body[0].body.push(ho("greedy",0,1/0,a)),r(N(i,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:r},{flagDirectivesByAlt:n}){let o=e.body.filter(a=>a.kind==="flags");for(let a=r+1;a<t.body.length;a++){let i=t.body[a];Pe(n,i,[]).push(...o)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let r=xo(t.get(e));if(r){let n=V({flags:r});n.body[0].body=e.body,e.body=[N(n,e)]}}}},Assertion({node:e,parent:t,key:r,container:n,root:o,remove:a,replaceWith:i},s){let{kind:l,negate:u}=e,{asciiWordBoundaries:c,avoidSubclass:d,supportedGNodes:g,wordIsAscii:h}=s;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${u?"Y":"y"}"`);if(l==="line_end")i(N(ae({body:[ce({body:[Vt("string_end")]}),ce({body:[ut(10)]})]}),t));else if(l==="line_start")i(N(J(S`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(g.has(e))o.flags.sticky=!0,a();else{let p=n[r-1];if(p&&Wl(p))i(N(ae({negate:!0}),t));else{if(d)throw new Error(S`Uses "\G" in a way that requires a subclass`);i(re(Vt("string_start"),t)),s.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")i(N(J(S`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!h&&!c){let p=`(?:(?<=${Z})(?!${Z})|(?<!${Z})(?=${Z}))`,b=`(?:(?<=${Z})(?=${Z})|(?<!${Z})(?!${Z}))`;i(N(J(u?b:p),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!Nt(r)&&(r=Bt(r,t),e.ref=r)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:r}){let{name:n}=e;n&&!Nt(n)&&(n=Bt(n,t),e.name=n),r.set(e.number,e),n&&r.set(n,e)},CharacterClassRange({node:e,parent:t,replaceWith:r}){if(t.kind==="intersection"){let n=qe({body:[e]});r(N(n,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:r},{accuracy:n,minTargetEs2024:o,digitIsAscii:a,spaceIsAscii:i,wordIsAscii:s}){let{kind:l,negate:u,value:c}=e;if(a&&(l==="digit"||c==="digit")){r(re(Qt("digit",{negate:u}),t));return}if(i&&(l==="space"||c==="space")){r(N($t(J(El),u),t));return}if(s&&(l==="word"||c==="word")){r(re(Qt("word",{negate:u}),t));return}if(l==="any")r(re(me("Any"),t));else if(l==="digit")r(re(me("Nd",{negate:u}),t));else if(l!=="dot")if(l==="text_segment"){if(n==="strict")throw new Error(S`Use of "\X" requires non-strict accuracy`);let d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",g=S`\p{RI}{2}|${d}(?:\u200D${d})*`;r(N(J(S`(?>\r\n|${o?S`\p{RGI_Emoji}`:g}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")r(re(me("AHex",{negate:u}),t));else if(l==="newline")r(N(J(u?`[^
|
|
150
|
+
]`:`(?>\r
|
|
151
|
+
?|[
|
|
152
|
+
\v\f\x85\u2028\u2029])`),t));else if(l==="posix")if(!o&&(c==="graph"||c==="print")){if(n==="strict")throw new Error(`POSIX class "${c}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[c];u&&(d=`\0-${P(d.codePointAt(0)-1)}${P(d.codePointAt(2)+1)}-\u{10FFFF}`),r(N(J(`[${d}]`),t))}else r(N($t(J(Pl.get(c)),u),t));else if(l==="property")cr.has(ct(c))||(e.key="sc");else if(l==="space")r(re(me("space",{negate:u}),t));else if(l==="word")r(N($t(J(Z),u),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:r,remove:n,replaceWith:o,removeAllPrevSiblings:a,removeAllNextSiblings:i}){let{kind:s,flags:l}=e;if(s==="flags")if(!l.enable&&!l.disable)n();else{let u=V({flags:l});u.body[0].body=i(),o(N(u,t),{traverse:!0})}else if(s==="keep"){let u=r.body[0],c=r.body.length===1&&lo(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:r;if(t.parent!==c||c.body.length>1)throw new Error(S`Uses "\K" in a way that's unsupported`);let d=ae({behind:!0});d.body[0].body=a(),o(N(d,t))}else throw new Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete e[r]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:r}=e.flags;t?.extended&&delete t.extended,r?.extended&&delete r.extended,t?.dotAll&&r?.dotAll&&delete t.dotAll,t?.ignoreCase&&r?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,r&&!Object.keys(r).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:r}=e;r==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:r}){let{kind:n}=e;if(n==="fail")r(N(ae({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){let t=V();t.body[0].body.push(e.body),e.body=N(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let r=[],n=!1,o=!1;for(let a of e.body)if(a.body.length===1&&a.body[0].kind==="search_start")a.body.pop();else{let i=_o(a.body);i?(n=!0,Array.isArray(i)?r.push(...i):r.push(i)):o=!0}n&&!o&&r.forEach(a=>t.add(a))},exit(e,{accuracy:t,passedLookbehind:r,strategy:n}){if(t==="strict"&&r&&n)throw new Error(S`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!Nt(r)&&(r=Bt(r,t),e.ref=r)}},Ml={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:r}){let{orphan:n,ref:o}=e;n||r.set(e,[...t.get(o).map(({node:a})=>a)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:r,skip:n},{groupOriginByCopy:o,groupsByName:a,multiplexCapturesToLeftByRef:i,openRefs:s,reffedNodesByReferencer:l}){let u=o.get(e);if(u&&s.has(e.number)){let d=re(en(e.number),t);l.set(d,s.get(e.number)),r(d);return}s.set(e.number,e),i.set(e.number,[]),e.name&&Pe(i,e.name,[]);let c=i.get(e.name??e.number);for(let d=0;d<c.length;d++){let g=c[d];if(u===g.node||u&&u===g.origin||e===g.origin){c.splice(d,1);break}}if(i.get(e.number).push({node:e,origin:u}),e.name&&i.get(e.name).push({node:e,origin:u}),e.name){let d=Pe(a,e.name,new Map),g=!1;if(u)g=!0;else for(let h of d.values())if(!h.hasDuplicateNameToRemove){g=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:g})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=nt(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:r},n){let{isRecursive:o,ref:a}=e;if(o){let c=t;for(;(c=c.parent)&&!(c.type==="CapturingGroup"&&(c.name===a||c.number===a)););n.reffedNodesByReferencer.set(e,c);return}let i=n.subroutineRefMap.get(a),s=a===0,l=s?en(0):Co(i,n.groupOriginByCopy,null),u=l;if(!s){let c=xo(jl(i,g=>g.type==="Group"&&!!g.flags)),d=c?nt(n.globalFlags,c):n.globalFlags;Dl(d,n.currentFlags)||(u=V({flags:Ul(d)}),u.body[0].body.push(l))}r(N(u,t),{traverse:!s})}},Ol={Backreference({node:e,parent:t,replaceWith:r},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}let o=n.reffedNodesByReferencer.get(e).filter(a=>Gl(a,e));if(!o.length)r(N(ae({negate:!0}),t));else if(o.length>1){let a=V({atomic:!0,body:o.reverse().map(i=>ce({body:[Xt(i.number)]}))});r(N(a,t))}else e.ref=o[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let r=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let n=0;n<r;n++){let o=co();e.body.at(-1).body.push(o)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function vo(e){Ae(e,{"*"({node:t,parent:r}){t.parent=r}})}function Dl(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Gl(e,t){let r=t;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===e)return!1;let n=So(r.parent);for(let o of n){if(o===r)break;if(o===e||Ao(o,e))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function Co(e,t,r,n){let o=Array.isArray(e)?[]:{};for(let[a,i]of Object.entries(e))a==="parent"?o.parent=Array.isArray(r)?n:r:i&&typeof i=="object"?o[a]=Co(i,t,o,r):(a==="type"&&i==="CapturingGroup"&&t.set(o,t.get(e)??e),o[a]=i);return o}function en(e){let t=go(e);return t.isRecursive=!0,t}function jl(e,t){let r=[];for(;e=e.parent;)(!t||t(e))&&r.push(e);return r}function Bt(e,t){if(t.has(e))return t.get(e);let r=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,r),r}function xo(e){let t=["dotAll","ignoreCase"],r={enable:{},disable:{}};return e.forEach(({flags:n})=>{t.forEach(o=>{n.enable?.[o]&&(delete r.disable[o],r.enable[o]=!0),n.disable?.[o]&&(r.disable[o]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function Ul({dotAll:e,ignoreCase:t}){let r={};return(e||t)&&(r.enable={},e&&(r.enable.dotAll=!0),t&&(r.enable.ignoreCase=!0)),(!e||!t)&&(r.disable={},!e&&(r.disable.dotAll=!0),!t&&(r.disable.ignoreCase=!0)),r}function So(e){if(!e)throw new Error("Node expected");let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function _o(e){let t=e.find(r=>r.kind==="search_start"||zl(r,{negate:!1})||!Hl(r));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){let r=[];for(let n of t.body){let o=_o(n.body);if(!o)return null;Array.isArray(o)?r.push(...o):r.push(o)}return r}return null}function Ao(e,t){let r=So(e)??[];for(let n of r)if(n===t||Ao(n,t))return!0;return!1}function Hl({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Wl(e){let t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function zl(e,t){let r={negate:null,...t};return e.type==="LookaroundAssertion"&&(r.negate===null||e.negate===r.negate)&&e.body.length===1&&lo(e.body[0],{type:"Assertion",kind:"search_start"})}function Nt(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function J(e,t){let r=uo(e,{...t,unicodePropertyMap:cr}).body;return r.length>1||r[0].body.length>1?V({body:r}):r[0].body[0]}function $t(e,t){return e.negate=t,e}function re(e,t){return e.parent=t,e}function N(e,t){return vo(e),e.parent=t,e}function ql(e,t){let r=yo(t),n=Kt(r.target,"ES2024"),o=Kt(r.target,"ES2025"),a=r.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw new Error("Invalid recursionLimit; use 2-20");let i=null,s=null;if(!o){let h=[e.flags.ignoreCase];Ae(e,Vl,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(p){h.push(p)},setHasCasedChar(){h.at(-1)?i=!0:s=!0}})}let l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||i)&&!s)},u=e,c={accuracy:r.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!o&&i&&s),useFlagMods:o,useFlagV:n,verbose:r.verbose};function d(h){return c.lastNode=u,u=h,Al(Xl[h.type],`Unexpected node type "${h.type}"`)(h,c,d)}let g={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return n||(delete g.options.force.v,g.options.disable.v=!0,g.options.unicodeSetsPlugin=null),g._captureTransfers=new Map,g._hiddenCaptures=[],c.captureMap.forEach((h,p)=>{h.hidden&&g._hiddenCaptures.push(p),h.transferTo&&Pe(g._captureTransfers,h.transferTo,[]).push(p)}),g}var Vl={"*":{enter({node:e},t){if(rn(e)){let r=t.getCurrentModI();t.pushModI(e.flags?nt({ignoreCase:r},e.flags).ignoreCase:r)}},exit({node:e},t){rn(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){dr(P(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},r){t(),Io(e,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&wo.has(e.value)&&t.setHasCasedChar()}},Xl={Alternative({body:e},t,r){return e.map(r).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?S`\B`:S`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,r){let{body:n,name:o,number:a}=e,i={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(i.hidden=!0,a>s.number&&(i.transferTo=s.number)),t.captureMap.set(a,i),`(${o?`?<${o}>`:""}${n.map(r).join("|")})`},Character({value:e},t){let r=P(e),n=pe(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(n!==r)return n;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&dr(r)){let o=ko(r);return t.inCharClass?o.join(""):o.length>1?`[${o.join("")}]`:o[0]}return r},CharacterClass(e,t,r){let{kind:n,negate:o,parent:a}=e,{body:i}=e;if(n==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Q.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&i.some(nn)&&(i=[ut(45),...i.filter(u=>!nn(u))]);let s=()=>`[${o?"^":""}${i.map(r).join(n==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Q.bugNestedClassIgnoresNegation)&&!o){let c=i.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(c.length){let d=V(),g=d.body[0];return d.parent=a,g.parent=d,i=i.filter(h=>!c.includes(h)),e.body=i,i.length?(e.parent=g,g.body.push(e)):d.body.pop(),c.forEach(h=>{let p=ce({body:[h]});h.parent=p,p.parent=d,d.body.push(p)}),r(d)}}t.inCharClass=!0;let u=s();return t.inCharClass=!1,u}let l=i[0];if(n==="union"&&!o&&l&&((!t.useFlagV||!t.verbose)&&a.kind==="union"&&!(Q.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind==="intersection"&&i.length===1&&l.type!=="CharacterClassRange"))return i.map(r).join("");if(!t.useFlagV&&a.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return s()},CharacterClassRange(e,t){let r=e.min.value,n=e.max.value,o={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=pe(r,o),i=pe(n,o),s=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){let l=Io(e);Jl(l).forEach(u=>{s.add(Array.isArray(u)?`${pe(u[0],o)}-${pe(u[1],o)}`:pe(u,o))})}return`${a}-${i}${[...s].join("")}`},CharacterSet({kind:e,negate:t,value:r,key:n},o){if(e==="dot")return o.currentFlags.dotAll?o.appliedGlobalFlags.dotAll||o.useFlagMods?".":"[^]":S`[^\n]`;if(e==="digit")return t?S`\D`:S`\d`;if(e==="property"){if(o.useAppliedIgnoreCase&&o.currentFlags.ignoreCase&&wo.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${t?S`\P`:S`\p`}{${n?`${n}=`:""}${r}}`}if(e==="word")return t?S`\W`:S`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:r,parent:n},o,a){let i=o.currentFlags;r&&(o.currentFlags=nt(i,r));let s=t.map(a).join("|"),l=!o.verbose&&t.length===1&&n.type!=="Quantifier"&&!e&&(!o.useFlagMods||!r)?s:`(?${eu(e,r,o.useFlagMods)}${s})`;return o.currentFlags=i,l},LookaroundAssertion({body:e,kind:t,negate:r},n,o){return`(?${`${t==="lookahead"?"":"<"}${r?"!":"="}`}${e.map(o).join("|")})`},Quantifier(e,t,r){return r(e.body)+tu(e)},Subroutine({isRecursive:e,ref:t},r){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");let n=r.recursionLimit;return t===0?`(?R=${n})`:S`\g<${t}&R=${n}>`}},Ql=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Yl=new Set(["-","\\","]","^","["]),Kl=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),tn=new Map([[9,S`\t`],[10,S`\n`],[11,S`\v`],[12,S`\f`],[13,S`\r`],[8232,S`\u2028`],[8233,S`\u2029`],[65279,S`\uFEFF`]]),Zl=new RegExp("^\\p{Cased}$","u");function dr(e){return Zl.test(e)}function Io(e,t){let r=!!t?.firstOnly,n=e.min.value,o=e.max.value,a=[];if(n<65&&(o===65535||o>=131071)||n===65536&&o>=131071)return a;for(let i=n;i<=o;i++){let s=P(i);if(!dr(s))continue;let l=ko(s).filter(u=>{let c=u.codePointAt(0);return c<n||c>o});if(l.length&&(a.push(...l),r))break}return a}function pe(e,{escDigit:t,inCharClass:r,useFlagV:n}){if(tn.has(e))return tn.get(e);if(e<32||e>126&&e<160||e>262143||t&&ru(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;let o=r?n?Kl:Yl:Ql,a=P(e);return(o.has(a)?"\\":"")+a}function Jl(e){let t=e.map(o=>o.codePointAt(0)).sort((o,a)=>o-a),r=[],n=null;for(let o=0;o<t.length;o++)t[o+1]===t[o]+1?n??=t[o]:n===null?r.push(t[o]):(r.push([n,t[o]]),n=null);return r}function eu(e,t,r){if(e)return">";let n="";if(t&&r){let{enable:o,disable:a}=t;n=(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")+(a?"-":"")+(a?.ignoreCase?"i":"")+(a?.dotAll?"s":"")}return`${n}:`}function tu({kind:e,max:t,min:r}){let n;return!r&&t===1?n="?":!r&&t===1/0?n="*":r===1&&t===1/0?n="+":r===t?n=`{${r}}`:n=`{${r},${t===1/0?"":t}}`,n+{greedy:"",lazy:"?",possessive:"+"}[e]}function rn({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function ru(e){return e>47&&e<58}function nn({type:e,value:t}){return e==="Character"&&t===45}var nu=class Zt extends RegExp{#t=new Map;#e=null;#n;#r=null;#o=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(t,r,n){let o=!!n?.lazyCompile;if(t instanceof RegExp){if(n)throw new Error("Cannot provide options when copying a regexp");let a=t;super(a,r),this.#n=a.source,a instanceof Zt&&(this.#t=a.#t,this.#r=a.#r,this.#o=a.#o,this.rawOptions=a.rawOptions)}else{let a={hiddenCaptures:[],strategy:null,transfers:[],...n};super(o?"":t,r),this.#n=t,this.#t=au(a.hiddenCaptures,a.transfers),this.#o=a.strategy,this.rawOptions=n??{}}o||(this.#e=this)}exec(t){if(!this.#e){let{lazyCompile:o,...a}=this.rawOptions;this.#e=new Zt(this.#n,this.flags,a)}let r=this.global||this.sticky,n=this.lastIndex;if(this.#o==="clip_search"&&r&&n){this.lastIndex=0;let o=this.#a(t.slice(n));return o&&(ou(o,n,t,this.hasIndices),this.lastIndex+=n),o}return this.#a(t)}#a(t){this.#e.lastIndex=this.lastIndex;let r=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!r||!this.#t.size)return r;let n=[...r];r.length=1;let o;this.hasIndices&&(o=[...r.indices],r.indices.length=1);let a=[0];for(let i=1;i<n.length;i++){let{hidden:s,transferTo:l}=this.#t.get(i)??{};if(s?a.push(null):(a.push(r.length),r.push(n[i]),this.hasIndices&&r.indices.push(o[i])),l&&n[i]!==void 0){let u=a[l];if(!u)throw new Error(`Invalid capture transfer to "${u}"`);if(r[u]=n[i],this.hasIndices&&(r.indices[u]=o[i]),r.groups){this.#r||(this.#r=iu(this.source));let c=this.#r.get(l);c&&(r.groups[c]=n[i],this.hasIndices&&(r.indices.groups[c]=o[i]))}}}return r}};function ou(e,t,r,n){if(e.index+=t,e.input=r,n){let o=e.indices;for(let i=0;i<o.length;i++){let s=o[i];s&&(o[i]=[s[0]+t,s[1]+t])}let a=o.groups;a&&Object.keys(a).forEach(i=>{let s=a[i];s&&(a[i]=[s[0]+t,s[1]+t])})}}function au(e,t){let r=new Map;for(let n of e)r.set(n,{hidden:!0});for(let[n,o]of t)for(let a of o)Pe(r,a,{}).transferTo=n;return r}function iu(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map,n=0,o=0,a;for(;a=t.exec(e);){let{0:i,groups:{capture:s,name:l}}=a;i==="["?n++:n?i==="]"&&n--:s&&(o++,l&&r.set(o,l))}return r}function su(e,t){let r=lu(e,t);return r.options?new nu(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function lu(e,t){let r=yo(t),n=uo(e,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:cr}),o=Rl(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),a=ql(o,r),i=Sl(a.pattern,{captureTransfers:a._captureTransfers,hiddenCaptures:a._hiddenCaptures,mode:"external"}),s=Cl(i.pattern),l=vl(s.pattern,{captureTransfers:i.captureTransfers,hiddenCaptures:i.hiddenCaptures}),u={pattern:l.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${a.flags}${a.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{let c=l.hiddenCaptures.sort((p,b)=>p-b),d=Array.from(l.captureTransfers),g=o._strategy,h=u.pattern.length>=r.lazyCompileLength;(c.length||d.length||g||h)&&(u.options={...c.length&&{hiddenCaptures:c},...d.length&&{transfers:d},...g&&{strategy:g},...h&&{lazyCompile:h}})}return u}function Eo(e,t){return su(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function uu(e={}){let t={target:"auto",cache:new Map,...e};return t.regexConstructor||=r=>Eo(r,{target:t.target}),{createScanner(r){return new _s(r,t)},createString(r){return{content:r}}}}var ot={NotSet:-1,Underline:4,Strikethrough:8};function on(e,t){let r=e.getTheme(t),n=Ie.createFromRawTheme(r),o=$e(r,{});return{name:r.name,fg:X(r.fg,o)??"",bg:X(r.bg,o)??"",theme:n,colorMap:n.getColorMap(),replacements:o,defaults:n.getDefaults()}}var cu=5e4,du=100,an=class extends Error{};function hu(e,t){let r=[on(e,t.light),on(e,t.dark)],n=["light","dark"],o=`--shiki-light:${r[0].fg||"inherit"};--shiki-dark:${r[1].fg||"inherit"}`,a=`--shiki-light-bg:${r[0].bg||"inherit"};--shiki-dark-bg:${r[1].bg||"inherit"}`,i=`shiki-themes ${r[0].name} ${r[1].name}`,s=()=>({path:null,fontStyle:[r[0].defaults.fontStyle,r[1].defaults.fontStyle],fg:[r[0].defaults.foregroundId,r[1].defaults.foregroundId],children:new Map}),l=s(),u=0,c=(h,p)=>{let b=h.children.get(p);if(b)return b;let y={parent:h.path,scopeName:p};b={path:y,fontStyle:[...h.fontStyle],fg:[...h.fg],children:new Map};for(let m of[0,1]){let f=r[m].theme.match(y);f&&(f.fontStyle!==ot.NotSet&&(b.fontStyle[m]=f.fontStyle),f.foregroundId!==0&&(b.fg[m]=f.foregroundId))}return h.children.set(p,b),u++,b},d=h=>h.style??=[0,1].map(p=>({color:X(r[p].colorMap[h.fg[p]],r[p].replacements)??"",fontStyle:h.fontStyle[p]===ot.NotSet?0:h.fontStyle[p]})),g=h=>{if(h.length>du)throw new an;let p=l;for(let b of h)p=c(p,b);return p};return function(h,p){u>cu&&(l=s(),u=0);let b=e.getLanguage(p.lang),y=Ke,m=[];try{for(let[v,x]of Re(h)){if(v===""){m.push([]);continue}if(p.tokenizeMaxLineLength>0&&v.length>=p.tokenizeMaxLineLength){m.push([Wt({content:v,offset:x,variants:{light:{color:"",fontStyle:0},dark:{color:"",fontStyle:0}}},n,"--shiki-",!1)]);continue}let _=b.tokenizeLine(v,y,p.tokenizeTimeLimit),B=[],A,U=()=>{A&&B.push(Wt({content:v.slice(A.start,A.end),offset:x+A.start,variants:{light:A.l,dark:A.d}},n,"--shiki-",!1))};for(let G=0;G<_.tokens.length;G++){let H=_.tokens[G],$=G+1<_.tokens.length?_.tokens[G+1].startIndex:v.length;if($<=H.startIndex)continue;let[O,Ce]=d(g(H.scopes));A&&A.end===H.startIndex&&sn(A.l,O)&&sn(A.d,Ce)?A.end=$:(U(),A={l:O,d:Ce,start:H.startIndex,end:$})}U(),m.push(B),y=_.ruleStack}}catch(v){if(v instanceof an)return;throw v}let f={meta:{},options:{lang:p.lang,themes:t,defaultColor:!1,transformers:p.transformers},codeToHast:()=>{throw new Error("codeToHast is not available in the one-pass renderer")},codeToTokens:()=>{throw new Error("codeToTokens is not available in the one-pass renderer")},get source(){return h}},w=to(gu(m),{...f.options,fg:o,bg:a,themeName:i,rootStyle:`${o};${a}`},f);return ro(w)}}var sn=(e,t)=>e.color===t.color&&e.fontStyle===t.fontStyle;function gu(e){let t=/^\s+$/;return e.map(r=>{let n=[],o="",a;return r.forEach((i,s)=>{let l=!(i.fontStyle&&(i.fontStyle&ot.Underline||i.fontStyle&ot.Strikethrough));l&&t.test(i.content)&&r[s+1]?(a===void 0&&(a=i.offset),o+=i.content):o?(l?n.push({...i,offset:a,content:o+i.content}):n.push({content:o,offset:a},i),a=void 0,o=""):n.push(i)}),n})}var pu=Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#fd8c73","activityBar.background":"#ffffff","activityBar.border":"#d0d7de","activityBar.foreground":"#1f2328","activityBar.inactiveForeground":"#656d76","activityBarBadge.background":"#0969da","activityBarBadge.foreground":"#ffffff","badge.background":"#0969da","badge.foreground":"#ffffff","breadcrumb.activeSelectionForeground":"#656d76","breadcrumb.focusForeground":"#1f2328","breadcrumb.foreground":"#656d76","breadcrumbPicker.background":"#ffffff","button.background":"#1f883d","button.foreground":"#ffffff","button.hoverBackground":"#1a7f37","button.secondaryBackground":"#ebecf0","button.secondaryForeground":"#24292f","button.secondaryHoverBackground":"#f3f4f6","checkbox.background":"#f6f8fa","checkbox.border":"#d0d7de","debugConsole.errorForeground":"#cf222e","debugConsole.infoForeground":"#57606a","debugConsole.sourceForeground":"#9a6700","debugConsole.warningForeground":"#7d4e00","debugConsoleInputIcon.foreground":"#6639ba","debugIcon.breakpointForeground":"#cf222e","debugTokenExpression.boolean":"#116329","debugTokenExpression.error":"#a40e26","debugTokenExpression.name":"#0550ae","debugTokenExpression.number":"#116329","debugTokenExpression.string":"#0a3069","debugTokenExpression.value":"#0a3069","debugToolBar.background":"#ffffff","descriptionForeground":"#656d76","diffEditor.insertedLineBackground":"#aceebb4d","diffEditor.insertedTextBackground":"#6fdd8b80","diffEditor.removedLineBackground":"#ffcecb4d","diffEditor.removedTextBackground":"#ff818266","dropdown.background":"#ffffff","dropdown.border":"#d0d7de","dropdown.foreground":"#1f2328","dropdown.listBackground":"#ffffff","editor.background":"#ffffff","editor.findMatchBackground":"#bf8700","editor.findMatchHighlightBackground":"#fae17d80","editor.focusedStackFrameHighlightBackground":"#4ac26b66","editor.foldBackground":"#6e77811a","editor.foreground":"#1f2328","editor.lineHighlightBackground":"#eaeef280","editor.linkedEditingBackground":"#0969da12","editor.selectionHighlightBackground":"#4ac26b40","editor.stackFrameHighlightBackground":"#d4a72c66","editor.wordHighlightBackground":"#eaeef280","editor.wordHighlightBorder":"#afb8c199","editor.wordHighlightStrongBackground":"#afb8c14d","editor.wordHighlightStrongBorder":"#afb8c199","editorBracketHighlight.foreground1":"#0969da","editorBracketHighlight.foreground2":"#1a7f37","editorBracketHighlight.foreground3":"#9a6700","editorBracketHighlight.foreground4":"#cf222e","editorBracketHighlight.foreground5":"#bf3989","editorBracketHighlight.foreground6":"#8250df","editorBracketHighlight.unexpectedBracket.foreground":"#656d76","editorBracketMatch.background":"#4ac26b40","editorBracketMatch.border":"#4ac26b99","editorCursor.foreground":"#0969da","editorGroup.border":"#d0d7de","editorGroupHeader.tabsBackground":"#f6f8fa","editorGroupHeader.tabsBorder":"#d0d7de","editorGutter.addedBackground":"#4ac26b66","editorGutter.deletedBackground":"#ff818266","editorGutter.modifiedBackground":"#d4a72c66","editorIndentGuide.activeBackground":"#1f23283d","editorIndentGuide.background":"#1f23281f","editorInlayHint.background":"#afb8c133","editorInlayHint.foreground":"#656d76","editorInlayHint.paramBackground":"#afb8c133","editorInlayHint.paramForeground":"#656d76","editorInlayHint.typeBackground":"#afb8c133","editorInlayHint.typeForeground":"#656d76","editorLineNumber.activeForeground":"#1f2328","editorLineNumber.foreground":"#8c959f","editorOverviewRuler.border":"#ffffff","editorWhitespace.foreground":"#afb8c1","editorWidget.background":"#ffffff","errorForeground":"#cf222e","focusBorder":"#0969da","foreground":"#1f2328","gitDecoration.addedResourceForeground":"#1a7f37","gitDecoration.conflictingResourceForeground":"#bc4c00","gitDecoration.deletedResourceForeground":"#cf222e","gitDecoration.ignoredResourceForeground":"#6e7781","gitDecoration.modifiedResourceForeground":"#9a6700","gitDecoration.submoduleResourceForeground":"#656d76","gitDecoration.untrackedResourceForeground":"#1a7f37","icon.foreground":"#656d76","input.background":"#ffffff","input.border":"#d0d7de","input.foreground":"#1f2328","input.placeholderForeground":"#6e7781","keybindingLabel.foreground":"#1f2328","list.activeSelectionBackground":"#afb8c133","list.activeSelectionForeground":"#1f2328","list.focusBackground":"#ddf4ff","list.focusForeground":"#1f2328","list.highlightForeground":"#0969da","list.hoverBackground":"#eaeef280","list.hoverForeground":"#1f2328","list.inactiveFocusBackground":"#ddf4ff","list.inactiveSelectionBackground":"#afb8c133","list.inactiveSelectionForeground":"#1f2328","minimapSlider.activeBackground":"#8c959f47","minimapSlider.background":"#8c959f33","minimapSlider.hoverBackground":"#8c959f3d","notificationCenterHeader.background":"#f6f8fa","notificationCenterHeader.foreground":"#656d76","notifications.background":"#ffffff","notifications.border":"#d0d7de","notifications.foreground":"#1f2328","notificationsErrorIcon.foreground":"#cf222e","notificationsInfoIcon.foreground":"#0969da","notificationsWarningIcon.foreground":"#9a6700","panel.background":"#f6f8fa","panel.border":"#d0d7de","panelInput.border":"#d0d7de","panelTitle.activeBorder":"#fd8c73","panelTitle.activeForeground":"#1f2328","panelTitle.inactiveForeground":"#656d76","pickerGroup.border":"#d0d7de","pickerGroup.foreground":"#656d76","progressBar.background":"#0969da","quickInput.background":"#ffffff","quickInput.foreground":"#1f2328","scrollbar.shadow":"#6e778133","scrollbarSlider.activeBackground":"#8c959f47","scrollbarSlider.background":"#8c959f33","scrollbarSlider.hoverBackground":"#8c959f3d","settings.headerForeground":"#1f2328","settings.modifiedItemIndicator":"#d4a72c66","sideBar.background":"#f6f8fa","sideBar.border":"#d0d7de","sideBar.foreground":"#1f2328","sideBarSectionHeader.background":"#f6f8fa","sideBarSectionHeader.border":"#d0d7de","sideBarSectionHeader.foreground":"#1f2328","sideBarTitle.foreground":"#1f2328","statusBar.background":"#ffffff","statusBar.border":"#d0d7de","statusBar.debuggingBackground":"#cf222e","statusBar.debuggingForeground":"#ffffff","statusBar.focusBorder":"#0969da80","statusBar.foreground":"#656d76","statusBar.noFolderBackground":"#ffffff","statusBarItem.activeBackground":"#1f23281f","statusBarItem.focusBorder":"#0969da","statusBarItem.hoverBackground":"#1f232814","statusBarItem.prominentBackground":"#afb8c133","statusBarItem.remoteBackground":"#eaeef2","statusBarItem.remoteForeground":"#1f2328","symbolIcon.arrayForeground":"#953800","symbolIcon.booleanForeground":"#0550ae","symbolIcon.classForeground":"#953800","symbolIcon.colorForeground":"#0a3069","symbolIcon.constantForeground":"#116329","symbolIcon.constructorForeground":"#3e1f79","symbolIcon.enumeratorForeground":"#953800","symbolIcon.enumeratorMemberForeground":"#0550ae","symbolIcon.eventForeground":"#57606a","symbolIcon.fieldForeground":"#953800","symbolIcon.fileForeground":"#7d4e00","symbolIcon.folderForeground":"#7d4e00","symbolIcon.functionForeground":"#6639ba","symbolIcon.interfaceForeground":"#953800","symbolIcon.keyForeground":"#0550ae","symbolIcon.keywordForeground":"#a40e26","symbolIcon.methodForeground":"#6639ba","symbolIcon.moduleForeground":"#a40e26","symbolIcon.namespaceForeground":"#a40e26","symbolIcon.nullForeground":"#0550ae","symbolIcon.numberForeground":"#116329","symbolIcon.objectForeground":"#953800","symbolIcon.operatorForeground":"#0a3069","symbolIcon.packageForeground":"#953800","symbolIcon.propertyForeground":"#953800","symbolIcon.referenceForeground":"#0550ae","symbolIcon.snippetForeground":"#0550ae","symbolIcon.stringForeground":"#0a3069","symbolIcon.structForeground":"#953800","symbolIcon.textForeground":"#0a3069","symbolIcon.typeParameterForeground":"#0a3069","symbolIcon.unitForeground":"#0550ae","symbolIcon.variableForeground":"#953800","tab.activeBackground":"#ffffff","tab.activeBorder":"#ffffff","tab.activeBorderTop":"#fd8c73","tab.activeForeground":"#1f2328","tab.border":"#d0d7de","tab.hoverBackground":"#ffffff","tab.inactiveBackground":"#f6f8fa","tab.inactiveForeground":"#656d76","tab.unfocusedActiveBorder":"#ffffff","tab.unfocusedActiveBorderTop":"#d0d7de","tab.unfocusedHoverBackground":"#eaeef280","terminal.ansiBlack":"#24292f","terminal.ansiBlue":"#0969da","terminal.ansiBrightBlack":"#57606a","terminal.ansiBrightBlue":"#218bff","terminal.ansiBrightCyan":"#3192aa","terminal.ansiBrightGreen":"#1a7f37","terminal.ansiBrightMagenta":"#a475f9","terminal.ansiBrightRed":"#a40e26","terminal.ansiBrightWhite":"#8c959f","terminal.ansiBrightYellow":"#633c01","terminal.ansiCyan":"#1b7c83","terminal.ansiGreen":"#116329","terminal.ansiMagenta":"#8250df","terminal.ansiRed":"#cf222e","terminal.ansiWhite":"#6e7781","terminal.ansiYellow":"#4d2d00","terminal.foreground":"#1f2328","textBlockQuote.background":"#f6f8fa","textBlockQuote.border":"#d0d7de","textCodeBlock.background":"#afb8c133","textLink.activeForeground":"#0969da","textLink.foreground":"#0969da","textPreformat.background":"#afb8c133","textPreformat.foreground":"#656d76","textSeparator.foreground":"#d8dee4","titleBar.activeBackground":"#ffffff","titleBar.activeForeground":"#656d76","titleBar.border":"#d0d7de","titleBar.inactiveBackground":"#f6f8fa","titleBar.inactiveForeground":"#656d76","tree.indentGuidesStroke":"#d8dee4","welcomePage.buttonBackground":"#f6f8fa","welcomePage.buttonHoverBackground":"#f3f4f6"},"displayName":"GitHub Light Default","name":"github-light-default","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#6e7781"}},{"scope":["constant.other.placeholder","constant.character"],"settings":{"foreground":"#cf222e"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language","entity"],"settings":{"foreground":"#0550ae"}},{"scope":["entity.name","meta.export.default","meta.definition.variable"],"settings":{"foreground":"#953800"}},{"scope":["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.object.member","meta.embedded.expression"],"settings":{"foreground":"#1f2328"}},{"scope":"entity.name.function","settings":{"foreground":"#8250df"}},{"scope":["entity.name.tag","support.class.component"],"settings":{"foreground":"#116329"}},{"scope":"keyword","settings":{"foreground":"#cf222e"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#cf222e"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#1f2328"}},{"scope":["string","string punctuation.section.embedded source"],"settings":{"foreground":"#0a3069"}},{"scope":"support","settings":{"foreground":"#0550ae"}},{"scope":"meta.property-name","settings":{"foreground":"#0550ae"}},{"scope":"variable","settings":{"foreground":"#953800"}},{"scope":"variable.other","settings":{"foreground":"#1f2328"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#82071e"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#82071e"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#82071e"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#82071e"}},{"scope":"carriage-return","settings":{"background":"#cf222e","content":"^M","fontStyle":"italic underline","foreground":"#f6f8fa"}},{"scope":"message.error","settings":{"foreground":"#82071e"}},{"scope":"string variable","settings":{"foreground":"#0550ae"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#0a3069"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#0a3069"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#116329"}},{"scope":"support.constant","settings":{"foreground":"#0550ae"}},{"scope":"support.variable","settings":{"foreground":"#0550ae"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#116329"}},{"scope":"meta.module-reference","settings":{"foreground":"#0550ae"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#953800"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#0550ae"}},{"scope":"markup.quote","settings":{"foreground":"#116329"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#1f2328"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#1f2328"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#0550ae"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#ffebe9","foreground":"#82071e"}},{"scope":["punctuation.section.embedded"],"settings":{"foreground":"#cf222e"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#dafbe1","foreground":"#116329"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#ffd8b5","foreground":"#953800"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#0550ae","foreground":"#eaeef2"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#8250df"}},{"scope":"meta.diff.header","settings":{"foreground":"#0550ae"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#0550ae"}},{"scope":"meta.output","settings":{"foreground":"#0550ae"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#57606a"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#82071e"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"foreground":"#0a3069"}}],"type":"light"}')),fu=Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#f78166","activityBar.background":"#0d1117","activityBar.border":"#30363d","activityBar.foreground":"#e6edf3","activityBar.inactiveForeground":"#7d8590","activityBarBadge.background":"#1f6feb","activityBarBadge.foreground":"#ffffff","badge.background":"#1f6feb","badge.foreground":"#ffffff","breadcrumb.activeSelectionForeground":"#7d8590","breadcrumb.focusForeground":"#e6edf3","breadcrumb.foreground":"#7d8590","breadcrumbPicker.background":"#161b22","button.background":"#238636","button.foreground":"#ffffff","button.hoverBackground":"#2ea043","button.secondaryBackground":"#282e33","button.secondaryForeground":"#c9d1d9","button.secondaryHoverBackground":"#30363d","checkbox.background":"#161b22","checkbox.border":"#30363d","debugConsole.errorForeground":"#ffa198","debugConsole.infoForeground":"#8b949e","debugConsole.sourceForeground":"#e3b341","debugConsole.warningForeground":"#d29922","debugConsoleInputIcon.foreground":"#bc8cff","debugIcon.breakpointForeground":"#f85149","debugTokenExpression.boolean":"#56d364","debugTokenExpression.error":"#ffa198","debugTokenExpression.name":"#79c0ff","debugTokenExpression.number":"#56d364","debugTokenExpression.string":"#a5d6ff","debugTokenExpression.value":"#a5d6ff","debugToolBar.background":"#161b22","descriptionForeground":"#7d8590","diffEditor.insertedLineBackground":"#23863626","diffEditor.insertedTextBackground":"#3fb9504d","diffEditor.removedLineBackground":"#da363326","diffEditor.removedTextBackground":"#ff7b724d","dropdown.background":"#161b22","dropdown.border":"#30363d","dropdown.foreground":"#e6edf3","dropdown.listBackground":"#161b22","editor.background":"#0d1117","editor.findMatchBackground":"#9e6a03","editor.findMatchHighlightBackground":"#f2cc6080","editor.focusedStackFrameHighlightBackground":"#2ea04366","editor.foldBackground":"#6e76811a","editor.foreground":"#e6edf3","editor.lineHighlightBackground":"#6e76811a","editor.linkedEditingBackground":"#2f81f712","editor.selectionHighlightBackground":"#3fb95040","editor.stackFrameHighlightBackground":"#bb800966","editor.wordHighlightBackground":"#6e768180","editor.wordHighlightBorder":"#6e768199","editor.wordHighlightStrongBackground":"#6e76814d","editor.wordHighlightStrongBorder":"#6e768199","editorBracketHighlight.foreground1":"#79c0ff","editorBracketHighlight.foreground2":"#56d364","editorBracketHighlight.foreground3":"#e3b341","editorBracketHighlight.foreground4":"#ffa198","editorBracketHighlight.foreground5":"#ff9bce","editorBracketHighlight.foreground6":"#d2a8ff","editorBracketHighlight.unexpectedBracket.foreground":"#7d8590","editorBracketMatch.background":"#3fb95040","editorBracketMatch.border":"#3fb95099","editorCursor.foreground":"#2f81f7","editorGroup.border":"#30363d","editorGroupHeader.tabsBackground":"#010409","editorGroupHeader.tabsBorder":"#30363d","editorGutter.addedBackground":"#2ea04366","editorGutter.deletedBackground":"#f8514966","editorGutter.modifiedBackground":"#bb800966","editorIndentGuide.activeBackground":"#e6edf33d","editorIndentGuide.background":"#e6edf31f","editorInlayHint.background":"#8b949e33","editorInlayHint.foreground":"#7d8590","editorInlayHint.paramBackground":"#8b949e33","editorInlayHint.paramForeground":"#7d8590","editorInlayHint.typeBackground":"#8b949e33","editorInlayHint.typeForeground":"#7d8590","editorLineNumber.activeForeground":"#e6edf3","editorLineNumber.foreground":"#6e7681","editorOverviewRuler.border":"#010409","editorWhitespace.foreground":"#484f58","editorWidget.background":"#161b22","errorForeground":"#f85149","focusBorder":"#1f6feb","foreground":"#e6edf3","gitDecoration.addedResourceForeground":"#3fb950","gitDecoration.conflictingResourceForeground":"#db6d28","gitDecoration.deletedResourceForeground":"#f85149","gitDecoration.ignoredResourceForeground":"#6e7681","gitDecoration.modifiedResourceForeground":"#d29922","gitDecoration.submoduleResourceForeground":"#7d8590","gitDecoration.untrackedResourceForeground":"#3fb950","icon.foreground":"#7d8590","input.background":"#0d1117","input.border":"#30363d","input.foreground":"#e6edf3","input.placeholderForeground":"#6e7681","keybindingLabel.foreground":"#e6edf3","list.activeSelectionBackground":"#6e768166","list.activeSelectionForeground":"#e6edf3","list.focusBackground":"#388bfd26","list.focusForeground":"#e6edf3","list.highlightForeground":"#2f81f7","list.hoverBackground":"#6e76811a","list.hoverForeground":"#e6edf3","list.inactiveFocusBackground":"#388bfd26","list.inactiveSelectionBackground":"#6e768166","list.inactiveSelectionForeground":"#e6edf3","minimapSlider.activeBackground":"#8b949e47","minimapSlider.background":"#8b949e33","minimapSlider.hoverBackground":"#8b949e3d","notificationCenterHeader.background":"#161b22","notificationCenterHeader.foreground":"#7d8590","notifications.background":"#161b22","notifications.border":"#30363d","notifications.foreground":"#e6edf3","notificationsErrorIcon.foreground":"#f85149","notificationsInfoIcon.foreground":"#2f81f7","notificationsWarningIcon.foreground":"#d29922","panel.background":"#010409","panel.border":"#30363d","panelInput.border":"#30363d","panelTitle.activeBorder":"#f78166","panelTitle.activeForeground":"#e6edf3","panelTitle.inactiveForeground":"#7d8590","peekViewEditor.background":"#6e76811a","peekViewEditor.matchHighlightBackground":"#bb800966","peekViewResult.background":"#0d1117","peekViewResult.matchHighlightBackground":"#bb800966","pickerGroup.border":"#30363d","pickerGroup.foreground":"#7d8590","progressBar.background":"#1f6feb","quickInput.background":"#161b22","quickInput.foreground":"#e6edf3","scrollbar.shadow":"#484f5833","scrollbarSlider.activeBackground":"#8b949e47","scrollbarSlider.background":"#8b949e33","scrollbarSlider.hoverBackground":"#8b949e3d","settings.headerForeground":"#e6edf3","settings.modifiedItemIndicator":"#bb800966","sideBar.background":"#010409","sideBar.border":"#30363d","sideBar.foreground":"#e6edf3","sideBarSectionHeader.background":"#010409","sideBarSectionHeader.border":"#30363d","sideBarSectionHeader.foreground":"#e6edf3","sideBarTitle.foreground":"#e6edf3","statusBar.background":"#0d1117","statusBar.border":"#30363d","statusBar.debuggingBackground":"#da3633","statusBar.debuggingForeground":"#ffffff","statusBar.focusBorder":"#1f6feb80","statusBar.foreground":"#7d8590","statusBar.noFolderBackground":"#0d1117","statusBarItem.activeBackground":"#e6edf31f","statusBarItem.focusBorder":"#1f6feb","statusBarItem.hoverBackground":"#e6edf314","statusBarItem.prominentBackground":"#6e768166","statusBarItem.remoteBackground":"#30363d","statusBarItem.remoteForeground":"#e6edf3","symbolIcon.arrayForeground":"#f0883e","symbolIcon.booleanForeground":"#58a6ff","symbolIcon.classForeground":"#f0883e","symbolIcon.colorForeground":"#79c0ff","symbolIcon.constantForeground":["#aff5b4","#7ee787","#56d364","#3fb950","#2ea043","#238636","#196c2e","#0f5323","#033a16","#04260f"],"symbolIcon.constructorForeground":"#d2a8ff","symbolIcon.enumeratorForeground":"#f0883e","symbolIcon.enumeratorMemberForeground":"#58a6ff","symbolIcon.eventForeground":"#6e7681","symbolIcon.fieldForeground":"#f0883e","symbolIcon.fileForeground":"#d29922","symbolIcon.folderForeground":"#d29922","symbolIcon.functionForeground":"#bc8cff","symbolIcon.interfaceForeground":"#f0883e","symbolIcon.keyForeground":"#58a6ff","symbolIcon.keywordForeground":"#ff7b72","symbolIcon.methodForeground":"#bc8cff","symbolIcon.moduleForeground":"#ff7b72","symbolIcon.namespaceForeground":"#ff7b72","symbolIcon.nullForeground":"#58a6ff","symbolIcon.numberForeground":"#3fb950","symbolIcon.objectForeground":"#f0883e","symbolIcon.operatorForeground":"#79c0ff","symbolIcon.packageForeground":"#f0883e","symbolIcon.propertyForeground":"#f0883e","symbolIcon.referenceForeground":"#58a6ff","symbolIcon.snippetForeground":"#58a6ff","symbolIcon.stringForeground":"#79c0ff","symbolIcon.structForeground":"#f0883e","symbolIcon.textForeground":"#79c0ff","symbolIcon.typeParameterForeground":"#79c0ff","symbolIcon.unitForeground":"#58a6ff","symbolIcon.variableForeground":"#f0883e","tab.activeBackground":"#0d1117","tab.activeBorder":"#0d1117","tab.activeBorderTop":"#f78166","tab.activeForeground":"#e6edf3","tab.border":"#30363d","tab.hoverBackground":"#0d1117","tab.inactiveBackground":"#010409","tab.inactiveForeground":"#7d8590","tab.unfocusedActiveBorder":"#0d1117","tab.unfocusedActiveBorderTop":"#30363d","tab.unfocusedHoverBackground":"#6e76811a","terminal.ansiBlack":"#484f58","terminal.ansiBlue":"#58a6ff","terminal.ansiBrightBlack":"#6e7681","terminal.ansiBrightBlue":"#79c0ff","terminal.ansiBrightCyan":"#56d4dd","terminal.ansiBrightGreen":"#56d364","terminal.ansiBrightMagenta":"#d2a8ff","terminal.ansiBrightRed":"#ffa198","terminal.ansiBrightWhite":"#ffffff","terminal.ansiBrightYellow":"#e3b341","terminal.ansiCyan":"#39c5cf","terminal.ansiGreen":"#3fb950","terminal.ansiMagenta":"#bc8cff","terminal.ansiRed":"#ff7b72","terminal.ansiWhite":"#b1bac4","terminal.ansiYellow":"#d29922","terminal.foreground":"#e6edf3","textBlockQuote.background":"#010409","textBlockQuote.border":"#30363d","textCodeBlock.background":"#6e768166","textLink.activeForeground":"#2f81f7","textLink.foreground":"#2f81f7","textPreformat.background":"#6e768166","textPreformat.foreground":"#7d8590","textSeparator.foreground":"#21262d","titleBar.activeBackground":"#0d1117","titleBar.activeForeground":"#7d8590","titleBar.border":"#30363d","titleBar.inactiveBackground":"#010409","titleBar.inactiveForeground":"#7d8590","tree.indentGuidesStroke":"#21262d","welcomePage.buttonBackground":"#21262d","welcomePage.buttonHoverBackground":"#30363d"},"displayName":"GitHub Dark Default","name":"github-dark-default","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#8b949e"}},{"scope":["constant.other.placeholder","constant.character"],"settings":{"foreground":"#ff7b72"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language","entity"],"settings":{"foreground":"#79c0ff"}},{"scope":["entity.name","meta.export.default","meta.definition.variable"],"settings":{"foreground":"#ffa657"}},{"scope":["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.object.member","meta.embedded.expression"],"settings":{"foreground":"#e6edf3"}},{"scope":"entity.name.function","settings":{"foreground":"#d2a8ff"}},{"scope":["entity.name.tag","support.class.component"],"settings":{"foreground":"#7ee787"}},{"scope":"keyword","settings":{"foreground":"#ff7b72"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#ff7b72"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#e6edf3"}},{"scope":["string","string punctuation.section.embedded source"],"settings":{"foreground":"#a5d6ff"}},{"scope":"support","settings":{"foreground":"#79c0ff"}},{"scope":"meta.property-name","settings":{"foreground":"#79c0ff"}},{"scope":"variable","settings":{"foreground":"#ffa657"}},{"scope":"variable.other","settings":{"foreground":"#e6edf3"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#ffa198"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#ffa198"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#ffa198"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#ffa198"}},{"scope":"carriage-return","settings":{"background":"#ff7b72","content":"^M","fontStyle":"italic underline","foreground":"#f0f6fc"}},{"scope":"message.error","settings":{"foreground":"#ffa198"}},{"scope":"string variable","settings":{"foreground":"#79c0ff"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#a5d6ff"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#a5d6ff"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#7ee787"}},{"scope":"support.constant","settings":{"foreground":"#79c0ff"}},{"scope":"support.variable","settings":{"foreground":"#79c0ff"}},{"scope":"support.type.property-name.json","settings":{"foreground":"#7ee787"}},{"scope":"meta.module-reference","settings":{"foreground":"#79c0ff"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#ffa657"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#79c0ff"}},{"scope":"markup.quote","settings":{"foreground":"#7ee787"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#e6edf3"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#e6edf3"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#79c0ff"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#490202","foreground":"#ffa198"}},{"scope":["punctuation.section.embedded"],"settings":{"foreground":"#ff7b72"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#04260f","foreground":"#7ee787"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#5a1e02","foreground":"#ffa657"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#79c0ff","foreground":"#161b22"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#d2a8ff"}},{"scope":"meta.diff.header","settings":{"foreground":"#79c0ff"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#79c0ff"}},{"scope":"meta.output","settings":{"foreground":"#79c0ff"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#8b949e"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#ffa198"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"foreground":"#a5d6ff"}}],"type":"dark"}')),mu={bash:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l0})),shellsession:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l1})),powershell:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l2})),bat:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l3})),javascript:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l4})),typescript:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l5})),jsx:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l6})),tsx:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l7})),json:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l8})),jsonc:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l9})),yaml:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l10})),toml:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l11})),ini:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l12})),properties:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l13})),xml:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l14})),xsl:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l15})),html:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l16})),css:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l17})),scss:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l18})),markdown:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l19})),java:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l20})),python:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l21})),go:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l22})),rust:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l23})),c:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l24})),cpp:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l25})),csharp:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l26})),sql:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l27})),diff:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l28})),docker:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l29})),makefile:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l30})),groovy:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l31})),kotlin:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l32})),ruby:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l33})),graphql:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l34})),nginx:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l35})),hcl:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l36})),http:()=>import("./dogsbay-grammars-QTFFN4OR.mjs").then(e=>({default:e.l37}))},Jt={bash:"bash",bat:"bat",batch:"bat",c:"c","c#":"csharp","c++":"cpp",cjs:"javascript",console:"shellsession",cpp:"cpp","cpp-macro":"cpp",cs:"csharp",csharp:"csharp",css:"css",cts:"typescript",diff:"diff",docker:"docker",dockerfile:"docker",glsl:"cpp",go:"go",gql:"graphql",graphql:"graphql",groovy:"groovy",haml:"ruby",hcl:"hcl",html:"html",http:"http",ini:"ini",java:"java",javascript:"javascript",js:"javascript",json:"json",jsonc:"jsonc",jsx:"jsx",kotlin:"kotlin",kt:"kotlin",kts:"kotlin",lua:"ruby",make:"makefile",makefile:"makefile",markdown:"markdown",md:"markdown",mjs:"javascript",mts:"typescript",nginx:"nginx",powershell:"powershell",properties:"ini",ps:"powershell",ps1:"powershell",py:"python",python:"python",rb:"ruby",regex:"cpp",regexp:"cpp",rs:"rust",ruby:"ruby",rust:"rust",scss:"scss",sh:"bash",shell:"bash",shellscript:"bash",shellsession:"shellsession",sql:"sql",toml:"toml",ts:"typescript",tsx:"tsx",typescript:"typescript",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yaml",zsh:"bash"},bu={markdown:{bat:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(bat(?:|ch))((\\s+|[,:?{])[^`]*)?$)"],c:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:([ch])((\\s+|[,:?{])[^`]*)?$)"],cpp:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(c(?:pp|\\+\\+|xx))((\\s+|[,:?{])[^`]*)?$)"],csharp:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(c(?:s|sharp|#))((\\s+|[,:?{])[^`]*)?$)"],css:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(css(?:|.erb))((\\s+|[,:?{])[^`]*)?$)"],diff:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(patch|diff|rej)((\\s+|[,:?{])[^`]*)?$)"],docker:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:([Dd]ockerfile)((\\s+|[,:?{])[^`]*)?$)"],go:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(go(?:|lang))((\\s+|[,:?{])[^`]*)?$)"],groovy:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(g(?:roovy|vy))((\\s+|[,:?{])[^`]*)?$)"],html:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(html?|shtml|xhtml|inc|tmpl|tpl)((\\s+|[,:?{])[^`]*)?$)","(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(php3??|php4|php5|phpt|phtml|aw|ctp)((\\s+|[,:?{])[^`]*)?$)"],ini:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(ini|conf)((\\s+|[,:?{])[^`]*)?$)"],java:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(java|bsh)((\\s+|[,:?{])[^`]*)?$)"],javascript:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(jsx??|javascript|es6|mjs|cjs|dataviewjs|\\{\\.js.+?})((\\s+|[,:?{])[^`]*)?$)"],json:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(json5??|sublime-settings|sublime-menu|sublime-keymap|sublime-mousemap|sublime-theme|sublime-build|sublime-project|sublime-completions)((\\s+|[,:?{])[^`]*)?$)"],jsonc:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(jsonc)((\\s+|[,:?{])[^`]*)?$)"],lua:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(lua)((\\s+|[,:?{])[^`]*)?$)"],make:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:((?:[Mm]|GNUm|OCamlM)akefile)((\\s+|[,:?{])[^`]*)?$)"],powershell:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(p(?:owershell|s1|sm1|sd1|wsh))((\\s+|[,:?{])[^`]*)?$)"],python:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(python|py3??|rpy|pyw|cpy|SConstruct|Sconstruct|sconstruct|SConscript|gypi??|\\{\\.python.+?})((\\s+|[,:?{])[^`]*)?$)"],regexp:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(re)((\\s+|[,:?{])[^`]*)?$)"],ruby:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(ruby|rbx??|rjs|Rakefile|rake|cgi|fcgi|gemspec|irbrc|Capfile|ru|prawn|Cheffile|Gemfile|Guardfile|Hobofile|Vagrantfile|Appraisals|Rantfile|Berksfile|Berksfile.lock|Thorfile|Puppetfile)((\\s+|[,:?{])[^`]*)?$)"],rust:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(rust|rs|\\{\\.rust.+?})((\\s+|[,:?{])[^`]*)?$)"],scss:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(scss)((\\s+|[,:?{])[^`]*)?$)"],shellscript:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(shell|sh|bash|zsh|bashrc|bash_profile|bash_login|profile|bash_logout|.textmate_init|\\{\\.bash.+?})((\\s+|[,:?{])[^`]*)?$)"],sql:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(sql|ddl|dml)((\\s+|[,:?{])[^`]*)?$)"],tsx:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(tsx)((\\s+|[,:?{])[^`]*)?$)"],typescript:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(t(?:ypescript|s))((\\s+|[,:?{])[^`]*)?$)"],xml:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(xml|xsd|tld|jsp|pt|cpt|dtml|rss|opml)((\\s+|[,:?{])[^`]*)?$)"],xsl:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(xslt??)((\\s+|[,:?{])[^`]*)?$)"],yaml:["(|)(\\s*)(`{3,}|~{3,})\\s*(?i:(ya?ml)((\\s+|[,:?{])[^`]*)?$)","(?=(-{3,}))"]},haml:{css:["(\\s*)(:(css|styles?))$"],javascript:["(\\s*):javascript","(\\s*)%script"],markdown:["(\\s*)(:markdown)"],ruby:["(\\s*):ruby","(\\s*):ruby$","\\s*(?:((%)([-:\\w]+))|(?=[#.]))","(\\s*):(ruby|opal)$","(\\s*)(:ruby)","#\\{","!?==","\\{","(&|!)?([-=~])"]}},Bo={haml:["haml"],markdown:["markdown"],ruby:["haml"]},yu=/(\s+\/\/)/,ku=/(?:\/\/|["'#]|;{1,2}|%{1,2}|--)(\s*)$/,wu=/(?:\/\/|#|;{1,2}|%{1,2}|--)(\s*)$/,vu=[[/^(<!--)(.+)(-->)$/,!1],[/^(\/\*)(.+)(\*\/)$/,!1],[/^(\/\/|["'#]|;{1,2}|%{1,2}|--)(.*)$/,!0],[/^(\*)(.+)$/,!0]];function Cu(e,t,r){let n=[];for(let o of e){if(r==="v3"){let s=o.children.flatMap((l,u)=>{if(l.type!=="element")return l;let c=l.children[0];if(c.type!=="text")return l;let d=u===o.children.length-1;if(!Ft(c.value,d))return l;let g=c.value.split(yu);if(g.length<=1)return l;let h=[g[0]];for(let p=1;p<g.length;p+=2)h.push(g[p]+(g[p+1]||""));return h=h.filter(Boolean),h.length<=1?l:h.map(p=>({...l,children:[{type:"text",value:p}]}))});s.length!==o.children.length&&(o.children=s)}let a=o.children,i=a.length-1;r==="v1"?i=0:t&&(i=a.length-2);for(let s=Math.max(i,0);s<a.length;s++){let l=a[s];if(l.type!=="element")continue;let u=l.children.at(0);if(u?.type!=="text")continue;let c=s===a.length-1,d=Ft(u.value,c),g;if(!d&&s>0&&u.value.trim().startsWith("[!code")){let h=a[s-1];if(h?.type==="element"){let p=h.children.at(0);if(p?.type==="text"&&p.value.includes("//")){let b=Ft(p.value+u.value,c);if(b){d=b,n.push({info:b,line:o,token:h,isLineCommentOnly:a.length===2&&h.children.length===1&&l.children.length===1,isJsxStyle:!1,additionalTokens:[l]});continue}}}}if(d)if(t&&!c&&s!==0){let h=ln(a[s-1],"{")&&ln(a[s+1],"}");n.push({info:d,line:o,token:l,isLineCommentOnly:a.length===3&&l.children.length===1,isJsxStyle:h,additionalTokens:g})}else n.push({info:d,line:o,token:l,isLineCommentOnly:a.length===1&&l.children.length===1,isJsxStyle:!1,additionalTokens:g})}}return n}function ln(e,t){if(e.type!=="element")return!1;let r=e.children[0];return r.type!=="text"?!1:r.value.trim()===t}function Ft(e,t){let r=e.trimStart(),n=e.length-r.length;r=r.trimEnd();let o=e.length-r.length-n;for(let[a,i]of vu){if(i&&!t)continue;let s=a.exec(r);if(s)return[" ".repeat(n)+s[1],s[2],s[3]?s[3]+" ".repeat(o):void 0]}}function xu(e){let t=e.match(ku);return t&&t[1].trim().length===0?e.slice(0,t.index):e}function Su(e){let t=e.match(wu);return t&&t[1].trim().length===0?e.slice(0,t.index).trimEnd():e}function No(e,t,r,n){return n??="v3",{name:e,code(o){let a=o.children.filter(u=>u.type==="element"),i=[];o.data??={};let s=o.data;s._shiki_notation??=Cu(a,["jsx","tsx"].includes(this.options.lang),n);let l=s._shiki_notation;for(let u of l){if(u.info[1].length===0)continue;let c=a.indexOf(u.line);u.isLineCommentOnly&&n!=="v1"&&c++;let d=!1;if(u.info[1]=u.info[1].replace(t,(...h)=>r.call(this,h,u.line,u.token,a,c)?(d=!0,""):h[0]),!d)continue;n==="v1"?u.info[1]=xu(u.info[1]):n==="v3"&&(u.info[1]=Su(u.info[1]));let g=u.info[1].trim().length===0;if(g&&(u.info[1]=""),g&&u.isLineCommentOnly)i.push(u.line);else if(g&&u.isJsxStyle)u.line.children.splice(u.line.children.indexOf(u.token)-1,3);else if(g){if(u.additionalTokens)for(let h=u.additionalTokens.length-1;h>=0;h--){let p=u.additionalTokens[h],b=u.line.children.indexOf(p);b!==-1&&u.line.children.splice(b,1)}u.line.children.splice(u.line.children.indexOf(u.token),1)}else{let h=u.token.children[0];if(h.type==="text"&&(h.value=u.info.join(""),u.additionalTokens))for(let p of u.additionalTokens){let b=p.children[0];b?.type==="text"&&(b.value="")}}}for(let u of i){let c=o.children.indexOf(u),d=o.children[c+1],g=1;d?.type==="text"&&d?.value===`
|
|
153
|
+
`&&(g=2),o.children.splice(c,g)}}}}var Ku=Symbol("highlighted-lines"),_u=/[.*+?^${}()|[\]\\]/g;function Au(e){return e.replace(_u,"\\$&")}function gt(e={},t="@shikijs/transformers:notation-map"){let{classMap:r={},classActivePre:n=void 0,classActiveCode:o=void 0}=e;return No(t,new RegExp(`#?\\s*\\[!code (${Object.keys(r).map(Au).join("|")})(:\\d+)?\\]`,"gi"),function([a,i,s=":1"],l,u,c,d){let g=Number.parseInt(s.slice(1),10);for(let h=d;h<Math.min(d+g,c.length);h++)this.addClassToHast(c[h],r[i]);return n&&this.addClassToHast(this.pre,n),o&&this.addClassToHast(this.code,o),!0},e.matchAlgorithm)}function Iu(e={}){let{classLineAdd:t="diff add",classLineRemove:r="diff remove",classActivePre:n="has-diff",classActiveCode:o}=e;return gt({classMap:{"++":t,"--":r},classActivePre:n,classActiveCode:o,matchAlgorithm:e.matchAlgorithm},"@shikijs/transformers:notation-diff")}function Eu(e={}){let{classMap:t={error:["highlighted","error"],warning:["highlighted","warning"],info:["highlighted","info"]},classActivePre:r="has-highlighted",classActiveCode:n}=e;return gt({classMap:t,classActivePre:r,classActiveCode:n,matchAlgorithm:e.matchAlgorithm},"@shikijs/transformers:notation-error-level")}function Bu(e={}){let{classActiveLine:t="focused",classActivePre:r="has-focused",classActiveCode:n}=e;return gt({classMap:{focus:t},classActivePre:r,classActiveCode:n,matchAlgorithm:e.matchAlgorithm},"@shikijs/transformers:notation-focus")}function Nu(e={}){let{classActiveLine:t="highlighted",classActivePre:r="has-highlighted",classActiveCode:n}=e;return gt({classMap:{highlight:t,hl:t},classActivePre:r,classActiveCode:n,matchAlgorithm:e.matchAlgorithm},"@shikijs/transformers:notation-highlight")}function $u(e,t,r,n){let o=$o(e),a=o.indexOf(r);for(;a!==-1;)Fu.call(this,e.children,t,a,r.length,n),a=o.indexOf(r,a+1)}function $o(e){return e.type==="text"?e.value:e.type==="element"&&e.tagName==="span"?e.children.map($o).join(""):""}function Fu(e,t,r,n,o){let a=0;for(let i=0;i<e.length;i++){let s=e[i];if(s.type!=="element"||s.tagName!=="span"||s===t)continue;let l=s.children[0];if(l.type==="text"){if(Pu([a,a+l.value.length-1],[r,r+n])){let u=Math.max(0,r-a),c=n-Math.max(0,a-r);if(c===0)continue;let d=Lu(s,l,u,c);this.addClassToHast(d[1],o);let g=d.filter(Boolean);e.splice(i,1,...g),i+=g.length-1}a+=l.value.length}}}function Pu(e,t){return e[0]<=t[1]&&e[1]>=t[0]}function Lu(e,t,r,n){let o=t.value,a=i=>Ru(e,{children:[{type:"text",value:i}]});return[r>0?a(o.slice(0,r)):void 0,a(o.slice(r,r+n)),r+n<o.length?a(o.slice(r+n)):void 0]}function Ru(e,t){return{...e,properties:{...e.properties},...t}}var Tu=/\s*\[!code word:((?:\\.|[^:\]])+)(:\d+)?\]/,Mu=/\\(.)/g;function Ou(e={}){let{classActiveWord:t="highlighted-word",classActivePre:r=void 0}=e;return No("@shikijs/transformers:notation-highlight-word",Tu,function([n,o,a],i,s,l,u){let c=a?Number.parseInt(a.slice(1),10):l.length;o=o.replace(Mu,"$1");for(let d=u;d<Math.min(u+c,l.length);d++)$u.call(this,l[d],s,o,t);return r&&this.addClassToHast(this.pre,r),!0},e.matchAlgorithm)}var Du={terminal:"bash",console:"shellsession","shell-session":"shellsession",cmd:"bat",dos:"bat",batch:"bat",dita:"xml",ditamap:"xml",ditaval:"xml",xhtml:"html",svg:"xml",xslt:"xsl",yml:"yaml",conf:"ini",cfg:"ini",env:"properties",dockerfile:"docker",containerfile:"docker","c++":"cpp","c#":"csharp",cs:"csharp",gradle:"groovy",kt:"kotlin",py:"python",rb:"ruby",md:"markdown",terraform:"hcl",tf:"hcl"},er=1e3,un=5e3,cn;function Gu(){return cn??=Ss({themes:[pu,fu],langs:[],engine:uu({forgiving:!0})}),cn}var Pt=new Map,ye=new Set;function ju(e,t){let r=Pt.get(t);return r||(r=mu[t]().then(async n=>{await e.loadLanguage(...n.default);for(let o of e.getLoadedLanguages())ye.add(o)}).catch(n=>{throw Pt.delete(t),n}),Pt.set(t,r)),r}var Lt=new Map;function Uu(e){if(!Lt.has(e)){let t=null;try{t=Eo(e)}catch{t=null}Lt.set(e,t)}return Lt.get(e)}function pt(e,t,r=new Set,n=Hu(t)){if(e==="text"||r.has(e))return r;r.add(e);for(let o of Bo[e]??[])for(let[a,i]of Object.entries(bu[o]))r.has(a)||(!n||i.some(s=>{if(s==="")return!0;let l=Uu(s);return!l||n.some(u=>(l.lastIndex=0,l.test(u)))}))&&pt(a,t,r,n);return r}function Hu(e){if(e!==void 0)return mt(e.replace(/\n$/,""),!1).split(/\r?\n/).filter(t=>t.length<er).map(t=>t+`
|
|
154
|
+
`)}var dn=new Map;function Fo(e){let t=dn.get(e);return t||dn.set(e,t=[...pt(e,void 0)]),t}function Wu(e,t){if(!ye.has(e))return!1;if(!Bo[e]||Fo(e).every(r=>ye.has(r)))return!0;for(let r of pt(e,t))if(!ye.has(r))return!1;return!0}function hn(e){let t=(e??"").toLowerCase().trim();if(pr.has(t))return"text";if(t==="ansi")return"ansi";let r=Du[t]??t;return Object.hasOwn(Jt,r)?r:"text"}var zu=8e6;async function Zu(e={}){let t=await Gu(),r={light:"github-light-default",dark:"github-dark-default"},n=e.onePass===!1?void 0:hu(t,r),o=hn,a=0,i=!0,s=async y=>{let m=new Set;for(let f of y){let w=typeof f=="object"?f:{lang:f,code:void 0},v=hn(w.lang);if(v==="text"||v==="ansi")continue;let x=Fo(v);if(!x.every(_=>ye.has(_)))for(let _ of w.code===void 0||x.length===1?x:pt(v,w.code))ye.has(_)||m.add(Jt[_])}m.size&&await Promise.all([...m].map(f=>ju(t,f)))};e.langs==="all"?await s(Object.keys(Jt)):e.langs&&await s(e.langs);let l=new Map,u=0,c=0,d=0,g=Number.isFinite(e.cacheChars)&&e.cacheChars>=0?e.cacheChars:zu,h=(y,m,f)=>`${m??""}\0${f.lineNumbers?1:0}\0${(f.highlights??[]).join(",")}\0${(f.diffAdd??[]).join(",")}\0${(f.diffRemove??[]).join(",")}\0${y}`,p=(y,m)=>{let f=y.length+m.length;if(f>g/4)return;for(let[v,x]of l){if(u+f<=g)break;l.delete(v),u-=x.key.length+x.html.length}let w={key:gn(y),html:gn(m)};l.set(w.key,w),u+=f},b=(y,m,f={})=>{let w=o(m),v=mt((w==="ansi"?gr(y):y).replace(/\n$/,""),w==="text"||w==="ansi"),x=new Set(f.highlights??[]),_=new Set(f.diffAdd??[]),B=new Set(f.diffRemove??[]),A=f.lineNumbers?" line-numbers":"";if(i=!0,w==="text")return bt(v,f);let U=w==="ansi";if(!U&&!Wu(w,y))return i=!1,a++,bt(v,f);let G=v.includes("[!code"),H=[...G?[Iu(),Nu(),Bu(),Eu(),Ou()]:[],{name:"dogsbay:lines",line($,O){x.has(O)&&this.addClassToHast($,"highlighted"),_.has(O)?this.addClassToHast($,["diff","add"]):B.has(O)&&this.addClassToHast($,["diff","remove"])}}];(f.lineNumbers||_.size||B.size||G)&&H.push(qu(!!f.lineNumbers));try{let $=()=>t.codeToHtml(v,{lang:w,themes:r,defaultColor:!1,tokenizeMaxLineLength:er,tokenizeTimeLimit:un,transformers:H}),O;if(n&&!G&&!U)try{O=n(v,{lang:w,tokenizeMaxLineLength:er,tokenizeTimeLimit:un,transformers:H})}catch{O=void 0}return O??=$(),A?O.replace('<pre class="shiki',`<pre class="shiki${A}`):O}catch{return`<pre class="shiki shiki-plain${A}" tabindex="0"><code>${hr(v)}</code></pre>`}};return{resolve:o,render:b,load:s,cacheStats:()=>({entries:l.size,chars:u,hits:c,misses:d,unloaded:a}),has:(y,m,f={})=>l.has(h(y,m,f)),prime(y,m,f,w){let v=h(y,m,f);l.has(v)||p(v,w)},code(y,m,f={}){let w=h(y,m,f),v=l.get(w);if(v!==void 0)return c++,l.delete(w),l.set(v.key,v),v.html;d++;let x=b(y,m,f);return i&&p(w,x),x}}}var gn=e=>JSON.parse(JSON.stringify(e));function qu(e){return{name:"dogsbay:gutter",code(t){let r=i=>{let s=i.properties?.class;return Array.isArray(s)?s.join(" "):String(s??"")},n=t.children.filter(i=>i.type==="element"&&i.tagName==="span"),o=n.some(i=>/\bdiff\b/.test(r(i)));if(!e&&!o)return;let a=1;for(let i of n){let s=r(i);if(!/\bline\b/.test(s))continue;let l=/\badd\b/.test(s)?"add":/\bremove\b/.test(s)?"remove":"",u=[];e&&u.push(String(a).padStart(3)),o&&u.push(l==="add"?"+":l==="remove"?"\u2212":" "),i.children.unshift({type:"element",tagName:"span",properties:{class:`gutter${l?` ${l}`:""}`,"data-pagefind-ignore":""},children:[{type:"text",value:u.join(" ")}]}),a++}}}}export{zu as DEFAULT_HIGHLIGHT_CACHE_CHARS,Zu as createHighlighter,Po as parseLineRanges};
|