cogpit 3.5.0 → 3.5.2

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.
Files changed (89) hide show
  1. package/dist/cli-runtime.js +42602 -37594
  2. package/dist/instance-worker.js +1189 -153
  3. package/dist/web/assets/AutomationsPanel-B3zT5G5K.js +1 -0
  4. package/dist/web/assets/{CogpitBlock-Ku77iAFz.js → CogpitBlock-d05YgSdQ.js} +12 -12
  5. package/dist/web/assets/CommandPaletteHost-D8fk5Qkq.js +1 -0
  6. package/dist/web/assets/ConfigBrowser-BRsvua8m.js +1 -0
  7. package/dist/web/assets/CrewPanel-C1Yq8jMT.js +1 -0
  8. package/dist/web/assets/HighlightedEditor-clIIwmWB.js +2 -0
  9. package/dist/web/assets/KeyboardShortcutsDialog-0VokzXOy.js +1 -0
  10. package/dist/web/assets/MissionHome-CNjhPZva.js +2 -0
  11. package/dist/web/assets/MobileFileChanges-iLhOAdgx.js +1 -0
  12. package/dist/web/assets/PluginsDialog-xM9uR8bB.js +1 -0
  13. package/dist/web/assets/PreviewPanel-DF4kUYpX.js +1 -0
  14. package/dist/web/assets/ProjectFilesPanel-D9_OzQi2.js +4 -0
  15. package/dist/web/assets/ProjectSwitcherModal-DMEEWm7Q.js +1 -0
  16. package/dist/web/assets/{TerminalOutput-4YZ5J0ny.js → TerminalOutput-CrGF3VWW.js} +3 -3
  17. package/dist/web/assets/ThemeSelectorModal-BLBet6sQ.js +1 -0
  18. package/dist/web/assets/WorkflowsPanel-DkXoYVsK.js +1 -0
  19. package/dist/web/assets/WorktreePanel-DvFGKfAn.js +1 -0
  20. package/dist/web/assets/{bash-Yzrsuije.js → bash-DgJyDXW6.js} +1 -1
  21. package/dist/web/assets/{c-BIGW1oBm.js → c-BG-tZi7o.js} +1 -1
  22. package/dist/web/assets/cpp-BzPMphJ4.js +1 -0
  23. package/dist/web/assets/{css-DPfMkruS.js → css-PZBBrkI0.js} +1 -1
  24. package/dist/web/assets/edition-ui-CvFxsVfJ.js +2 -0
  25. package/dist/web/assets/github-dark-BQV5ugrc.js +1 -0
  26. package/dist/web/assets/github-light-Rcb2q3L5.js +1 -0
  27. package/dist/web/assets/{go-CxLEBnE3.js → go-BBr2UQCn.js} +1 -1
  28. package/dist/web/assets/{html-GMplVEZG.js → html-DOf0XnR2.js} +1 -1
  29. package/dist/web/assets/index-BvNyEUVG.js +506 -0
  30. package/dist/web/assets/index-CAupRX51.js +1 -0
  31. package/dist/web/assets/index-D6HYPdiw.css +1 -0
  32. package/dist/web/assets/{index-BFA_YkUM.js → index-DueGSx7L.js} +4 -4
  33. package/dist/web/assets/index-DxZSG7e3.js +2 -0
  34. package/dist/web/assets/{java-CylS5w8V.js → java-BTDmaRNO.js} +1 -1
  35. package/dist/web/assets/{javascript-wDzz0qaB.js → javascript-WyGyM1wV.js} +1 -1
  36. package/dist/web/assets/{json-Cp-IABpG.js → json-B8JryHcM.js} +1 -1
  37. package/dist/web/assets/{jsx-g9-lgVsj.js → jsx-8cLv2Six.js} +1 -1
  38. package/dist/web/assets/{kotlin-BdnUsdx6.js → kotlin-BQy537ds.js} +1 -1
  39. package/dist/web/assets/{markdown-Cvjx9yec.js → markdown-DX-TNHnc.js} +1 -1
  40. package/dist/web/assets/{php-aq0itWAE.js → php-47JHu45N.js} +1 -1
  41. package/dist/web/assets/{python-B6aJPvgy.js → python-B6Ihcp-E.js} +1 -1
  42. package/dist/web/assets/render.worker-DW0Lo4fc.js +154 -0
  43. package/dist/web/assets/ruby-BrGyNOch.js +1 -0
  44. package/dist/web/assets/{rust-B1yitclQ.js → rust-CxuBE0J8.js} +1 -1
  45. package/dist/web/assets/{scss-OYdSNvt2.js → scss-DxBkwadj.js} +1 -1
  46. package/dist/web/assets/session-parser.worker-Dv5Kch9n.js +41 -0
  47. package/dist/web/assets/{sql-BLtJtn59.js → sql-BbONfI8K.js} +1 -1
  48. package/dist/web/assets/svelte-H3swLp47.js +1 -0
  49. package/dist/web/assets/{swift-D82vCrfD.js → swift-tEesUtni.js} +1 -1
  50. package/dist/web/assets/switch-BHG6oFbM.js +1 -0
  51. package/dist/web/assets/{toml-vGWfd6FD.js → toml-Ms459DBw.js} +1 -1
  52. package/dist/web/assets/{tsx-COt5Ahok.js → tsx-D6116Ycy.js} +1 -1
  53. package/dist/web/assets/{typescript-BPQ3VLAy.js → typescript-BqvgUolh.js} +1 -1
  54. package/dist/web/assets/vendor-markdown-BEJ8yVzA.js +29 -0
  55. package/dist/web/assets/{vendor-ui-DkzcTXCS.js → vendor-ui-keo4oB2X.js} +226 -191
  56. package/dist/web/assets/vue-CWSgrUPf.js +1 -0
  57. package/dist/web/assets/{xml-D2mA2LmW.js → xml-CdYS3kUe.js} +1 -1
  58. package/dist/web/assets/{yaml-Buea-lGh.js → yaml-Bopit2L3.js} +1 -1
  59. package/dist/web/index.html +4 -5
  60. package/package.json +1 -1
  61. package/dist/web/assets/CommandPaletteHost-CjZO-FyZ.js +0 -1
  62. package/dist/web/assets/ConfigBrowser-B6jQRpcW.js +0 -1
  63. package/dist/web/assets/CrewPanel-DvHboAAW.js +0 -1
  64. package/dist/web/assets/HighlightedEditor-5NbcDE8n.js +0 -2
  65. package/dist/web/assets/KeyboardShortcutsDialog-yO3h4xr-.js +0 -1
  66. package/dist/web/assets/MissionHome-CZpQbWs3.js +0 -2
  67. package/dist/web/assets/MobileFileChanges-DERAdWVc.js +0 -1
  68. package/dist/web/assets/PluginsDialog-DusZU8fA.js +0 -1
  69. package/dist/web/assets/PreviewPanel-BpCD0UAz.js +0 -1
  70. package/dist/web/assets/ProjectFilesPanel-CPHWyVwU.js +0 -4
  71. package/dist/web/assets/ProjectSwitcherModal-BmYW6es0.js +0 -1
  72. package/dist/web/assets/ThemeSelectorModal-CHFAl7zz.js +0 -1
  73. package/dist/web/assets/WorkflowsPanel-B6whBEyJ.js +0 -1
  74. package/dist/web/assets/WorktreePanel-ASvzuwqm.js +0 -1
  75. package/dist/web/assets/cpp-BRuaLJcg.js +0 -1
  76. package/dist/web/assets/edition-ui-DZ5m565z.js +0 -2
  77. package/dist/web/assets/github-dark-DHJKELXO.js +0 -1
  78. package/dist/web/assets/github-light-DAi9KRSo.js +0 -1
  79. package/dist/web/assets/index-C9bzBC6T.js +0 -2
  80. package/dist/web/assets/index-D262IRnL.js +0 -1
  81. package/dist/web/assets/index-hGMtuUNI.css +0 -1
  82. package/dist/web/assets/index-yM7CTfeg.js +0 -498
  83. package/dist/web/assets/ruby-B0Tyh1qT.js +0 -1
  84. package/dist/web/assets/session-parser.worker-3tFlB6dy.js +0 -31
  85. package/dist/web/assets/svelte-DZMnMd3x.js +0 -1
  86. package/dist/web/assets/switch-BBkU1zqg.js +0 -1
  87. package/dist/web/assets/vendor-markdown-BE1gYnO9.js +0 -37
  88. package/dist/web/assets/vendor-shiki-DOn6sF-i.js +0 -144
  89. package/dist/web/assets/vue-DVfSmUF7.js +0 -1
@@ -0,0 +1,154 @@
1
+ var ws=Object.defineProperty;var bs=Object.getPrototypeOf;var Cs=Reflect.get;var bn=t=>{throw TypeError(t)};var _s=(t,e,n)=>e in t?ws(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var g=(t,e,n)=>_s(t,typeof e!="symbol"?e+"":e,n),Ct=(t,e,n)=>e.has(t)||bn("Cannot "+n);var B=(t,e,n)=>(Ct(t,e,"read from private field"),n?n.call(t):e.get(t)),he=(t,e,n)=>e.has(t)?bn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),V=(t,e,n,r)=>(Ct(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),_t=(t,e,n)=>(Ct(t,e,"access private method"),n);var Cn=(t,e,n)=>Cs(bs(t),n,e);function _n(t){if(!t)return[];const e=t.split(`
2
+ `);return t.endsWith(`
3
+ `)&&e.pop(),e}const Ss=25e4;function*ks(t,e){const n=_n(t),r=_n(e),s=n.length,o=r.length;let i=0;for(;i<s&&i<o&&n[i]===r[i];)i++,i%2048===0&&(yield);let a=0;for(;a<s-i&&a<o-i&&n[s-1-a]===r[o-1-a];)a++,a%2048===0&&(yield);const l=s-i-a,c=o-i-a,h=[];for(let u=0;u<i;u++)u%2048===0&&(yield),h.push({type:"unchanged",text:n[u],oldIdx:u,newIdx:u});if(!(l===0&&c===0))if(l===0)for(let u=0;u<c;u++)u%2048===0&&(yield),h.push({type:"added",text:r[i+u],newIdx:i+u});else if(c===0)for(let u=0;u<l;u++)u%2048===0&&(yield),h.push({type:"removed",text:n[i+u],oldIdx:i+u});else if(l*c>Ss){for(let u=0;u<l;u++)u%2048===0&&(yield),h.push({type:"removed",text:n[i+u],oldIdx:i+u});for(let u=0;u<c;u++)u%2048===0&&(yield),h.push({type:"added",text:r[i+u],newIdx:i+u})}else{const u=c+1,f=new Int32Array((l+1)*u);for(let b=1;b<=l;b++){b%16===0&&(yield);const C=n[i+b-1],S=b*u,w=S-u;for(let _=1;_<=c;_++)if(C===r[i+_-1])f[S+_]=f[w+_-1]+1;else{const x=f[w+_],E=f[S+_-1];f[S+_]=x>E?x:E}}const d=[];let p=l,m=c;for(;p>0||m>0;)(p+m)%2048===0&&(yield),p>0&&m>0&&n[i+p-1]===r[i+m-1]?(d.push({type:"unchanged",text:n[i+p-1],oldIdx:i+p-1,newIdx:i+m-1}),p--,m--):m>0&&(p===0||f[p*u+m-1]>=f[(p-1)*u+m])?(d.push({type:"added",text:r[i+m-1],newIdx:i+m-1}),m--):(d.push({type:"removed",text:n[i+p-1],oldIdx:i+p-1}),p--);d.reverse();for(let b=0;b<d.length;b++)b%2048===0&&(yield),h.push(d[b])}for(let u=0;u<a;u++){u%2048===0&&(yield);const f=s-a+u,d=o-a+u;h.push({type:"unchanged",text:n[f],oldIdx:f,newIdx:d})}return h}function xs(t,e){const n=ks(t,e);let r=n.next();for(;!r.done;)r=n.next();return r.value}let L=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function vs(t){return nn(t)}function nn(t){return Array.isArray(t)?As(t):t instanceof RegExp?t:typeof t=="object"?Es(t):t}function As(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=nn(t[n]);return e}function Es(t){let e={};for(let n in t)e[n]=nn(t[n]);return e}function hr(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function fr(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?fr(t.substring(0,t.length-1)):t.substr(~e+1)}var St=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,qe=class{static hasCaptures(t){return t===null?!1:(St.lastIndex=0,St.test(t))}static replaceCaptures(t,e,n){return t.replace(St,(r,s,o,i)=>{let a=n[parseInt(s||o,10)];if(a){let l=e.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(i){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function pr(t,e){return t<e?-1:t>e?1:0}function dr(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let s=0;s<n;s++){let o=pr(t[s],e[s]);if(o!==0)return o}return 0}return n-r}function Sn(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function gr(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var mr=class{constructor(t){g(this,"cache",new Map);this.fn=t}get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},nt=class{constructor(t,e,n){g(this,"_cachedMatchRoot",new mr(t=>this._root.match(t)));this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Ns(t),e)}static createFromParsedTheme(t,e){return Ps(t,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(s=>Is(t.parent,s.parentScopes));return r?new yr(r.fontStyle,r.foreground,r.background):null}},kt=class Je{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new Je(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new Je(n,e[r]);return n}push(e){return new Je(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function Is(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],s=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],s=!0}for(;t&&!Rs(t.scopeName,r);){if(s)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Rs(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var yr=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Ns(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let s=0,o=e.length;s<o;s++){let i=e[s];if(!i.settings)continue;let a;if(typeof i.scope=="string"){let u=i.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),a=u.split(",")}else Array.isArray(i.scope)?a=i.scope:a=[""];let l=-1;if(typeof i.settings.fontStyle=="string"){l=0;let u=i.settings.fontStyle.split(" ");for(let f=0,d=u.length;f<d;f++)switch(u[f]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let c=null;typeof i.settings.foreground=="string"&&Sn(i.settings.foreground)&&(c=i.settings.foreground);let h=null;typeof i.settings.background=="string"&&Sn(i.settings.background)&&(h=i.settings.background);for(let u=0,f=a.length;u<f;u++){let p=a[u].trim().split(" "),m=p[p.length-1],b=null;p.length>1&&(b=p.slice(0,p.length-1),b.reverse()),n[r++]=new $s(m,b,s,l,c,h)}}return n}var $s=class{constructor(t,e,n,r,s,o){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=s,this.background=o}},O=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(O||{});function Ps(t,e){t.sort((l,c)=>{let h=pr(l.scope,c.scope);return h!==0||(h=dr(l.parentScopes,c.parentScopes),h!==0)?h:l.index-c.index});let n=0,r="#000000",s="#ffffff";for(;t.length>=1&&t[0].scope==="";){let l=t.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(s=l.background)}let o=new Ls(e),i=new yr(n,o.getId(r),o.getId(s)),a=new Ms(new Dt(0,null,-1,0,0),[]);for(let l=0,c=t.length;l<c;l++){let h=t[l];a.insert(0,h.scope,h.parentScopes,h.fontStyle,o.getId(h.foreground),o.getId(h.background))}return new nt(o,i,a)}var Ls=class{constructor(t){g(this,"_isFrozen");g(this,"_lastColorId");g(this,"_id2color");g(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Ts=Object.freeze([]),Dt=class wr{constructor(e,n,r,s,o){g(this,"scopeDepth");g(this,"parentScopes");g(this,"fontStyle");g(this,"foreground");g(this,"background");this.scopeDepth=e,this.parentScopes=n||Ts,this.fontStyle=r,this.foreground=s,this.background=o}clone(){return new wr(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,s=e.length;r<s;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,s){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},Ms=class Bt{constructor(e,n=[],r={}){g(this,"_rulesWithParentScopes");this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,s=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=n.parentScopes.length);){const o=n.parentScopes[s].length-e.parentScopes[r].length;if(o!==0)return o;r++,s++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,o;if(r===-1?(s=e,o=""):(s=e.substring(0,r),o=e.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Bt._cmpBySpecificity),n}insert(e,n,r,s,o,i){if(n===""){this._doInsertHere(e,r,s,o,i);return}let a=n.indexOf("."),l,c;a===-1?(l=n,c=""):(l=n.substring(0,a),c=n.substring(a+1));let h;this._children.hasOwnProperty(l)?h=this._children[l]:(h=new Bt(this._mainRule.clone(),Dt.cloneArr(this._rulesWithParentScopes)),this._children[l]=h),h.insert(e+1,c,r,s,o,i)}_doInsertHere(e,n,r,s,o){if(n===null){this._mainRule.acceptOverwrite(e,r,s,o);return}for(let i=0,a=this._rulesWithParentScopes.length;i<a;i++){let l=this._rulesWithParentScopes[i];if(dr(l.parentScopes,n)===0){l.acceptOverwrite(e,r,s,o);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new Dt(e,n,r,s,o))}},Ie=class z{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=z.getLanguageId(e),r=z.getTokenType(e),s=z.getFontStyle(e),o=z.getForeground(e),i=z.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:o,background:i})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,s,o,i,a){let l=z.getLanguageId(e),c=z.getTokenType(e),h=z.containsBalancedBrackets(e)?1:0,u=z.getFontStyle(e),f=z.getForeground(e),d=z.getBackground(e);return n!==0&&(l=n),r!==8&&(c=r),s!==null&&(h=s?1:0),o!==-1&&(u=o),i!==0&&(f=i),a!==0&&(d=a),(l<<0|c<<8|h<<10|u<<11|f<<15|d<<24)>>>0}};function rt(t,e){const n=[],r=Os(t);let s=r.next();for(;s!==null;){let l=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let c=i();if(n.push({matcher:c,priority:l}),s!==",")break;s=r.next()}return n;function o(){if(s==="-"){s=r.next();const l=o();return c=>!!l&&!l(c)}if(s==="("){s=r.next();const l=a();return s===")"&&(s=r.next()),l}if(kn(s)){const l=[];do l.push(s),s=r.next();while(kn(s));return c=>e(l,c)}return null}function i(){const l=[];let c=o();for(;c;)l.push(c),c=o();return h=>l.every(u=>u(h))}function a(){const l=[];let c=i();for(;c&&(l.push(c),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");c=i()}return h=>l.some(u=>u(h))}}function kn(t){return!!t&&!!t.match(/[\w\.:]+/)}function Os(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function br(t){typeof t.dispose=="function"&&t.dispose()}var Ge=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},Gs=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ds=class{constructor(){g(this,"_references",[]);g(this,"_seenReferenceKeys",new Set);g(this,"visitedRule",new Set)}get references(){return this._references}add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Bs=class{constructor(t,e){g(this,"seenFullScopeRequests",new Set);g(this,"seenPartialScopeRequests",new Set);g(this,"Q");this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ge(this.initialScopeName)]}processQueue(){const t=this.Q;this.Q=[];const e=new Ds;for(const n of t)Fs(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof Ge){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Fs(t,e,n,r){const s=n.lookup(t.scopeName);if(!s){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const o=n.lookup(e);t instanceof Ge?et({baseGrammar:o,selfGrammar:s},r):Ft(t.ruleName,{baseGrammar:o,selfGrammar:s,repository:s.repository},r);const i=n.injections(t.scopeName);if(i)for(const a of i)r.add(new Ge(a))}function Ft(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];st([r],e,n)}}function et(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&st(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&st(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function st(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?hr({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&st(r.patterns,{...e,repository:s},n);const o=r.include;if(!o)continue;const i=Cr(o);switch(i.kind){case 0:et({...e,selfGrammar:e.baseGrammar},n);break;case 1:et(e,n);break;case 2:Ft(i.ruleName,{...e,repository:s},n);break;case 3:case 4:const a=i.scopeName===e.selfGrammar.scopeName?e.selfGrammar:i.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){const l={baseGrammar:e.baseGrammar,selfGrammar:a,repository:s};i.kind===4?Ft(i.ruleName,l,n):et(l,n)}else i.kind===4?n.add(new Gs(i.scopeName,i.ruleName)):n.add(new Ge(i.scopeName));break}}}var Us=class{constructor(){g(this,"kind",0)}},js=class{constructor(){g(this,"kind",1)}},zs=class{constructor(t){g(this,"kind",2);this.ruleName=t}},Ws=class{constructor(t){g(this,"kind",3);this.scopeName=t}},Hs=class{constructor(t,e){g(this,"kind",4);this.scopeName=t,this.ruleName=e}};function Cr(t){if(t==="$base")return new Us;if(t==="$self")return new js;const e=t.indexOf("#");if(e===-1)return new Ws(t);if(e===0)return new zs(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new Hs(n,r)}}var qs=/\\(\d+)/,xn=/\\(\d+)/g,Vs=-1,_r=-2;var ze=class{constructor(t,e,n,r){g(this,"$location");g(this,"id");g(this,"_nameIsCapturing");g(this,"_name");g(this,"_contentNameIsCapturing");g(this,"_contentName");this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=qe.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=qe.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${fr(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:qe.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:qe.replaceCaptures(this._contentName,t,e)}},Xs=class extends ze{constructor(e,n,r,s,o){super(e,n,r,s);g(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,n){throw new Error("Not supported!")}compile(e,n){throw new Error("Not supported!")}compileAG(e,n,r,s){throw new Error("Not supported!")}},Ks=class extends ze{constructor(e,n,r,s,o){super(e,n,r,null);g(this,"_match");g(this,"captures");g(this,"_cachedCompiledPatterns");this._match=new De(s,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,n){n.push(this._match)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Be,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},vn=class extends ze{constructor(e,n,r,s,o){super(e,n,r,s);g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,n){for(const r of this.patterns)e.getRule(r).collectPatterns(e,n)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Be,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ut=class extends ze{constructor(e,n,r,s,o,i,a,l,c,h){super(e,n,r,s);g(this,"_begin");g(this,"beginCaptures");g(this,"_end");g(this,"endHasBackReferences");g(this,"endCaptures");g(this,"applyEndPatternLast");g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");this._begin=new De(o,this.id),this.beginCaptures=i,this._end=new De(a||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=c||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.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,n){return this._end.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e,n).compile(e)}compileAG(e,n,r,s){return this._getCachedCompiledPatterns(e,n).compileAG(e,r,s)}_getCachedCompiledPatterns(e,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Be;for(const 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,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}},ot=class extends ze{constructor(e,n,r,s,o,i,a,l,c){super(e,n,r,s);g(this,"_begin");g(this,"beginCaptures");g(this,"whileCaptures");g(this,"_while");g(this,"whileHasBackReferences");g(this,"hasMissingPatterns");g(this,"patterns");g(this,"_cachedCompiledPatterns");g(this,"_cachedCompiledWhilePatterns");this._begin=new De(o,this.id),this.beginCaptures=i,this.whileCaptures=l,this._while=new De(a,_r),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.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,n){return this._while.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,r,s){return this._getCachedCompiledPatterns(e).compileAG(e,r,s)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Be;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,n){return this._getCachedCompiledWhilePatterns(e,n).compile(e)}compileWhileAG(e,n,r,s){return this._getCachedCompiledWhilePatterns(e,n).compileAG(e,r,s)}_getCachedCompiledWhilePatterns(e,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Be,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"￿"),this._cachedCompiledWhilePatterns}},Sr=class M{static createCaptureRule(e,n,r,s,o){return e.registerRule(i=>new Xs(n,i,r,s,o))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(s=>{if(e.id=s,e.match)return new Ks(e.$vscodeTextmateLocation,e.id,e.name,e.match,M._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=hr({},r,e.repository));let o=e.patterns;return typeof o>"u"&&e.include&&(o=[{include:e.include}]),new vn(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,M._compilePatterns(o,n,r))}return e.while?new ot(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,M._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,M._compileCaptures(e.whileCaptures||e.captures,n,r),M._compilePatterns(e.patterns,n,r)):new Ut(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,M._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,M._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,M._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let s=[];if(e){let o=0;for(const i in e){if(i==="$vscodeTextmateLocation")continue;const a=parseInt(i,10);a>o&&(o=a)}for(let i=0;i<=o;i++)s[i]=null;for(const i in e){if(i==="$vscodeTextmateLocation")continue;const a=parseInt(i,10);let l=0;e[i].patterns&&(l=M.getCompiledRuleId(e[i],n,r)),s[a]=M.createCaptureRule(n,e[i].$vscodeTextmateLocation,e[i].name,e[i].contentName,l)}}return s}static _compilePatterns(e,n,r){let s=[];if(e)for(let o=0,i=e.length;o<i;o++){const a=e[o];let l=-1;if(a.include){const c=Cr(a.include);switch(c.kind){case 0:case 1:l=M.getCompiledRuleId(r[a.include],n,r);break;case 2:let h=r[c.ruleName];h&&(l=M.getCompiledRuleId(h,n,r));break;case 3:case 4:const u=c.scopeName,f=c.kind===4?c.ruleName:null,d=n.getExternalGrammar(u,r);if(d)if(f){let p=d.repository[f];p&&(l=M.getCompiledRuleId(p,n,d.repository))}else l=M.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else l=M.getCompiledRuleId(a,n,r);if(l!==-1){const c=n.getRule(l);let h=!1;if((c instanceof vn||c instanceof Ut||c instanceof ot)&&c.hasMissingPatterns&&c.patterns.length===0&&(h=!0),h)continue;s.push(l)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},De=class kr{constructor(e,n){g(this,"source");g(this,"ruleId");g(this,"hasAnchor");g(this,"hasBackReferences");g(this,"_anchorCache");if(e&&typeof e=="string"){const r=e.length;let s=0,o=[],i=!1;for(let a=0;a<r;a++)if(e.charAt(a)==="\\"&&a+1<r){const c=e.charAt(a+1);c==="z"?(o.push(e.substring(s,a)),o.push("$(?!\\n)(?<!\\n)"),s=a+2):(c==="A"||c==="G")&&(i=!0),a++}this.hasAnchor=i,s===0?this.source=e:(o.push(e.substring(s,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=qs.test(this.source):this.hasBackReferences=!1}clone(){return new kr(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(s=>e.substring(s.start,s.end));return xn.lastIndex=0,this.source.replace(xn,(s,o)=>gr(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],s=[],o,i,a,l;for(o=0,i=this.source.length;o<i;o++)a=this.source.charAt(o),e[o]=a,n[o]=a,r[o]=a,s[o]=a,a==="\\"&&o+1<i&&(l=this.source.charAt(o+1),l==="A"?(e[o+1]="￿",n[o+1]="￿",r[o+1]="A",s[o+1]="A"):l==="G"?(e[o+1]="￿",n[o+1]="G",r[o+1]="￿",s[o+1]="G"):(e[o+1]=l,n[o+1]=l,r[o+1]=l,s[o+1]=l),o++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Be=class{constructor(){g(this,"_items");g(this,"_hasAnchors");g(this,"_cached");g(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new An(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(s=>s.resolveAnchors(e,n));return new An(t,r,this._items.map(s=>s.ruleId))}},An=class{constructor(t,e,n){g(this,"scanner");this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
4
+ `)}findNextMatchSync(t,e,n){const r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},xt=class{constructor(t,e){this.languageId=t,this.tokenType=e}},ne,Qs=(ne=class{constructor(e,n){g(this,"_defaultAttributes");g(this,"_embeddedLanguagesMatcher");g(this,"_getBasicScopeAttributes",new mr(e=>{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new xt(n,r)}));this._defaultAttributes=new xt(e,8),this._embeddedLanguagesMatcher=new Zs(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?ne._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(ne.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},g(ne,"_NULL_SCOPE_METADATA",new xt(0,0)),g(ne,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),ne),Zs=class{constructor(t){g(this,"values");g(this,"scopesRegExp");if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>gr(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},En=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function xr(t,e,n,r,s,o,i,a){const l=e.content.length;let c=!1,h=-1;if(i){const d=Ys(t,e,n,r,s,o);s=d.stack,r=d.linePos,n=d.isFirstLine,h=d.anchorPosition}const u=Date.now();for(;!c;){if(a!==0&&Date.now()-u>a)return new En(s,!0);f()}return new En(s,!1);function f(){const d=Js(t,e,n,r,s,h);if(!d){o.produce(s,l),c=!0;return}const p=d.captureIndices,m=d.matchedRuleId,b=p&&p.length>0?p[0].end>r:!1;if(m===Vs){const C=s.getRule(t);o.produce(s,p[0].start),s=s.withContentNameScopesList(s.nameScopesList),Te(t,e,n,s,o,C.endCaptures,p),o.produce(s,p[0].end);const S=s;if(s=s.parent,h=S.getAnchorPos(),!b&&S.getEnterPos()===r){s=S,o.produce(s,l),c=!0;return}}else{const C=t.getRule(m);o.produce(s,p[0].start);const S=s,w=C.getName(e.content,p),_=s.contentNameScopesList.pushAttributed(w,t);if(s=s.push(m,r,h,p[0].end===l,null,_,_),C instanceof Ut){const x=C;Te(t,e,n,s,o,x.beginCaptures,p),o.produce(s,p[0].end),h=p[0].end;const E=x.getContentName(e.content,p),A=_.pushAttributed(E,t);if(s=s.withContentNameScopesList(A),x.endHasBackReferences&&(s=s.withEndRule(x.getEndWithResolvedBackReferences(e.content,p))),!b&&S.hasSameRuleAs(s)){s=s.pop(),o.produce(s,l),c=!0;return}}else if(C instanceof ot){const x=C;Te(t,e,n,s,o,x.beginCaptures,p),o.produce(s,p[0].end),h=p[0].end;const E=x.getContentName(e.content,p),A=_.pushAttributed(E,t);if(s=s.withContentNameScopesList(A),x.whileHasBackReferences&&(s=s.withEndRule(x.getWhileWithResolvedBackReferences(e.content,p))),!b&&S.hasSameRuleAs(s)){s=s.pop(),o.produce(s,l),c=!0;return}}else if(Te(t,e,n,s,o,C.captures,p),o.produce(s,p[0].end),s=s.pop(),!b){s=s.safePop(),o.produce(s,l),c=!0;return}}p[0].end>r&&(r=p[0].end,n=!1)}}function Ys(t,e,n,r,s,o){let i=s.beginRuleCapturedEOL?0:-1;const a=[];for(let l=s;l;l=l.pop()){const c=l.getRule(t);c instanceof ot&&a.push({rule:c,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:c,findOptions:h}=no(l.rule,t,l.stack.endRule,n,r===i),u=c.findNextMatchSync(e,r,h);if(u){if(u.ruleId!==_r){s=l.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(o.produce(l.stack,u.captureIndices[0].start),Te(t,e,n,l.stack,o,l.rule.whileCaptures,u.captureIndices),o.produce(l.stack,u.captureIndices[0].end),i=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{s=l.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:i,isFirstLine:n}}function Js(t,e,n,r,s,o){const i=eo(t,e,n,r,s,o),a=t.getInjections();if(a.length===0)return i;const l=to(a,t,e,n,r,s,o);if(!l)return i;if(!i)return l;const c=i.captureIndices[0].start,h=l.captureIndices[0].start;return h<c||l.priorityMatch&&h===c?l:i}function eo(t,e,n,r,s,o){const i=s.getRule(t),{ruleScanner:a,findOptions:l}=vr(i,t,s.endRule,n,r===o),c=a.findNextMatchSync(e,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function to(t,e,n,r,s,o,i){let a=Number.MAX_VALUE,l=null,c,h=0;const u=o.contentNameScopesList.getScopeNames();for(let f=0,d=t.length;f<d;f++){const p=t[f];if(!p.matcher(u))continue;const m=e.getRule(p.ruleId),{ruleScanner:b,findOptions:C}=vr(m,e,null,r,s===i),S=b.findNextMatchSync(n,s,C);if(!S)continue;const w=S.captureIndices[0].start;if(!(w>=a)&&(a=w,l=S.captureIndices,c=S.ruleId,h=p.priority,a===s))break}return l?{priorityMatch:h===-1,captureIndices:l,matchedRuleId:c}:null}function vr(t,e,n,r,s){return{ruleScanner:t.compileAG(e,n,r,s),findOptions:0}}function no(t,e,n,r,s){return{ruleScanner:t.compileWhileAG(e,n,r,s),findOptions:0}}function Te(t,e,n,r,s,o,i){if(o.length===0)return;const a=e.content,l=Math.min(o.length,i.length),c=[],h=i[0].end;for(let u=0;u<l;u++){const f=o[u];if(f===null)continue;const d=i[u];if(d.length===0)continue;if(d.start>h)break;for(;c.length>0&&c[c.length-1].endPos<=d.start;)s.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?s.produceFromScopes(c[c.length-1].scopes,d.start):s.produce(r,d.start),f.retokenizeCapturedWithRuleId){const m=f.getName(a,i),b=r.contentNameScopesList.pushAttributed(m,t),C=f.getContentName(a,i),S=b.pushAttributed(C,t),w=r.push(f.retokenizeCapturedWithRuleId,d.start,-1,!1,null,b,S),_=t.createOnigString(a.substring(0,d.end));xr(t,_,n&&d.start===0,d.start,w,s,!1,0),br(_);continue}const p=f.getName(a,i);if(p!==null){const b=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(p,t);c.push(new ro(b,d.end))}}for(;c.length>0;)s.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var ro=class{constructor(t,e){g(this,"scopes");g(this,"endPos");this.scopes=t,this.endPos=e}};function so(t,e,n,r,s,o,i,a){return new io(t,e,n,r,s,o,i,a)}function In(t,e,n,r,s){const o=rt(e,it),i=Sr.getCompiledRuleId(n,r,s.repository);for(const a of o)t.push({debugSelector:e,matcher:a.matcher,ruleId:i,grammar:s,priority:a.priority})}function it(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let s=n;s<e.length;s++)if(oo(e[s],r))return n=s+1,!0;return!1})}function oo(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var io=class{constructor(t,e,n,r,s,o,i,a){g(this,"_rootId");g(this,"_lastRuleId");g(this,"_ruleId2desc");g(this,"_includedGrammars");g(this,"_grammarRepository");g(this,"_grammar");g(this,"_injections");g(this,"_basicScopeAttributesProvider");g(this,"_tokenTypeMatchers");if(this._rootScopeName=t,this.balancedBracketSelectors=o,this._onigLib=a,this._basicScopeAttributesProvider=new Qs(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=Rn(e,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const l of Object.keys(s)){const c=rt(l,it);for(const h of c)this._tokenTypeMatchers.push({matcher:h.matcher,type:s[l]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const s=r.injections;if(s)for(let i in s)In(e,i,s[i],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(i=>{const a=this.getExternalGrammar(i);if(a){const l=a.injectionSelector;l&&In(e,l,a,this,a)}})}return e.sort((s,o)=>s.priority-o.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=Rn(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=Sr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!e||e===jt.NULL){s=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),h=this.themeProvider.getDefaults(),u=Ie.set(0,c.languageId,c.tokenType,null,h.fontStyle,h.foregroundId,h.backgroundId),f=this.getRule(this._rootId).getName(null,null);let d;f?d=Me.createRootAndLookUpScopeName(f,u,this):d=Me.createRoot("unknown",u),e=new jt(null,this._rootId,-1,-1,!1,null,d,d)}else s=!1,e.reset();t=t+`
5
+ `;const o=this.createOnigString(t),i=o.content.length,a=new lo(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),l=xr(this,o,s,0,e,a,!0,r);return br(o),{lineLength:i,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Rn(t,e){return t=vs(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var Me=class Z{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,s=(e==null?void 0:e.scopePath)??null;for(const o of n)s=kt.push(s,o.scopeNames),r=new Z(r,s,o.encodedTokenAttributes);return r}static createRoot(e,n){return new Z(null,new kt(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const s=r.getMetadataForScope(e),o=new kt(null,e),i=r.themeProvider.themeMatch(o),a=Z.mergeAttributes(n,s,i);return new Z(null,o,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return Z.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let s=-1,o=0,i=0;return r!==null&&(s=r.fontStyle,o=r.foregroundId,i=r.backgroundId),Ie.set(e,n.languageId,n.tokenType,null,s,o,i)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return Z._pushAttributed(this,e,n);const r=e.split(/ /g);let s=this;for(const o of r)s=Z._pushAttributed(s,o,n);return s}static _pushAttributed(e,n,r){const s=r.getMetadataForScope(n),o=e.scopePath.push(n),i=r.themeProvider.themeMatch(o),a=Z.mergeAttributes(e.tokenAttributes,s,i);return new Z(e,o,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var s;const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((s=r.parent)==null?void 0:s.scopePath)??null)}),r=r.parent;return r===e?n.reverse():void 0}},W,jt=(W=class{constructor(e,n,r,s,o,i,a,l){g(this,"_stackElementBrand");g(this,"_enterPos");g(this,"_anchorPos");g(this,"depth");this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=i,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}equals(e){return e===null?!1:W._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?Me.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){W._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,s,o,i,a){return new W(this,e,n,r,s,o,i,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){var r,s;return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(s=this.contentNameScopesList)==null?void 0:s.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new W(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var e,n,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,n){const r=Me.fromExtension((e==null?void 0:e.nameScopesList)??null,n.nameScopesList);return new W(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Me.fromExtension(r,n.contentNameScopesList))}},g(W,"NULL",new W(null,0,0,0,!1,null,null,null)),W),ao=class{constructor(t,e){g(this,"balancedBracketScopes");g(this,"unbalancedBracketScopes");g(this,"allowAny",!1);this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):rt(n,it).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>rt(n,it).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},lo=class{constructor(t,e,n,r){g(this,"_emitBinaryTokens");g(this,"_lineText");g(this,"_tokens");g(this,"_binaryTokens");g(this,"_lastTokenEndIndex");g(this,"_tokenTypeOverrides");this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){var r;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let s=(t==null?void 0:t.tokenAttributes)??0,o=!1;if((r=this.balancedBracketSelectors)!=null&&r.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=(t==null?void 0:t.getScopeNames())??[];for(const a of this._tokenTypeOverrides)a.matcher(i)&&(s=Ie.set(s,0,a.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(i))}if(o&&(s=Ie.set(s,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=e;return}const n=(t==null?void 0:t.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)n[r]=this._binaryTokens[r];return n}},co=class{constructor(t,e){g(this,"_grammars",new Map);g(this,"_rawGrammars",new Map);g(this,"_injectionGrammars",new Map);g(this,"_theme");this._onigLib=e,this._theme=t}dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,r,s){if(!this._grammars.has(t)){let o=this._rawGrammars.get(t);if(!o)return null;this._grammars.set(t,so(t,o,e,n,r,s,this,this._onigLib))}return this._grammars.get(t)}},uo=class{constructor(e){g(this,"_options");g(this,"_syncRegistry");g(this,"_ensureGrammarCache");this._options=e,this._syncRegistry=new co(nt.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(nt.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,r){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,n,r){return this._loadGrammar(e,n,r.embeddedLanguages,r.tokenTypes,new ao(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,r,s,o){const i=new Bs(this._syncRegistry,e);for(;i.Q.length>0;)i.Q.map(a=>this._loadSingleGrammar(a.scopeName)),i.processQueue();return this._grammarForScopeName(e,n,r,s,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(e,n=[],r=0,s=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,r,s)}_grammarForScopeName(e,n=0,r=null,s=null,o=null){return this._syncRegistry.grammarForScopeName(e,n,r,s,o)}},zt=jt.NULL;const ho=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class We{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}We.prototype.normal={};We.prototype.property={};We.prototype.space=void 0;function Ar(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new We(n,r,e)}function Wt(t){return t.toLowerCase()}class F{constructor(e,n){this.attribute=n,this.property=e}}F.prototype.attribute="";F.prototype.booleanish=!1;F.prototype.boolean=!1;F.prototype.commaOrSpaceSeparated=!1;F.prototype.commaSeparated=!1;F.prototype.defined=!1;F.prototype.mustUseProperty=!1;F.prototype.number=!1;F.prototype.overloadedBoolean=!1;F.prototype.property="";F.prototype.spaceSeparated=!1;F.prototype.space=void 0;let fo=0;const k=Ce(),N=Ce(),Ht=Ce(),y=Ce(),I=Ce(),we=Ce(),U=Ce();function Ce(){return 2**++fo}var qt=Object.freeze({__proto__:null,boolean:k,booleanish:N,commaOrSpaceSeparated:U,commaSeparated:we,number:y,overloadedBoolean:Ht,spaceSeparated:I});const vt=Object.keys(qt);class rn extends F{constructor(e,n,r,s){let o=-1;if(super(e,n),Nn(this,"space",s),typeof r=="number")for(;++o<vt.length;){const i=vt[o];Nn(this,vt[o],(r&qt[i])===qt[i])}}}rn.prototype.defined=!0;function Nn(t,e,n){n&&(t[e]=n)}function Re(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const o=new rn(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),e[r]=o,n[Wt(r)]=r,n[Wt(o.attribute)]=r}return new We(e,n,t.space)}const Er=Re({properties:{ariaActiveDescendant:null,ariaAtomic:N,ariaAutoComplete:null,ariaBusy:N,ariaChecked:N,ariaColCount:y,ariaColIndex:y,ariaColSpan:y,ariaControls:I,ariaCurrent:null,ariaDescribedBy:I,ariaDetails:null,ariaDisabled:N,ariaDropEffect:I,ariaErrorMessage:null,ariaExpanded:N,ariaFlowTo:I,ariaGrabbed:N,ariaHasPopup:null,ariaHidden:N,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:I,ariaLevel:y,ariaLive:null,ariaModal:N,ariaMultiLine:N,ariaMultiSelectable:N,ariaOrientation:null,ariaOwns:I,ariaPlaceholder:null,ariaPosInSet:y,ariaPressed:N,ariaReadOnly:N,ariaRelevant:null,ariaRequired:N,ariaRoleDescription:I,ariaRowCount:y,ariaRowIndex:y,ariaRowSpan:y,ariaSelected:N,ariaSetSize:y,ariaSort:null,ariaValueMax:y,ariaValueMin:y,ariaValueNow:y,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Ir(t,e){return e in t?t[e]:e}function Rr(t,e){return Ir(t,e.toLowerCase())}const po=Re({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:we,acceptCharset:I,accessKey:I,action:null,allow:null,allowFullScreen:k,allowPaymentRequest:k,allowUserMedia:k,alpha:k,alt:null,as:null,async:k,autoCapitalize:null,autoComplete:I,autoFocus:k,autoPlay:k,blocking:I,capture:null,charSet:null,checked:k,cite:null,className:I,closedBy:null,colorSpace:null,cols:y,colSpan:y,command:null,commandFor:null,content:null,contentEditable:N,controls:k,controlsList:I,coords:y|we,crossOrigin:null,data:null,dateTime:null,decoding:null,default:k,defer:k,dir:null,dirName:null,disabled:k,download:Ht,draggable:N,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:k,formTarget:null,headers:I,height:y,hidden:Ht,high:y,href:null,hrefLang:null,htmlFor:I,httpEquiv:I,id:null,imageSizes:null,imageSrcSet:null,inert:k,inputMode:null,integrity:null,is:null,isMap:k,itemId:null,itemProp:I,itemRef:I,itemScope:k,itemType:I,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:k,low:y,manifest:null,max:null,maxLength:y,media:null,method:null,min:null,minLength:y,multiple:k,muted:k,name:null,nonce:null,noModule:k,noValidate:k,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:k,optimum:y,pattern:null,ping:I,placeholder:null,playsInline:k,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:k,referrerPolicy:null,rel:I,required:k,reversed:k,rows:y,rowSpan:y,sandbox:I,scope:null,scoped:k,seamless:k,selected:k,shadowRootClonable:k,shadowRootCustomElementRegistry:k,shadowRootDelegatesFocus:k,shadowRootMode:null,shadowRootSerializable:k,shape:null,size:y,sizes:null,slot:null,span:y,spellCheck:N,src:null,srcDoc:null,srcLang:null,srcSet:null,start:y,step:null,style:null,tabIndex:y,target:null,title:null,translate:null,type:null,typeMustMatch:k,useMap:null,value:N,width:y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:I,axis:null,background:null,bgColor:null,border:y,borderColor:null,bottomMargin:y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:k,declare:k,event:null,face:null,frame:null,frameBorder:null,hSpace:y,leftMargin:y,link:null,longDesc:null,lowSrc:null,marginHeight:y,marginWidth:y,noResize:k,noHref:k,noShade:k,noWrap:k,object:null,profile:null,prompt:null,rev:null,rightMargin:y,rules:null,scheme:null,scrolling:N,standby:null,summary:null,text:null,topMargin:y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:k,disablePictureInPicture:k,disableRemotePlayback:k,exportParts:we,part:I,prefix:null,property:null,results:y,security:null,unselectable:null},space:"html",transform:Rr}),go=Re({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:U,accentHeight:y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:y,amplitude:y,arabicForm:null,ascent:y,attributeName:null,attributeType:null,azimuth:y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:y,by:null,calcMode:null,capHeight:y,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:y,diffuseConstant:y,direction:null,display:null,dur:null,divisor:y,dominantBaseline:null,download:k,dx:null,dy:null,edgeMode:null,editable:null,elevation:y,enableBackground:null,end:null,event:null,exponent:y,externalResourcesRequired:null,fill:null,fillOpacity:y,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:we,g2:we,glyphName:we,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:y,horizOriginX:y,horizOriginY:y,id:null,ideographic:y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:y,k:y,k1:y,k2:y,k3:y,k4:y,kernelMatrix:U,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:y,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:y,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:y,overlineThickness:y,paintOrder:null,panose1:null,path:null,pathLength:y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:I,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:y,pointsAtY:y,pointsAtZ:y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:U,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:U,rev:U,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:U,requiredFeatures:U,requiredFonts:U,requiredFormats:U,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:y,specularExponent:y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:y,strikethroughThickness:y,string:null,stroke:null,strokeDashArray:U,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:y,strokeOpacity:y,strokeWidth:null,style:null,surfaceScale:y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:U,tabIndex:y,tableValues:null,target:null,targetX:y,targetY:y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:U,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:y,underlineThickness:y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:y,values:null,vAlphabetic:y,vMathematical:y,vectorEffect:null,vHanging:y,vIdeographic:y,version:null,vertAdvY:y,vertOriginX:y,vertOriginY:y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ir}),Nr=Re({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),$r=Re({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Rr}),Pr=Re({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),mo=/[A-Z]/g,$n=/-[a-z]/g,yo=/^data[-\w.:]+$/i;function wo(t,e){const n=Wt(e);let r=e,s=F;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&yo.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace($n,Co);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!$n.test(o)){let i=o.replace(mo,bo);i.charAt(0)!=="-"&&(i="-"+i),e="data"+i}}s=rn}return new s(r,e)}function bo(t){return"-"+t.toLowerCase()}function Co(t){return t.charAt(1).toUpperCase()}const _o=Ar([Er,po,Nr,$r,Pr],"html"),Lr=Ar([Er,go,Nr,$r,Pr],"svg"),Pn={}.hasOwnProperty;function So(t,e){const n=e||{};function r(s,...o){let i=r.invalid;const a=r.handlers;if(s&&Pn.call(s,t)){const l=String(s[t]);i=Pn.call(a,l)?a[l]:r.unknown}if(i)return i.call(this,s,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const ko=/["&'<>`]/g,xo=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,vo=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ao=/[|\\{}()[\]^$+*?.]/g,Ln=new WeakMap;function Eo(t,e){if(t=t.replace(e.subset?Io(e.subset):ko,r),e.subset||e.escapeOnly)return t;return t.replace(xo,n).replace(vo,r);function n(s,o,i){return e.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,i.charCodeAt(o+2),e)}function r(s,o,i){return e.format(s.charCodeAt(0),i.charCodeAt(o+1),e)}}function Io(t){let e=Ln.get(t);return e||(e=Ro(t),Ln.set(t,e)),e}function Ro(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Ao,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const No=/[\dA-Fa-f]/;function $o(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!No.test(String.fromCharCode(e))?r:r+";"}const Po=/\d/;function Lo(t,e,n){const r="&#"+String(t);return n&&e&&!Po.test(String.fromCharCode(e))?r:r+";"}const To=["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"],At={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Mo=["cent","copy","divide","gt","lt","not","para","times"],Tr={}.hasOwnProperty,Vt={};let Ve;for(Ve in At)Tr.call(At,Ve)&&(Vt[At[Ve]]=Ve);const Oo=/[^\dA-Za-z]/;function Go(t,e,n,r){const s=String.fromCharCode(t);if(Tr.call(Vt,s)){const o=Vt[s],i="&"+o;return n&&To.includes(o)&&!Mo.includes(o)&&(!r||e&&e!==61&&Oo.test(String.fromCharCode(e)))?i:i+";"}return""}function Do(t,e,n){let r=$o(t,e,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=Go(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){const o=Lo(t,e,n.omitOptionalSemicolons);o.length<r.length&&(r=o)}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function Ee(t,e){return Eo(t,Object.assign({format:Do},e))}const Bo=/^>|^->|<!--|-->|--!>|<!-$/g,Fo=[">"],Uo=["<",">"];function jo(t,e,n,r){return r.settings.bogusComments?"<?"+Ee(t.value,Object.assign({},r.settings.characterReferences,{subset:Fo}))+">":"<!--"+t.value.replace(Bo,s)+"-->";function s(o){return Ee(o,Object.assign({},r.settings.characterReferences,{subset:Uo}))}}function zo(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Tn(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function Wo(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Ho(t){return t.join(" ").trim()}const qo=/[ \t\n\f\r]/g;function sn(t){return typeof t=="object"?t.type==="text"?Mn(t.value):!1:Mn(t)}function Mn(t){return t.replace(qo,"")===""}const P=Or(1),Mr=Or(-1),Vo=[];function Or(t){return e;function e(n,r,s){const o=n?n.children:Vo;let i=(r||0)+t,a=o[i];if(!s)for(;a&&sn(a);)i+=t,a=o[i];return a}}const Xo={}.hasOwnProperty;function Gr(t){return e;function e(n,r,s){return Xo.call(t,n.tagName)&&t[n.tagName](n,r,s)}}const on=Gr({body:Qo,caption:Et,colgroup:Et,dd:ei,dt:Jo,head:Et,html:Ko,li:Yo,optgroup:ti,option:ni,p:Zo,rp:On,rt:On,tbody:si,td:Gn,tfoot:oi,th:Gn,thead:ri,tr:ii});function Et(t,e,n){const r=P(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&sn(r.value.charAt(0)))}function Ko(t,e,n){const r=P(n,e);return!r||r.type!=="comment"}function Qo(t,e,n){const r=P(n,e);return!r||r.type!=="comment"}function Zo(t,e,n){const r=P(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Yo(t,e,n){const r=P(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Jo(t,e,n){const r=P(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function ei(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function On(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function ti(t,e,n){const r=P(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function ni(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function ri(t,e,n){const r=P(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function si(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function oi(t,e,n){return!P(n,e)}function ii(t,e,n){const r=P(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function Gn(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const ai=Gr({body:ui,colgroup:hi,head:ci,html:li,tbody:fi});function li(t){const e=P(t,-1);return!e||e.type!=="comment"}function ci(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function ui(t){const e=P(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&sn(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function hi(t,e,n){const r=Mr(n,e),s=P(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&on(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function fi(t,e,n){const r=Mr(n,e),s=P(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&on(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const Xe={name:[[`
6
+ \f\r &/=>`.split(""),`
7
+ \f\r "&'/=>\``.split("")],[`\0
8
+ \f\r "&'/<=>`.split(""),`\0
9
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
10
+ \f\r &>`.split(""),`\0
11
+ \f\r "&'<=>\``.split("")],[`\0
12
+ \f\r "&'<=>\``.split(""),`\0
13
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function pi(t,e,n,r){const s=r.schema,o=s.space==="svg"?!1:r.settings.omitOptionalTags;let i=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const a=[];let l;s.space==="html"&&t.tagName==="svg"&&(r.schema=Lr);const c=di(r,t.properties),h=r.all(s.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=s,h&&(i=!1),(c||!o||!ai(t,e,n))&&(a.push("<",t.tagName,c?" "+c:""),i&&(s.space==="svg"||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(h),!i&&(!o||!on(t,e,n))&&a.push("</"+t.tagName+">"),a.join("")}function di(t,e){const n=[];let r=-1,s;if(e){for(s in e)if(e[s]!==null&&e[s]!==void 0){const o=gi(t,s,e[s]);o&&n.push(o)}}for(;++r<n.length;){const o=t.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&o!=='"'&&o!=="'"&&(n[r]+=" ")}return n.join("")}function gi(t,e,n){const r=wo(t.schema,e),s=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,o=t.settings.allowDangerousCharacters?0:1;let i=t.quote,a;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=Ee(r.attribute,Object.assign({},t.settings.characterReferences,{subset:Xe.name[s][o]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Wo:Ho)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?l:(t.settings.preferUnquoted&&(a=Ee(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:Xe.unquoted[s][o]}))),a!==n&&(t.settings.quoteSmart&&Tn(n,i)>Tn(n,t.alternative)&&(i=t.alternative),a=i+Ee(n,Object.assign({},t.settings.characterReferences,{subset:(i==="'"?Xe.single:Xe.double)[s][o],attribute:!0}))+i),l+(a&&"="+a))}const mi=["<","&"];function Dr(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Ee(t.value,Object.assign({},r.settings.characterReferences,{subset:mi}))}function yi(t,e,n,r){return r.settings.allowDangerousHtml?t.value:Dr(t,e,n,r)}function wi(t,e,n,r){return r.all(t)}const bi=So("type",{invalid:Ci,unknown:_i,handlers:{comment:jo,doctype:zo,element:pi,raw:yi,root:wi,text:Dr}});function Ci(t){throw new Error("Expected node, not `"+t+"`")}function _i(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Si={},ki={},xi=[];function vi(t,e){const n=e||Si,r=n.quote||'"',s=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Ai,all:Ei,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ho,characterReferences:n.characterReferences||ki,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Lr:_o,quote:r,alternative:s}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Ai(t,e,n){return bi(t,e,n,this)}function Ei(t){const e=[],n=t&&t.children||xi;let r=-1;for(;++r<n.length;)e[r]=this.one(n[r],r,t);return e.join("")}function at(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(const[s,o]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof o=="string"?n[s]=o:s===r&&Object.assign(n,o);return n}function ce(t,e){return t&&((e==null?void 0:e[t==null?void 0:t.toLowerCase()])||t)}function Ii(t){return Array.isArray(t)?t:[t]}async function Br(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function an(t){return!t||["plaintext","txt","text","plain"].includes(t)}function Ri(t){return t==="ansi"||an(t)}function ln(t){return t==="none"}function Ni(t){return ln(t)}function Fr(t,e){var r;if(!e)return t;t.properties||(t.properties={}),(r=t.properties).class||(r.class=[]),typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(/\s+/g);for(const s of n)s&&!t.properties.class.includes(s)&&t.properties.class.push(s);return t}function pt(t,e=!1){var o;if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let r=0;const s=[];for(let i=0;i<n.length;i+=2){const a=e?n[i]+(n[i+1]||""):n[i];s.push([a,r]),r+=n[i].length,r+=((o=n[i+1])==null?void 0:o.length)||0}return s}function $i(t){const e=pt(t,!0).map(([s])=>s);function n(s){if(s===t.length)return{line:e.length-1,character:e[e.length-1].length};let o=s,i=0;for(const a of e){if(o<a.length)break;o-=a.length,i++}return{line:i,character:o}}function r(s,o){let i=0;for(let a=0;a<s;a++)i+=e[a].length;return i+=o,i}return{lines:e,indexToPos:n,posToIndex:r}}const cn="light-dark()",Pi=["color","background-color"];function Li(t,e){let n=0;const r=[];for(const s of e)s>n&&r.push({...t,content:t.content.slice(n,s),offset:t.offset+n}),n=s;return n<t.content.length&&r.push({...t,content:t.content.slice(n),offset:t.offset+n}),r}function Ti(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((r,s)=>r-s);return n.length?t.map(r=>r.flatMap(s=>{const o=n.filter(i=>s.offset<i&&i<s.offset+s.content.length).map(i=>i-s.offset).sort((i,a)=>i-a);return o.length?Li(s,o):s})):t}function Mi(t,e,n,r,s="css-vars"){const o={content:t.content,explanation:t.explanation,offset:t.offset},i=e.map(h=>lt(t.variants[h])),a=new Set(i.flatMap(h=>Object.keys(h))),l={},c=(h,u)=>{const f=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return n+e[h]+(u==="color"?"":f)};return i.forEach((h,u)=>{for(const f of a){const d=h[f]||"inherit";if(u===0&&r&&Pi.includes(f))if(r===cn&&i.length>1){const p=e.findIndex(S=>S==="light"),m=e.findIndex(S=>S==="dark");if(p===-1||m===-1)throw new L('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=i[p][f]||"inherit",C=i[m][f]||"inherit";l[f]=`light-dark(${b}, ${C})`,s==="css-vars"&&(l[c(u,f)]=d)}else l[f]=d;else s==="css-vars"&&(l[c(u,f)]=d)}}),o.htmlStyle=l,o}function lt(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&O.Italic&&(e["font-style"]="italic"),t.fontStyle&O.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&O.Underline&&n.push("underline"),t.fontStyle&O.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function Xt(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}const Ur=new WeakMap;function dt(t,e){Ur.set(t,e)}function Fe(t){return Ur.get(t)}class Ne{constructor(...e){g(this,"_stacks",{});g(this,"lang");if(e.length===2){const[n,r]=e;this.lang=r,this._stacks=n}else{const[n,r,s]=e;this.lang=r,this._stacks={[s]:n}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new Ne(Object.fromEntries(Ii(n).map(r=>[r,zt])),e)}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Oi(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Oi(t){const e=[],n=new Set;function r(s){var i;if(n.has(s))return;n.add(s);const o=(i=s==null?void 0:s.nameScopesList)==null?void 0:i.scopeName;o&&e.push(o),s.parent&&r(s.parent)}return r(t),e}function Gi(t,e){if(!(t instanceof Ne))throw new L("Invalid grammar state");return t.getInternalStack(e)}function Di(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(i){if(typeof i=="number"){if(i<0||i>n.source.length)throw new L(`Invalid decoration offset: ${i}. Code length: ${n.source.length}`);return{...s.indexToPos(i),offset:i}}else{const a=s.lines[i.line];if(a===void 0)throw new L(`Invalid decoration position ${JSON.stringify(i)}. Lines length: ${s.lines.length}`);let l=i.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new L(`Invalid decoration position ${JSON.stringify(i)}. Line ${i.line} length: ${a.length}`);return{...i,character:l,offset:s.posToIndex(i.line,l)}}};const s=$i(n.source),o=(n.options.decorations||[]).map(i=>({...i,start:r(i.start),end:r(i.end)}));Bi(o),t.set(n.meta,{decorations:o,converter:s,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){var i;if(!((i=this.options.decorations)!=null&&i.length))return;const s=e(this).decorations.flatMap(a=>[a.start.offset,a.end.offset]);return Ti(n,s)},code(n){var h;if(!((h=this.options.decorations)!=null&&h.length))return;const r=e(this),s=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(s.length!==r.converter.lines.length)throw new L(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function o(u,f,d,p){const m=s[u];let b="",C=-1,S=-1;if(f===0&&(C=0),d===0&&(S=0),d===Number.POSITIVE_INFINITY&&(S=m.children.length),C===-1||S===-1)for(let _=0;_<m.children.length;_++)b+=jr(m.children[_]),C===-1&&b.length===f&&(C=_+1),S===-1&&b.length===d&&(S=_+1);if(C===-1)throw new L(`Failed to find start index for decoration ${JSON.stringify(p.start)}`);if(S===-1)throw new L(`Failed to find end index for decoration ${JSON.stringify(p.end)}`);const w=m.children.slice(C,S);if(!p.alwaysWrap&&w.length===m.children.length)a(m,p,"line");else if(!p.alwaysWrap&&w.length===1&&w[0].type==="element")a(w[0],p,"token");else{const _={type:"element",tagName:"span",properties:{},children:w};a(_,p,"wrapper"),m.children.splice(C,w.length,_)}}function i(u,f){s[u]=a(s[u],f,"line")}function a(u,f,d){var b;const p=f.properties||{},m=f.transform||(C=>C);return u.tagName=f.tagName||"span",u.properties={...u.properties,...p,class:u.properties.class},(b=f.properties)!=null&&b.class&&Fr(u,f.properties.class),u=m(u,d)||u,u}const l=[],c=r.decorations.sort((u,f)=>f.start.offset-u.start.offset||u.end.offset-f.end.offset);for(const u of c){const{start:f,end:d}=u;if(f.line===d.line)o(f.line,f.character,d.character,u);else if(f.line<d.line){o(f.line,f.character,Number.POSITIVE_INFINITY,u);for(let p=f.line+1;p<d.line;p++)l.unshift(()=>i(p,u));o(d.line,0,d.character,u)}}l.forEach(u=>u())}}}function Bi(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new L(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=e+1;r<t.length;r++){const s=t[r],o=n.start.offset<=s.start.offset&&s.start.offset<n.end.offset,i=n.start.offset<s.end.offset&&s.end.offset<=n.end.offset,a=s.start.offset<=n.start.offset&&n.start.offset<s.end.offset,l=s.start.offset<n.end.offset&&n.end.offset<=s.end.offset;if(o||i||a||l){if(o&&i||a&&l||a&&n.start.offset===n.end.offset||i&&s.start.offset===s.end.offset)continue;throw new L(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function jr(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(jr).join(""):""}const Fi=[Di()];function ct(t){const e=Ui(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...Fi]}function Ui(t){const e=[],n=[],r=[];for(const s of t)switch(s.enforce){case"pre":e.push(s);break;case"post":n.push(s);break;default:r.push(s)}return{pre:e,post:n,normal:r}}var de=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],It={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function ji(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const r=t.indexOf("m",n);if(r!==-1)return{sequence:t.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:t.length}}function Dn(t){const e=t.shift();if(e==="2"){const n=t.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function zi(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)It[r]&&e.push({type:"setDecoration",value:It[r]});else if(r<=29){const s=It[r-20];s&&(e.push({type:"resetDecoration",value:s}),s==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:de[r-30]}});else if(r===38){const s=Dn(t);s&&e.push({type:"setForegroundColor",value:s})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:de[r-40]}});else if(r===48){const s=Dn(t);s&&e.push({type:"setBackgroundColor",value:s})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:de[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:de[r-100+8]}})}return e}function Wi(){let t=null,e=null,n=new Set;return{parse(r){const s=[];let o=0;do{const i=ji(r,o),a=i.sequence?r.substring(o,i.startPosition):r.substring(o);if(a.length>0&&s.push({value:a,foreground:t,background:e,decorations:new Set(n)}),i.sequence){const l=zi(i.sequence);for(const c of l)c.type==="resetAll"?(t=null,e=null,n.clear()):c.type==="resetForegroundColor"?t=null:c.type==="resetBackgroundColor"?e=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of l)c.type==="setForegroundColor"?t=c.value:c.type==="setBackgroundColor"?e=c.value:c.type==="setDecoration"&&n.add(c.value)}o=i.position}while(o<r.length);return s}}}var Hi={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 qi(t=Hi){function e(a){return t[a]}function n(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function s(){if(r)return r;r=[];for(let c=0;c<de.length;c++)r.push(e(de[c]));let a=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let h=0;h<6;h++)for(let u=0;u<6;u++)r.push(n([a[c],a[h],a[u]]));let l=8;for(let c=0;c<24;c++,l+=10)r.push(n([l,l,l]));return r}function o(a){return s()[a]}function i(a){switch(a.type){case"named":return e(a.name);case"rgb":return n(a.rgb);case"table":return o(a.index)}}return{value:i}}const Vi={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 Xi(t,e,n){const r=at(t,n),s=pt(e),o=Object.fromEntries(de.map(l=>{var u;const c=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,h=(u=t.colors)==null?void 0:u[c];return[l,h||Vi[l]]})),i=qi(o),a=Wi();return s.map(l=>a.parse(l[0]).map(c=>{let h,u;c.decorations.has("reverse")?(h=c.background?i.value(c.background):t.bg,u=c.foreground?i.value(c.foreground):t.fg):(h=c.foreground?i.value(c.foreground):t.fg,u=c.background?i.value(c.background):void 0),h=ce(h,r),u=ce(u,r),c.decorations.has("dim")&&(h=Ki(h));let f=O.None;return c.decorations.has("bold")&&(f|=O.Bold),c.decorations.has("italic")&&(f|=O.Italic),c.decorations.has("underline")&&(f|=O.Underline),c.decorations.has("strikethrough")&&(f|=O.Strikethrough),{content:c.value,offset:l[1],color:h,bgColor:u,fontStyle:f}}))}function Ki(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const r=e[1];if(r.length===8){const s=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${s}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const s=r[0],o=r[1],i=r[2],a=r[3],l=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${s}${s}${o}${o}${i}${i}${l}`}else if(r.length===3){const s=r[0],o=r[1],i=r[2];return`#${s}${s}${o}${o}${i}${i}80`}}}const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function un(t,e,n={}){const{theme:r=t.getLoadedThemes()[0]}=n,s=t.resolveLangAlias(n.lang||"text");if(an(s)||ln(r))return pt(e).map(l=>[{content:l[0],offset:l[1]}]);const{theme:o,colorMap:i}=t.setTheme(r);if(s==="ansi")return Xi(o,e,n);const a=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new L(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(o.name))throw new L(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return Zi(e,a,o,i,n)}function Qi(...t){if(t.length===2)return Fe(t[1]);const[e,n,r={}]=t,{lang:s="text",theme:o=e.getLoadedThemes()[0]}=r;if(an(s)||ln(o))throw new L("Plain language does not have grammar state");if(s==="ansi")throw new L("ANSI language does not have grammar state");const{theme:i,colorMap:a}=e.setTheme(o),l=e.getLanguage(s);return new Ne(hn(n,l,i,a,r).stateStack,l.name,i.name)}function Zi(t,e,n,r,s){const o=hn(t,e,n,r,s),i=new Ne(o.stateStack,e.name,n.name);return dt(o.tokens,i),o.tokens}function hn(t,e,n,r,s){const o=at(n,s),{tokenizeMaxLineLength:i=0,tokenizeTimeLimit:a=500}=s,l=pt(t);let c=s.grammarState?Gi(s.grammarState,n.name)??zt:s.grammarContextCode!=null?hn(s.grammarContextCode,e,n,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:zt,h=[];const u=[];for(let f=0,d=l.length;f<d;f++){const[p,m]=l[f];if(p===""){h=[],u.push([]);continue}if(i>0&&p.length>=i){h=[],u.push([{content:p,offset:m,color:"",fontStyle:0}]);continue}let b,C,S;s.includeExplanation&&(b=e.tokenizeLine(p,c,a),C=b.tokens,S=0);const w=e.tokenizeLine2(p,c,a),_=w.tokens.length/2;for(let x=0;x<_;x++){const E=w.tokens[2*x],A=x+1<_?w.tokens[2*x+2]:p.length;if(E===A)continue;const G=w.tokens[2*x+1],D=ce(r[Ie.getForeground(G)],o),Q=Ie.getFontStyle(G),se={content:p.substring(E,A),offset:m+E,color:D,fontStyle:Q};if(s.includeExplanation){const j=[];if(s.includeExplanation!=="scopeName")for(const Y of n.settings){let _e;switch(typeof Y.scope){case"string":_e=Y.scope.split(/,/).map(bt=>bt.trim());break;case"object":_e=Y.scope;break;default:continue}j.push({settings:Y,selectors:_e.map(bt=>bt.split(/ /))})}se.explanation=[];let wn=0;for(;E+wn<A;){const Y=C[S],_e=p.substring(Y.startIndex,Y.endIndex);wn+=_e.length,se.explanation.push({content:_e,scopes:s.includeExplanation==="scopeName"?Yi(Y.scopes):Ji(j,Y.scopes)}),S+=1}}h.push(se)}u.push(h),h=[],c=w.ruleStack}return{tokens:u,stateStack:c}}function Yi(t){return t.map(e=>({scopeName:e}))}function Ji(t,e){const n=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];n[r]={scopeName:o,themeMatches:ta(t,o,e.slice(0,r))}}return n}function Bn(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function ea(t,e,n){if(!Bn(t[t.length-1],e))return!1;let r=t.length-2,s=n.length-1;for(;r>=0&&s>=0;)Bn(t[r],n[s])&&(r-=1),s-=1;return r===-1}function ta(t,e,n){const r=[];for(const{selectors:s,settings:o}of t)for(const i of s)if(ea(i,e,n)){r.push(o);break}return r}function zr(t,e,n){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),s=r.map(l=>{const c=un(t,e,{...n,theme:l.theme}),h=Fe(c),u=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:c,state:h,theme:u}}),o=na(...s.map(l=>l.tokens)),i=o[0].map((l,c)=>l.map((h,u)=>{const f={content:h.content,variants:{},offset:h.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=h.explanation),o.forEach((d,p)=>{const{content:m,explanation:b,offset:C,...S}=d[c][u];f.variants[r[p].color]=S}),f})),a=s[0].state?new Ne(Object.fromEntries(s.map(l=>{var c;return[l.theme,(c=l.state)==null?void 0:c.getInternalStack(l.theme)]})),s[0].state.lang):void 0;return a&&dt(i,a),i}function na(...t){const e=t.map(()=>[]),n=t.length;for(let r=0;r<t[0].length;r++){const s=t.map(l=>l[r]),o=e.map(()=>[]);e.forEach((l,c)=>l.push(o[c]));const i=s.map(()=>0),a=s.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(c=>c.content.length));for(let c=0;c<n;c++){const h=a[c];h.content.length===l?(o[c].push(h),i[c]+=1,a[c]=s[c][i[c]]):(o[c].push({...h,content:h.content.slice(0,l)}),a[c]={...h,content:h.content.slice(l),offset:h.offset+l})}}}return e}function ut(t,e,n){let r,s,o,i,a,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:h="--shiki-",colorsRendering:u="css-vars"}=n,f=Object.entries(n.themes).filter(C=>C[1]).map(C=>({color:C[0],theme:C[1]})).sort((C,S)=>C.color===c?-1:S.color===c?1:0);if(f.length===0)throw new L("`themes` option must not be empty");const d=zr(t,e,n);if(l=Fe(d),c&&cn!==c&&!f.find(C=>C.color===c))throw new L(`\`themes\` option must contain the defaultColor key \`${c}\``);const p=f.map(C=>t.getTheme(C.theme)),m=f.map(C=>C.color);o=d.map(C=>C.map(S=>Mi(S,m,h,c,u))),l&&dt(o,l);const b=f.map(C=>at(C.theme,n));s=Fn(f,p,b,h,c,"fg",u),r=Fn(f,p,b,h,c,"bg",u),i=`shiki-themes ${p.map(C=>C.name).join(" ")}`,a=c?void 0:[s,r].join(";")}else if("theme"in n){const c=at(n.theme,n);o=un(t,e,n);const h=t.getTheme(n.theme);r=ce(h.bg,c),s=ce(h.fg,c),i=h.name,l=Fe(o)}else throw new L("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:s,bg:r,themeName:i,rootStyle:a,grammarState:l}}function Fn(t,e,n,r,s,o,i){return t.map((a,l)=>{const c=ce(e[l][o],n[l])||"inherit",h=`${r+a.color}${o==="bg"?"-bg":""}:${c}`;if(l===0&&s){if(s===cn&&t.length>1){const u=t.findIndex(m=>m.color==="light"),f=t.findIndex(m=>m.color==="dark");if(u===-1||f===-1)throw new L('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const d=ce(e[u][o],n[u])||"inherit",p=ce(e[f][o],n[f])||"inherit";return`light-dark(${d}, ${p});${h}`}return c}return i==="css-vars"?h:null}).filter(a=>!!a).join(";")}function ht(t,e,n,r={meta:{},options:n,codeToHast:(s,o)=>ht(t,s,o),codeToTokens:(s,o)=>ut(t,s,o)}){var p,m;let s=e;for(const b of ct(n))s=((p=b.preprocess)==null?void 0:p.call(r,s,n))||s;let{tokens:o,fg:i,bg:a,themeName:l,rootStyle:c,grammarState:h}=ut(t,s,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:f=!1}=n;u===!0?o=sa(o):u==="never"&&(o=oa(o)),f&&(o=ia(o));const d={...r,get source(){return s}};for(const b of ct(n))o=((m=b.tokens)==null?void 0:m.call(d,o))||o;return ra(o,{...n,fg:i,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},d,h)}function ra(t,e,n,r=Fe(t)){var m,b,C,S;const s=ct(e),o=[],i={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=e,c={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?c.style=e.rootStyle:c.style=`background-color:${e.bg};color:${e.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(const[w,_]of Object.entries(e.meta||{}))w.startsWith("_")||(c[w]=_);let h={type:"element",tagName:"pre",properties:c,children:[],data:e.data},u={type:"element",tagName:"code",properties:{},children:o};const f=[],d={...n,structure:a,addClassToHast:Fr,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return i},get pre(){return h},get code(){return u},get lines(){return f}};if(t.forEach((w,_)=>{var A,G;_&&(a==="inline"?i.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&o.push({type:"text",value:`
14
+ `}));let x={type:"element",tagName:"span",properties:{class:"line"},children:[]},E=0;for(const D of w){let Q={type:"element",tagName:"span",properties:{...D.htmlAttrs},children:[{type:"text",value:D.content}]};const se=Xt(D.htmlStyle||lt(D));se&&(Q.properties.style=se);for(const j of s)Q=((A=j==null?void 0:j.span)==null?void 0:A.call(d,Q,_+1,E,x,D))||Q;a==="inline"?i.children.push(Q):a==="classic"&&x.children.push(Q),E+=D.content.length}if(a==="classic"){for(const D of s)x=((G=D==null?void 0:D.line)==null?void 0:G.call(d,x,_+1))||x;f.push(x),o.push(x)}else a==="inline"&&f.push(x)}),a==="classic"){for(const w of s)u=((m=w==null?void 0:w.code)==null?void 0:m.call(d,u))||u;h.children.push(u);for(const w of s)h=((b=w==null?void 0:w.pre)==null?void 0:b.call(d,h))||h;i.children.push(h)}else if(a==="inline"){const w=[];let _={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const A of i.children)A.type==="element"&&A.tagName==="br"?(w.push(_),_={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(A.type==="element"||A.type==="text")&&_.children.push(A);w.push(_);let E={type:"element",tagName:"code",properties:{},children:w};for(const A of s)E=((C=A==null?void 0:A.code)==null?void 0:C.call(d,E))||E;i.children=[];for(let A=0;A<E.children.length;A++){A>0&&i.children.push({type:"element",tagName:"br",properties:{},children:[]});const G=E.children[A];G.type==="element"&&i.children.push(...G.children)}}let p=i;for(const w of s)p=((S=w==null?void 0:w.root)==null?void 0:S.call(d,p))||p;return r&&dt(p,r),p}function sa(t){return t.map(e=>{const n=[];let r="",s;return e.forEach((o,i)=>{const l=!(o.fontStyle&&(o.fontStyle&O.Underline||o.fontStyle&O.Strikethrough));l&&o.content.match(/^\s+$/)&&e[i+1]?(s===void 0&&(s=o.offset),r+=o.content):r?(l?n.push({...o,offset:s,content:r+o.content}):n.push({content:r,offset:s},o),s=void 0,r=""):n.push(o)}),n})}function oa(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,s,o,i]=r;if(!s&&!i)return n;const a=[{...n,offset:n.offset+s.length,content:o}];return s&&a.unshift({content:s,offset:n.offset}),i&&a.push({content:i,offset:n.offset+s.length+o.length}),a}))}function ia(t){return t.map(e=>{const n=[];for(const r of e){if(n.length===0){n.push({...r});continue}const s=n[n.length-1],o=Xt(s.htmlStyle||lt(s)),i=Xt(r.htmlStyle||lt(r)),a=s.fontStyle&&(s.fontStyle&O.Underline||s.fontStyle&O.Strikethrough),l=r.fontStyle&&(r.fontStyle&O.Underline||r.fontStyle&O.Strikethrough);!a&&!l&&o===i?s.content+=r.content:n.push({...r})}return n})}const aa=vi;function la(t,e,n){var o;const r={meta:{},options:n,codeToHast:(i,a)=>ht(t,i,a),codeToTokens:(i,a)=>ut(t,i,a)};let s=aa(ht(t,e,n,r));for(const i of ct(n))s=((o=i.postprocess)==null?void 0:o.call(r,s,n))||s;return s}const Un={light:"#333333",dark:"#bbbbbb"},jn={light:"#fffffe",dark:"#1e1e1e"},zn="__shiki_resolved";function fn(t){var a,l,c,h,u;if(t!=null&&t[zn])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||(e.type="dark"),e.colorReplacements={...e.colorReplacements},e.settings||(e.settings=[]);let{bg:n,fg:r}=e;if(!n||!r){const f=e.settings?e.settings.find(d=>!d.name&&!d.scope):void 0;(a=f==null?void 0:f.settings)!=null&&a.foreground&&(r=f.settings.foreground),(l=f==null?void 0:f.settings)!=null&&l.background&&(n=f.settings.background),!r&&((c=e==null?void 0:e.colors)!=null&&c["editor.foreground"])&&(r=e.colors["editor.foreground"]),!n&&((h=e==null?void 0:e.colors)!=null&&h["editor.background"])&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?Un.light:Un.dark),n||(n=e.type==="light"?jn.light:jn.dark),e.fg=r,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let s=0;const o=new Map;function i(f){var p;if(o.has(f))return o.get(f);s+=1;const d=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return(p=e.colorReplacements)!=null&&p[`#${d}`]?i(f):(o.set(f,d),d)}e.settings=e.settings.map(f=>{var b,C;const d=((b=f.settings)==null?void 0:b.foreground)&&!f.settings.foreground.startsWith("#"),p=((C=f.settings)==null?void 0:C.background)&&!f.settings.background.startsWith("#");if(!d&&!p)return f;const m={...f,settings:{...f.settings}};if(d){const S=i(f.settings.foreground);e.colorReplacements[S]=f.settings.foreground,m.settings.foreground=S}if(p){const S=i(f.settings.background);e.colorReplacements[S]=f.settings.background,m.settings.background=S}return m});for(const f of Object.keys(e.colors||{}))if((f==="editor.foreground"||f==="editor.background"||f.startsWith("terminal.ansi"))&&!((u=e.colors[f])!=null&&u.startsWith("#"))){const d=i(e.colors[f]);e.colorReplacements[d]=e.colors[f],e.colors[f]=d}return Object.defineProperty(e,zn,{enumerable:!1,writable:!1,value:!0}),e}async function Wr(t){return Array.from(new Set((await Promise.all(t.filter(e=>!Ri(e)).map(async e=>await Br(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Hr(t){return(await Promise.all(t.map(async n=>Ni(n)?null:fn(await Br(n))))).filter(n=>!!n)}let ca=3;function ua(t,e=3){e>ca||console.trace(`[SHIKI DEPRECATE]: ${t}`)}class Ae extends Error{constructor(e){super(e),this.name="ShikiError"}}function qr(t,e){if(!e)return t;if(e[t]){const n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new Ae(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}class ha extends uo{constructor(n,r,s,o={}){super(n);g(this,"_resolvedThemes",new Map);g(this,"_resolvedGrammars",new Map);g(this,"_langMap",new Map);g(this,"_langGraph",new Map);g(this,"_textmateThemeCache",new WeakMap);g(this,"_loadedThemesCache",null);g(this,"_loadedLanguagesCache",null);this._resolver=n,this._themes=r,this._langs=s,this._alias=o,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(n){return typeof n=="string"?this._resolvedThemes.get(n):this.loadTheme(n)}loadTheme(n){const r=fn(n);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(n){let r=this._textmateThemeCache.get(n);r||(r=nt.createFromRawTheme(n),this._textmateThemeCache.set(n,r)),this._syncRegistry.setTheme(r)}getGrammar(n){return n=qr(n,this._alias),this._resolvedGrammars.get(n)}loadLanguage(n){var i,a,l,c;if(this.getGrammar(n.name))return;const r=new Set([...this._langMap.values()].filter(h=>{var u;return(u=h.embeddedLangsLazy)==null?void 0:u.includes(n.name)}));this._resolver.addLanguage(n);const s={balancedBracketSelectors:n.balancedBracketSelectors||["*"],unbalancedBracketSelectors:n.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(n.scopeName,n);const o=this.loadGrammarWithConfiguration(n.scopeName,1,s);if(o.name=n.name,this._resolvedGrammars.set(n.name,o),n.aliases&&n.aliases.forEach(h=>{this._alias[h]=n.name}),this._loadedLanguagesCache=null,r.size)for(const h of r)this._resolvedGrammars.delete(h.name),this._loadedLanguagesCache=null,(a=(i=this._syncRegistry)==null?void 0:i._injectionGrammars)==null||a.delete(h.scopeName),(c=(l=this._syncRegistry)==null?void 0:l._grammars)==null||c.delete(h.scopeName),this.loadLanguage(this._langMap.get(h.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(n){for(const o of n)this.resolveEmbeddedLanguages(o);const r=Array.from(this._langGraph.entries()),s=r.filter(([o,i])=>!i);if(s.length){const o=r.filter(([i,a])=>{if(!a)return!1;const l=a.embeddedLanguages||a.embeddedLangs;return l==null?void 0:l.some(c=>s.map(([h])=>h).includes(c))}).filter(i=>!s.includes(i));throw new Ae(`Missing languages ${s.map(([i])=>`\`${i}\``).join(", ")}, required by ${o.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[o,i]of r)this._resolver.addLanguage(i);for(const[o,i]of r)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(n){this._langMap.set(n.name,n),this._langGraph.set(n.name,n);const r=n.embeddedLanguages??n.embeddedLangs;if(r)for(const s of r)this._langGraph.set(s,this._langMap.get(s))}}class fa{constructor(e,n){g(this,"_langs",new Map);g(this,"_scopeToLang",new Map);g(this,"_injections",new Map);g(this,"_onigLib");this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},n.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(n=>{this._langs.set(n,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(e.scopeName)})}getInjections(e){const n=e.split(".");let r=[];for(let s=1;s<=n.length;s++){const o=n.slice(0,s).join(".");r=[...r,...this._injections.get(o)||[]]}return r}}let Le=0;function pa(t){Le+=1,t.warnings!==!1&&Le>=10&&Le%10===0&&console.warn(`[Shiki] ${Le} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new Ae("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(fn),s=new fa(t.engine,n),o=new ha(s,r,n,t.langAlias);let i;function a(w){return qr(w,t.langAlias)}function l(w){C();const _=o.getGrammar(typeof w=="string"?w:w.name);if(!_)throw new Ae(`Language \`${w}\` not found, you may need to load it first`);return _}function c(w){if(w==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};C();const _=o.getTheme(w);if(!_)throw new Ae(`Theme \`${w}\` not found, you may need to load it first`);return _}function h(w){C();const _=c(w);i!==w&&(o.setTheme(_),i=w);const x=o.getColorMap();return{theme:_,colorMap:x}}function u(){return C(),o.getLoadedThemes()}function f(){return C(),o.getLoadedLanguages()}function d(...w){C(),o.loadLanguages(w.flat(1))}async function p(...w){return d(await Wr(w))}function m(...w){C();for(const _ of w.flat(1))o.loadTheme(_)}async function b(...w){return C(),m(await Hr(w))}function C(){if(e)throw new Ae("Shiki instance has been disposed")}function S(){e||(e=!0,o.dispose(),Le-=1)}return{setTheme:h,getTheme:c,getLanguage:l,getLoadedThemes:u,getLoadedLanguages:f,resolveLangAlias:a,loadLanguage:p,loadLanguageSync:d,loadTheme:b,loadThemeSync:m,dispose:S,[Symbol.dispose]:S}}async function da(t){t.engine||ua("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,r]=await Promise.all([Hr(t.themes||[]),Wr(t.langs||[]),t.engine]);return pa({...t,themes:e,langs:n,engine:r})}async function ga(t){const e=await da(t);return{getLastGrammarState:(...n)=>Qi(e,...n),codeToTokensBase:(n,r)=>un(e,n,r),codeToTokensWithThemes:(n,r)=>zr(e,n,r),codeToTokens:(n,r)=>ut(e,n,r),codeToHast:(n,r)=>ht(e,n,r),codeToHtml:(n,r)=>la(e,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function $e(t){if([...t].length!==1)throw new Error(`Expected "${t}" to be a single code point`);return t.codePointAt(0)}function ma(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}const pn=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),T=String.raw;function Pe(t,e){if(t==null)throw new Error(e??"Value expected");return t}const Vr=T`\[\^?`,Xr=`c.? | C(?:-.?)?|${T`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${T`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${T`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${T`o\{[^\}]*\}?`}|${T`\d{1,3}`}`,dn=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Ke=new RegExp(T`
15
+ \\ (?:
16
+ ${Xr}
17
+ | [gk]<[^>]*>?
18
+ | [gk]'[^']*'?
19
+ | .
20
+ )
21
+ | \( (?:
22
+ \? (?:
23
+ [:=!>({]
24
+ | <[=!]
25
+ | <[^>]*>
26
+ | '[^']*'
27
+ | ~\|?
28
+ | #(?:[^)\\]|\\.?)*
29
+ | [^:)]*[:)]
30
+ )?
31
+ | \*[^\)]*\)?
32
+ )?
33
+ | (?:${dn.source})+
34
+ | ${Vr}
35
+ | .
36
+ `.replace(/\s+/g,""),"gsu"),Rt=new RegExp(T`
37
+ \\ (?:
38
+ ${Xr}
39
+ | .
40
+ )
41
+ | \[:(?:\^?\p{Alpha}+|\^):\]
42
+ | ${Vr}
43
+ | &&
44
+ | .
45
+ `.replace(/\s+/g,""),"gsu");function ya(t,e={}){const n={flags:"",...e,rules:{captureGroup:!1,singleline:!1,...e.rules}};if(typeof t!="string")throw new Error("String expected as pattern");const r=Oa(n.flags),s=[r.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX(){return s.at(-1)},numOpenGroups:0,popModX(){s.pop()},pushModX(u){s.push(u)},replaceCurrentModX(u){s[s.length-1]=u},singleline:n.rules.singleline};let i=[],a;for(Ke.lastIndex=0;a=Ke.exec(t);){const u=wa(o,t,a[0],Ke.lastIndex);u.tokens?i.push(...u.tokens):u.token&&i.push(u.token),u.lastIndex!==void 0&&(Ke.lastIndex=u.lastIndex)}const l=[];let c=0;i.filter(u=>u.type==="GroupOpen").forEach(u=>{u.kind==="capturing"?u.number=++c:u.raw==="("&&l.push(u)}),c||l.forEach((u,f)=>{u.kind="capturing",u.number=f+1});const h=c||l.length;return{tokens:i.map(u=>u.type==="EscapedNumber"?Da(u,h):u).flat(),flags:r}}function wa(t,e,n,r){const[s,o]=n;if(n==="["||n==="[^"){const i=ba(e,n,r);return{tokens:i.tokens,lastIndex:i.lastIndex}}if(s==="\\"){if("AbBGyYzZ".includes(o))return{token:Wn(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Ra(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Qr(n)}}if(o==="K")return{token:Zr("keep",n)};if(o==="N"||o==="R")return{token:ge("newline",n,{negate:o==="N"})};if(o==="O")return{token:ge("any",n)};if(o==="X")return{token:ge("text_segment",n)};const i=Kr(n,{inCharClass:!1});return Array.isArray(i)?{tokens:i}:{token:i}}if(s==="("){if(o==="*")return{token:La(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(e[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Pa(n,t)};if(t.pushModX(t.getCurrentModX()),t.numOpenGroups++,n==="("&&!t.captureGroup||n==="(?:")return{token:xe("group",n)};if(n==="(?>")return{token:xe("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:xe(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&t.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:xe("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:xe("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(t.popModX(),t.numOpenGroups--,t.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:Aa(n)}}if(t.getCurrentModX()){if(n==="#"){const i=e.indexOf(`
46
+ `,r);return{lastIndex:i===-1?e.length:i}}if(/^\s$/.test(n)){const i=/\s+/y;return i.lastIndex=r,{lastIndex:i.exec(e)?i.lastIndex:r}}}if(n===".")return{token:ge("dot",n)};if(n==="^"||n==="$"){const i=t.singleline?{"^":T`\A`,$:T`\Z`}[n]:n;return{token:Wn(i,n)}}return n==="|"?{token:_a(n)}:dn.test(n)?{tokens:Ba(n)}:{token:re($e(n),n)}}function ba(t,e,n){const r=[Hn(e[1]==="^",e)];let s=1,o;for(Rt.lastIndex=n;o=Rt.exec(t);){const i=o[0];if(i[0]==="["&&i[1]!==":")s++,r.push(Hn(i[1]==="^",i));else if(i==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(re(93,i));else if(s--,r.push(Sa(i)),!s)break}else{const a=Ca(i);Array.isArray(a)?r.push(...a):r.push(a)}}return{tokens:r,lastIndex:Rt.lastIndex||t.length}}function Ca(t){if(t[0]==="\\")return Kr(t,{inCharClass:!0});if(t[0]==="["){const e=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(t);if(!e||!pn.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return ge("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?ka(t):t==="&&"?xa(t):re($e(t),t)}function Kr(t,{inCharClass:e}){const n=t[1];if(n==="c"||n==="C")return $a(t);if("dDhHsSwW".includes(n))return Ta(t);if(t.startsWith(T`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${t}"`);if(/^\\[pP]\{/.test(t)){if(t.length===3)throw new Error(`Incomplete or invalid Unicode property "${t}"`);return Ma(t)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(t))try{const r=t.split(/\\x/).slice(1).map(i=>parseInt(i,16)),s=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),o=new TextEncoder;return[...s].map(i=>{const a=[...o.encode(i)].map(l=>`\\x${l.toString(16)}`).join("");return re($e(i),a)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return re(Ga(t),t);if(qn.has(n))return re(qn.get(n),t);if(/\d/.test(n))return va(e,t);if(t==="\\")throw new Error(T`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return re(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function _a(t){return{type:"Alternator",raw:t}}function Wn(t,e){return{type:"Assertion",kind:t,raw:e}}function Qr(t){return{type:"Backreference",raw:t}}function re(t,e){return{type:"Character",value:t,raw:e}}function Sa(t){return{type:"CharacterClassClose",raw:t}}function ka(t){return{type:"CharacterClassHyphen",raw:t}}function xa(t){return{type:"CharacterClassIntersector",raw:t}}function Hn(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function ge(t,e,n={}){return{type:"CharacterSet",kind:t,...n,raw:e}}function Zr(t,e,n={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:Pe(n.flags),raw:e}}function va(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function Aa(t){return{type:"GroupClose",raw:t}}function xe(t,e,n={}){return{type:"GroupOpen",kind:t,...n,raw:e}}function Ea(t,e,n,r){return{type:"NamedCallout",kind:t,tag:e,arguments:n,raw:r}}function Ia(t,e,n,r){return{type:"Quantifier",kind:t,min:e,max:n,raw:r}}function Ra(t){return{type:"Subroutine",raw:t}}const Na=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),qn=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function $a(t){const e=t[1]==="c"?t[2]:t[3];if(!e||!/[A-Za-z]/.test(e))throw new Error(`Unsupported control character "${t}"`);return re($e(e.toUpperCase())-64,t)}function Pa(t,e){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;r??(r="");const s=(e.getCurrentModX()||n.includes("x"))&&!r.includes("x"),o=Xn(n),i=Xn(r),a={};if(o&&(a.enable=o),i&&(a.disable=i),t.endsWith(")"))return e.replaceCurrentModX(s),Zr("flags",t,{flags:a});if(t.endsWith(":"))return e.pushModX(s),e.numOpenGroups++,xe("group",t,{...(o||i)&&{flags:a}});throw new Error(`Unexpected flag modifier "${t}"`)}function La(t){const e=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(t);if(!e)throw new Error(`Incomplete or invalid named callout "${t}"`);const{name:n,tag:r,args:s}=e.groups;if(!n)throw new Error(`Invalid named callout "${t}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);const o=s?s.split(",").filter(h=>h!=="").map(h=>/^[+-]?\d+$/.test(h)?+h:h):[],[i,a,l]=o,c=Na.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(o.length>0)throw new Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(typeof i=="string")throw new Error(`Named callout argument must be a number "${i}"`);break;case"max":if(!o.length||o.length>2)throw new Error(`Named callout must have one or two arguments "${o}"`);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(o.length===2&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);break;case"count":case"total_count":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(o.length===1&&(typeof i=="number"||!/^[<>X]$/.test(i)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${i}"`);break;case"cmp":if(o.length!==3)throw new Error(`Named callout must have three arguments "${o}"`);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 a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);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 "${n}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return Ea(c,r??null,(s==null?void 0:s.split(","))??null,t)}function Vn(t){let e=null,n,r;if(t[0]==="{"){const{minStr:s,maxStr:o}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(t).groups,i=1e5;if(+s>i||o&&+o>i)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+s,r=o===void 0?+s:o===""?1/0:+o,n>r&&(e="possessive",[n,r]=[r,n]),t.endsWith("?")){if(e==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');e="lazy"}else e||(e="greedy")}else n=t[0]==="+"?1:0,r=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return Ia(e,n,r,t)}function Ta(t){const e=t[1].toLowerCase();return ge({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function Ma(t){const{p:e,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;return ge("property",t,{value:r,negate:e==="P"&&!n||e==="p"&&!!n})}function Xn(t){const e={};return t.includes("i")&&(e.ignoreCase=!0),t.includes("m")&&(e.dotAll=!0),t.includes("x")&&(e.extended=!0),Object.keys(e).length?e:null}function Oa(t){const e={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<t.length;n++){const r=t[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(t.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');e.textSegmentMode=t[n+2]==="g"?"grapheme":"word",n+=3;continue}e[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return e}function Ga(t){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(t))throw new Error(`Incomplete or invalid escape "${t}"`);const e=t[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function Da(t,e){const{raw:n,inCharClass:r}=t,s=n.slice(1);if(!r&&(s!=="0"&&s.length===1||s[0]!=="0"&&+s<=e))return[Qr(n)];const o=[],i=s.match(/^[0-7]+|\d/g);for(let a=0;a<i.length;a++){const l=i[a];let c;if(a===0&&l!=="8"&&l!=="9"){if(c=parseInt(l,8),c>127)throw new Error(T`Octal encoded byte above 177 unsupported "${n}"`)}else c=$e(l);o.push(re(c,(a===0?"\\":"")+l))}return o}function Ba(t){const e=[],n=new RegExp(dn,"gy");let r;for(;r=n.exec(t);){const s=r[0];if(s[0]==="{"){const o=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(s);if(o){const{min:i,max:a}=o.groups;if(+i>+a&&s.endsWith("?")){n.lastIndex--,e.push(Vn(s.slice(0,-1)));continue}}}e.push(Vn(s))}return e}function Yr(t,e){if(!Array.isArray(t.body))throw new Error("Expected node with body array");if(t.body.length!==1)return!1;const n=t.body[0];return!e||Object.keys(e).every(r=>e[r]===n[r])}function Fa(t){return Ua.has(t.type)}const Ua=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Jr(t,e={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},r=ya(t,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),s=(f,d)=>{const p=r.tokens[o.nextIndex];switch(o.parent=f,o.nextIndex++,p.type){case"Alternator":return be();case"Assertion":return ja(p);case"Backreference":return za(p,o);case"Character":return gt(p.value,{useLastValid:!!d.isCheckingRangeEnd});case"CharacterClassHyphen":return Wa(p,o,d);case"CharacterClassOpen":return Ha(p,o,d);case"CharacterSet":return qa(p,o);case"Directive":return Ya(p.kind,{flags:p.flags});case"GroupOpen":return Va(p,o,d);case"NamedCallout":return el(p.kind,p.tag,p.arguments);case"Quantifier":return Xa(p,o);case"Subroutine":return Ka(p,o);default:throw new Error(`Unexpected token type "${p.type}"`)}},o={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:s},i=nl(Ja(r.flags));let a=i.body[0];for(;o.nextIndex<r.tokens.length;){const f=s(a,{});f.type==="Alternative"?(i.body.push(f),a=f):a.body.push(f)}const{capturingGroups:l,hasNumberedRef:c,namedGroupsByName:h,subroutines:u}=o;if(c&&h.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:f}of u)if(typeof f=="number"){if(f>l.length)throw new Error("Subroutine uses a group number that's not defined");f&&(l[f-1].isSubroutined=!0)}else if(h.has(f)){if(h.get(f).length>1)throw new Error(T`Subroutine uses a duplicate group name "\g<${f}>"`);h.get(f)[0].isSubroutined=!0}else throw new Error(T`Subroutine uses a group name that's not defined "\g<${f}>"`);return i}function ja({kind:t}){return Kt(Pe({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[t],`Unexpected assertion kind "${t}"`),{negate:t===T`\B`||t===T`\Y`})}function za({raw:t},e){const n=/^\\k[<']/.test(t),r=n?t.slice(3,-1):t.slice(1),s=(o,i=!1)=>{const a=e.capturingGroups.length;let l=!1;if(o>a)if(e.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${t}"`);return e.hasNumberedRef=!0,Qt(i?a+1-o:o,{orphan:l})};if(n){const o=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(o)return s(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${t}"`);return Qt(r)}return s(+r)}function Wa(t,e,n){const{tokens:r,walk:s}=e,o=e.parent,i=o.body.at(-1),a=r[e.nextIndex];if(!n.isCheckingRangeEnd&&i&&i.type!=="CharacterClass"&&i.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=s(o,{...n,isCheckingRangeEnd:!0});if(i.type==="Character"&&l.type==="Character")return o.body.pop(),Za(i,l);throw new Error("Invalid character class range")}return gt($e("-"))}function Ha({negate:t},e,n){const{tokens:r,walk:s}=e,o=[tt()],i=r[e.nextIndex];let a=Zn(i);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")o.push(tt()),e.nextIndex++;else{const c=o.at(-1);c.body.push(s(c,n))}a=Zn(r[e.nextIndex],i)}const l=tt({negate:t});return o.length===1?l.body=o[0].body:(l.kind="intersection",l.body=o.map(c=>c.body.length===1?c.body[0]:c)),e.nextIndex++,l}function qa({kind:t,negate:e,value:n},r){const{normalizeUnknownPropertyNames:s,skipPropertyNameValidation:o,unicodePropertyMap:i}=r;if(t==="property"){const a=mt(n);if(pn.has(a)&&!(i!=null&&i.has(a)))t="posix",n=a;else return ve(n,{negate:e,normalizeUnknownPropertyNames:s,skipPropertyNameValidation:o,unicodePropertyMap:i})}return t==="posix"?tl(n,{negate:e}):Zt(t,{negate:e})}function Va(t,e,n){const{tokens:r,capturingGroups:s,namedGroupsByName:o,skipLookbehindValidation:i,walk:a}=e,l=rl(t),c=l.type==="AbsenceFunction",h=Qn(l),u=h&&l.negate;if(l.type==="CapturingGroup"&&(s.push(l),l.name&&ma(o,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let f=Yn(r[e.nextIndex]);for(;f.type!=="GroupClose";){if(f.type==="Alternator")l.body.push(be()),e.nextIndex++;else{const d=l.body.at(-1),p=a(d,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||h,isInNegLookbehind:n.isInNegLookbehind||u});if(d.body.push(p),(h||n.isInLookbehind)&&!i){const m="Lookbehind includes a pattern not allowed by Oniguruma";if(u||n.isInNegLookbehind){if(Kn(p)||p.type==="CapturingGroup")throw new Error(m)}else if(Kn(p)||Qn(p)&&p.negate)throw new Error(m)}}f=Yn(r[e.nextIndex])}return e.nextIndex++,l}function Xa({kind:t,min:e,max:n},r){const s=r.parent,o=s.body.at(-1);if(!o||!Fa(o))throw new Error("Quantifier requires a repeatable token");const i=ts(t,e,n,o);return s.body.pop(),i}function Ka({raw:t},e){const{capturingGroups:n,subroutines:r}=e;let s=t.slice(3,-1);const o=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(s);if(o){const a=+o.groups.num,l=n.length;if(e.hasNumberedRef=!0,s={"":a,"+":l+a,"-":l+1-a}[o.groups.sign],s<1)throw new Error("Invalid subroutine number")}else s==="0"&&(s=0);const i=ns(s);return r.push(i),i}function Qa(t,e){return{type:"AbsenceFunction",kind:t,body:He(e==null?void 0:e.body)}}function be(t){return{type:"Alternative",body:rs(t==null?void 0:t.body)}}function Kt(t,e){const n={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(n.negate=!!(e!=null&&e.negate)),n}function Qt(t,e){const n=!!(e!=null&&e.orphan);return{type:"Backreference",ref:t,...n&&{orphan:n}}}function es(t,e){const n={name:void 0,isSubroutined:!1,...e};if(n.name!==void 0&&!sl(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:t,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:He(e==null?void 0:e.body)}}function gt(t,e){const n={useLastValid:!1,...e};if(t>1114111){const r=t.toString(16);if(n.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:t}}function tt(t){const e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:rs(t==null?void 0:t.body)}}function Za(t,e){if(e.value<t.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:t,max:e}}function Zt(t,e){const n=!!(e!=null&&e.negate),r={type:"CharacterSet",kind:t};return(t==="digit"||t==="hex"||t==="newline"||t==="space"||t==="word")&&(r.negate=n),(t==="text_segment"||t==="newline"&&!n)&&(r.variableLength=!0),r}function Ya(t,e={}){if(t==="keep")return{type:"Directive",kind:t};if(t==="flags")return{type:"Directive",kind:t,flags:Pe(e.flags)};throw new Error(`Unexpected directive kind "${t}"`)}function Ja(t){return{type:"Flags",...t}}function X(t){const e=t==null?void 0:t.atomic,n=t==null?void 0:t.flags;if(e&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...e&&{atomic:e},...n&&{flags:n},body:He(t==null?void 0:t.body)}}function pe(t){const e={behind:!1,negate:!1,...t};return{type:"LookaroundAssertion",kind:e.behind?"lookbehind":"lookahead",negate:e.negate,body:He(t==null?void 0:t.body)}}function el(t,e,n){return{type:"NamedCallout",kind:t,tag:e,arguments:n}}function tl(t,e){const n=!!(e!=null&&e.negate);if(!pn.has(t))throw new Error(`Invalid POSIX class "${t}"`);return{type:"CharacterSet",kind:"posix",value:t,negate:n}}function ts(t,e,n,r){if(e>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:n,body:r}}function nl(t,e){return{type:"Regex",body:He(e==null?void 0:e.body),flags:t}}function ns(t){return{type:"Subroutine",ref:t}}function ve(t,e){var s;const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e};let r=(s=n.unicodePropertyMap)==null?void 0:s.get(mt(t));if(!r){if(n.normalizeUnknownPropertyNames)r=ol(t);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(T`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:r??t,negate:n.negate}}function rl({flags:t,kind:e,name:n,negate:r,number:s}){switch(e){case"absence_repeater":return Qa("repeater");case"atomic":return X({atomic:!0});case"capturing":return es(s,{name:n});case"group":return X({flags:t});case"lookahead":case"lookbehind":return pe({behind:e==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${e}"`)}}function He(t){if(t===void 0)t=[be()];else if(!Array.isArray(t)||!t.length||!t.every(e=>e.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return t}function rs(t){if(t===void 0)t=[];else if(!Array.isArray(t)||!t.every(e=>!!e.type))throw new Error("Invalid body; expected array of nodes");return t}function Kn(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function Qn(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function sl(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function ol(t){return t.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function mt(t){return t.replace(/[- _]+/g,"").toLowerCase()}function Zn(t,e){const n=e;return Pe(t,`Unclosed character class${(n==null?void 0:n.type)==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function Yn(t){return Pe(t,"Unclosed group")}function Oe(t,e,n=null){function r(o,i){for(let a=0;a<o.length;a++){const l=s(o[a],i,a,o);a=Math.max(-1,a+l)}}function s(o,i=null,a=null,l=null){var C,S;let c=0,h=!1;const u={node:o,parent:i,key:a,container:l,root:t,remove(){Qe(l).splice(Math.max(0,Se(a)+c),1),c--,h=!0},removeAllNextSiblings(){return Qe(l).splice(Se(a)+1)},removeAllPrevSiblings(){const w=Se(a)+c;return c-=w,Qe(l).splice(0,Math.max(0,w))},replaceWith(w,_={}){const x=!!_.traverse;l?l[Math.max(0,Se(a)+c)]=w:Pe(i,"Can't replace root node")[a]=w,x&&s(w,i,a,l),h=!0},replaceWithMultiple(w,_={}){const x=!!_.traverse;if(Qe(l).splice(Math.max(0,Se(a)+c),1,...w),c+=w.length-1,x){let E=0;for(let A=0;A<w.length;A++)E+=s(w[A],i,Se(a)+A+E,l)}h=!0},skip(){h=!0}},{type:f}=o,d=e["*"],p=e[f],m=typeof d=="function"?d:d==null?void 0:d.enter,b=typeof p=="function"?p:p==null?void 0:p.enter;if(m==null||m(u,n),b==null||b(u,n),!h)switch(f){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(o.body,o);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":s(o.min,o,"min"),s(o.max,o,"max");break;case"Quantifier":s(o.body,o,"body");break;case"Regex":r(o.body,o),s(o.flags,o,"flags");break;default:throw new Error(`Unexpected node type "${f}"`)}return(C=p==null?void 0:p.exit)==null||C.call(p,u,n),(S=d==null?void 0:d.exit)==null||S.call(d,u,n),c}return s(t),t}function Qe(t){if(!Array.isArray(t))throw new Error("Container expected");return t}function Se(t){if(typeof t!="number")throw new Error("Numeric key expected");return t}const il=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function al(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function ll(t,e,n,r){return t.slice(0,e)+r+t.slice(e+n.length)}const q=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function gn(t,e,n,r){const s=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let i=0,a="";for(const l of t.matchAll(s)){const{0:c,groups:{$skip:h}}=l;if(!h&&(!r||r===q.DEFAULT==!i)){n instanceof Function?a+=n(l,{context:i?q.CHAR_CLASS:q.DEFAULT,negated:o[o.length-1]}):a+=n;continue}c[0]==="["?(i++,o.push(c[1]==="^")):c==="]"&&i&&(i--,o.pop()),a+=c}return a}function ss(t,e,n,r){gn(t,e,n,r)}function cl(t,e,n=0,r){if(!new RegExp(e,"su").test(t))return null;const s=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=n;let o=0,i;for(;i=s.exec(t);){const{0:a,groups:{$skip:l}}=i;if(!l&&(!r||r===q.DEFAULT==!o))return i;a==="["?o++:a==="]"&&o&&o--,s.lastIndex==i.index&&s.lastIndex++}return null}function Ze(t,e,n){return!!cl(t,e,0,n)}function ul(t,e){const n=/\\?./gsu;n.lastIndex=e;let r=t.length,s=0,o=1,i;for(;i=n.exec(t);){const[a]=i;if(a==="[")s++;else if(s)a==="]"&&s--;else if(a==="(")o++;else if(a===")"&&(o--,!o)){r=i.index;break}}return t.slice(e,r)}const Jn=new RegExp(String.raw`(?<noncapturingStart>${il})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function hl(t,e){const n=(e==null?void 0:e.hiddenCaptures)??[];let r=(e==null?void 0:e.captureTransfers)??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:r,hiddenCaptures:n};const s="(?>",o="(?:(?=(",i=[0],a=[];let l=0,c=0,h=NaN,u;do{u=!1;let f=0,d=0,p=!1,m;for(Jn.lastIndex=Number.isNaN(h)?0:h+o.length;m=Jn.exec(t);){const{0:b,index:C,groups:{capturingStart:S,noncapturingStart:w}}=m;if(b==="[")f++;else if(f)b==="]"&&f--;else if(b===s&&!p)h=C,p=!0;else if(p&&w)d++;else if(S)p?d++:(l++,i.push(l+c));else if(b===")"&&p){if(!d){c++;const _=l+c;if(t=`${t.slice(0,h)}${o}${t.slice(h+s.length,C)}))<$$${_}>)${t.slice(C+1)}`,u=!0,a.push(_),al(n,_),r.size){const x=new Map;r.forEach((E,A)=>{x.set(A>=_?A+1:A,E.map(G=>G>=_?G+1:G))}),r=x}break}d--}}}while(u);return n.push(...a),t=gn(t,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:f,groups:{backrefNum:d,wrappedBackrefNum:p}})=>{if(d){const m=+d;if(m>i.length-1)throw new Error(`Backref "${f}" greater than number of captures`);return`\\${i[m]}`}return`\\${p}`},q.DEFAULT),{pattern:t,captureTransfers:r,hiddenCaptures:n}}const os=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Nt=new RegExp(String.raw`
47
+ \\(?: \d+
48
+ | c[A-Za-z]
49
+ | [gk]<[^>]+>
50
+ | [pPu]\{[^\}]+\}
51
+ | u[A-Fa-f\d]{4}
52
+ | x[A-Fa-f\d]{2}
53
+ )
54
+ | \((?: \? (?: [:=!>]
55
+ | <(?:[=!]|[^>]+>)
56
+ | [A-Za-z\-]+:
57
+ | \(DEFINE\)
58
+ ))?
59
+ | (?<qBase>${os})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
60
+ | \\?.
61
+ `.replace(/\s+/g,""),"gsu");function fl(t){if(!new RegExp(`${os}\\+`).test(t))return{pattern:t};const e=[];let n=null,r=null,s="",o=0,i;for(Nt.lastIndex=0;i=Nt.exec(t);){const{0:a,index:l,groups:{qBase:c,qMod:h,invalidQ:u}}=i;if(a==="[")o||(r=l),o++;else if(a==="]")o?o--:r=null;else if(!o)if(h==="+"&&s&&!s.startsWith("(")){if(u)throw new Error(`Invalid quantifier "${a}"`);let f=-1;if(/^\{\d+\}$/.test(c))t=ll(t,l+c.length,h,"");else{if(s===")"||s==="]"){const d=s===")"?n:r;if(d===null)throw new Error(`Invalid unmatched "${s}"`);t=`${t.slice(0,d)}(?>${t.slice(d,l)}${c})${t.slice(l+a.length)}`}else t=`${t.slice(0,l-s.length)}(?>${s}${c})${t.slice(l+a.length)}`;f+=4}Nt.lastIndex+=f}else a[0]==="("?e.push(l):a===")"&&(n=e.length?e.pop():null);s=a}return{pattern:t}}const H=String.raw,pl=H`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Yt=H`\(\?R=(?<rDepth>[^\)]+)\)|${pl}`,yt=H`\(\?<(?![=!])(?<captureName>[^>]+)>`,is=H`${yt}|(?<unnamed>\()(?!\?)`,fe=new RegExp(H`${yt}|${Yt}|\(\?|\\?.`,"gsu"),$t="Cannot use multiple overlapping recursions";function dl(t,e){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...e};let s=(e==null?void 0:e.captureTransfers)??new Map;if(!new RegExp(Yt,"su").test(t))return{pattern:t,captureTransfers:s,hiddenCaptures:n};if(r==="plugin"&&Ze(t,H`\(\?\(DEFINE\)`,q.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],i=Ze(t,H`\\[1-9]`,q.DEFAULT),a=new Map,l=[];let c=!1,h=0,u=0,f;for(fe.lastIndex=0;f=fe.exec(t);){const{0:d,groups:{captureName:p,rDepth:m,gRNameOrNum:b,gRDepth:C}}=f;if(d==="[")h++;else if(h)d==="]"&&h--;else if(m){if(er(m),c)throw new Error($t);if(i)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const S=t.slice(0,f.index),w=t.slice(fe.lastIndex);if(Ze(w,Yt,q.DEFAULT))throw new Error($t);const _=+m-1;t=tr(S,w,_,!1,n,o,u),s=rr(s,S,_,o.length,0,u);break}else if(b){er(C);let S=!1;for(const j of l)if(j.name===b||j.num===+b){if(S=!0,j.hasRecursedWithin)throw new Error($t);break}if(!S)throw new Error(H`Recursive \g cannot be used outside the referenced group "${r==="external"?b:H`\g<${b}&R=${C}>`}"`);const w=a.get(b),_=ul(t,w);if(i&&Ze(_,H`${yt}|\((?!\?)`,q.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const x=t.slice(w,f.index),E=_.slice(x.length+d.length),A=o.length,G=+C-1,D=tr(x,E,G,!0,n,o,u);s=rr(s,x,G,o.length-A,A,u);const Q=t.slice(0,w),se=t.slice(w+_.length);t=`${Q}${D}${se}`,fe.lastIndex+=D.length-d.length-x.length-E.length,l.forEach(j=>j.hasRecursedWithin=!0),c=!0}else if(p)u++,a.set(String(u),fe.lastIndex),a.set(p,fe.lastIndex),l.push({num:u,name:p});else if(d[0]==="("){const S=d==="(";S&&(u++,a.set(String(u),fe.lastIndex)),l.push(S?{num:u}:{})}else d===")"&&l.pop()}return n.push(...o),{pattern:t,captureTransfers:s,hiddenCaptures:n}}function er(t){const e=`Max depth must be integer between 2 and 100; used ${t}`;if(!/^[1-9]\d*$/.test(t))throw new Error(e);if(t=+t,t<2||t>100)throw new Error(e)}function tr(t,e,n,r,s,o,i){const a=new Set;r&&ss(t+e,yt,({groups:{captureName:c}})=>{a.add(c)},q.DEFAULT);const l=[n,r?a:null,s,o,i];return`${t}${nr(`(?:${t}`,"forward",...l)}(?:)${nr(`${e})`,"backward",...l)}${e}`}function nr(t,e,n,r,s,o,i){const l=h=>e==="forward"?h+2:n-h+2-1;let c="";for(let h=0;h<n;h++){const u=l(h);c+=gn(t,H`${is}|\\k<(?<backref>[^>]+)>`,({0:f,groups:{captureName:d,unnamed:p,backref:m}})=>{if(m&&r&&!r.has(m))return f;const b=`_$${u}`;if(p||d){const C=i+o.length+1;return o.push(C),gl(s,C),p?f:`(?<${d}${b}>`}return H`\k<${m}${b}>`},q.DEFAULT)}return c}function gl(t,e){for(let n=0;n<t.length;n++)t[n]>=e&&t[n]++}function rr(t,e,n,r,s,o){if(t.size&&r){let i=0;ss(e,is,()=>i++,q.DEFAULT);const a=o-i+s,l=new Map;return t.forEach((c,h)=>{const u=(r-i*n)/n,f=i*n,d=h>a+i?h+r:h,p=[];for(const m of c)if(m<=a)p.push(m);else if(m>a+i+u)p.push(m+r);else if(m<=a+i)for(let b=0;b<=n;b++)p.push(m+i*b);else for(let b=0;b<=n;b++)p.push(m+f+u*b);l.set(d,p)}),l}return t}var $=String.fromCodePoint,v=String.raw,K={},wt=globalThis.RegExp;K.flagGroups=(()=>{try{new wt("(?i:)")}catch{return!1}return!0})();K.unicodeSets=(()=>{try{new wt("[[]]","v")}catch{return!1}return!0})();K.bugFlagVLiteralHyphenIsRange=K.unicodeSets?(()=>{try{new wt(v`[\d\-a]`,"v")}catch{return!0}return!1})():!1;K.bugNestedClassIgnoresNegation=K.unicodeSets&&new wt("[[^a]]","v").test("a");function ft(t,{enable:e,disable:n}){return{dotAll:!(n!=null&&n.dotAll)&&!!(e!=null&&e.dotAll||t.dotAll),ignoreCase:!(n!=null&&n.ignoreCase)&&!!(e!=null&&e.ignoreCase||t.ignoreCase)}}function Ue(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}function Jt(t,e){return sr[t]>=sr[e]}function ml(t,e){if(t==null)throw new Error(e??"Value expected");return t}var sr={ES2025:2025,ES2024:2024,ES2018:2018},yl={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function as(t={}){if({}.toString.call(t)!=="[object Object]")throw new Error("Unexpected options");if(t.target!==void 0&&!yl[t.target])throw new Error(`Unexpected target "${t.target}"`);const e={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...t,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...t.rules}};return e.target==="auto"&&(e.target=K.flagGroups?"ES2025":K.unicodeSets?"ES2024":"ES2018"),e}var wl="[ -\r ]",bl=new Set([$(304),$(305)]),J=v`[\p{L}\p{M}\p{N}\p{Pc}]`;function ls(t){if(bl.has(t))return[t];const e=new Set,n=t.toLowerCase(),r=n.toUpperCase(),s=Sl.get(n),o=Cl.get(n),i=_l.get(n);return[...r].length===1&&e.add(r),i&&e.add(i),s&&e.add(s),e.add(n),o&&e.add(o),[...e]}var mn=new Map(`C Other
62
+ Cc Control cntrl
63
+ Cf Format
64
+ Cn Unassigned
65
+ Co Private_Use
66
+ Cs Surrogate
67
+ L Letter
68
+ LC Cased_Letter
69
+ Ll Lowercase_Letter
70
+ Lm Modifier_Letter
71
+ Lo Other_Letter
72
+ Lt Titlecase_Letter
73
+ Lu Uppercase_Letter
74
+ M Mark Combining_Mark
75
+ Mc Spacing_Mark
76
+ Me Enclosing_Mark
77
+ Mn Nonspacing_Mark
78
+ N Number
79
+ Nd Decimal_Number digit
80
+ Nl Letter_Number
81
+ No Other_Number
82
+ P Punctuation punct
83
+ Pc Connector_Punctuation
84
+ Pd Dash_Punctuation
85
+ Pe Close_Punctuation
86
+ Pf Final_Punctuation
87
+ Pi Initial_Punctuation
88
+ Po Other_Punctuation
89
+ Ps Open_Punctuation
90
+ S Symbol
91
+ Sc Currency_Symbol
92
+ Sk Modifier_Symbol
93
+ Sm Math_Symbol
94
+ So Other_Symbol
95
+ Z Separator
96
+ Zl Line_Separator
97
+ Zp Paragraph_Separator
98
+ Zs Space_Separator
99
+ ASCII
100
+ ASCII_Hex_Digit AHex
101
+ Alphabetic Alpha
102
+ Any
103
+ Assigned
104
+ Bidi_Control Bidi_C
105
+ Bidi_Mirrored Bidi_M
106
+ Case_Ignorable CI
107
+ Cased
108
+ Changes_When_Casefolded CWCF
109
+ Changes_When_Casemapped CWCM
110
+ Changes_When_Lowercased CWL
111
+ Changes_When_NFKC_Casefolded CWKCF
112
+ Changes_When_Titlecased CWT
113
+ Changes_When_Uppercased CWU
114
+ Dash
115
+ Default_Ignorable_Code_Point DI
116
+ Deprecated Dep
117
+ Diacritic Dia
118
+ Emoji
119
+ Emoji_Component EComp
120
+ Emoji_Modifier EMod
121
+ Emoji_Modifier_Base EBase
122
+ Emoji_Presentation EPres
123
+ Extended_Pictographic ExtPict
124
+ Extender Ext
125
+ Grapheme_Base Gr_Base
126
+ Grapheme_Extend Gr_Ext
127
+ Hex_Digit Hex
128
+ IDS_Binary_Operator IDSB
129
+ IDS_Trinary_Operator IDST
130
+ ID_Continue IDC
131
+ ID_Start IDS
132
+ Ideographic Ideo
133
+ Join_Control Join_C
134
+ Logical_Order_Exception LOE
135
+ Lowercase Lower
136
+ Math
137
+ Noncharacter_Code_Point NChar
138
+ Pattern_Syntax Pat_Syn
139
+ Pattern_White_Space Pat_WS
140
+ Quotation_Mark QMark
141
+ Radical
142
+ Regional_Indicator RI
143
+ Sentence_Terminal STerm
144
+ Soft_Dotted SD
145
+ Terminal_Punctuation Term
146
+ Unified_Ideograph UIdeo
147
+ Uppercase Upper
148
+ Variation_Selector VS
149
+ White_Space space
150
+ XID_Continue XIDC
151
+ XID_Start XIDS`.split(/\s/).map(t=>[mt(t),t])),Cl=new Map([["s",$(383)],[$(383),"s"]]),_l=new Map([[$(223),$(7838)],[$(107),$(8490)],[$(229),$(8491)],[$(969),$(8486)]]),Sl=new Map([oe(453),oe(456),oe(459),oe(498),...Pt(8072,8079),...Pt(8088,8095),...Pt(8104,8111),oe(8124),oe(8140),oe(8188)]),kl=new Map([["alnum",v`[\p{Alpha}\p{Nd}]`],["alpha",v`\p{Alpha}`],["ascii",v`\p{ASCII}`],["blank",v`[\p{Zs}\t]`],["cntrl",v`\p{Cc}`],["digit",v`\p{Nd}`],["graph",v`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",v`\p{Lower}`],["print",v`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",v`[\p{P}\p{S}]`],["space",v`\p{space}`],["upper",v`\p{Upper}`],["word",v`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",v`\p{AHex}`]]);function xl(t,e){const n=[];for(let r=t;r<=e;r++)n.push(r);return n}function oe(t){const e=$(t);return[e.toLowerCase(),e]}function Pt(t,e){return xl(t,e).map(n=>oe(n))}var cs=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function vl(t,e){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...e};us(t);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Jt(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:t.flags.digitIsAscii,spaceIsAscii:t.flags.spaceIsAscii,wordIsAscii:t.flags.wordIsAscii};Oe(t,Al,r);const s={dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},o={currentFlags:s,prevFlags:null,globalFlags:s,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Oe(t,El,o);const i={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return Oe(t,Il,i),t._originMap=o.groupOriginByCopy,t._strategy=r.strategy,t}var Al={AbsenceFunction({node:t,parent:e,replaceWith:n}){const{body:r,kind:s}=t;if(s==="repeater"){const o=X();o.body[0].body.push(pe({negate:!0,body:r}),ve("Any"));const i=X();i.body[0].body.push(ts("greedy",0,1/0,o)),n(R(i,e),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:t,parent:e,key:n},{flagDirectivesByAlt:r}){const s=t.body.filter(o=>o.kind==="flags");for(let o=n+1;o<e.body.length;o++){const i=e.body[o];Ue(r,i,[]).push(...s)}},exit({node:t},{flagDirectivesByAlt:e}){var n;if((n=e.get(t))!=null&&n.length){const r=fs(e.get(t));if(r){const s=X({flags:r});s.body[0].body=t.body,t.body=[R(s,t)]}}}},Assertion({node:t,parent:e,key:n,container:r,root:s,remove:o,replaceWith:i},a){const{kind:l,negate:c}=t,{asciiWordBoundaries:h,avoidSubclass:u,supportedGNodes:f,wordIsAscii:d}=a;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if(l==="line_end")i(R(pe({body:[be({body:[Kt("string_end")]}),be({body:[gt(10)]})]}),e));else if(l==="line_start")i(R(ee(v`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),e));else if(l==="search_start")if(f.has(t))s.flags.sticky=!0,o();else{const p=r[n-1];if(p&&Tl(p))i(R(pe({negate:!0}),e));else{if(u)throw new Error(v`Uses "\G" in a way that requires a subclass`);i(ie(Kt("string_start"),e)),a.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")i(R(ee(v`(?=\n?\z)`),e));else if(l==="word_boundary"){if(!d&&!h){const p=`(?:(?<=${J})(?!${J})|(?<!${J})(?=${J}))`,m=`(?:(?<=${J})(?=${J})|(?<!${J})(?!${J}))`;i(R(ee(c?m:p),e))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!Tt(n)&&(n=Lt(n,e),t.ref=n)},CapturingGroup({node:t},{jsGroupNameMap:e,subroutineRefMap:n}){let{name:r}=t;r&&!Tt(r)&&(r=Lt(r,e),t.name=r),n.set(t.number,t),r&&n.set(r,t)},CharacterClassRange({node:t,parent:e,replaceWith:n}){if(e.kind==="intersection"){const r=tt({body:[t]});n(R(r,e),{traverse:!0})}},CharacterSet({node:t,parent:e,replaceWith:n},{accuracy:r,minTargetEs2024:s,digitIsAscii:o,spaceIsAscii:i,wordIsAscii:a}){const{kind:l,negate:c,value:h}=t;if(o&&(l==="digit"||h==="digit")){n(ie(Zt("digit",{negate:c}),e));return}if(i&&(l==="space"||h==="space")){n(R(Mt(ee(wl),c),e));return}if(a&&(l==="word"||h==="word")){n(ie(Zt("word",{negate:c}),e));return}if(l==="any")n(ie(ve("Any"),e));else if(l==="digit")n(ie(ve("Nd",{negate:c}),e));else if(l!=="dot")if(l==="text_segment"){if(r==="strict")throw new Error(v`Use of "\X" requires non-strict accuracy`);const u="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",f=v`\p{RI}{2}|${u}(?:\u200D${u})*`;n(R(ee(v`(?>\r\n|${s?v`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),e))}else if(l==="hex")n(ie(ve("AHex",{negate:c}),e));else if(l==="newline")n(R(ee(c?`[^
152
+ ]`:`(?>\r
153
+ ?|[
154
+ \v\f…\u2028\u2029])`),e));else if(l==="posix")if(!s&&(h==="graph"||h==="print")){if(r==="strict")throw new Error(`POSIX class "${h}" requires min target ES2024 or non-strict accuracy`);let u={graph:"!-~",print:" -~"}[h];c&&(u=`\0-${$(u.codePointAt(0)-1)}${$(u.codePointAt(2)+1)}-􏿿`),n(R(ee(`[${u}]`),e))}else n(R(Mt(ee(kl.get(h)),c),e));else if(l==="property")mn.has(mt(h))||(t.key="sc");else if(l==="space")n(ie(ve("space",{negate:c}),e));else if(l==="word")n(R(Mt(ee(J),c),e));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:t,parent:e,root:n,remove:r,replaceWith:s,removeAllPrevSiblings:o,removeAllNextSiblings:i}){const{kind:a,flags:l}=t;if(a==="flags")if(!l.enable&&!l.disable)r();else{const c=X({flags:l});c.body[0].body=i(),s(R(c,e),{traverse:!0})}else if(a==="keep"){const c=n.body[0],u=n.body.length===1&&Yr(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(e.parent!==u||u.body.length>1)throw new Error(v`Uses "\K" in a way that's unsupported`);const f=pe({behind:!0});f.body[0].body=o(),s(R(f,e))}else throw new Error(`Unexpected directive kind "${a}"`)},Flags({node:t,parent:e}){if(t.posixIsAscii)throw new Error('Unsupported flag "P"');if(t.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete t[n]),Object.assign(t,{global:!1,hasIndices:!1,multiline:!1,sticky:t.sticky??!1}),e.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:t}){if(!t.flags)return;const{enable:e,disable:n}=t.flags;e!=null&&e.extended&&delete e.extended,n!=null&&n.extended&&delete n.extended,e!=null&&e.dotAll&&(n!=null&&n.dotAll)&&delete e.dotAll,e!=null&&e.ignoreCase&&(n!=null&&n.ignoreCase)&&delete e.ignoreCase,e&&!Object.keys(e).length&&delete t.flags.enable,n&&!Object.keys(n).length&&delete t.flags.disable,!t.flags.enable&&!t.flags.disable&&delete t.flags},LookaroundAssertion({node:t},e){const{kind:n}=t;n==="lookbehind"&&(e.passedLookbehind=!0)},NamedCallout({node:t,parent:e,replaceWith:n}){const{kind:r}=t;if(r==="fail")n(R(pe({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){const e=X();e.body[0].body.push(t.body),t.body=R(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){const n=[];let r=!1,s=!1;for(const o of t.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const i=ds(o.body);i?(r=!0,Array.isArray(i)?n.push(...i):n.push(i)):s=!0}r&&!s&&n.forEach(o=>e.add(o))},exit(t,{accuracy:e,passedLookbehind:n,strategy:r}){if(e==="strict"&&n&&r)throw new Error(v`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!Tt(n)&&(n=Lt(n,e),t.ref=n)}},El={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:n}){const{orphan:r,ref:s}=t;r||n.set(t,[...e.get(s).map(({node:o})=>o)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:n,skip:r},{groupOriginByCopy:s,groupsByName:o,multiplexCapturesToLeftByRef:i,openRefs:a,reffedNodesByReferencer:l}){const c=s.get(t);if(c&&a.has(t.number)){const u=ie(or(t.number),e);l.set(u,a.get(t.number)),n(u);return}a.set(t.number,t),i.set(t.number,[]),t.name&&Ue(i,t.name,[]);const h=i.get(t.name??t.number);for(let u=0;u<h.length;u++){const f=h[u];if(c===f.node||c&&c===f.origin||t===f.origin){h.splice(u,1);break}}if(i.get(t.number).push({node:t,origin:c}),t.name&&i.get(t.name).push({node:t,origin:c}),t.name){const u=Ue(o,t.name,new Map);let f=!1;if(c)f=!0;else for(const d of u.values())if(!d.hasDuplicateNameToRemove){f=!0;break}o.get(t.name).set(t,{node:t,hasDuplicateNameToRemove:f})}},exit({node:t},{openRefs:e}){e.get(t.number)===t&&e.delete(t.number)}},Group:{enter({node:t},e){e.prevFlags=e.currentFlags,t.flags&&(e.currentFlags=ft(e.currentFlags,t.flags))},exit(t,e){e.currentFlags=e.prevFlags}},Subroutine({node:t,parent:e,replaceWith:n},r){const{isRecursive:s,ref:o}=t;if(s){let h=e;for(;(h=h.parent)&&!(h.type==="CapturingGroup"&&(h.name===o||h.number===o)););r.reffedNodesByReferencer.set(t,h);return}const i=r.subroutineRefMap.get(o),a=o===0,l=a?or(0):hs(i,r.groupOriginByCopy,null);let c=l;if(!a){const h=fs($l(i,f=>f.type==="Group"&&!!f.flags)),u=h?ft(r.globalFlags,h):r.globalFlags;Rl(u,r.currentFlags)||(c=X({flags:Pl(u)}),c.body[0].body.push(l))}n(R(c,e),{traverse:!a})}},Il={Backreference({node:t,parent:e,replaceWith:n},r){if(t.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,t.ref);return}const o=r.reffedNodesByReferencer.get(t).filter(i=>Nl(i,t));if(!o.length)n(R(pe({negate:!0}),e));else if(o.length>1){const i=X({atomic:!0,body:o.reverse().map(a=>be({body:[Qt(a.number)]}))});n(R(i,e))}else t.ref=o[0].number},CapturingGroup({node:t},e){t.number=++e.numCapturesToLeft,t.name&&e.groupsByName.get(t.name).get(t).hasDuplicateNameToRemove&&delete t.name},Regex:{exit({node:t},e){const n=Math.max(e.highestOrphanBackref-e.numCapturesToLeft,0);for(let r=0;r<n;r++){const s=es();t.body.at(-1).body.push(s)}}},Subroutine({node:t},e){!t.isRecursive||t.ref===0||(t.ref=e.reffedNodesByReferencer.get(t).number)}};function us(t){Oe(t,{"*"({node:e,parent:n}){e.parent=n}})}function Rl(t,e){return t.dotAll===e.dotAll&&t.ignoreCase===e.ignoreCase}function Nl(t,e){let n=e;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===t)return!1;const r=ps(n.parent);for(const s of r){if(s===n)break;if(s===t||gs(s,t))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function hs(t,e,n,r){const s=Array.isArray(t)?[]:{};for(const[o,i]of Object.entries(t))o==="parent"?s.parent=Array.isArray(n)?r:n:i&&typeof i=="object"?s[o]=hs(i,e,s,n):(o==="type"&&i==="CapturingGroup"&&e.set(s,e.get(t)??t),s[o]=i);return s}function or(t){const e=ns(t);return e.isRecursive=!0,e}function $l(t,e){const n=[];for(;t=t.parent;)(!e||e(t))&&n.push(t);return n}function Lt(t,e){if(e.has(t))return e.get(t);const n=`$${e.size}_${t.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return e.set(t,n),n}function fs(t){const e=["dotAll","ignoreCase"],n={enable:{},disable:{}};return t.forEach(({flags:r})=>{e.forEach(s=>{var o,i;(o=r.enable)!=null&&o[s]&&(delete n.disable[s],n.enable[s]=!0),(i=r.disable)!=null&&i[s]&&(n.disable[s]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Pl({dotAll:t,ignoreCase:e}){const n={};return(t||e)&&(n.enable={},t&&(n.enable.dotAll=!0),e&&(n.enable.ignoreCase=!0)),(!t||!e)&&(n.disable={},!t&&(n.disable.dotAll=!0),!e&&(n.disable.ignoreCase=!0)),n}function ps(t){if(!t)throw new Error("Node expected");const{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function ds(t){const e=t.find(n=>n.kind==="search_start"||Ml(n,{negate:!1})||!Ll(n));if(!e)return null;if(e.kind==="search_start")return e;if(e.type==="LookaroundAssertion")return e.body[0].body[0];if(e.type==="CapturingGroup"||e.type==="Group"){const n=[];for(const r of e.body){const s=ds(r.body);if(!s)return null;Array.isArray(s)?n.push(...s):n.push(s)}return n}return null}function gs(t,e){const n=ps(t)??[];for(const r of n)if(r===e||gs(r,e))return!0;return!1}function Ll({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function Tl(t){const e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function Ml(t,e){const n={negate:null,...e};return t.type==="LookaroundAssertion"&&(n.negate===null||t.negate===n.negate)&&t.body.length===1&&Yr(t.body[0],{type:"Assertion",kind:"search_start"})}function Tt(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function ee(t,e){const r=Jr(t,{...e,unicodePropertyMap:mn}).body;return r.length>1||r[0].body.length>1?X({body:r}):r[0].body[0]}function Mt(t,e){return t.negate=e,t}function ie(t,e){return t.parent=e,t}function R(t,e){return us(t),t.parent=e,t}function Ol(t,e){const n=as(e),r=Jt(n.target,"ES2024"),s=Jt(n.target,"ES2025"),o=n.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw new Error("Invalid recursionLimit; use 2-20");let i=null,a=null;if(!s){const d=[t.flags.ignoreCase];Oe(t,Gl,{getCurrentModI:()=>d.at(-1),popModI(){d.pop()},pushModI(p){d.push(p)},setHasCasedChar(){d.at(-1)?i=!0:a=!0}})}const l={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||i)&&!a)};let c=t;const h={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:t._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!s&&i&&a),useFlagMods:s,useFlagV:r,verbose:n.verbose};function u(d){return h.lastNode=c,c=d,ml(Dl[d.type],`Unexpected node type "${d.type}"`)(d,h,u)}const f={pattern:t.body.map(u).join("|"),flags:u(t.flags),options:{...t.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],h.captureMap.forEach((d,p)=>{d.hidden&&f._hiddenCaptures.push(p),d.transferTo&&Ue(f._captureTransfers,d.transferTo,[]).push(p)}),f}var Gl={"*":{enter({node:t},e){if(ar(t)){const n=e.getCurrentModI();e.pushModI(t.flags?ft({ignoreCase:n},t.flags).ignoreCase:n)}},exit({node:t},e){ar(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){yn($(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},n){e(),ms(t,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&cs.has(t.value)&&e.setHasCasedChar()}},Dl={Alternative({body:t},e,n){return t.map(n).join("")},Assertion({kind:t,negate:e}){if(t==="string_end")return"$";if(t==="string_start")return"^";if(t==="word_boundary")return e?v`\B`:v`\b`;throw new Error(`Unexpected assertion kind "${t}"`)},Backreference({ref:t},e){if(typeof t!="number")throw new Error("Unexpected named backref in transformed AST");if(!e.useFlagMods&&e.accuracy==="strict"&&e.currentFlags.ignoreCase&&!e.captureMap.get(t).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+t},CapturingGroup(t,e,n){const{body:r,name:s,number:o}=t,i={ignoreCase:e.currentFlags.ignoreCase},a=e.originMap.get(t);return a&&(i.hidden=!0,o>a.number&&(i.transferTo=a.number)),e.captureMap.set(o,i),`(${s?`?<${s}>`:""}${r.map(n).join("|")})`},Character({value:t},e){const n=$(t),r=ke(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(r!==n)return r;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&yn(n)){const s=ls(n);return e.inCharClass?s.join(""):s.length>1?`[${s.join("")}]`:s[0]}return n},CharacterClass(t,e,n){const{kind:r,negate:s,parent:o}=t;let{body:i}=t;if(r==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");K.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&i.some(lr)&&(i=[gt(45),...i.filter(c=>!lr(c))]);const a=()=>`[${s?"^":""}${i.map(n).join(r==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||K.bugNestedClassIgnoresNegation)&&!s){const h=i.filter(u=>u.type==="CharacterClass"&&u.kind==="union"&&u.negate);if(h.length){const u=X(),f=u.body[0];return u.parent=o,f.parent=u,i=i.filter(d=>!h.includes(d)),t.body=i,i.length?(t.parent=f,f.body.push(t)):u.body.pop(),h.forEach(d=>{const p=be({body:[d]});d.parent=p,p.parent=u,u.body.push(p)}),n(u)}}e.inCharClass=!0;const c=a();return e.inCharClass=!1,c}const l=i[0];if(r==="union"&&!s&&l&&((!e.useFlagV||!e.verbose)&&o.kind==="union"&&!(K.bugFlagVLiteralHyphenIsRange&&e.useFlagV)||!e.verbose&&o.kind==="intersection"&&i.length===1&&l.type!=="CharacterClassRange"))return i.map(n).join("");if(!e.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(t,e){const n=t.min.value,r=t.max.value,s={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},o=ke(n,s),i=ke(r,s),a=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){const l=ms(t);zl(l).forEach(h=>{a.add(Array.isArray(h)?`${ke(h[0],s)}-${ke(h[1],s)}`:ke(h,s))})}return`${o}-${i}${[...a].join("")}`},CharacterSet({kind:t,negate:e,value:n,key:r},s){if(t==="dot")return s.currentFlags.dotAll?s.appliedGlobalFlags.dotAll||s.useFlagMods?".":"[^]":v`[^\n]`;if(t==="digit")return e?v`\D`:v`\d`;if(t==="property"){if(s.useAppliedIgnoreCase&&s.currentFlags.ignoreCase&&cs.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${e?v`\P`:v`\p`}{${r?`${r}=`:""}${n}}`}if(t==="word")return e?v`\W`:v`\w`;throw new Error(`Unexpected character set kind "${t}"`)},Flags(t,e){return(e.appliedGlobalFlags.ignoreCase?"i":"")+(t.dotAll?"s":"")+(t.sticky?"y":"")},Group({atomic:t,body:e,flags:n,parent:r},s,o){const i=s.currentFlags;n&&(s.currentFlags=ft(i,n));const a=e.map(o).join("|"),l=!s.verbose&&e.length===1&&r.type!=="Quantifier"&&!t&&(!s.useFlagMods||!n)?a:`(?${Wl(t,n,s.useFlagMods)}${a})`;return s.currentFlags=i,l},LookaroundAssertion({body:t,kind:e,negate:n},r,s){return`(?${`${e==="lookahead"?"":"<"}${n?"!":"="}`}${t.map(s).join("|")})`},Quantifier(t,e,n){return n(t.body)+Hl(t)},Subroutine({isRecursive:t,ref:e},n){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return e===0?`(?R=${r})`:v`\g<${e}&R=${r}>`}},Bl=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Fl=new Set(["-","\\","]","^","["]),Ul=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),ir=new Map([[9,v`\t`],[10,v`\n`],[11,v`\v`],[12,v`\f`],[13,v`\r`],[8232,v`\u2028`],[8233,v`\u2029`],[65279,v`\uFEFF`]]),jl=new RegExp("^\\p{Cased}$","u");function yn(t){return jl.test(t)}function ms(t,e){const n=!!(e!=null&&e.firstOnly),r=t.min.value,s=t.max.value,o=[];if(r<65&&(s===65535||s>=131071)||r===65536&&s>=131071)return o;for(let i=r;i<=s;i++){const a=$(i);if(!yn(a))continue;const l=ls(a).filter(c=>{const h=c.codePointAt(0);return h<r||h>s});if(l.length&&(o.push(...l),n))break}return o}function ke(t,{escDigit:e,inCharClass:n,useFlagV:r}){if(ir.has(t))return ir.get(t);if(t<32||t>126&&t<160||t>262143||e&&ql(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;const s=n?r?Ul:Fl:Bl,o=$(t);return(s.has(o)?"\\":"")+o}function zl(t){const e=t.map(s=>s.codePointAt(0)).sort((s,o)=>s-o),n=[];let r=null;for(let s=0;s<e.length;s++)e[s+1]===e[s]+1?r??(r=e[s]):r===null?n.push(e[s]):(n.push([r,e[s]]),r=null);return n}function Wl(t,e,n){if(t)return">";let r="";if(e&&n){const{enable:s,disable:o}=e;r=(s!=null&&s.ignoreCase?"i":"")+(s!=null&&s.dotAll?"s":"")+(o?"-":"")+(o!=null&&o.ignoreCase?"i":"")+(o!=null&&o.dotAll?"s":"")}return`${r}:`}function Hl({kind:t,max:e,min:n}){let r;return!n&&e===1?r="?":!n&&e===1/0?r="*":n===1&&e===1/0?r="+":n===e?r=`{${n}}`:r=`{${n},${e===1/0?"":e}}`,r+{greedy:"",lazy:"?",possessive:"+"}[t]}function ar({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function ql(t){return t>47&&t<58}function lr({type:t,value:e}){return t==="Character"&&e===45}var ae,te,me,le,ye,je,en,ue,Vl=(ue=class extends RegExp{constructor(n,r,s){var e=(...Fc)=>(super(...Fc),he(this,je),he(this,ae,new Map),he(this,te,null),he(this,me),he(this,le,null),he(this,ye,null),g(this,"rawOptions",{}),this);const o=!!(s!=null&&s.lazyCompile);if(n instanceof RegExp){if(s)throw new Error("Cannot provide options when copying a regexp");const i=n;e(i,r),V(this,me,i.source),i instanceof ue&&(V(this,ae,B(i,ae)),V(this,le,B(i,le)),V(this,ye,B(i,ye)),this.rawOptions=i.rawOptions)}else{const i={hiddenCaptures:[],strategy:null,transfers:[],...s};e(o?"":n,r),V(this,me,n),V(this,ae,Kl(i.hiddenCaptures,i.transfers)),V(this,ye,i.strategy),this.rawOptions=s??{}}o||V(this,te,this)}get source(){return B(this,me)||"(?:)"}exec(n){if(!B(this,te)){const{lazyCompile:o,...i}=this.rawOptions;V(this,te,new ue(B(this,me),this.flags,i))}const r=this.global||this.sticky,s=this.lastIndex;if(B(this,ye)==="clip_search"&&r&&s){this.lastIndex=0;const o=_t(this,je,en).call(this,n.slice(s));return o&&(Xl(o,s,n,this.hasIndices),this.lastIndex+=s),o}return _t(this,je,en).call(this,n)}},ae=new WeakMap,te=new WeakMap,me=new WeakMap,le=new WeakMap,ye=new WeakMap,je=new WeakSet,en=function(n){B(this,te).lastIndex=this.lastIndex;const r=Cn(ue.prototype,this,"exec").call(B(this,te),n);if(this.lastIndex=B(this,te).lastIndex,!r||!B(this,ae).size)return r;const s=[...r];r.length=1;let o;this.hasIndices&&(o=[...r.indices],r.indices.length=1);const i=[0];for(let a=1;a<s.length;a++){const{hidden:l,transferTo:c}=B(this,ae).get(a)??{};if(l?i.push(null):(i.push(r.length),r.push(s[a]),this.hasIndices&&r.indices.push(o[a])),c&&s[a]!==void 0){const h=i[c];if(!h)throw new Error(`Invalid capture transfer to "${h}"`);if(r[h]=s[a],this.hasIndices&&(r.indices[h]=o[a]),r.groups){B(this,le)||V(this,le,Ql(this.source));const u=B(this,le).get(c);u&&(r.groups[u]=s[a],this.hasIndices&&(r.indices.groups[u]=o[a]))}}}return r},ue);function Xl(t,e,n,r){if(t.index+=e,t.input=n,r){const s=t.indices;for(let i=0;i<s.length;i++){const a=s[i];a&&(s[i]=[a[0]+e,a[1]+e])}const o=s.groups;o&&Object.keys(o).forEach(i=>{const a=o[i];a&&(o[i]=[a[0]+e,a[1]+e])})}}function Kl(t,e){const n=new Map;for(const r of t)n.set(r,{hidden:!0});for(const[r,s]of e)for(const o of s)Ue(n,o,{}).transferTo=r;return n}function Ql(t){const e=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,s=0,o;for(;o=e.exec(t);){const{0:i,groups:{capture:a,name:l}}=o;i==="["?r++:r?i==="]"&&r--:a&&(s++,l&&n.set(s,l))}return n}function Zl(t,e){const n=Yl(t,e);return n.options?new Vl(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Yl(t,e){const n=as(e),r=Jr(t,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:mn}),s=vl(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),o=Ol(s,n),i=dl(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),a=fl(i.pattern),l=hl(a.pattern,{captureTransfers:i.captureTransfers,hiddenCaptures:i.hiddenCaptures}),c={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const h=l.hiddenCaptures.sort((p,m)=>p-m),u=Array.from(l.captureTransfers),f=s._strategy,d=c.pattern.length>=n.lazyCompileLength;(h.length||u.length||f||d)&&(c.options={...h.length&&{hiddenCaptures:h},...u.length&&{transfers:u},...f&&{strategy:f},...d&&{lazyCompile:d}})}return c}const cr=4294967295;class Jl{constructor(e,n={}){g(this,"regexps");this.patterns=e,this.options=n;const{forgiving:r=!1,cache:s,regexConstructor:o}=n;if(!o)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(i=>{if(typeof i!="string")return i;const a=s==null?void 0:s.get(i);if(a){if(a instanceof RegExp)return a;if(r)return null;throw a}try{const l=o(i);return s==null||s.set(i,l),l}catch(l){if(s==null||s.set(i,l),r)return null;throw l}})}findNextMatchSync(e,n,r){const s=typeof e=="string"?e:e.content,o=[];function i(a,l,c=0){return{index:a,captureIndices:l.indices.map(h=>h==null?{start:cr,end:cr,length:0}:{start:h[0]+c,end:h[1]+c,length:h[1]-h[0]})}}for(let a=0;a<this.regexps.length;a++){const l=this.regexps[a];if(l)try{l.lastIndex=n;const c=l.exec(s);if(!c)continue;if(c.index===n)return i(a,c,0);o.push([a,c,0])}catch(c){if(this.options.forgiving)continue;throw c}}if(o.length){const a=Math.min(...o.map(l=>l[1].index));for(const[l,c,h]of o)if(c.index===a)return i(l,c,h)}return null}}function ec(t,e){return Zl(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function tc(t={}){const e=Object.assign({target:"auto",cache:new Map},t);return e.regexConstructor||(e.regexConstructor=n=>ec(n,{target:e.target})),{createScanner(n){return new Jl(n,e)},createString(n){return{content:n}}}}let Ot=null;const tn=new Set,Ye=new Map,ur=["typescript","tsx","javascript","jsx","json","css","html","python","bash","yaml","markdown"],ys={typescript:()=>import("./typescript-BqvgUolh.js"),tsx:()=>import("./tsx-D6116Ycy.js"),javascript:()=>import("./javascript-WyGyM1wV.js"),jsx:()=>import("./jsx-8cLv2Six.js"),json:()=>import("./json-B8JryHcM.js"),css:()=>import("./css-PZBBrkI0.js"),html:()=>import("./html-DOf0XnR2.js"),python:()=>import("./python-B6Ihcp-E.js"),bash:()=>import("./bash-DgJyDXW6.js"),yaml:()=>import("./yaml-Bopit2L3.js"),markdown:()=>import("./markdown-DX-TNHnc.js"),rust:()=>import("./rust-CxuBE0J8.js"),go:()=>import("./go-BBr2UQCn.js"),toml:()=>import("./toml-Ms459DBw.js"),sql:()=>import("./sql-BbONfI8K.js"),c:()=>import("./c-BG-tZi7o.js"),cpp:()=>import("./cpp-BzPMphJ4.js"),java:()=>import("./java-BTDmaRNO.js"),ruby:()=>import("./ruby-BrGyNOch.js"),swift:()=>import("./swift-tEesUtni.js"),kotlin:()=>import("./kotlin-BQy537ds.js"),php:()=>import("./php-47JHu45N.js"),vue:()=>import("./vue-CWSgrUPf.js"),svelte:()=>import("./svelte-H3swLp47.js"),scss:()=>import("./scss-DxBkwadj.js")};function nc(){return Ot||(Ot=(async()=>{const[t,e,...n]=await Promise.all([import("./github-dark-BQV5ugrc.js").then(s=>s.default),import("./github-light-Rcb2q3L5.js").then(s=>s.default),...ur.map(s=>ys[s]().then(o=>o.default))]),r=await ga({themes:[t,e],langs:n,engine:tc()});for(const s of ur)tn.add(s);return r})()),Ot}async function rc(t,e){if(tn.has(e))return;if(Ye.has(e))return Ye.get(e);const n=ys[e];if(!n)return;const r=n().then(async s=>{await t.loadLanguage(s.default),tn.add(e)}).finally(()=>Ye.delete(e));Ye.set(e,r),await r}async function sc(t,e,n){const r=await nc();return await rc(r,e),r.getLoadedLanguages().includes(e)?r.codeToTokens(t,{lang:e,theme:n?"github-dark":"github-light"}).tokens:null}function oc(t){var n;if(!t)return 0;let e=32+t.length*8;for(const r of t)if(Array.isArray(r)){e+=32+r.length*8;for(const s of r)e+=128+s.content.length*2+(((n=s.color)==null?void 0:n.length)??0)*2}else e+=96+r.text.length*2;return e}const Gt=globalThis;Gt.onmessage=async({data:{id:t,input:e}})=>{try{const n=e.kind==="diff"?xs(e.oldString,e.newString):await sc(e.code,e.lang,e.isDark);Gt.postMessage({id:t,result:e.kind==="highlight"&&oc(n)>4*1024*1024?null:n})}catch{Gt.postMessage({id:t,error:!0})}};