fumapress 0.1.21 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/cli/index.mjs +1 -1
- package/dist/waku/public/assets/{Icon-D30p-2dq.js → Icon-CzRHlV7t.js} +1 -1
- package/dist/waku/public/assets/{Icon-C79MpmBL.js → Icon-D4jnmEig.js} +1 -1
- package/dist/waku/public/assets/_root-BNlQgf93.css +1 -0
- package/dist/waku/public/assets/{_root-BWh8XBln.js → _root-Brujdncx.js} +2 -2
- package/dist/waku/public/assets/{algolia-B1uhfuD6.js → algolia-B99nS-nG.js} +1 -1
- package/dist/waku/public/assets/{chevron-right-DmP6Xa1g.js → chevron-right-C8j2DxMu.js} +1 -1
- package/dist/waku/public/assets/{client-BSFjekJY.js → client-BJnu4nCQ.js} +1 -1
- package/dist/waku/public/assets/{collapsible-B2rvGry7.js → collapsible-xIcMRFdY.js} +1 -1
- package/dist/waku/public/assets/{core-C4jOG9I2.js → core-DyUNnBc9.js} +1 -1
- package/dist/waku/public/assets/{i18n-V4QzeUbV.js → i18n-3LIRVH83.js} +1 -1
- package/dist/waku/public/assets/{index-CBSxJfFU.js → index-B1CNS8yL.js} +1 -1
- package/dist/waku/public/assets/index-B4jb-YeS.js +1 -0
- package/dist/waku/public/assets/{index-B65N5043.js → index-BByRkXVE.js} +1 -1
- package/dist/waku/public/assets/{index-BQZmdbam.js → index-BDkLcF6O.js} +1 -1
- package/dist/waku/public/assets/{index-OFfnl8sH.js → index-BP1WY6Lo.js} +2 -2
- package/dist/waku/public/assets/{index-DW9Fo86a.js → index-Bjx2zPoC.js} +1 -1
- package/dist/waku/public/assets/{index-B-5ouVG_.js → index-C3s8rSzK.js} +1 -1
- package/dist/waku/public/assets/{index-2HLUYgxN.js → index-C9bf1JGP.js} +5 -5
- package/dist/waku/public/assets/{index-CYJW3hzB.js → index-CS08xFbq.js} +1 -1
- package/dist/waku/public/assets/{index-xXa72sZS.js → index-CjxkSobY.js} +1 -1
- package/dist/waku/public/assets/{index-NB9D4S1v.js → index-Co9YM64a.js} +1 -1
- package/dist/waku/public/assets/{index-DHENdpwd.js → index-DNUrMY9s.js} +1 -1
- package/dist/waku/public/assets/{index-Bojr-xLv.js → index-Dmso5wU0.js} +1 -1
- package/dist/waku/public/assets/{index-Bonlu0LX.js → index-jLLD7vSY.js} +1 -1
- package/dist/waku/public/assets/{link-item-BlYkot48.js → link-item-Cqzdqpkh.js} +1 -1
- package/dist/waku/public/assets/{merge-refs-BIez66Kl.js → merge-refs-CbdSzRBV.js} +1 -1
- package/dist/waku/public/assets/{orama-cloud-CazpSeQ0.js → orama-cloud-Dy192xXH.js} +1 -1
- package/dist/waku/public/assets/{orama-cloud-legacy-CINWERV2.js → orama-cloud-legacy-DfN2Ihs3.js} +1 -1
- package/dist/waku/public/assets/{orama-static-DwfVMMmc.js → orama-static-DlrzLbvZ.js} +1 -1
- package/dist/waku/public/assets/{page-actions--VStSULV.js → page-actions-D5R6x2EG.js} +1 -1
- package/dist/waku/public/assets/{proxy-CWSxKwWP.js → proxy-Dqy5zi5w.js} +1 -1
- package/dist/waku/public/assets/{search-default-B2jTK1EC.js → search-default-YX4fBBKq.js} +3 -3
- package/dist/waku/public/assets/{search-D1WUBd3N.js → search-pXfzPq1G.js} +1 -1
- package/dist/waku/public/assets/{use-copy-button-BO3GBlwZ.js → use-copy-button-CUBSgIa6.js} +1 -1
- package/dist/waku/public/assets/{x-CB1cQ-bo.js → x-DpD5OGBz.js} +1 -1
- package/dist/waku/server/__vite_rsc_assets_manifest.js +150 -150
- package/dist/waku/server/assets/{_...slugs_-8lFegkVB.js → _...slugs_-CgUUP3eF.js} +10 -10
- package/dist/waku/server/assets/_root-BNlQgf93.css +1 -0
- package/dist/waku/server/assets/{_root-B7AMftRI.js → _root-DEu9rGSt.js} +1 -1
- package/dist/waku/server/assets/{ai-C1Bf8DXZ.js → ai-DCNVfAwq.js} +2 -2
- package/dist/waku/server/assets/{chat-CN1qUeN-.js → chat-BjsQFRTR.js} +4 -4
- package/dist/waku/server/assets/{image.webp-PNGidV2r.js → image.webp-DJPJ0Uey.js} +1 -1
- package/dist/waku/server/assets/{img-C2Ne7ke5.js → img-BuyJk1aC.js} +1 -1
- package/dist/waku/server/assets/{index-6LQQnOj9.js → index-47GKCypM.js} +1 -1
- package/dist/waku/server/assets/{index-D6orYQqE.js → index-B7xdiwp5.js} +1 -1
- package/dist/waku/server/assets/{index-CtEJq0xW.js → index-Bb8CvExW.js} +5 -5
- package/dist/waku/server/assets/{index-DFPuXyRR.js → index-BkkzeniP.js} +1 -1
- package/dist/waku/server/assets/{index-dpJ5KyUl.js → index-Bv0lOgQ0.js} +1 -1
- package/dist/waku/server/assets/{index-AIo6cWfN.js → index-M7KOE8Pa.js} +1 -1
- package/dist/waku/server/assets/{index-QgPg52ej.js → index-WKo6xEjd.js} +1 -1
- package/dist/waku/server/assets/{index-BtnFj3IN.js → index-o1S-S6Ss.js} +1 -1
- package/dist/waku/server/assets/{search-BuYfcIgW.js → search-O98TdRSL.js} +2 -2
- package/dist/waku/server/assets/{server-entry-inner-DrYrCg3c.js → server-entry-inner-DKPA3uS5.js} +60 -12
- package/dist/waku/server/assets/{token-BJQ71htz.js → token-BpthfJxo.js} +3 -3
- package/dist/waku/server/assets/{token-util-BdUbceAe.js → token-util-3zsL8R5b.js} +1 -1
- package/dist/waku/server/assets/{token-util-WrcienE5.js → token-util-BaSHt7dT.js} +2 -2
- package/dist/waku/server/build.js +1 -1
- package/dist/waku/server/index.js +1 -1
- package/dist/waku/server/ssr/__vite_rsc_assets_manifest.js +150 -150
- package/dist/waku/server/ssr/assets/{core-CLB7CUo5.js → core-Ru16gShL.js} +3 -3
- package/dist/waku/server/ssr/assets/{index-CKMvBRnq.js → index-BFvm1zbH.js} +4 -4
- package/dist/waku/server/ssr/assets/{index-BggSP1CG.js → index-CTD5LS21.js} +3 -3
- package/dist/waku/server/ssr/assets/{index-F8Xj3Sj4.js → index-DR2zqaC5.js} +1 -1
- package/dist/waku/server/ssr/index.js +6 -6
- package/package.json +3 -3
- package/dist/waku/public/assets/_root-CzUOgPm2.css +0 -1
- package/dist/waku/public/assets/index-B7lX48CB.js +0 -1
- package/dist/waku/server/assets/_root-CzUOgPm2.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as Bt}from"./index-CkdplsNl.js";import{J as Ie,s as nt,f as Mt,c as jt,d as Dt,z as Wt,h as Ft}from"./index-B65N5043.js";import{c as Me}from"./index-2HLUYgxN.js";import"./index-OFfnl8sH.js";import"./index-B-5ouVG_.js";import"./merge-refs-BIez66Kl.js";import"./index-Bojr-xLv.js";import"./Icon-D30p-2dq.js";import"./schemas-BzqjMV9-.js";import"./use-copy-button-BO3GBlwZ.js";import"./index-DHENdpwd.js";import"./x-CB1cQ-bo.js";import"./search-D1WUBd3N.js";var S=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function qt(t){return Le(t)}function Le(t){return Array.isArray(t)?zt(t):t instanceof RegExp?t:typeof t=="object"?Ht(t):t}function zt(t){let e=[];for(let n=0,s=t.length;n<s;n++)e[n]=Le(t[n]);return e}function Ht(t){let e={};for(let n in t)e[n]=Le(t[n]);return e}function st(t,...e){return e.forEach(n=>{for(let s in n)t[s]=n[s]}),t}function rt(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?rt(t.substring(0,t.length-1)):t.substr(~e+1)}var de=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,H=class{static hasCaptures(t){return t===null?!1:(de.lastIndex=0,de.test(t))}static replaceCaptures(t,e,n){return t.replace(de,(s,r,i,o)=>{let a=n[parseInt(r||i,10)];if(a){let c=e.substring(a.start,a.end);for(;c[0]===".";)c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return s})}};function it(t,e){return t<e?-1:t>e?1:0}function ot(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,s=e.length;if(n===s){for(let r=0;r<n;r++){let i=it(t[r],e[r]);if(i!==0)return i}return 0}return n-s}function je(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 at(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ct=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},V=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Yt(t),e)}static createFromParsedTheme(t,e){return Vt(t,e)}_cachedMatchRoot=new ct(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,s=this._cachedMatchRoot.get(e).find(r=>Ut(t.parent,r.parentScopes));return s?new lt(s.fontStyle,s.foreground,s.background):null}},ge=class Y{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const s of n)e=new Y(e,s);return e}static from(...e){let n=null;for(let s=0;s<e.length;s++)n=new Y(n,e[s]);return n}push(e){return new Y(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 s=this;for(;s&&s!==e;)n.push(s.scopeName),s=s.parent;return s===e?n.reverse():void 0}};function Ut(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let s=e[n],r=!1;if(s===">"){if(n===e.length-1)return!1;s=e[++n],r=!0}for(;t&&!Kt(t.scopeName,s);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Kt(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var lt=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Yt(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],s=0;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!o.settings)continue;let a;if(typeof o.scope=="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),a=h.split(",")}else Array.isArray(o.scope)?a=o.scope:a=[""];let c=-1;if(typeof o.settings.fontStyle=="string"){c=0;let h=o.settings.fontStyle.split(" ");for(let f=0,d=h.length;f<d;f++)switch(h[f]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof o.settings.foreground=="string"&&je(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&je(o.settings.background)&&(u=o.settings.background);for(let h=0,f=a.length;h<f;h++){let g=a[h].trim().split(" "),b=g[g.length-1],_=null;g.length>1&&(_=g.slice(0,g.length-1),_.reverse()),n[s++]=new Jt(b,_,r,c,l,u)}}return n}var Jt=class{constructor(t,e,n,s,r,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=s,this.foreground=r,this.background=i}},k=(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))(k||{});function Vt(t,e){t.sort((c,l)=>{let u=it(c.scope,l.scope);return u!==0||(u=ot(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,s="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(s=c.foreground),c.background!==null&&(r=c.background)}let i=new Qt(e),o=new lt(n,i.getId(s),i.getId(r)),a=new Zt(new be(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];a.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new V(i,o,a)}var Qt=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,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)}},Xt=Object.freeze([]),be=class ut{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,s,r,i){this.scopeDepth=e,this.parentScopes=n||Xt,this.fontStyle=s,this.foreground=r,this.background=i}clone(){return new ut(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let s=0,r=e.length;s<r;s++)n[s]=e[s].clone();return n}acceptOverwrite(e,n,s,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),r!==0&&(this.background=r)}},Zt=class Se{constructor(e,n=[],s={}){this._mainRule=e,this._children=s,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let s=0,r=0;for(;e.parentScopes[s]===">"&&s++,n.parentScopes[r]===">"&&r++,!(s>=e.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-e.parentScopes[s].length;if(i!==0)return i;s++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let s=e.indexOf("."),r,i;if(s===-1?(r=e,i=""):(r=e.substring(0,s),i=e.substring(s+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Se._cmpBySpecificity),n}insert(e,n,s,r,i,o){if(n===""){this._doInsertHere(e,s,r,i,o);return}let a=n.indexOf("."),c,l;a===-1?(c=n,l=""):(c=n.substring(0,a),l=n.substring(a+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new Se(this._mainRule.clone(),be.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(e+1,l,s,r,i,o)}_doInsertHere(e,n,s,r,i){if(n===null){this._mainRule.acceptOverwrite(e,s,r,i);return}for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let c=this._rulesWithParentScopes[o];if(ot(c.parentScopes,n)===0){c.acceptOverwrite(e,s,r,i);return}}s===-1&&(s=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new be(e,n,s,r,i))}},$=class A{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=A.getLanguageId(e),s=A.getTokenType(e),r=A.getFontStyle(e),i=A.getForeground(e),o=A.getBackground(e);console.log({languageId:n,tokenType:s,fontStyle:r,foreground:i,background:o})}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,s,r,i,o,a){let c=A.getLanguageId(e),l=A.getTokenType(e),u=A.containsBalancedBrackets(e)?1:0,h=A.getFontStyle(e),f=A.getForeground(e),d=A.getBackground(e);return n!==0&&(c=n),s!==8&&(l=s),r!==null&&(u=r?1:0),i!==-1&&(h=i),o!==0&&(f=o),a!==0&&(d=a),(c<<0|l<<8|u<<10|h<<11|f<<15|d<<24)>>>0}};function Q(t,e){const n=[],s=en(t);let r=s.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=s.next()}let l=o();if(n.push({matcher:l,priority:c}),r!==",")break;r=s.next()}return n;function i(){if(r==="-"){r=s.next();const c=i();return l=>!!c&&!c(l)}if(r==="("){r=s.next();const c=a();return r===")"&&(r=s.next()),c}if(De(r)){const c=[];do c.push(r),r=s.next();while(De(r));return l=>e(c,l)}return null}function o(){const c=[];let l=i();for(;l;)c.push(l),l=i();return u=>c.every(h=>h(u))}function a(){const c=[];let l=o();for(;l&&(c.push(l),r==="|"||r===",");){do r=s.next();while(r==="|"||r===",");l=o()}return u=>c.some(h=>h(u))}}function De(t){return!!t&&!!t.match(/[\w\.:]+/)}function en(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const s=n[0];return n=e.exec(t),s}}}function ht(t){typeof t.dispose=="function"&&t.dispose()}var D=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},tn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},nn=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},sn=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new D(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new nn;for(const n of t)rn(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof D){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 rn(t,e,n,s){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof D?J({baseGrammar:i,selfGrammar:r},s):Ce(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},s);const o=n.injections(t.scopeName);if(o)for(const a of o)s.add(new D(a))}function Ce(t,e,n){if(e.repository&&e.repository[t]){const s=e.repository[t];X([s],e,n)}}function J(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&X(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&X(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function X(t,e,n){for(const s of t){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const r=s.repository?st({},e.repository,s.repository):e.repository;Array.isArray(s.patterns)&&X(s.patterns,{...e,repository:r},n);const i=s.include;if(!i)continue;const o=ft(i);switch(o.kind){case 0:J({...e,selfGrammar:e.baseGrammar},n);break;case 1:J(e,n);break;case 2:Ce(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){const c={baseGrammar:e.baseGrammar,selfGrammar:a,repository:r};o.kind===4?Ce(o.ruleName,c,n):J(c,n)}else o.kind===4?n.add(new tn(o.scopeName,o.ruleName)):n.add(new D(o.scopeName));break}}}var on=class{kind=0},an=class{kind=1},cn=class{constructor(t){this.ruleName=t}kind=2},ln=class{constructor(t){this.scopeName=t}kind=3},un=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function ft(t){if(t==="$base")return new on;if(t==="$self")return new an;const e=t.indexOf("#");if(e===-1)return new ln(t);if(e===0)return new cn(t.substring(1));{const n=t.substring(0,e),s=t.substring(e+1);return new un(n,s)}}var hn=/\\(\d+)/,We=/\\(\d+)/g,fn=-1,dt=-2;var z=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,s){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=H.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=H.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${rt(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:H.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:H.replaceCaptures(this._contentName,t,e)}},dn=class extends z{retokenizeCapturedWithRuleId;constructor(t,e,n,s,r){super(t,e,n,s),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,s){throw new Error("Not supported!")}},gn=class extends z{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,null),this._match=new W(s,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new F,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Fe=class extends z{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,s),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new F,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},we=class extends z{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r,i,o,a,c,l){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this._end=new W(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,s)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new F;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Z=class extends z{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,s,r,i,o,a,c){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new W(o,dt),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(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new F;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,s){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,s)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new F,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},gt=class N{static createCaptureRule(e,n,s,r,i){return e.registerRule(o=>new dn(n,o,s,r,i))}static getCompiledRuleId(e,n,s){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new gn(e.$vscodeTextmateLocation,e.id,e.name,e.match,N._compileCaptures(e.captures,n,s));if(typeof e.begin>"u"){e.repository&&(s=st({},s,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new Fe(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,N._compilePatterns(i,n,s))}return e.while?new Z(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,N._compileCaptures(e.beginCaptures||e.captures,n,s),e.while,N._compileCaptures(e.whileCaptures||e.captures,n,s),N._compilePatterns(e.patterns,n,s)):new we(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,N._compileCaptures(e.beginCaptures||e.captures,n,s),e.end,N._compileCaptures(e.endCaptures||e.captures,n,s),e.applyEndPatternLast,N._compilePatterns(e.patterns,n,s))}),e.id}static _compileCaptures(e,n,s){let r=[];if(e){let i=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>i&&(i=a)}for(let o=0;o<=i;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let c=0;e[o].patterns&&(c=N.getCompiledRuleId(e[o],n,s)),r[a]=N.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return r}static _compilePatterns(e,n,s){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){const a=e[i];let c=-1;if(a.include){const l=ft(a.include);switch(l.kind){case 0:case 1:c=N.getCompiledRuleId(s[a.include],n,s);break;case 2:let u=s[l.ruleName];u&&(c=N.getCompiledRuleId(u,n,s));break;case 3:case 4:const h=l.scopeName,f=l.kind===4?l.ruleName:null,d=n.getExternalGrammar(h,s);if(d)if(f){let g=d.repository[f];g&&(c=N.getCompiledRuleId(g,n,d.repository))}else c=N.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else c=N.getCompiledRuleId(a,n,s);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof Fe||l instanceof we||l instanceof Z)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(c)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},W=class mt{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const s=e.length;let r=0,i=[],o=!1;for(let a=0;a<s;a++)if(e.charAt(a)==="\\"&&a+1<s){const l=e.charAt(a+1);l==="z"?(i.push(e.substring(r,a)),i.push("$(?!\\n)(?<!\\n)"),r=a+2):(l==="A"||l==="G")&&(o=!0),a++}this.hasAnchor=o,r===0?this.source=e:(i.push(e.substring(r,s)),this.source=i.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=hn.test(this.source):this.hasBackReferences=!1}clone(){return new mt(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 s=n.map(r=>e.substring(r.start,r.end));return We.lastIndex=0,this.source.replace(We,(r,i)=>at(s[parseInt(i,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=[],s=[],r=[],i,o,a,c;for(i=0,o=this.source.length;i<o;i++)a=this.source.charAt(i),e[i]=a,n[i]=a,s[i]=a,r[i]=a,a==="\\"&&i+1<o&&(c=this.source.charAt(i+1),c==="A"?(e[i+1]="",n[i+1]="",s[i+1]="A",r[i+1]="A"):c==="G"?(e[i+1]="",n[i+1]="G",s[i+1]="",r[i+1]="G"):(e[i+1]=c,n[i+1]=c,s[i+1]=c,r[i+1]=c),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:r.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}},F=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new qe(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 s=this._items.map(r=>r.resolveAnchors(e,n));return new qe(t,s,this._items.map(r=>r.ruleId))}},qe=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;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(`
|
|
1
|
+
import{h as Bt}from"./index-CkdplsNl.js";import{J as Ie,s as nt,f as Mt,c as jt,d as Dt,z as Wt,h as Ft}from"./index-BByRkXVE.js";import{c as Me}from"./index-C9bf1JGP.js";import"./index-BP1WY6Lo.js";import"./index-C3s8rSzK.js";import"./merge-refs-CbdSzRBV.js";import"./index-Dmso5wU0.js";import"./Icon-CzRHlV7t.js";import"./schemas-BzqjMV9-.js";import"./use-copy-button-CUBSgIa6.js";import"./index-DNUrMY9s.js";import"./x-DpD5OGBz.js";import"./search-pXfzPq1G.js";var S=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function qt(t){return Le(t)}function Le(t){return Array.isArray(t)?zt(t):t instanceof RegExp?t:typeof t=="object"?Ht(t):t}function zt(t){let e=[];for(let n=0,s=t.length;n<s;n++)e[n]=Le(t[n]);return e}function Ht(t){let e={};for(let n in t)e[n]=Le(t[n]);return e}function st(t,...e){return e.forEach(n=>{for(let s in n)t[s]=n[s]}),t}function rt(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?rt(t.substring(0,t.length-1)):t.substr(~e+1)}var de=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,H=class{static hasCaptures(t){return t===null?!1:(de.lastIndex=0,de.test(t))}static replaceCaptures(t,e,n){return t.replace(de,(s,r,i,o)=>{let a=n[parseInt(r||i,10)];if(a){let c=e.substring(a.start,a.end);for(;c[0]===".";)c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return s})}};function it(t,e){return t<e?-1:t>e?1:0}function ot(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,s=e.length;if(n===s){for(let r=0;r<n;r++){let i=it(t[r],e[r]);if(i!==0)return i}return 0}return n-s}function je(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 at(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ct=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},V=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Yt(t),e)}static createFromParsedTheme(t,e){return Vt(t,e)}_cachedMatchRoot=new ct(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,s=this._cachedMatchRoot.get(e).find(r=>Ut(t.parent,r.parentScopes));return s?new lt(s.fontStyle,s.foreground,s.background):null}},ge=class Y{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const s of n)e=new Y(e,s);return e}static from(...e){let n=null;for(let s=0;s<e.length;s++)n=new Y(n,e[s]);return n}push(e){return new Y(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 s=this;for(;s&&s!==e;)n.push(s.scopeName),s=s.parent;return s===e?n.reverse():void 0}};function Ut(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let s=e[n],r=!1;if(s===">"){if(n===e.length-1)return!1;s=e[++n],r=!0}for(;t&&!Kt(t.scopeName,s);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Kt(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var lt=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Yt(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],s=0;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!o.settings)continue;let a;if(typeof o.scope=="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),a=h.split(",")}else Array.isArray(o.scope)?a=o.scope:a=[""];let c=-1;if(typeof o.settings.fontStyle=="string"){c=0;let h=o.settings.fontStyle.split(" ");for(let f=0,d=h.length;f<d;f++)switch(h[f]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof o.settings.foreground=="string"&&je(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&je(o.settings.background)&&(u=o.settings.background);for(let h=0,f=a.length;h<f;h++){let g=a[h].trim().split(" "),b=g[g.length-1],_=null;g.length>1&&(_=g.slice(0,g.length-1),_.reverse()),n[s++]=new Jt(b,_,r,c,l,u)}}return n}var Jt=class{constructor(t,e,n,s,r,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=s,this.foreground=r,this.background=i}},k=(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))(k||{});function Vt(t,e){t.sort((c,l)=>{let u=it(c.scope,l.scope);return u!==0||(u=ot(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,s="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(s=c.foreground),c.background!==null&&(r=c.background)}let i=new Qt(e),o=new lt(n,i.getId(s),i.getId(r)),a=new Zt(new be(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];a.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new V(i,o,a)}var Qt=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,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)}},Xt=Object.freeze([]),be=class ut{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,s,r,i){this.scopeDepth=e,this.parentScopes=n||Xt,this.fontStyle=s,this.foreground=r,this.background=i}clone(){return new ut(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let s=0,r=e.length;s<r;s++)n[s]=e[s].clone();return n}acceptOverwrite(e,n,s,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),r!==0&&(this.background=r)}},Zt=class Se{constructor(e,n=[],s={}){this._mainRule=e,this._children=s,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let s=0,r=0;for(;e.parentScopes[s]===">"&&s++,n.parentScopes[r]===">"&&r++,!(s>=e.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-e.parentScopes[s].length;if(i!==0)return i;s++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let s=e.indexOf("."),r,i;if(s===-1?(r=e,i=""):(r=e.substring(0,s),i=e.substring(s+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Se._cmpBySpecificity),n}insert(e,n,s,r,i,o){if(n===""){this._doInsertHere(e,s,r,i,o);return}let a=n.indexOf("."),c,l;a===-1?(c=n,l=""):(c=n.substring(0,a),l=n.substring(a+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new Se(this._mainRule.clone(),be.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(e+1,l,s,r,i,o)}_doInsertHere(e,n,s,r,i){if(n===null){this._mainRule.acceptOverwrite(e,s,r,i);return}for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let c=this._rulesWithParentScopes[o];if(ot(c.parentScopes,n)===0){c.acceptOverwrite(e,s,r,i);return}}s===-1&&(s=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new be(e,n,s,r,i))}},$=class A{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=A.getLanguageId(e),s=A.getTokenType(e),r=A.getFontStyle(e),i=A.getForeground(e),o=A.getBackground(e);console.log({languageId:n,tokenType:s,fontStyle:r,foreground:i,background:o})}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,s,r,i,o,a){let c=A.getLanguageId(e),l=A.getTokenType(e),u=A.containsBalancedBrackets(e)?1:0,h=A.getFontStyle(e),f=A.getForeground(e),d=A.getBackground(e);return n!==0&&(c=n),s!==8&&(l=s),r!==null&&(u=r?1:0),i!==-1&&(h=i),o!==0&&(f=o),a!==0&&(d=a),(c<<0|l<<8|u<<10|h<<11|f<<15|d<<24)>>>0}};function Q(t,e){const n=[],s=en(t);let r=s.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=s.next()}let l=o();if(n.push({matcher:l,priority:c}),r!==",")break;r=s.next()}return n;function i(){if(r==="-"){r=s.next();const c=i();return l=>!!c&&!c(l)}if(r==="("){r=s.next();const c=a();return r===")"&&(r=s.next()),c}if(De(r)){const c=[];do c.push(r),r=s.next();while(De(r));return l=>e(c,l)}return null}function o(){const c=[];let l=i();for(;l;)c.push(l),l=i();return u=>c.every(h=>h(u))}function a(){const c=[];let l=o();for(;l&&(c.push(l),r==="|"||r===",");){do r=s.next();while(r==="|"||r===",");l=o()}return u=>c.some(h=>h(u))}}function De(t){return!!t&&!!t.match(/[\w\.:]+/)}function en(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const s=n[0];return n=e.exec(t),s}}}function ht(t){typeof t.dispose=="function"&&t.dispose()}var D=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},tn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},nn=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},sn=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new D(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new nn;for(const n of t)rn(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof D){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 rn(t,e,n,s){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof D?J({baseGrammar:i,selfGrammar:r},s):Ce(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},s);const o=n.injections(t.scopeName);if(o)for(const a of o)s.add(new D(a))}function Ce(t,e,n){if(e.repository&&e.repository[t]){const s=e.repository[t];X([s],e,n)}}function J(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&X(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&X(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function X(t,e,n){for(const s of t){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const r=s.repository?st({},e.repository,s.repository):e.repository;Array.isArray(s.patterns)&&X(s.patterns,{...e,repository:r},n);const i=s.include;if(!i)continue;const o=ft(i);switch(o.kind){case 0:J({...e,selfGrammar:e.baseGrammar},n);break;case 1:J(e,n);break;case 2:Ce(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){const c={baseGrammar:e.baseGrammar,selfGrammar:a,repository:r};o.kind===4?Ce(o.ruleName,c,n):J(c,n)}else o.kind===4?n.add(new tn(o.scopeName,o.ruleName)):n.add(new D(o.scopeName));break}}}var on=class{kind=0},an=class{kind=1},cn=class{constructor(t){this.ruleName=t}kind=2},ln=class{constructor(t){this.scopeName=t}kind=3},un=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function ft(t){if(t==="$base")return new on;if(t==="$self")return new an;const e=t.indexOf("#");if(e===-1)return new ln(t);if(e===0)return new cn(t.substring(1));{const n=t.substring(0,e),s=t.substring(e+1);return new un(n,s)}}var hn=/\\(\d+)/,We=/\\(\d+)/g,fn=-1,dt=-2;var z=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,s){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=H.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=H.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${rt(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:H.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:H.replaceCaptures(this._contentName,t,e)}},dn=class extends z{retokenizeCapturedWithRuleId;constructor(t,e,n,s,r){super(t,e,n,s),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,s){throw new Error("Not supported!")}},gn=class extends z{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,null),this._match=new W(s,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new F,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Fe=class extends z{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,s),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new F,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},we=class extends z{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r,i,o,a,c,l){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this._end=new W(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,s)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new F;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Z=class extends z{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,s,r,i,o,a,c){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new W(o,dt),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(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new F;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,s){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,s)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new F,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},gt=class N{static createCaptureRule(e,n,s,r,i){return e.registerRule(o=>new dn(n,o,s,r,i))}static getCompiledRuleId(e,n,s){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new gn(e.$vscodeTextmateLocation,e.id,e.name,e.match,N._compileCaptures(e.captures,n,s));if(typeof e.begin>"u"){e.repository&&(s=st({},s,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new Fe(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,N._compilePatterns(i,n,s))}return e.while?new Z(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,N._compileCaptures(e.beginCaptures||e.captures,n,s),e.while,N._compileCaptures(e.whileCaptures||e.captures,n,s),N._compilePatterns(e.patterns,n,s)):new we(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,N._compileCaptures(e.beginCaptures||e.captures,n,s),e.end,N._compileCaptures(e.endCaptures||e.captures,n,s),e.applyEndPatternLast,N._compilePatterns(e.patterns,n,s))}),e.id}static _compileCaptures(e,n,s){let r=[];if(e){let i=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>i&&(i=a)}for(let o=0;o<=i;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let c=0;e[o].patterns&&(c=N.getCompiledRuleId(e[o],n,s)),r[a]=N.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return r}static _compilePatterns(e,n,s){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){const a=e[i];let c=-1;if(a.include){const l=ft(a.include);switch(l.kind){case 0:case 1:c=N.getCompiledRuleId(s[a.include],n,s);break;case 2:let u=s[l.ruleName];u&&(c=N.getCompiledRuleId(u,n,s));break;case 3:case 4:const h=l.scopeName,f=l.kind===4?l.ruleName:null,d=n.getExternalGrammar(h,s);if(d)if(f){let g=d.repository[f];g&&(c=N.getCompiledRuleId(g,n,d.repository))}else c=N.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else c=N.getCompiledRuleId(a,n,s);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof Fe||l instanceof we||l instanceof Z)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(c)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},W=class mt{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const s=e.length;let r=0,i=[],o=!1;for(let a=0;a<s;a++)if(e.charAt(a)==="\\"&&a+1<s){const l=e.charAt(a+1);l==="z"?(i.push(e.substring(r,a)),i.push("$(?!\\n)(?<!\\n)"),r=a+2):(l==="A"||l==="G")&&(o=!0),a++}this.hasAnchor=o,r===0?this.source=e:(i.push(e.substring(r,s)),this.source=i.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=hn.test(this.source):this.hasBackReferences=!1}clone(){return new mt(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 s=n.map(r=>e.substring(r.start,r.end));return We.lastIndex=0,this.source.replace(We,(r,i)=>at(s[parseInt(i,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=[],s=[],r=[],i,o,a,c;for(i=0,o=this.source.length;i<o;i++)a=this.source.charAt(i),e[i]=a,n[i]=a,s[i]=a,r[i]=a,a==="\\"&&i+1<o&&(c=this.source.charAt(i+1),c==="A"?(e[i+1]="",n[i+1]="",s[i+1]="A",r[i+1]="A"):c==="G"?(e[i+1]="",n[i+1]="G",s[i+1]="",r[i+1]="G"):(e[i+1]=c,n[i+1]=c,s[i+1]=c,r[i+1]=c),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:r.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}},F=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new qe(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 s=this._items.map(r=>r.resolveAnchors(e,n));return new qe(t,s,this._items.map(r=>r.ruleId))}},qe=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;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(`
|
|
2
2
|
`)}findNextMatchSync(t,e,n){const s=this.scanner.findNextMatchSync(t,e,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},me=class{constructor(t,e){this.languageId=t,this.tokenType=e}},mn=class Re{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new me(e,8),this._embeddedLanguagesMatcher=new pn(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?Re._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new me(0,0);_getBasicScopeAttributes=new ct(e=>{const n=this._scopeToLanguage(e),s=this._toStandardTokenType(e);return new me(n,s)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(Re.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},pn=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,s])=>at(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])}},ze=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function pt(t,e,n,s,r,i,o,a){const c=e.content.length;let l=!1,u=-1;if(o){const d=_n(t,e,n,s,r,i);r=d.stack,s=d.linePos,n=d.isFirstLine,u=d.anchorPosition}const h=Date.now();for(;!l;){if(a!==0&&Date.now()-h>a)return new ze(r,!0);f()}return new ze(r,!1);function f(){const d=yn(t,e,n,s,r,u);if(!d){i.produce(r,c),l=!0;return}const g=d.captureIndices,b=d.matchedRuleId,_=g&&g.length>0?g[0].end>s:!1;if(b===fn){const p=r.getRule(t);i.produce(r,g[0].start),r=r.withContentNameScopesList(r.nameScopesList),M(t,e,n,r,i,p.endCaptures,g),i.produce(r,g[0].end);const m=r;if(r=r.parent,u=m.getAnchorPos(),!_&&m.getEnterPos()===s){r=m,i.produce(r,c),l=!0;return}}else{const p=t.getRule(b);i.produce(r,g[0].start);const m=r,y=p.getName(e.content,g),R=r.contentNameScopesList.pushAttributed(y,t);if(r=r.push(b,s,u,g[0].end===c,null,R,R),p instanceof we){const C=p;M(t,e,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const v=C.getContentName(e.content,g),x=R.pushAttributed(v,t);if(r=r.withContentNameScopesList(x),C.endHasBackReferences&&(r=r.withEndRule(C.getEndWithResolvedBackReferences(e.content,g))),!_&&m.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(p instanceof Z){const C=p;M(t,e,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const v=C.getContentName(e.content,g),x=R.pushAttributed(v,t);if(r=r.withContentNameScopesList(x),C.whileHasBackReferences&&(r=r.withEndRule(C.getWhileWithResolvedBackReferences(e.content,g))),!_&&m.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(M(t,e,n,r,i,p.captures,g),i.produce(r,g[0].end),r=r.pop(),!_){r=r.safePop(),i.produce(r,c),l=!0;return}}g[0].end>s&&(s=g[0].end,n=!1)}}function _n(t,e,n,s,r,i){let o=r.beginRuleCapturedEOL?0:-1;const a=[];for(let c=r;c;c=c.pop()){const l=c.getRule(t);l instanceof Z&&a.push({rule:l,stack:c})}for(let c=a.pop();c;c=a.pop()){const{ruleScanner:l,findOptions:u}=Cn(c.rule,t,c.stack.endRule,n,s===o),h=l.findNextMatchSync(e,s,u);if(h){if(h.ruleId!==dt){r=c.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(i.produce(c.stack,h.captureIndices[0].start),M(t,e,n,c.stack,i,c.rule.whileCaptures,h.captureIndices),i.produce(c.stack,h.captureIndices[0].end),o=h.captureIndices[0].end,h.captureIndices[0].end>s&&(s=h.captureIndices[0].end,n=!1))}else{r=c.stack.pop();break}}return{stack:r,linePos:s,anchorPosition:o,isFirstLine:n}}function yn(t,e,n,s,r,i){const o=bn(t,e,n,s,r,i),a=t.getInjections();if(a.length===0)return o;const c=Sn(a,t,e,n,s,r,i);if(!c)return o;if(!o)return c;const l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function bn(t,e,n,s,r,i){const o=r.getRule(t),{ruleScanner:a,findOptions:c}=_t(o,t,r.endRule,n,s===i),l=a.findNextMatchSync(e,s,c);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function Sn(t,e,n,s,r,i,o){let a=Number.MAX_VALUE,c=null,l,u=0;const h=i.contentNameScopesList.getScopeNames();for(let f=0,d=t.length;f<d;f++){const g=t[f];if(!g.matcher(h))continue;const b=e.getRule(g.ruleId),{ruleScanner:_,findOptions:p}=_t(b,e,null,s,r===o),m=_.findNextMatchSync(n,r,p);if(!m)continue;const y=m.captureIndices[0].start;if(!(y>=a)&&(a=y,c=m.captureIndices,l=m.ruleId,u=g.priority,a===r))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function _t(t,e,n,s,r){return{ruleScanner:t.compileAG(e,n,s,r),findOptions:0}}function Cn(t,e,n,s,r){return{ruleScanner:t.compileWhileAG(e,n,s,r),findOptions:0}}function M(t,e,n,s,r,i,o){if(i.length===0)return;const a=e.content,c=Math.min(i.length,o.length),l=[],u=o[0].end;for(let h=0;h<c;h++){const f=i[h];if(f===null)continue;const d=o[h];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?r.produceFromScopes(l[l.length-1].scopes,d.start):r.produce(s,d.start),f.retokenizeCapturedWithRuleId){const b=f.getName(a,o),_=s.contentNameScopesList.pushAttributed(b,t),p=f.getContentName(a,o),m=_.pushAttributed(p,t),y=s.push(f.retokenizeCapturedWithRuleId,d.start,-1,!1,null,_,m),R=t.createOnigString(a.substring(0,d.end));pt(t,R,n&&d.start===0,d.start,y,r,!1,0),ht(R);continue}const g=f.getName(a,o);if(g!==null){const _=(l.length>0?l[l.length-1].scopes:s.contentNameScopesList).pushAttributed(g,t);l.push(new wn(_,d.end))}}for(;l.length>0;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var wn=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function Rn(t,e,n,s,r,i,o,a){return new kn(t,e,n,s,r,i,o,a)}function He(t,e,n,s,r){const i=Q(e,ee),o=gt.getCompiledRuleId(n,s,r.repository);for(const a of i)t.push({debugSelector:e,matcher:a.matcher,ruleId:o,grammar:r,priority:a.priority})}function ee(t,e){if(e.length<t.length)return!1;let n=0;return t.every(s=>{for(let r=n;r<e.length;r++)if(Nn(e[r],s))return n=r+1,!0;return!1})}function Nn(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 kn=class{constructor(t,e,n,s,r,i,o,a){if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=a,this._basicScopeAttributesProvider=new mn(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ue(e,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const c of Object.keys(r)){const l=Q(c,ee);for(const u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[c]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},e=[],n=this._rootScopeName,s=t.lookup(n);if(s){const r=s.injections;if(r)for(let o in r)He(e,o,r[o],this,s);const i=this._grammarRepository.injections(n);i&&i.forEach(o=>{const a=this.getExternalGrammar(o);if(a){const c=a.injectionSelector;c&&He(e,c,a,this,a)}})}return e.sort((r,i)=>r.priority-i.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]=Ue(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const s=this._tokenize(t,e,!1,n);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(t,e,n=0){const s=this._tokenize(t,e,!0,n);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(t,e,n,s){this._rootId===-1&&(this._rootId=gt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!e||e===Ne.NULL){r=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=$.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),f=this.getRule(this._rootId).getName(null,null);let d;f?d=j.createRootAndLookUpScopeName(f,h,this):d=j.createRoot("unknown",h),e=new Ne(null,this._rootId,-1,-1,!1,null,d,d)}else r=!1,e.reset();t=t+`
|
|
3
3
|
`;const i=this.createOnigString(t),o=i.content.length,a=new vn(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),c=pt(this,i,r,0,e,a,!0,s);return ht(i),{lineLength:o,lineTokens:a,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Ue(t,e){return t=qt(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 j=class T{constructor(e,n,s){this.parent=e,this.scopePath=n,this.tokenAttributes=s}static fromExtension(e,n){let s=e,r=e?.scopePath??null;for(const i of n)r=ge.push(r,i.scopeNames),s=new T(s,r,i.encodedTokenAttributes);return s}static createRoot(e,n){return new T(null,new ge(null,e),n)}static createRootAndLookUpScopeName(e,n,s){const r=s.getMetadataForScope(e),i=new ge(null,e),o=s.themeProvider.themeMatch(i),a=T.mergeAttributes(n,r,o);return new T(null,i,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return T.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,s){let r=-1,i=0,o=0;return s!==null&&(r=s.fontStyle,i=s.foregroundId,o=s.backgroundId),$.set(e,n.languageId,n.tokenType,null,r,i,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return T._pushAttributed(this,e,n);const s=e.split(/ /g);let r=this;for(const i of s)r=T._pushAttributed(r,i,n);return r}static _pushAttributed(e,n,s){const r=s.getMetadataForScope(n),i=e.scopePath.push(n),o=s.themeProvider.themeMatch(i),a=T.mergeAttributes(e.tokenAttributes,r,o);return new T(e,i,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let s=this;for(;s&&s!==e;)n.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(s.parent?.scopePath??null)}),s=s.parent;return s===e?n.reverse():void 0}},Ne=class E{constructor(e,n,s,r,i,o,a,c){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new E(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:E._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?j.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(){E._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,s,r,i,o,a){return new E(this,e,n,s,r,i,o,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){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.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 E(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(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){const s=j.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new E(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,j.fromExtension(s,n.contentNameScopesList))}},An=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Q(n,ee).map(s=>s.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>Q(n,ee).map(s=>s.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}},vn=class{constructor(t,e,n,s){this.balancedBracketSelectors=s,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let s=t?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=t?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(i)&&(s=$.set(s,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(s=$.set(s,0,8,r,-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?.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 s=0,r=this._binaryTokens.length;s<r;s++)n[s]=this._binaryTokens[s];return n}},Tn=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,s,r){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,Rn(t,i,e,n,s,r,this,this._onigLib))}return this._grammars.get(t)}},In=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Tn(V.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(V.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,s){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:s})}loadGrammarWithConfiguration(e,n,s){return this._loadGrammar(e,n,s.embeddedLanguages,s.tokenTypes,new An(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,s,r,i){const o=new sn(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(a=>this._loadSingleGrammar(a.scopeName)),o.processQueue();return this._grammarForScopeName(e,n,s,r,i)}_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 s=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,s)}}addGrammar(e,n=[],s=0,r=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,s,r)}_grammarForScopeName(e,n=0,s=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,n,s,r,i)}},ke=Ne.NULL;function te(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},s=typeof t=="string"?t:t.name;for(const[r,i]of Object.entries(e?.colorReplacements||{}))typeof i=="string"?n[r]=i:r===s&&Object.assign(n,i);return n}function L(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function Ln(t){return Array.isArray(t)?t:[t]}async function yt(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function oe(t){return!t||["plaintext","txt","text","plain"].includes(t)}function bt(t){return t==="ansi"||oe(t)}function ae(t){return t==="none"}function St(t){return ae(t)}function ce(t,e=!1){if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let s=0;const r=[];for(let i=0;i<n.length;i+=2){const o=e?n[i]+(n[i+1]||""):n[i];r.push([o,s]),s+=n[i].length,s+=n[i+1]?.length||0}return r}const Ke={light:"#333333",dark:"#bbbbbb"},Ye={light:"#fffffe",dark:"#1e1e1e"},Je="__shiki_resolved";function xe(t){if(t?.[Je])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||="dark",e.colorReplacements={...e.colorReplacements},e.settings||=[];let{bg:n,fg:s}=e;if(!n||!s){const a=e.settings?e.settings.find(c=>!c.name&&!c.scope):void 0;a?.settings?.foreground&&(s=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!s&&e?.colors?.["editor.foreground"]&&(s=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),s||(s=e.type==="light"?Ke.light:Ke.dark),n||(n=e.type==="light"?Ye.light:Ye.dark),e.fg=s,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 r=0;const i=new Map;function o(a){if(i.has(a))return i.get(a);r+=1;const c=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${c}`]?o(a):(i.set(a,c),c)}e.settings=e.settings.map(a=>{const c=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),l=a.settings?.background&&!a.settings.background.startsWith("#");if(!c&&!l)return a;const u={...a,settings:{...a.settings}};if(c){const h=o(a.settings.foreground);e.colorReplacements[h]=a.settings.foreground,u.settings.foreground=h}if(l){const h=o(a.settings.background);e.colorReplacements[h]=a.settings.background,u.settings.background=h}return u});for(const a of Object.keys(e.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!e.colors[a]?.startsWith("#")){const c=o(e.colors[a]);e.colorReplacements[c]=e.colors[a],e.colors[a]=c}return Object.defineProperty(e,Je,{enumerable:!1,writable:!1,value:!0}),e}async function Ct(t){return Array.from(new Set((await Promise.all(t.filter(e=>!bt(e)).map(async e=>await yt(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function wt(t){return(await Promise.all(t.map(async e=>St(e)?null:xe(await yt(e))))).filter(e=>!!e)}function Rt(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 S(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}var xn=class extends In{_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(t,e,n,s={}){super(t),this._resolver=t,this._themes=e,this._langs=n,this._alias=s,this._themes.map(r=>this.loadTheme(r)),this.loadLanguages(this._langs)}getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const e=xe(t);return e.name&&(this._resolvedThemes.set(e.name,e),this._loadedThemesCache=null),e}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let e=this._textmateThemeCache.get(t);e||(e=V.createFromRawTheme(t),this._textmateThemeCache.set(t,e)),this._syncRegistry.setTheme(e)}getGrammar(t){return t=Rt(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const e=new Set([...this._langMap.values()].filter(r=>r.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const n={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const s=this.loadGrammarWithConfiguration(t.scopeName,1,n);if(s.name=t.name,this._resolvedGrammars.set(t.name,s),t.aliases&&t.aliases.forEach(r=>{this._alias[r]=t.name}),this._loadedLanguagesCache=null,e.size)for(const r of e)this._resolvedGrammars.delete(r.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(r.scopeName),this._syncRegistry?._grammars?.delete(r.scopeName),this.loadLanguage(this._langMap.get(r.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const s of t)this.resolveEmbeddedLanguages(s);const e=Array.from(this._langGraph.entries()),n=e.filter(([s,r])=>!r);if(n.length){const s=e.filter(([r,i])=>i?(i.embeddedLanguages||i.embeddedLangs)?.some(o=>n.map(([a])=>a).includes(o)):!1).filter(r=>!n.includes(r));throw new S(`Missing languages ${n.map(([r])=>`\`${r}\``).join(", ")}, required by ${s.map(([r])=>`\`${r}\``).join(", ")}`)}for(const[s,r]of e)this._resolver.addLanguage(r);for(const[s,r]of e)this.loadLanguage(r)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const e=t.embeddedLanguages??t.embeddedLangs;if(e)for(const n of e)this._langGraph.set(n,this._langMap.get(n))}},En=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,e){this._onigLib={createOnigScanner:n=>t.createScanner(n),createOnigString:n=>t.createString(n)},e.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(e=>{this._langs.set(e,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(e=>{this._injections.get(e)||this._injections.set(e,[]),this._injections.get(e).push(t.scopeName)})}getInjections(t){const e=t.split(".");let n=[];for(let s=1;s<=e.length;s++){const r=e.slice(0,s).join(".");n=[...n,...this._injections.get(r)||[]]}return n}};let B=0;function Pn(t){B+=1,t.warnings!==!1&&B>=10&&B%10===0&&console.warn(`[Shiki] ${B} 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 S("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),s=(t.themes||[]).flat(1).map(xe),r=new xn(new En(t.engine,n),s,n,t.langAlias);let i;function o(m){return Rt(m,t.langAlias)}function a(m){_();const y=r.getGrammar(typeof m=="string"?m:m.name);if(!y)throw new S(`Language \`${m}\` not found, you may need to load it first`);return y}function c(m){if(m==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};_();const y=r.getTheme(m);if(!y)throw new S(`Theme \`${m}\` not found, you may need to load it first`);return y}function l(m){_();const y=c(m);return i!==m&&(r.setTheme(y),i=m),{theme:y,colorMap:r.getColorMap()}}function u(){return _(),r.getLoadedThemes()}function h(){return _(),r.getLoadedLanguages()}function f(...m){_(),r.loadLanguages(m.flat(1))}async function d(...m){return f(await Ct(m))}function g(...m){_();for(const y of m.flat(1))r.loadTheme(y)}async function b(...m){return _(),g(await wt(m))}function _(){if(e)throw new S("Shiki instance has been disposed")}function p(){e||(e=!0,r.dispose(),B-=1)}return{setTheme:l,getTheme:c,getLanguage:a,getLoadedThemes:u,getLoadedLanguages:h,resolveLangAlias:o,loadLanguage:d,loadLanguageSync:f,loadTheme:b,loadThemeSync:g,dispose:p,[Symbol.dispose]:p}}async function Gn(t){t.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,s]=await Promise.all([wt(t.themes||[]),Ct(t.langs||[]),t.engine]);return Pn({...t,themes:e,langs:n,engine:s})}const Nt=new WeakMap;function le(t,e){Nt.set(t,e)}function q(t){return Nt.get(t)}var ue=class kt{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new kt(Object.fromEntries(Ln(n).map(s=>[s,ke])),e)}constructor(...e){if(e.length===2){const[n,s]=e;this.lang=s,this._stacks=n}else{const[n,s,r]=e;this.lang=s,this._stacks={[r]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return On(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function On(t){const e=[],n=new Set;function s(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&e.push(i),r.parent&&s(r.parent)}return s(t),e}function $n(t,e){if(!(t instanceof ue))throw new S("Invalid grammar state");return t.getInternalStack(e)}function At(t,e,n={}){const{theme:s=t.getLoadedThemes()[0]}=n;if(oe(t.resolveLangAlias(n.lang||"text"))||ae(s))return ce(e).map(a=>[{content:a[0],offset:a[1]}]);const{theme:r,colorMap:i}=t.setTheme(s),o=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==o.name)throw new S(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(r.name))throw new S(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return Mn(e,o,r,i,n)}function Bn(...t){if(t.length===2)return q(t[1]);const[e,n,s={}]=t,{lang:r="text",theme:i=e.getLoadedThemes()[0]}=s;if(oe(r)||ae(i))throw new S("Plain language does not have grammar state");if(r==="ansi")throw new S("ANSI language does not have grammar state");const{theme:o,colorMap:a}=e.setTheme(i),c=e.getLanguage(r);return new ue(Ee(n,c,o,a,s).stateStack,c.name,o.name)}function Mn(t,e,n,s,r){const i=Ee(t,e,n,s,r),o=new ue(i.stateStack,e.name,n.name);return le(i.tokens,o),i.tokens}function Ee(t,e,n,s,r){const i=te(n,r),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=r,c=ce(t);let l=r.grammarState?$n(r.grammarState,n.name)??ke:r.grammarContextCode!=null?Ee(r.grammarContextCode,e,n,s,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:ke,u=[];const h=[];for(let f=0,d=c.length;f<d;f++){const[g,b]=c[f];if(g===""){u=[],h.push([]);continue}if(o>0&&g.length>=o){u=[],h.push([{content:g,offset:b,color:"",fontStyle:0}]);continue}let _,p,m;r.includeExplanation&&(_=e.tokenizeLine(g,l,a),p=_.tokens,m=0);const y=e.tokenizeLine2(g,l,a),R=y.tokens.length/2;for(let C=0;C<R;C++){const v=y.tokens[2*C],x=C+1<R?y.tokens[2*C+2]:g.length;if(v===x)continue;const Oe=y.tokens[2*C+1],Ot=L(s[$.getForeground(Oe)],i),$t=$.getFontStyle(Oe),he={content:g.substring(v,x),offset:b+v,color:Ot,fontStyle:$t};if(r.includeExplanation){const $e=[];if(r.includeExplanation!=="scopeName")for(const I of n.settings){let G;switch(typeof I.scope){case"string":G=I.scope.split(/,/).map(fe=>fe.trim());break;case"object":G=I.scope;break;default:continue}$e.push({settings:I,selectors:G.map(fe=>fe.split(/ /))})}he.explanation=[];let Be=0;for(;v+Be<x;){const I=p[m],G=g.substring(I.startIndex,I.endIndex);Be+=G.length,he.explanation.push({content:G,scopes:r.includeExplanation==="scopeName"?jn(I.scopes):Dn($e,I.scopes)}),m+=1}}u.push(he)}h.push(u),u=[],l=y.ruleStack}return{tokens:h,stateStack:l}}function jn(t){return t.map(e=>({scopeName:e}))}function Dn(t,e){const n=[];for(let s=0,r=e.length;s<r;s++){const i=e[s];n[s]={scopeName:i,themeMatches:Fn(t,i,e.slice(0,s))}}return n}function Ve(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function Wn(t,e,n){if(!Ve(t[t.length-1],e))return!1;let s=t.length-2,r=n.length-1;for(;s>=0&&r>=0;)Ve(t[s],n[r])&&(s-=1),r-=1;return s===-1}function Fn(t,e,n){const s=[];for(const{selectors:r,settings:i}of t)for(const o of r)if(Wn(o,e,n)){s.push(i);break}return s}function vt(t,e,n,s=At){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=r.map(l=>{const u=s(t,e,{...n,theme:l.theme});return{tokens:u,state:q(u),theme:typeof l.theme=="string"?l.theme:l.theme.name}}),o=qn(...i.map(l=>l.tokens)),a=o[0].map((l,u)=>l.map((h,f)=>{const d={content:h.content,variants:{},offset:h.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=h.explanation),o.forEach((g,b)=>{const{content:_,explanation:p,offset:m,...y}=g[u][f];d.variants[r[b].color]=y}),d})),c=i[0].state?new ue(Object.fromEntries(i.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),i[0].state.lang):void 0;return c&&le(a,c),a}function qn(...t){const e=t.map(()=>[]),n=t.length;for(let s=0;s<t[0].length;s++){const r=t.map(c=>c[s]),i=e.map(()=>[]);e.forEach((c,l)=>c.push(i[l]));const o=r.map(()=>0),a=r.map(c=>c[0]);for(;a.every(c=>c);){const c=Math.min(...a.map(l=>l.content.length));for(let l=0;l<n;l++){const u=a[l];u.content.length===c?(i[l].push(u),o[l]+=1,a[l]=r[l][o[l]]):(i[l].push({...u,content:u.content.slice(0,c)}),a[l]={...u,content:u.content.slice(c),offset:u.offset+c})}}}return e}const zn=/["&'<>`]/g,Hn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Un=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Kn=/[|\\{}()[\]^$+*?.]/g,Qe=new WeakMap;function Yn(t,e){if(t=t.replace(e.subset?Jn(e.subset):zn,s),e.subset||e.escapeOnly)return t;return t.replace(Hn,n).replace(Un,s);function n(r,i,o){return e.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,o.charCodeAt(i+2),e)}function s(r,i,o){return e.format(r.charCodeAt(0),o.charCodeAt(i+1),e)}}function Jn(t){let e=Qe.get(t);return e||(e=Vn(t),Qe.set(t,e)),e}function Vn(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Kn,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const Qn=/[\dA-Fa-f]/;function Xn(t,e,n){const s="&#x"+t.toString(16).toUpperCase();return n&&e&&!Qn.test(String.fromCharCode(e))?s:s+";"}const Zn=/\d/;function es(t,e,n){const s="&#"+String(t);return n&&e&&!Zn.test(String.fromCharCode(e))?s:s+";"}const ts=["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"],pe={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:"€"},ns=["cent","copy","divide","gt","lt","not","para","times"],Tt={}.hasOwnProperty,Ae={};let U;for(U in pe)Tt.call(pe,U)&&(Ae[pe[U]]=U);const ss=/[^\dA-Za-z]/;function rs(t,e,n,s){const r=String.fromCharCode(t);if(Tt.call(Ae,r)){const i=Ae[r],o="&"+i;return n&&ts.includes(i)&&!ns.includes(i)&&(!s||e&&e!==61&&ss.test(String.fromCharCode(e)))?o:o+";"}return""}function is(t,e,n){let s=Xn(t,e,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=rs(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=es(t,e,n.omitOptionalSemicolons);i.length<s.length&&(s=i)}return r&&(!n.useShortestReferences||r.length<s.length)?r:s}function O(t,e){return Yn(t,Object.assign({format:is},e))}const os=/^>|^->|<!--|-->|--!>|<!-$/g,as=[">"],cs=["<",">"];function ls(t,e,n,s){return s.settings.bogusComments?"<?"+O(t.value,Object.assign({},s.settings.characterReferences,{subset:as}))+">":"<!--"+t.value.replace(os,r)+"-->";function r(i){return O(i,Object.assign({},s.settings.characterReferences,{subset:cs}))}}function us(t,e,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}const w=Lt(1),It=Lt(-1),hs=[];function Lt(t){return e;function e(n,s,r){const i=n?n.children:hs;let o=(s||0)+t,a=i[o];if(!r)for(;a&&Ie(a);)o+=t,a=i[o];return a}}const fs={}.hasOwnProperty;function xt(t){return e;function e(n,s,r){return fs.call(t,n.tagName)&&t[n.tagName](n,s,r)}}const Pe=xt({body:gs,caption:_e,colgroup:_e,dd:ys,dt:_s,head:_e,html:ds,li:ps,optgroup:bs,option:Ss,p:ms,rp:Xe,rt:Xe,tbody:ws,td:Ze,tfoot:Rs,th:Ze,thead:Cs,tr:Ns});function _e(t,e,n){const s=w(n,e,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Ie(s.value.charAt(0)))}function ds(t,e,n){const s=w(n,e);return!s||s.type!=="comment"}function gs(t,e,n){const s=w(n,e);return!s||s.type!=="comment"}function ms(t,e,n){const s=w(n,e);return s?s.type==="element"&&(s.tagName==="address"||s.tagName==="article"||s.tagName==="aside"||s.tagName==="blockquote"||s.tagName==="details"||s.tagName==="div"||s.tagName==="dl"||s.tagName==="fieldset"||s.tagName==="figcaption"||s.tagName==="figure"||s.tagName==="footer"||s.tagName==="form"||s.tagName==="h1"||s.tagName==="h2"||s.tagName==="h3"||s.tagName==="h4"||s.tagName==="h5"||s.tagName==="h6"||s.tagName==="header"||s.tagName==="hgroup"||s.tagName==="hr"||s.tagName==="main"||s.tagName==="menu"||s.tagName==="nav"||s.tagName==="ol"||s.tagName==="p"||s.tagName==="pre"||s.tagName==="section"||s.tagName==="table"||s.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 ps(t,e,n){const s=w(n,e);return!s||s.type==="element"&&s.tagName==="li"}function _s(t,e,n){const s=w(n,e);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function ys(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function Xe(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function bs(t,e,n){const s=w(n,e);return!s||s.type==="element"&&s.tagName==="optgroup"}function Ss(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function Cs(t,e,n){const s=w(n,e);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function ws(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function Rs(t,e,n){return!w(n,e)}function Ns(t,e,n){const s=w(n,e);return!s||s.type==="element"&&s.tagName==="tr"}function Ze(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const ks=xt({body:Ts,colgroup:Is,head:vs,html:As,tbody:Ls});function As(t){const e=w(t,-1);return!e||e.type!=="comment"}function vs(t){const e=new Set;for(const s of t.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(e.has(s.tagName))return!1;e.add(s.tagName)}const n=t.children[0];return!n||n.type==="element"}function Ts(t){const e=w(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Ie(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Is(t,e,n){const s=It(n,e),r=w(t,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&Pe(s,n.children.indexOf(s),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function Ls(t,e,n){const s=It(n,e),r=w(t,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&Pe(s,n.children.indexOf(s),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const K={name:[[`
|
|
4
4
|
\f\r &/=>`.split(""),`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,j as m}from"./index-
|
|
1
|
+
import{r as s,j as m}from"./index-BP1WY6Lo.js";import{u as d,a as P}from"./index-C3s8rSzK.js";const c={search:"Search",searchNoResult:"No results found",toc:"On this page",tocNoHeadings:"No Headings",lastUpdate:"Last updated on",chooseLanguage:"Choose a language",nextPage:"Next Page",previousPage:"Previous Page",chooseTheme:"Theme",editOnGithub:"Edit on GitHub"},h=s.createContext({text:{...c}});function R(t){return C().text[t.label]}function C(){return s.useContext(h)}function b({locales:t=[],locale:o,onLocaleChange:a,children:g,translations:r}){const f=d(),x=P(),u=e=>{if(a)return a(e);const n=x.split("/").filter(p=>p.length>0);n[0]!==o?n.unshift(e):n[0]=e,f.push(`/${n.join("/")}`)},i=s.useRef(u);return i.current=u,m.jsx(h,{value:s.useMemo(()=>({locale:o,locales:t,text:{...c,...r},onChange:e=>i.current(e)}),[o,t,r]),children:g})}export{R as I,b as a,C as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,u as y,d as z,C as R,e as q,i as J,f as K,g as Q,_ as X}from"./collapsible-
|
|
1
|
+
import{c as S,u as y,d as z,C as R,e as q,i as J,f as K,g as Q,_ as X}from"./collapsible-xIcMRFdY.js";import{I as O,u as v}from"./i18n-3LIRVH83.js";import{t as l,b as Y}from"./index-Dmso5wU0.js";import{u as T,c as k,d as D,T as P,a as Z,b as W,e as ee,f as te,C as se,S as re,V as I,M as L}from"./page-actions-D5R6x2EG.js";import{u as oe}from"./client-BJnu4nCQ.js";import{r as m,j as e}from"./index-BP1WY6Lo.js";import"./index-jLLD7vSY.js";import{a as ne}from"./index-C3s8rSzK.js";import{L as B}from"./merge-refs-CbdSzRBV.js";import{C as E}from"./chevron-right-C8j2DxMu.js";import"./index-CjxkSobY.js";import"./Icon-CzRHlV7t.js";import"./use-copy-button-CUBSgIa6.js";import"./link-item-Cqzdqpkh.js";import"./search-pXfzPq1G.js";import"./index-DNUrMY9s.js";function ae(t){return e.jsx(W,{...t})}function ce({container:t,header:r,footer:s,style:a="normal"}){const o=T(),{TOCItems:d,TOCEmpty:i,TOCItem:c}=a==="clerk"?k:D;return e.jsxs("div",{id:"nd-toc",...t,className:l("sticky top-(--fd-docs-row-1) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] flex flex-col [grid-area:toc] w-(--fd-toc-width) pt-12 pe-4 pb-2 max-xl:hidden",t?.className),children:[r,e.jsxs("h3",{id:"toc-title",className:"inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground",children:[e.jsx(Z,{className:"size-4"}),e.jsx(O,{label:"toc"})]}),e.jsx(P,{children:e.jsxs(d,{children:[o.length===0&&e.jsx(i,{}),o.map(n=>e.jsx(c,{item:n},n.url))]})}),s]})}const M=m.createContext(null);function ie({container:t,trigger:r,content:s,header:a,footer:o,style:d="normal"}){const i=T(),c=m.useRef(null),[n,u]=m.useState(!1),{isNavTransparent:p}=oe(),{TOCItems:f,TOCItem:g,TOCEmpty:j}=d==="clerk"?k:D,x=m.useEffectEvent(h=>{!n||!(h.target instanceof HTMLElement)||c.current&&!c.current.contains(h.target)&&u(!1)}),U=()=>{u(!1)};return m.useEffect(()=>(window.addEventListener("click",x),()=>{window.removeEventListener("click",x)}),[]),e.jsx(M,{value:m.useMemo(()=>({open:n,setOpen:u}),[u,n]),children:e.jsx(S,{open:n,onOpenChange:u,"data-toc-popover":"",...t,className:l("sticky top-(--fd-docs-row-2) z-10 [grid-area:toc-popover] h-(--fd-toc-popover-height) xl:hidden max-xl:layout:[--fd-toc-popover-height:--spacing(10)]",t?.className),children:e.jsxs("header",{ref:c,className:l("border-b backdrop-blur-sm transition-colors",(!p||n)&&"bg-fd-background/80",n&&"shadow-lg"),children:[e.jsx(le,{...r}),e.jsxs(me,{...s,children:[a,e.jsx(P,{children:e.jsxs(f,{children:[i.length===0&&e.jsx(j,{}),i.map(h=>e.jsx(g,{item:h,onClick:U},h.url))]})}),o]})]})})})}function le({className:t,...r}){const{text:s}=v(),{open:a}=m.use(M),o=ee(),d=o.findIndex(n=>n.active),i=y().at(-1),c=d!==-1&&!a;return e.jsxs(z,{className:l("flex w-full h-10 items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:size-4 md:px-6",t),"data-toc-popover-trigger":"",...r,children:[e.jsx(ue,{value:(d+1)/Math.max(1,o.length),max:1,className:l("shrink-0",a&&"text-fd-primary")}),e.jsxs("span",{className:"grid flex-1 *:my-auto *:row-start-1 *:col-start-1",children:[e.jsx("span",{className:l("truncate transition-[opacity,translate,color]",a&&"text-fd-foreground",c&&"opacity-0 -translate-y-full pointer-events-none"),children:i?.name??s.toc}),e.jsx("span",{className:l("truncate transition-[opacity,translate]",!c&&"opacity-0 translate-y-full pointer-events-none"),children:o[d]?.original.title})]}),e.jsx(R,{className:l("shrink-0 transition-transform mx-0.5",a&&"rotate-180")})]})}function de(t,r,s){return t<r?r:t>s?s:t}function ue({value:t,strokeWidth:r=2,size:s=24,min:a=0,max:o=100,...d}){const i=de(t,a,o),c=(s-r)/2,n=2*Math.PI*c,u=i/o*n,p={cx:s/2,cy:s/2,r:c,fill:"none",strokeWidth:r};return e.jsxs("svg",{role:"progressbar",viewBox:`0 0 ${s} ${s}`,"aria-valuenow":i,"aria-valuemin":a,"aria-valuemax":o,...d,children:[e.jsx("circle",{...p,className:"stroke-current/25"}),e.jsx("circle",{...p,stroke:"currentColor",strokeDasharray:n,strokeDashoffset:n-u,strokeLinecap:"round",transform:`rotate(-90 ${s/2} ${s/2})`,className:"transition-all"})]})}function me(t){return e.jsx(q,{"data-toc-popover-content":"",...t,children:e.jsx("div",{className:"flex flex-col px-4 max-h-[50vh] md:px-6",children:t.children})})}function C({items:t,children:r,className:s,...a}){const o=te(),d=ne(),{previous:i,next:c}=m.useMemo(()=>{if(t)return t;const n=o.findIndex(u=>J(u.url,d));return n===-1?{}:{previous:o[n-1],next:o[n+1]}},[o,t,d]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:l("@container grid gap-4",i&&c?"grid-cols-2":"grid-cols-1",s),...a,children:[i&&e.jsx(w,{item:i,index:0}),c&&e.jsx(w,{item:c,index:1})]}),r]})}function w({item:t,index:r}){const{text:s}=v(),a=r===0?se:E;return e.jsxs(B,{href:t.url,className:l("flex flex-col gap-2 rounded-lg border p-4 text-sm transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground @max-lg:col-span-full",r===1&&"text-end"),children:[e.jsxs("div",{className:l("inline-flex items-center gap-1.5 font-medium",r===1&&"flex-row-reverse"),children:[e.jsx(a,{className:"-mx-1 size-4 shrink-0 rtl:rotate-180"}),e.jsx("p",{children:t.name})]}),e.jsx("p",{className:"text-fd-muted-foreground truncate",children:t.description??(r===0?s.previousPage:s.nextPage)})]})}function b({includeRoot:t,includeSeparator:r,includePage:s,...a}){const o=y(),{root:d}=K(),i=m.useMemo(()=>Q(d,o,{includePage:s,includeSeparator:r,includeRoot:t}),[s,t,r,o,d]);return i.length===0?null:e.jsx("div",{...a,className:l("flex items-center gap-1.5 text-sm text-fd-muted-foreground",a.className),children:i.map((c,n)=>{const u=l("truncate",n===i.length-1&&"text-fd-primary font-medium");return e.jsxs(m.Fragment,{children:[n!==0&&e.jsx(E,{className:"size-3.5 shrink-0"}),c.url?e.jsx(B,{href:c.url,className:l(u,"transition-opacity hover:opacity-80"),children:c.name}):e.jsx("span",{className:u,children:c.name})]},n)})})}function xe(t){const{props:{full:r}}=N();return e.jsx("article",{id:"nd-page","data-full":r,...t,className:l("flex flex-col w-full max-w-[900px] mx-auto [grid-area:main] px-4 py-6 gap-4 md:px-6 md:pt-8 xl:px-8 xl:pt-14",r?"max-w-[1168px]":"xl:layout:[--fd-toc-width:268px]",t.className),children:t.children})}var pe=X({DocsBody:()=>$,DocsDescription:()=>A,DocsPage:()=>F,DocsTitle:()=>G,EditOnGitHub:()=>V,MarkdownCopyButton:()=>L,PageBreadcrumb:()=>b,PageFooter:()=>C,PageLastUpdate:()=>H,ViewOptionsPopover:()=>I,useDocsPage:()=>N});const _=m.createContext(null);function N(){const t=m.use(_);if(!t)throw new Error("Please use page components under <DocsPage /> (`fumadocs-ui/layouts/docs/page`).");return t}function F({tableOfContent:{enabled:t,single:r,...s}={},tableOfContentPopover:{enabled:a,...o}={},breadcrumb:{enabled:d=!0,...i}={},footer:{enabled:c=!0,...n}={},full:u=!1,toc:p=[],slots:f={},children:g,...j}){t??=!!(!u&&(p.length>0||s.footer||s.header)),a??=!!(p.length>0||o.header||o.footer);const x={breadcrumb:f.breadcrumb??b,footer:f.footer??C,toc:f.toc??{provider:ae,main:ce,popover:ie},container:f.container??xe};return e.jsx(_,{value:{props:{full:u},slots:x},children:e.jsxs(x.toc.provider,{single:r,toc:t||a?p:[],children:[a&&(o.component??e.jsx(x.toc.popover,{...o})),e.jsxs(x.container,{...j,children:[d&&(i.component??e.jsx(x.breadcrumb,{...i})),g,c&&(n.component??e.jsx(x.footer,{...n}))]}),t&&(s.component??e.jsx(x.toc.main,{...s}))]})})}function V(t){return e.jsx("a",{target:"_blank",rel:"noreferrer noopener",...t,className:l(Y({color:"secondary",size:"sm"}),"gap-1.5 not-prose",t.className),children:t.children??e.jsxs(e.Fragment,{children:[e.jsx(re,{className:"size-3.5"}),e.jsx(O,{label:"editOnGithub"})]})})}function $({children:t,className:r,...s}){return e.jsx("div",{...s,className:l("prose flex-1",r),children:t})}function A({children:t,className:r,...s}){return t===void 0?null:e.jsx("p",{...s,className:l("mb-8 text-lg text-fd-muted-foreground",r),children:t})}function G({children:t,className:r,...s}){return e.jsx("h1",{...s,className:l("text-[1.75em] font-semibold",r),children:t})}function H({date:t,...r}){const{text:s}=v(),[a,o]=m.useState("");return m.useEffect(()=>{o(t.toLocaleDateString())},[t]),e.jsxs("p",{...r,className:l("text-sm text-fd-muted-foreground",r.className),children:[s.lastUpdate," ",a]})}const Le={DocsBody:$,DocsDescription:A,DocsPage:F,DocsTitle:G,EditOnGitHub:V,MarkdownCopyButton:L,PageBreadcrumb:b,PageFooter:C,PageLastUpdate:H,ViewOptionsPopover:I,page_exports:pe,useDocsPage:N};export{Le as export_598340e25603};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as o,L as t}from"./client-BJnu4nCQ.js";import"./index-Dmso5wU0.js";import"./index-BP1WY6Lo.js";import"./Icon-CzRHlV7t.js";import"./collapsible-xIcMRFdY.js";import"./index-C3s8rSzK.js";import"./index-CjxkSobY.js";import"./link-item-Cqzdqpkh.js";import"./i18n-3LIRVH83.js";import"./index-jLLD7vSY.js";import"./search-pXfzPq1G.js";import"./merge-refs-CbdSzRBV.js";import"./index-DNUrMY9s.js";const B={LayoutBody:t,useDocsLayout:o};export{B as export_430db65dc2ed};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Dt}from"./index-OFfnl8sH.js";const Mr={};function vn(e,n){const t=Mr,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Ot(e,r,i)}function Ot(e,n,t){if(Nr(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Gn(e.children,n,t)}return Array.isArray(e)?Gn(e,n,t):""}function Gn(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ot(e[i],n,t);return r.join("")}function Nr(e){return!!(e&&typeof e=="object")}const Jn=document.createElement("i");function Tn(e){const n="&"+e+";";Jn.innerHTML=n;const t=Jn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function se(e,n,t,r){const i=e.length;let l=0,o;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l<r.length;)o=r.slice(l,l+1e4),o.unshift(n,0),e.splice(...o),l+=1e4,n+=1e4}function te(e,n){return e.length>0?(se(e,e.length,0,n),e):n}const Kn={}.hasOwnProperty;function jr(e){const n={};let t=-1;for(;++t<e.length;)Hr(n,e[t]);return n}function Hr(e,n){let t;for(t in n){const i=(Kn.call(e,t)?e[t]:void 0)||(e[t]={}),l=n[t];let o;if(l)for(o in l){Kn.call(i,o)||(i[o]=[]);const a=l[o];Ur(i[o],Array.isArray(a)?a:a?[a]:[])}}}function Ur(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);se(e,0,0,r)}function Bt(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function ve(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ue=ye(/[A-Za-z]/),ne=ye(/[\dA-Za-z]/),$r=ye(/[#-'*+\--9=?A-Z^-~]/);function mn(e){return e!==null&&(e<32||e===127)}const gn=ye(/\d/),qr=ye(/[\dA-Fa-f]/),Vr=ye(/[!-/:-@[-`{-~]/);function P(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function D(e){return e===-2||e===-1||e===32}const Wr=ye(new RegExp("\\p{P}|\\p{S}","u")),Yr=ye(/\s/);function ye(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Pe(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const l=e.charCodeAt(t);let o="";if(l===37&&ne(e.charCodeAt(t+1))&&ne(e.charCodeAt(t+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function V(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(s){return D(s)?(e.enter(t),a(s)):n(s)}function a(s){return D(s)&&l++<i?(e.consume(s),a):(e.exit(t),n(s))}}const Qr={tokenize:Xr};function Xr(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),V(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){const s=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=s),t=s,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return P(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}const Gr={tokenize:Jr},Zn={tokenize:Kr};function Jr(e){const n=this,t=[];let r=0,i,l,o;return a;function a(E){if(r<t.length){const N=t[r];return n.containerState=N[1],e.attempt(N[0].continuation,s,u)(E)}return u(E)}function s(E){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&L();const N=n.events.length;let H=N,y;for(;H--;)if(n.events[H][0]==="exit"&&n.events[H][1].type==="chunkFlow"){y=n.events[H][1].end;break}x(r);let R=N;for(;R<n.events.length;)n.events[R][1].end={...y},R++;return se(n.events,H+1,0,n.events.slice(N)),n.events.length=R,u(E)}return a(E)}function u(E){if(r===t.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return b(E);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Zn,c,f)(E)}function c(E){return i&&L(),x(r),p(E)}function f(E){return n.parser.lazy[n.now().line]=r!==t.length,o=n.now().offset,b(E)}function p(E){return n.containerState={},e.attempt(Zn,h,b)(E)}function h(E){return r++,t.push([n.currentConstruct,n.containerState]),p(E)}function b(E){if(E===null){i&&L(),x(0),e.consume(E);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),S(E)}function S(E){if(E===null){I(e.exit("chunkFlow"),!0),x(0),e.consume(E);return}return P(E)?(e.consume(E),I(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(E),S)}function I(E,N){const H=n.sliceStream(E);if(N&&H.push(null),E.previous=l,l&&(l.next=E),l=E,i.defineSkip(E.start),i.write(H),n.parser.lazy[E.start.line]){let y=i.events.length;for(;y--;)if(i.events[y][1].start.offset<o&&(!i.events[y][1].end||i.events[y][1].end.offset>o))return;const R=n.events.length;let U=R,O,B;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){if(O){B=n.events[U][1].end;break}O=!0}for(x(r),y=R;y<n.events.length;)n.events[y][1].end={...B},y++;se(n.events,U+1,0,n.events.slice(R)),n.events.length=y}}function x(E){let N=t.length;for(;N-- >E;){const H=t[N];n.containerState=H[1],H[0].exit.call(n,e)}t.length=E}function L(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Kr(e,n,t){return V(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xe(e){if(e===null||J(e)||Yr(e))return 1;if(Wr(e))return 2}function Pn(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(n=l(n,t),r.push(l))}return n}const yn={name:"attention",resolveAll:Zr,tokenize:ei};function Zr(e,n){let t=-1,r,i,l,o,a,s,u,c;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;s=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const f={...e[r][1].end},p={...e[t][1].start};et(f,-s),et(p,s),o={type:s>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},l={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:s>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=te(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=te(u,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),u=te(u,Pn(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=te(u,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(c=2,u=te(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):c=0,se(e,r-1,t-r+3,u),t=r+u.length-c-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function ei(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Xe(r);let l;return o;function o(s){return l=s,e.enter("attentionSequence"),a(s)}function a(s){if(s===l)return e.consume(s),a;const u=e.exit("attentionSequence"),c=Xe(s),f=!c||c===2&&i||t.includes(s),p=!i||i===2&&c||t.includes(r);return u._open=!!(l===42?f:f&&(i||!p)),u._close=!!(l===42?p:p&&(c||!f)),n(s)}}function et(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const ni={name:"autolink",tokenize:ti};function ti(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(h){return ue(h)?(e.consume(h),o):h===64?t(h):u(h)}function o(h){return h===43||h===45||h===46||ne(h)?(r=1,a(h)):u(h)}function a(h){return h===58?(e.consume(h),r=0,s):(h===43||h===45||h===46||ne(h))&&r++<32?(e.consume(h),a):(r=0,u(h))}function s(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||mn(h)?t(h):(e.consume(h),s)}function u(h){return h===64?(e.consume(h),c):$r(h)?(e.consume(h),u):t(h)}function c(h){return ne(h)?f(h):t(h)}function f(h){return h===46?(e.consume(h),r=0,c):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):p(h)}function p(h){if((h===45||ne(h))&&r++<63){const b=h===45?p:f;return e.consume(h),b}return t(h)}}const Ze={partial:!0,tokenize:ri};function ri(e,n,t){return r;function r(l){return D(l)?V(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||P(l)?n(l):t(l)}}const Mt={continuation:{tokenize:li},exit:oi,name:"blockQuote",tokenize:ii};function ii(e,n,t){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return t(o)}function l(o){return D(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(o))}}function li(e,n,t){const r=this;return i;function i(o){return D(o)?V(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(Mt,n,t)(o)}}function oi(e){e.exit("blockQuote")}const Nt={name:"characterEscape",tokenize:ai};function ai(e,n,t){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return Vr(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}const jt={name:"characterReference",tokenize:ui};function ui(e,n,t){const r=this;let i=0,l,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),s}function s(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),l=31,o=ne,c(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=qr,c):(e.enter("characterReferenceValue"),l=7,o=gn,c(f))}function c(f){if(f===59&&i){const p=e.exit("characterReferenceValue");return o===ne&&!Tn(r.sliceSerialize(p))?t(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return o(f)&&i++<l?(e.consume(f),c):t(f)}}const nt={partial:!0,tokenize:ci},tt={concrete:!0,name:"codeFenced",tokenize:si};function si(e,n,t){const r=this,i={partial:!0,tokenize:H};let l=0,o=0,a;return s;function s(y){return u(y)}function u(y){const R=r.events[r.events.length-1];return l=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,a=y,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(y)}function c(y){return y===a?(o++,e.consume(y),c):o<3?t(y):(e.exit("codeFencedFenceSequence"),D(y)?V(e,f,"whitespace")(y):f(y))}function f(y){return y===null||P(y)?(e.exit("codeFencedFence"),r.interrupt?n(y):e.check(nt,S,N)(y)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||P(y)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(y)):D(y)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),V(e,h,"whitespace")(y)):y===96&&y===a?t(y):(e.consume(y),p)}function h(y){return y===null||P(y)?f(y):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(y))}function b(y){return y===null||P(y)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(y)):y===96&&y===a?t(y):(e.consume(y),b)}function S(y){return e.attempt(i,N,I)(y)}function I(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),x}function x(y){return l>0&&D(y)?V(e,L,"linePrefix",l+1)(y):L(y)}function L(y){return y===null||P(y)?e.check(nt,S,N)(y):(e.enter("codeFlowValue"),E(y))}function E(y){return y===null||P(y)?(e.exit("codeFlowValue"),L(y)):(e.consume(y),E)}function N(y){return e.exit("codeFenced"),n(y)}function H(y,R,U){let O=0;return B;function B(C){return y.enter("lineEnding"),y.consume(C),y.exit("lineEnding"),v}function v(C){return y.enter("codeFencedFence"),D(C)?V(y,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):A(C)}function A(C){return C===a?(y.enter("codeFencedFenceSequence"),$(C)):U(C)}function $(C){return C===a?(O++,y.consume(C),$):O>=o?(y.exit("codeFencedFenceSequence"),D(C)?V(y,T,"whitespace")(C):T(C)):U(C)}function T(C){return C===null||P(C)?(y.exit("codeFencedFence"),R(C)):U(C)}}}function ci(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const tn={name:"codeIndented",tokenize:hi},fi={partial:!0,tokenize:pi};function hi(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),V(e,l,"linePrefix",5)(u)}function l(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(u):t(u)}function o(u){return u===null?s(u):P(u)?e.attempt(fi,o,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||P(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),n(u)}}function pi(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):P(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):V(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):P(o)?i(o):t(o)}}const di={name:"codeText",previous:gi,resolve:mi,tokenize:yi};function mi(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function gi(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yi(e,n,t){let r=0,i,l;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),s(f))}function s(f){return f===null?t(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),s):f===96?(l=e.enter("codeTextSequence"),i=0,c(f)):P(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),s):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||P(f)?(e.exit("codeTextData"),s(f)):(e.consume(f),u)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(f)):(l.type="codeTextData",u(f))}}class xi{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Re(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Re(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Re(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);Re(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Re(this.left,t.reverse())}}}function Re(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function Ht(e){const n={};let t=-1,r,i,l,o,a,s,u;const c=new xi(e);for(;++t<c.length;){for(;t in n;)t=n[t];if(r=c.get(t),t&&r[1].type==="chunkFlow"&&c.get(t-1)[1].type==="listItemPrefix"&&(s=r[1]._tokenizer.events,l=0,l<s.length&&s[l][1].type==="lineEndingBlank"&&(l+=2),l<s.length&&s[l][1].type==="content"))for(;++l<s.length&&s[l][1].type!=="content";)s[l][1].type==="chunkText"&&(s[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,ki(c,t)),t=n[t],u=!0);else if(r[1]._container){for(l=t,i=void 0;l--;)if(o=c.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,t),a.unshift(r),c.splice(i,t-i+1,a))}}return se(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function ki(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const l=[];let o=t._tokenizer;o||(o=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,s=[],u={};let c,f,p=-1,h=t,b=0,S=0;const I=[S];for(;h;){for(;e.get(++i)[1]!==h;);l.push(i),h._tokenizer||(c=r.sliceStream(h),h.next||c.push(null),f&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(S=p+1,I.push(S),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):I.pop(),p=I.length;p--;){const x=a.slice(I[p],I[p+1]),L=l.pop();s.push([L,L+x.length-1]),e.splice(L,2,x)}for(s.reverse(),p=-1;++p<s.length;)u[b+s[p][0]]=b+s[p][1],b+=s[p][1]-s[p][0]-1;return u}const bi={resolve:Si,tokenize:Ci},wi={partial:!0,tokenize:Ei};function Si(e){return Ht(e),e}function Ci(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):P(a)?e.check(wi,o,l)(a):(e.consume(a),i)}function l(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function o(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Ei(e,n,t){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),V(e,l,"linePrefix")}function l(o){if(o===null||P(o))return t(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function Ut(e,n,t,r,i,l,o,a,s){const u=s||Number.POSITIVE_INFINITY;let c=0;return f;function f(x){return x===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(x),e.exit(l),p):x===null||x===32||x===41||mn(x)?t(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),S(x))}function p(x){return x===62?(e.enter(l),e.consume(x),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||P(x)?t(x):(e.consume(x),x===92?b:h)}function b(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function S(x){return!c&&(x===null||x===41||J(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(x)):c<u&&x===40?(e.consume(x),c++,S):x===41?(e.consume(x),c--,S):x===null||x===32||x===40||mn(x)?t(x):(e.consume(x),x===92?I:S)}function I(x){return x===40||x===41||x===92?(e.consume(x),S):S(x)}}function $t(e,n,t,r,i,l){const o=this;let a=0,s;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(l),c}function c(h){return a>999||h===null||h===91||h===93&&!s||h===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(h):h===93?(e.exit(l),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):P(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||P(h)||a++>999?(e.exit("chunkString"),c(h)):(e.consume(h),s||(s=!D(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function qt(e,n,t,r,i,l){let o;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),o=p===40?41:p,s):t(p)}function s(p){return p===o?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(l),u(p))}function u(p){return p===o?(e.exit(l),s(o)):p===null?t(p):P(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),V(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===o||p===null||P(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?f:c)}function f(p){return p===o||p===92?(e.consume(p),c):c(p)}}function Me(e,n){let t;return r;function r(i){return P(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):D(i)?V(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Ii={name:"definition",tokenize:vi},Ai={partial:!0,tokenize:Ti};function vi(e,n,t){const r=this;let i;return l;function l(h){return e.enter("definition"),o(h)}function o(h){return $t.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=ve(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),s):t(h)}function s(h){return J(h)?Me(e,u)(h):u(h)}function u(h){return Ut(e,c,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(Ai,f,f)(h)}function f(h){return D(h)?V(e,p,"whitespace")(h):p(h)}function p(h){return h===null||P(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function Ti(e,n,t){return r;function r(a){return J(a)?Me(e,i)(a):t(a)}function i(a){return qt(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return D(a)?V(e,o,"whitespace")(a):o(a)}function o(a){return a===null||P(a)?n(a):t(a)}}const Pi={name:"hardBreakEscape",tokenize:Li};function Li(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return P(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const zi={name:"headingAtx",resolve:_i,tokenize:Fi};function _i(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},se(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function Fi(e,n,t){let r=0;return i;function i(c){return e.enter("atxHeading"),l(c)}function l(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||J(c)?(e.exit("atxHeadingSequence"),a(c)):t(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||P(c)?(e.exit("atxHeading"),n(c)):D(c)?V(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function s(c){return c===35?(e.consume(c),s):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||J(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}const Ri=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],rt=["pre","script","style","textarea"],Di={concrete:!0,name:"htmlFlow",resolveTo:Mi,tokenize:Ni},Oi={partial:!0,tokenize:Hi},Bi={partial:!0,tokenize:ji};function Mi(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Ni(e,n,t){const r=this;let i,l,o,a,s;return u;function u(m){return c(m)}function c(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),f}function f(m){return m===33?(e.consume(m),p):m===47?(e.consume(m),l=!0,S):m===63?(e.consume(m),i=3,r.interrupt?n:d):ue(m)?(e.consume(m),o=String.fromCharCode(m),I):t(m)}function p(m){return m===45?(e.consume(m),i=2,h):m===91?(e.consume(m),i=5,a=0,b):ue(m)?(e.consume(m),i=4,r.interrupt?n:d):t(m)}function h(m){return m===45?(e.consume(m),r.interrupt?n:d):t(m)}function b(m){const le="CDATA[";return m===le.charCodeAt(a++)?(e.consume(m),a===le.length?r.interrupt?n:A:b):t(m)}function S(m){return ue(m)?(e.consume(m),o=String.fromCharCode(m),I):t(m)}function I(m){if(m===null||m===47||m===62||J(m)){const le=m===47,xe=o.toLowerCase();return!le&&!l&&rt.includes(xe)?(i=1,r.interrupt?n(m):A(m)):Ri.includes(o.toLowerCase())?(i=6,le?(e.consume(m),x):r.interrupt?n(m):A(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(m):l?L(m):E(m))}return m===45||ne(m)?(e.consume(m),o+=String.fromCharCode(m),I):t(m)}function x(m){return m===62?(e.consume(m),r.interrupt?n:A):t(m)}function L(m){return D(m)?(e.consume(m),L):B(m)}function E(m){return m===47?(e.consume(m),B):m===58||m===95||ue(m)?(e.consume(m),N):D(m)?(e.consume(m),E):B(m)}function N(m){return m===45||m===46||m===58||m===95||ne(m)?(e.consume(m),N):H(m)}function H(m){return m===61?(e.consume(m),y):D(m)?(e.consume(m),H):E(m)}function y(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),s=m,R):D(m)?(e.consume(m),y):U(m)}function R(m){return m===s?(e.consume(m),s=null,O):m===null||P(m)?t(m):(e.consume(m),R)}function U(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||J(m)?H(m):(e.consume(m),U)}function O(m){return m===47||m===62||D(m)?E(m):t(m)}function B(m){return m===62?(e.consume(m),v):t(m)}function v(m){return m===null||P(m)?A(m):D(m)?(e.consume(m),v):t(m)}function A(m){return m===45&&i===2?(e.consume(m),M):m===60&&i===1?(e.consume(m),Y):m===62&&i===4?(e.consume(m),ie):m===63&&i===3?(e.consume(m),d):m===93&&i===5?(e.consume(m),ce):P(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Oi,fe,$)(m)):m===null||P(m)?(e.exit("htmlFlowData"),$(m)):(e.consume(m),A)}function $(m){return e.check(Bi,T,fe)(m)}function T(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),C}function C(m){return m===null||P(m)?$(m):(e.enter("htmlFlowData"),A(m))}function M(m){return m===45?(e.consume(m),d):A(m)}function Y(m){return m===47?(e.consume(m),o="",re):A(m)}function re(m){if(m===62){const le=o.toLowerCase();return rt.includes(le)?(e.consume(m),ie):A(m)}return ue(m)&&o.length<8?(e.consume(m),o+=String.fromCharCode(m),re):A(m)}function ce(m){return m===93?(e.consume(m),d):A(m)}function d(m){return m===62?(e.consume(m),ie):m===45&&i===2?(e.consume(m),d):A(m)}function ie(m){return m===null||P(m)?(e.exit("htmlFlowData"),fe(m)):(e.consume(m),ie)}function fe(m){return e.exit("htmlFlow"),n(m)}}function ji(e,n,t){const r=this;return i;function i(o){return P(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function Hi(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ze,n,t)}}const Ui={name:"htmlText",tokenize:$i};function $i(e,n,t){const r=this;let i,l,o;return a;function a(d){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(d),s}function s(d){return d===33?(e.consume(d),u):d===47?(e.consume(d),H):d===63?(e.consume(d),E):ue(d)?(e.consume(d),U):t(d)}function u(d){return d===45?(e.consume(d),c):d===91?(e.consume(d),l=0,b):ue(d)?(e.consume(d),L):t(d)}function c(d){return d===45?(e.consume(d),h):t(d)}function f(d){return d===null?t(d):d===45?(e.consume(d),p):P(d)?(o=f,Y(d)):(e.consume(d),f)}function p(d){return d===45?(e.consume(d),h):f(d)}function h(d){return d===62?M(d):d===45?p(d):f(d)}function b(d){const ie="CDATA[";return d===ie.charCodeAt(l++)?(e.consume(d),l===ie.length?S:b):t(d)}function S(d){return d===null?t(d):d===93?(e.consume(d),I):P(d)?(o=S,Y(d)):(e.consume(d),S)}function I(d){return d===93?(e.consume(d),x):S(d)}function x(d){return d===62?M(d):d===93?(e.consume(d),x):S(d)}function L(d){return d===null||d===62?M(d):P(d)?(o=L,Y(d)):(e.consume(d),L)}function E(d){return d===null?t(d):d===63?(e.consume(d),N):P(d)?(o=E,Y(d)):(e.consume(d),E)}function N(d){return d===62?M(d):E(d)}function H(d){return ue(d)?(e.consume(d),y):t(d)}function y(d){return d===45||ne(d)?(e.consume(d),y):R(d)}function R(d){return P(d)?(o=R,Y(d)):D(d)?(e.consume(d),R):M(d)}function U(d){return d===45||ne(d)?(e.consume(d),U):d===47||d===62||J(d)?O(d):t(d)}function O(d){return d===47?(e.consume(d),M):d===58||d===95||ue(d)?(e.consume(d),B):P(d)?(o=O,Y(d)):D(d)?(e.consume(d),O):M(d)}function B(d){return d===45||d===46||d===58||d===95||ne(d)?(e.consume(d),B):v(d)}function v(d){return d===61?(e.consume(d),A):P(d)?(o=v,Y(d)):D(d)?(e.consume(d),v):O(d)}function A(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),i=d,$):P(d)?(o=A,Y(d)):D(d)?(e.consume(d),A):(e.consume(d),T)}function $(d){return d===i?(e.consume(d),i=void 0,C):d===null?t(d):P(d)?(o=$,Y(d)):(e.consume(d),$)}function T(d){return d===null||d===34||d===39||d===60||d===61||d===96?t(d):d===47||d===62||J(d)?O(d):(e.consume(d),T)}function C(d){return d===47||d===62||J(d)?O(d):t(d)}function M(d){return d===62?(e.consume(d),e.exit("htmlTextData"),e.exit("htmlText"),n):t(d)}function Y(d){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),re}function re(d){return D(d)?V(e,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):ce(d)}function ce(d){return e.enter("htmlTextData"),o(d)}}const Ln={name:"labelEnd",resolveAll:Yi,resolveTo:Qi,tokenize:Xi},qi={tokenize:Gi},Vi={tokenize:Ji},Wi={tokenize:Ki};function Yi(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&se(e,0,e.length,t),e}function Qi(e,n){let t=e.length,r=0,i,l,o,a;for(;t--;)if(i=e[t][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=t);const s={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",s,n],["enter",u,n]],a=te(a,e.slice(l+1,l+r+3)),a=te(a,[["enter",c,n]]),a=te(a,Pn(n.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),n)),a=te(a,[["exit",c,n],e[o-2],e[o-1],["exit",u,n]]),a=te(a,e.slice(o+1)),a=te(a,[["exit",s,n]]),se(e,l,e.length,a),e}function Xi(e,n,t){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(p){return l?l._inactive?f(p):(o=r.parser.defined.includes(ve(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),s):t(p)}function s(p){return p===40?e.attempt(qi,c,o?c:f)(p):p===91?e.attempt(Vi,c,o?u:f)(p):o?c(p):f(p)}function u(p){return e.attempt(Wi,c,f)(p)}function c(p){return n(p)}function f(p){return l._balanced=!0,t(p)}}function Gi(e,n,t){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return J(f)?Me(e,l)(f):l(f)}function l(f){return f===41?c(f):Ut(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return J(f)?Me(e,s)(f):c(f)}function a(f){return t(f)}function s(f){return f===34||f===39||f===40?qt(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return J(f)?Me(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),n):t(f)}}function Ji(e,n,t){const r=this;return i;function i(a){return $t.call(r,e,l,o,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(ve(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function o(a){return t(a)}}function Ki(e,n,t){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),n):t(l)}}const Zi={name:"labelStartImage",resolveAll:Ln.resolveAll,tokenize:el};function el(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),l}function l(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):t(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const nl={name:"labelStartLink",resolveAll:Ln.resolveAll,tokenize:tl};function tl(e,n,t){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):n(o)}}const rn={name:"lineEnding",tokenize:rl};function rl(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),V(e,n,"linePrefix")}}const Qe={name:"thematicBreak",tokenize:il};function il(e,n,t){let r=0,i;return l;function l(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),s(u)):r>=3&&(u===null||P(u))?(e.exit("thematicBreak"),n(u)):t(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),D(u)?V(e,a,"whitespace")(u):a(u))}}const G={continuation:{tokenize:ul},exit:cl,name:"list",tokenize:al},ll={partial:!0,tokenize:fl},ol={partial:!0,tokenize:sl};function al(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(h){const b=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:gn(h)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Qe,t,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(h)}return t(h)}function s(h){return gn(h)&&++o<10?(e.consume(h),s):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):t(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Ze,r.interrupt?t:c,e.attempt(ll,p,f))}function c(h){return r.containerState.initialBlankLine=!0,l++,p(h)}function f(h){return D(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function ul(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ze,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,V(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!D(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ol,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,V(e,e.attempt(G,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function sl(e,n,t){const r=this;return V(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function cl(e){e.exit(this.containerState.type)}function fl(e,n,t){const r=this;return V(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!D(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const it={name:"setextUnderline",resolveTo:hl,tokenize:pl};function hl(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function pl(e,n,t){const r=this;let i;return l;function l(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,o(u)):t(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),D(u)?V(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||P(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const dl={tokenize:ml};function ml(e){const n=this,t=e.attempt(Ze,r,e.attempt(this.parser.constructs.flowInitial,i,V(e,e.attempt(this.parser.constructs.flow,i,e.attempt(bi,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const gl={resolveAll:Wt()},yl=Vt("string"),xl=Vt("text");function Vt(e){return{resolveAll:Wt(e==="text"?kl:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(c){return u(c)?l(c):a(c)}function a(c){if(c===null){t.consume(c);return}return t.enter("data"),t.consume(c),s}function s(c){return u(c)?(t.exit("data"),l(c)):(t.consume(c),s)}function u(c){if(c===null)return!0;const f=i[c];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Wt(e){return n;function n(t,r){let i=-1,l;for(;++i<=t.length;)l===void 0?t[i]&&t[i][1].type==="data"&&(l=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==l+2&&(t[l][1].end=t[i-1][1].end,t.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(t,r):t}}function kl(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let l=i.length,o=-1,a=0,s;for(;l--;){const u=i[l];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)s=!0,a++;else if(u!==-1){l++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const u={type:t===e.length||s||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(t,0,["enter",u,n],["exit",u,n]),t+=2)}t++}return e}const bl={42:G,43:G,45:G,48:G,49:G,50:G,51:G,52:G,53:G,54:G,55:G,56:G,57:G,62:Mt},wl={91:Ii},Sl={[-2]:tn,[-1]:tn,32:tn},Cl={35:zi,42:Qe,45:[it,Qe],60:Di,61:it,95:Qe,96:tt,126:tt},El={38:jt,92:Nt},Il={[-5]:rn,[-4]:rn,[-3]:rn,33:Zi,38:jt,42:yn,60:[ni,Ui],91:nl,92:[Pi,Nt],93:Ln,95:yn,96:di},Al={null:[yn,gl]},vl={null:[42,95]},Tl={null:[]},Pl=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:vl,contentInitial:wl,disable:Tl,document:bl,flow:Cl,flowInitial:Sl,insideSpan:Al,string:El,text:Il},Symbol.toStringTag,{value:"Module"}));function Ll(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},l=[];let o=[],a=[];const s={attempt:R(H),check:R(y),consume:L,enter:E,exit:N,interrupt:R(y,{interrupt:!0})},u={code:null,containerState:{},defineSkip:S,events:[],now:b,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:f};let c=n.tokenize.call(u,s);return n.resolveAll&&l.push(n),u;function f(v){return o=te(o,v),I(),o[o.length-1]!==null?[]:(U(n,0),u.events=Pn(l,u.events,u),u.events)}function p(v,A){return _l(h(v),A)}function h(v){return zl(o,v)}function b(){const{_bufferIndex:v,_index:A,line:$,column:T,offset:C}=r;return{_bufferIndex:v,_index:A,line:$,column:T,offset:C}}function S(v){i[v.line]=v.column,B()}function I(){let v;for(;r._index<o.length;){const A=o[r._index];if(typeof A=="string")for(v=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===v&&r._bufferIndex<A.length;)x(A.charCodeAt(r._bufferIndex));else x(A)}}function x(v){c=c(v)}function L(v){P(v)?(r.line++,r.column=1,r.offset+=v===-3?2:1,B()):v!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=v}function E(v,A){const $=A||{};return $.type=v,$.start=b(),u.events.push(["enter",$,u]),a.push($),$}function N(v){const A=a.pop();return A.end=b(),u.events.push(["exit",A,u]),A}function H(v,A){U(v,A.from)}function y(v,A){A.restore()}function R(v,A){return $;function $(T,C,M){let Y,re,ce,d;return Array.isArray(T)?fe(T):"tokenize"in T?fe([T]):ie(T);function ie(Q){return ze;function ze(de){const Se=de!==null&&Q[de],Ce=de!==null&&Q.null,qe=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(Ce)?Ce:Ce?[Ce]:[]];return fe(qe)(de)}}function fe(Q){return Y=Q,re=0,Q.length===0?M:m(Q[re])}function m(Q){return ze;function ze(de){return d=O(),ce=Q,Q.partial||(u.currentConstruct=Q),Q.name&&u.parser.constructs.disable.null.includes(Q.name)?xe():Q.tokenize.call(A?Object.assign(Object.create(u),A):u,s,le,xe)(de)}}function le(Q){return v(ce,d),C}function xe(Q){return d.restore(),++re<Y.length?m(Y[re]):M}}}function U(v,A){v.resolveAll&&!l.includes(v)&&l.push(v),v.resolve&&se(u.events,A,u.events.length-A,v.resolve(u.events.slice(A),u)),v.resolveTo&&(u.events=v.resolveTo(u.events,u))}function O(){const v=b(),A=u.previous,$=u.currentConstruct,T=u.events.length,C=Array.from(a);return{from:T,restore:M};function M(){r=v,u.previous=A,u.currentConstruct=$,u.events.length=T,a=C,B()}}function B(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function zl(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,l=n.end._bufferIndex;let o;if(t===i)o=[e[t].slice(r,l)];else{if(o=e.slice(t,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function _l(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const l=e[t];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
|
|
1
|
+
import{g as Dt}from"./index-BP1WY6Lo.js";const Mr={};function vn(e,n){const t=Mr,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Ot(e,r,i)}function Ot(e,n,t){if(Nr(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Gn(e.children,n,t)}return Array.isArray(e)?Gn(e,n,t):""}function Gn(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ot(e[i],n,t);return r.join("")}function Nr(e){return!!(e&&typeof e=="object")}const Jn=document.createElement("i");function Tn(e){const n="&"+e+";";Jn.innerHTML=n;const t=Jn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function se(e,n,t,r){const i=e.length;let l=0,o;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l<r.length;)o=r.slice(l,l+1e4),o.unshift(n,0),e.splice(...o),l+=1e4,n+=1e4}function te(e,n){return e.length>0?(se(e,e.length,0,n),e):n}const Kn={}.hasOwnProperty;function jr(e){const n={};let t=-1;for(;++t<e.length;)Hr(n,e[t]);return n}function Hr(e,n){let t;for(t in n){const i=(Kn.call(e,t)?e[t]:void 0)||(e[t]={}),l=n[t];let o;if(l)for(o in l){Kn.call(i,o)||(i[o]=[]);const a=l[o];Ur(i[o],Array.isArray(a)?a:a?[a]:[])}}}function Ur(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);se(e,0,0,r)}function Bt(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function ve(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ue=ye(/[A-Za-z]/),ne=ye(/[\dA-Za-z]/),$r=ye(/[#-'*+\--9=?A-Z^-~]/);function mn(e){return e!==null&&(e<32||e===127)}const gn=ye(/\d/),qr=ye(/[\dA-Fa-f]/),Vr=ye(/[!-/:-@[-`{-~]/);function P(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function D(e){return e===-2||e===-1||e===32}const Wr=ye(new RegExp("\\p{P}|\\p{S}","u")),Yr=ye(/\s/);function ye(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Pe(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const l=e.charCodeAt(t);let o="";if(l===37&&ne(e.charCodeAt(t+1))&&ne(e.charCodeAt(t+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function V(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(s){return D(s)?(e.enter(t),a(s)):n(s)}function a(s){return D(s)&&l++<i?(e.consume(s),a):(e.exit(t),n(s))}}const Qr={tokenize:Xr};function Xr(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),V(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){const s=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=s),t=s,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return P(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}const Gr={tokenize:Jr},Zn={tokenize:Kr};function Jr(e){const n=this,t=[];let r=0,i,l,o;return a;function a(E){if(r<t.length){const N=t[r];return n.containerState=N[1],e.attempt(N[0].continuation,s,u)(E)}return u(E)}function s(E){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&L();const N=n.events.length;let H=N,y;for(;H--;)if(n.events[H][0]==="exit"&&n.events[H][1].type==="chunkFlow"){y=n.events[H][1].end;break}x(r);let R=N;for(;R<n.events.length;)n.events[R][1].end={...y},R++;return se(n.events,H+1,0,n.events.slice(N)),n.events.length=R,u(E)}return a(E)}function u(E){if(r===t.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return b(E);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Zn,c,f)(E)}function c(E){return i&&L(),x(r),p(E)}function f(E){return n.parser.lazy[n.now().line]=r!==t.length,o=n.now().offset,b(E)}function p(E){return n.containerState={},e.attempt(Zn,h,b)(E)}function h(E){return r++,t.push([n.currentConstruct,n.containerState]),p(E)}function b(E){if(E===null){i&&L(),x(0),e.consume(E);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),S(E)}function S(E){if(E===null){I(e.exit("chunkFlow"),!0),x(0),e.consume(E);return}return P(E)?(e.consume(E),I(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(E),S)}function I(E,N){const H=n.sliceStream(E);if(N&&H.push(null),E.previous=l,l&&(l.next=E),l=E,i.defineSkip(E.start),i.write(H),n.parser.lazy[E.start.line]){let y=i.events.length;for(;y--;)if(i.events[y][1].start.offset<o&&(!i.events[y][1].end||i.events[y][1].end.offset>o))return;const R=n.events.length;let U=R,O,B;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){if(O){B=n.events[U][1].end;break}O=!0}for(x(r),y=R;y<n.events.length;)n.events[y][1].end={...B},y++;se(n.events,U+1,0,n.events.slice(R)),n.events.length=y}}function x(E){let N=t.length;for(;N-- >E;){const H=t[N];n.containerState=H[1],H[0].exit.call(n,e)}t.length=E}function L(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Kr(e,n,t){return V(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xe(e){if(e===null||J(e)||Yr(e))return 1;if(Wr(e))return 2}function Pn(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(n=l(n,t),r.push(l))}return n}const yn={name:"attention",resolveAll:Zr,tokenize:ei};function Zr(e,n){let t=-1,r,i,l,o,a,s,u,c;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;s=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const f={...e[r][1].end},p={...e[t][1].start};et(f,-s),et(p,s),o={type:s>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},l={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:s>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=te(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=te(u,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),u=te(u,Pn(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=te(u,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(c=2,u=te(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):c=0,se(e,r-1,t-r+3,u),t=r+u.length-c-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function ei(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Xe(r);let l;return o;function o(s){return l=s,e.enter("attentionSequence"),a(s)}function a(s){if(s===l)return e.consume(s),a;const u=e.exit("attentionSequence"),c=Xe(s),f=!c||c===2&&i||t.includes(s),p=!i||i===2&&c||t.includes(r);return u._open=!!(l===42?f:f&&(i||!p)),u._close=!!(l===42?p:p&&(c||!f)),n(s)}}function et(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const ni={name:"autolink",tokenize:ti};function ti(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(h){return ue(h)?(e.consume(h),o):h===64?t(h):u(h)}function o(h){return h===43||h===45||h===46||ne(h)?(r=1,a(h)):u(h)}function a(h){return h===58?(e.consume(h),r=0,s):(h===43||h===45||h===46||ne(h))&&r++<32?(e.consume(h),a):(r=0,u(h))}function s(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||mn(h)?t(h):(e.consume(h),s)}function u(h){return h===64?(e.consume(h),c):$r(h)?(e.consume(h),u):t(h)}function c(h){return ne(h)?f(h):t(h)}function f(h){return h===46?(e.consume(h),r=0,c):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):p(h)}function p(h){if((h===45||ne(h))&&r++<63){const b=h===45?p:f;return e.consume(h),b}return t(h)}}const Ze={partial:!0,tokenize:ri};function ri(e,n,t){return r;function r(l){return D(l)?V(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||P(l)?n(l):t(l)}}const Mt={continuation:{tokenize:li},exit:oi,name:"blockQuote",tokenize:ii};function ii(e,n,t){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return t(o)}function l(o){return D(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(o))}}function li(e,n,t){const r=this;return i;function i(o){return D(o)?V(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(Mt,n,t)(o)}}function oi(e){e.exit("blockQuote")}const Nt={name:"characterEscape",tokenize:ai};function ai(e,n,t){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return Vr(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}const jt={name:"characterReference",tokenize:ui};function ui(e,n,t){const r=this;let i=0,l,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),s}function s(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),l=31,o=ne,c(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=qr,c):(e.enter("characterReferenceValue"),l=7,o=gn,c(f))}function c(f){if(f===59&&i){const p=e.exit("characterReferenceValue");return o===ne&&!Tn(r.sliceSerialize(p))?t(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return o(f)&&i++<l?(e.consume(f),c):t(f)}}const nt={partial:!0,tokenize:ci},tt={concrete:!0,name:"codeFenced",tokenize:si};function si(e,n,t){const r=this,i={partial:!0,tokenize:H};let l=0,o=0,a;return s;function s(y){return u(y)}function u(y){const R=r.events[r.events.length-1];return l=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,a=y,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(y)}function c(y){return y===a?(o++,e.consume(y),c):o<3?t(y):(e.exit("codeFencedFenceSequence"),D(y)?V(e,f,"whitespace")(y):f(y))}function f(y){return y===null||P(y)?(e.exit("codeFencedFence"),r.interrupt?n(y):e.check(nt,S,N)(y)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||P(y)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(y)):D(y)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),V(e,h,"whitespace")(y)):y===96&&y===a?t(y):(e.consume(y),p)}function h(y){return y===null||P(y)?f(y):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(y))}function b(y){return y===null||P(y)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(y)):y===96&&y===a?t(y):(e.consume(y),b)}function S(y){return e.attempt(i,N,I)(y)}function I(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),x}function x(y){return l>0&&D(y)?V(e,L,"linePrefix",l+1)(y):L(y)}function L(y){return y===null||P(y)?e.check(nt,S,N)(y):(e.enter("codeFlowValue"),E(y))}function E(y){return y===null||P(y)?(e.exit("codeFlowValue"),L(y)):(e.consume(y),E)}function N(y){return e.exit("codeFenced"),n(y)}function H(y,R,U){let O=0;return B;function B(C){return y.enter("lineEnding"),y.consume(C),y.exit("lineEnding"),v}function v(C){return y.enter("codeFencedFence"),D(C)?V(y,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):A(C)}function A(C){return C===a?(y.enter("codeFencedFenceSequence"),$(C)):U(C)}function $(C){return C===a?(O++,y.consume(C),$):O>=o?(y.exit("codeFencedFenceSequence"),D(C)?V(y,T,"whitespace")(C):T(C)):U(C)}function T(C){return C===null||P(C)?(y.exit("codeFencedFence"),R(C)):U(C)}}}function ci(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const tn={name:"codeIndented",tokenize:hi},fi={partial:!0,tokenize:pi};function hi(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),V(e,l,"linePrefix",5)(u)}function l(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(u):t(u)}function o(u){return u===null?s(u):P(u)?e.attempt(fi,o,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||P(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),n(u)}}function pi(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):P(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):V(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):P(o)?i(o):t(o)}}const di={name:"codeText",previous:gi,resolve:mi,tokenize:yi};function mi(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function gi(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yi(e,n,t){let r=0,i,l;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),s(f))}function s(f){return f===null?t(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),s):f===96?(l=e.enter("codeTextSequence"),i=0,c(f)):P(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),s):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||P(f)?(e.exit("codeTextData"),s(f)):(e.consume(f),u)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(f)):(l.type="codeTextData",u(f))}}class xi{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Re(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Re(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Re(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);Re(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Re(this.left,t.reverse())}}}function Re(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function Ht(e){const n={};let t=-1,r,i,l,o,a,s,u;const c=new xi(e);for(;++t<c.length;){for(;t in n;)t=n[t];if(r=c.get(t),t&&r[1].type==="chunkFlow"&&c.get(t-1)[1].type==="listItemPrefix"&&(s=r[1]._tokenizer.events,l=0,l<s.length&&s[l][1].type==="lineEndingBlank"&&(l+=2),l<s.length&&s[l][1].type==="content"))for(;++l<s.length&&s[l][1].type!=="content";)s[l][1].type==="chunkText"&&(s[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,ki(c,t)),t=n[t],u=!0);else if(r[1]._container){for(l=t,i=void 0;l--;)if(o=c.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,t),a.unshift(r),c.splice(i,t-i+1,a))}}return se(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function ki(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const l=[];let o=t._tokenizer;o||(o=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,s=[],u={};let c,f,p=-1,h=t,b=0,S=0;const I=[S];for(;h;){for(;e.get(++i)[1]!==h;);l.push(i),h._tokenizer||(c=r.sliceStream(h),h.next||c.push(null),f&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(S=p+1,I.push(S),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):I.pop(),p=I.length;p--;){const x=a.slice(I[p],I[p+1]),L=l.pop();s.push([L,L+x.length-1]),e.splice(L,2,x)}for(s.reverse(),p=-1;++p<s.length;)u[b+s[p][0]]=b+s[p][1],b+=s[p][1]-s[p][0]-1;return u}const bi={resolve:Si,tokenize:Ci},wi={partial:!0,tokenize:Ei};function Si(e){return Ht(e),e}function Ci(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):P(a)?e.check(wi,o,l)(a):(e.consume(a),i)}function l(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function o(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Ei(e,n,t){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),V(e,l,"linePrefix")}function l(o){if(o===null||P(o))return t(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function Ut(e,n,t,r,i,l,o,a,s){const u=s||Number.POSITIVE_INFINITY;let c=0;return f;function f(x){return x===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(x),e.exit(l),p):x===null||x===32||x===41||mn(x)?t(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),S(x))}function p(x){return x===62?(e.enter(l),e.consume(x),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||P(x)?t(x):(e.consume(x),x===92?b:h)}function b(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function S(x){return!c&&(x===null||x===41||J(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(x)):c<u&&x===40?(e.consume(x),c++,S):x===41?(e.consume(x),c--,S):x===null||x===32||x===40||mn(x)?t(x):(e.consume(x),x===92?I:S)}function I(x){return x===40||x===41||x===92?(e.consume(x),S):S(x)}}function $t(e,n,t,r,i,l){const o=this;let a=0,s;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(l),c}function c(h){return a>999||h===null||h===91||h===93&&!s||h===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(h):h===93?(e.exit(l),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):P(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||P(h)||a++>999?(e.exit("chunkString"),c(h)):(e.consume(h),s||(s=!D(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function qt(e,n,t,r,i,l){let o;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),o=p===40?41:p,s):t(p)}function s(p){return p===o?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(l),u(p))}function u(p){return p===o?(e.exit(l),s(o)):p===null?t(p):P(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),V(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===o||p===null||P(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?f:c)}function f(p){return p===o||p===92?(e.consume(p),c):c(p)}}function Me(e,n){let t;return r;function r(i){return P(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):D(i)?V(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Ii={name:"definition",tokenize:vi},Ai={partial:!0,tokenize:Ti};function vi(e,n,t){const r=this;let i;return l;function l(h){return e.enter("definition"),o(h)}function o(h){return $t.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=ve(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),s):t(h)}function s(h){return J(h)?Me(e,u)(h):u(h)}function u(h){return Ut(e,c,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(Ai,f,f)(h)}function f(h){return D(h)?V(e,p,"whitespace")(h):p(h)}function p(h){return h===null||P(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function Ti(e,n,t){return r;function r(a){return J(a)?Me(e,i)(a):t(a)}function i(a){return qt(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return D(a)?V(e,o,"whitespace")(a):o(a)}function o(a){return a===null||P(a)?n(a):t(a)}}const Pi={name:"hardBreakEscape",tokenize:Li};function Li(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return P(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const zi={name:"headingAtx",resolve:_i,tokenize:Fi};function _i(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},se(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function Fi(e,n,t){let r=0;return i;function i(c){return e.enter("atxHeading"),l(c)}function l(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||J(c)?(e.exit("atxHeadingSequence"),a(c)):t(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||P(c)?(e.exit("atxHeading"),n(c)):D(c)?V(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function s(c){return c===35?(e.consume(c),s):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||J(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}const Ri=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],rt=["pre","script","style","textarea"],Di={concrete:!0,name:"htmlFlow",resolveTo:Mi,tokenize:Ni},Oi={partial:!0,tokenize:Hi},Bi={partial:!0,tokenize:ji};function Mi(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Ni(e,n,t){const r=this;let i,l,o,a,s;return u;function u(m){return c(m)}function c(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),f}function f(m){return m===33?(e.consume(m),p):m===47?(e.consume(m),l=!0,S):m===63?(e.consume(m),i=3,r.interrupt?n:d):ue(m)?(e.consume(m),o=String.fromCharCode(m),I):t(m)}function p(m){return m===45?(e.consume(m),i=2,h):m===91?(e.consume(m),i=5,a=0,b):ue(m)?(e.consume(m),i=4,r.interrupt?n:d):t(m)}function h(m){return m===45?(e.consume(m),r.interrupt?n:d):t(m)}function b(m){const le="CDATA[";return m===le.charCodeAt(a++)?(e.consume(m),a===le.length?r.interrupt?n:A:b):t(m)}function S(m){return ue(m)?(e.consume(m),o=String.fromCharCode(m),I):t(m)}function I(m){if(m===null||m===47||m===62||J(m)){const le=m===47,xe=o.toLowerCase();return!le&&!l&&rt.includes(xe)?(i=1,r.interrupt?n(m):A(m)):Ri.includes(o.toLowerCase())?(i=6,le?(e.consume(m),x):r.interrupt?n(m):A(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(m):l?L(m):E(m))}return m===45||ne(m)?(e.consume(m),o+=String.fromCharCode(m),I):t(m)}function x(m){return m===62?(e.consume(m),r.interrupt?n:A):t(m)}function L(m){return D(m)?(e.consume(m),L):B(m)}function E(m){return m===47?(e.consume(m),B):m===58||m===95||ue(m)?(e.consume(m),N):D(m)?(e.consume(m),E):B(m)}function N(m){return m===45||m===46||m===58||m===95||ne(m)?(e.consume(m),N):H(m)}function H(m){return m===61?(e.consume(m),y):D(m)?(e.consume(m),H):E(m)}function y(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),s=m,R):D(m)?(e.consume(m),y):U(m)}function R(m){return m===s?(e.consume(m),s=null,O):m===null||P(m)?t(m):(e.consume(m),R)}function U(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||J(m)?H(m):(e.consume(m),U)}function O(m){return m===47||m===62||D(m)?E(m):t(m)}function B(m){return m===62?(e.consume(m),v):t(m)}function v(m){return m===null||P(m)?A(m):D(m)?(e.consume(m),v):t(m)}function A(m){return m===45&&i===2?(e.consume(m),M):m===60&&i===1?(e.consume(m),Y):m===62&&i===4?(e.consume(m),ie):m===63&&i===3?(e.consume(m),d):m===93&&i===5?(e.consume(m),ce):P(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Oi,fe,$)(m)):m===null||P(m)?(e.exit("htmlFlowData"),$(m)):(e.consume(m),A)}function $(m){return e.check(Bi,T,fe)(m)}function T(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),C}function C(m){return m===null||P(m)?$(m):(e.enter("htmlFlowData"),A(m))}function M(m){return m===45?(e.consume(m),d):A(m)}function Y(m){return m===47?(e.consume(m),o="",re):A(m)}function re(m){if(m===62){const le=o.toLowerCase();return rt.includes(le)?(e.consume(m),ie):A(m)}return ue(m)&&o.length<8?(e.consume(m),o+=String.fromCharCode(m),re):A(m)}function ce(m){return m===93?(e.consume(m),d):A(m)}function d(m){return m===62?(e.consume(m),ie):m===45&&i===2?(e.consume(m),d):A(m)}function ie(m){return m===null||P(m)?(e.exit("htmlFlowData"),fe(m)):(e.consume(m),ie)}function fe(m){return e.exit("htmlFlow"),n(m)}}function ji(e,n,t){const r=this;return i;function i(o){return P(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function Hi(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ze,n,t)}}const Ui={name:"htmlText",tokenize:$i};function $i(e,n,t){const r=this;let i,l,o;return a;function a(d){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(d),s}function s(d){return d===33?(e.consume(d),u):d===47?(e.consume(d),H):d===63?(e.consume(d),E):ue(d)?(e.consume(d),U):t(d)}function u(d){return d===45?(e.consume(d),c):d===91?(e.consume(d),l=0,b):ue(d)?(e.consume(d),L):t(d)}function c(d){return d===45?(e.consume(d),h):t(d)}function f(d){return d===null?t(d):d===45?(e.consume(d),p):P(d)?(o=f,Y(d)):(e.consume(d),f)}function p(d){return d===45?(e.consume(d),h):f(d)}function h(d){return d===62?M(d):d===45?p(d):f(d)}function b(d){const ie="CDATA[";return d===ie.charCodeAt(l++)?(e.consume(d),l===ie.length?S:b):t(d)}function S(d){return d===null?t(d):d===93?(e.consume(d),I):P(d)?(o=S,Y(d)):(e.consume(d),S)}function I(d){return d===93?(e.consume(d),x):S(d)}function x(d){return d===62?M(d):d===93?(e.consume(d),x):S(d)}function L(d){return d===null||d===62?M(d):P(d)?(o=L,Y(d)):(e.consume(d),L)}function E(d){return d===null?t(d):d===63?(e.consume(d),N):P(d)?(o=E,Y(d)):(e.consume(d),E)}function N(d){return d===62?M(d):E(d)}function H(d){return ue(d)?(e.consume(d),y):t(d)}function y(d){return d===45||ne(d)?(e.consume(d),y):R(d)}function R(d){return P(d)?(o=R,Y(d)):D(d)?(e.consume(d),R):M(d)}function U(d){return d===45||ne(d)?(e.consume(d),U):d===47||d===62||J(d)?O(d):t(d)}function O(d){return d===47?(e.consume(d),M):d===58||d===95||ue(d)?(e.consume(d),B):P(d)?(o=O,Y(d)):D(d)?(e.consume(d),O):M(d)}function B(d){return d===45||d===46||d===58||d===95||ne(d)?(e.consume(d),B):v(d)}function v(d){return d===61?(e.consume(d),A):P(d)?(o=v,Y(d)):D(d)?(e.consume(d),v):O(d)}function A(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),i=d,$):P(d)?(o=A,Y(d)):D(d)?(e.consume(d),A):(e.consume(d),T)}function $(d){return d===i?(e.consume(d),i=void 0,C):d===null?t(d):P(d)?(o=$,Y(d)):(e.consume(d),$)}function T(d){return d===null||d===34||d===39||d===60||d===61||d===96?t(d):d===47||d===62||J(d)?O(d):(e.consume(d),T)}function C(d){return d===47||d===62||J(d)?O(d):t(d)}function M(d){return d===62?(e.consume(d),e.exit("htmlTextData"),e.exit("htmlText"),n):t(d)}function Y(d){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),re}function re(d){return D(d)?V(e,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):ce(d)}function ce(d){return e.enter("htmlTextData"),o(d)}}const Ln={name:"labelEnd",resolveAll:Yi,resolveTo:Qi,tokenize:Xi},qi={tokenize:Gi},Vi={tokenize:Ji},Wi={tokenize:Ki};function Yi(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&se(e,0,e.length,t),e}function Qi(e,n){let t=e.length,r=0,i,l,o,a;for(;t--;)if(i=e[t][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=t);const s={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",s,n],["enter",u,n]],a=te(a,e.slice(l+1,l+r+3)),a=te(a,[["enter",c,n]]),a=te(a,Pn(n.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),n)),a=te(a,[["exit",c,n],e[o-2],e[o-1],["exit",u,n]]),a=te(a,e.slice(o+1)),a=te(a,[["exit",s,n]]),se(e,l,e.length,a),e}function Xi(e,n,t){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(p){return l?l._inactive?f(p):(o=r.parser.defined.includes(ve(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),s):t(p)}function s(p){return p===40?e.attempt(qi,c,o?c:f)(p):p===91?e.attempt(Vi,c,o?u:f)(p):o?c(p):f(p)}function u(p){return e.attempt(Wi,c,f)(p)}function c(p){return n(p)}function f(p){return l._balanced=!0,t(p)}}function Gi(e,n,t){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return J(f)?Me(e,l)(f):l(f)}function l(f){return f===41?c(f):Ut(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return J(f)?Me(e,s)(f):c(f)}function a(f){return t(f)}function s(f){return f===34||f===39||f===40?qt(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return J(f)?Me(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),n):t(f)}}function Ji(e,n,t){const r=this;return i;function i(a){return $t.call(r,e,l,o,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(ve(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function o(a){return t(a)}}function Ki(e,n,t){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),n):t(l)}}const Zi={name:"labelStartImage",resolveAll:Ln.resolveAll,tokenize:el};function el(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),l}function l(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):t(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const nl={name:"labelStartLink",resolveAll:Ln.resolveAll,tokenize:tl};function tl(e,n,t){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):n(o)}}const rn={name:"lineEnding",tokenize:rl};function rl(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),V(e,n,"linePrefix")}}const Qe={name:"thematicBreak",tokenize:il};function il(e,n,t){let r=0,i;return l;function l(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),s(u)):r>=3&&(u===null||P(u))?(e.exit("thematicBreak"),n(u)):t(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),D(u)?V(e,a,"whitespace")(u):a(u))}}const G={continuation:{tokenize:ul},exit:cl,name:"list",tokenize:al},ll={partial:!0,tokenize:fl},ol={partial:!0,tokenize:sl};function al(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(h){const b=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:gn(h)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Qe,t,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(h)}return t(h)}function s(h){return gn(h)&&++o<10?(e.consume(h),s):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):t(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Ze,r.interrupt?t:c,e.attempt(ll,p,f))}function c(h){return r.containerState.initialBlankLine=!0,l++,p(h)}function f(h){return D(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function ul(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ze,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,V(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!D(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ol,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,V(e,e.attempt(G,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function sl(e,n,t){const r=this;return V(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function cl(e){e.exit(this.containerState.type)}function fl(e,n,t){const r=this;return V(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!D(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const it={name:"setextUnderline",resolveTo:hl,tokenize:pl};function hl(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function pl(e,n,t){const r=this;let i;return l;function l(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,o(u)):t(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),D(u)?V(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||P(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const dl={tokenize:ml};function ml(e){const n=this,t=e.attempt(Ze,r,e.attempt(this.parser.constructs.flowInitial,i,V(e,e.attempt(this.parser.constructs.flow,i,e.attempt(bi,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const gl={resolveAll:Wt()},yl=Vt("string"),xl=Vt("text");function Vt(e){return{resolveAll:Wt(e==="text"?kl:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(c){return u(c)?l(c):a(c)}function a(c){if(c===null){t.consume(c);return}return t.enter("data"),t.consume(c),s}function s(c){return u(c)?(t.exit("data"),l(c)):(t.consume(c),s)}function u(c){if(c===null)return!0;const f=i[c];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Wt(e){return n;function n(t,r){let i=-1,l;for(;++i<=t.length;)l===void 0?t[i]&&t[i][1].type==="data"&&(l=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==l+2&&(t[l][1].end=t[i-1][1].end,t.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(t,r):t}}function kl(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let l=i.length,o=-1,a=0,s;for(;l--;){const u=i[l];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)s=!0,a++;else if(u!==-1){l++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const u={type:t===e.length||s||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(t,0,["enter",u,n],["exit",u,n]),t+=2)}t++}return e}const bl={42:G,43:G,45:G,48:G,49:G,50:G,51:G,52:G,53:G,54:G,55:G,56:G,57:G,62:Mt},wl={91:Ii},Sl={[-2]:tn,[-1]:tn,32:tn},Cl={35:zi,42:Qe,45:[it,Qe],60:Di,61:it,95:Qe,96:tt,126:tt},El={38:jt,92:Nt},Il={[-5]:rn,[-4]:rn,[-3]:rn,33:Zi,38:jt,42:yn,60:[ni,Ui],91:nl,92:[Pi,Nt],93:Ln,95:yn,96:di},Al={null:[yn,gl]},vl={null:[42,95]},Tl={null:[]},Pl=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:vl,contentInitial:wl,disable:Tl,document:bl,flow:Cl,flowInitial:Sl,insideSpan:Al,string:El,text:Il},Symbol.toStringTag,{value:"Module"}));function Ll(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},l=[];let o=[],a=[];const s={attempt:R(H),check:R(y),consume:L,enter:E,exit:N,interrupt:R(y,{interrupt:!0})},u={code:null,containerState:{},defineSkip:S,events:[],now:b,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:f};let c=n.tokenize.call(u,s);return n.resolveAll&&l.push(n),u;function f(v){return o=te(o,v),I(),o[o.length-1]!==null?[]:(U(n,0),u.events=Pn(l,u.events,u),u.events)}function p(v,A){return _l(h(v),A)}function h(v){return zl(o,v)}function b(){const{_bufferIndex:v,_index:A,line:$,column:T,offset:C}=r;return{_bufferIndex:v,_index:A,line:$,column:T,offset:C}}function S(v){i[v.line]=v.column,B()}function I(){let v;for(;r._index<o.length;){const A=o[r._index];if(typeof A=="string")for(v=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===v&&r._bufferIndex<A.length;)x(A.charCodeAt(r._bufferIndex));else x(A)}}function x(v){c=c(v)}function L(v){P(v)?(r.line++,r.column=1,r.offset+=v===-3?2:1,B()):v!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=v}function E(v,A){const $=A||{};return $.type=v,$.start=b(),u.events.push(["enter",$,u]),a.push($),$}function N(v){const A=a.pop();return A.end=b(),u.events.push(["exit",A,u]),A}function H(v,A){U(v,A.from)}function y(v,A){A.restore()}function R(v,A){return $;function $(T,C,M){let Y,re,ce,d;return Array.isArray(T)?fe(T):"tokenize"in T?fe([T]):ie(T);function ie(Q){return ze;function ze(de){const Se=de!==null&&Q[de],Ce=de!==null&&Q.null,qe=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(Ce)?Ce:Ce?[Ce]:[]];return fe(qe)(de)}}function fe(Q){return Y=Q,re=0,Q.length===0?M:m(Q[re])}function m(Q){return ze;function ze(de){return d=O(),ce=Q,Q.partial||(u.currentConstruct=Q),Q.name&&u.parser.constructs.disable.null.includes(Q.name)?xe():Q.tokenize.call(A?Object.assign(Object.create(u),A):u,s,le,xe)(de)}}function le(Q){return v(ce,d),C}function xe(Q){return d.restore(),++re<Y.length?m(Y[re]):M}}}function U(v,A){v.resolveAll&&!l.includes(v)&&l.push(v),v.resolve&&se(u.events,A,u.events.length-A,v.resolve(u.events.slice(A),u)),v.resolveTo&&(u.events=v.resolveTo(u.events,u))}function O(){const v=b(),A=u.previous,$=u.currentConstruct,T=u.events.length,C=Array.from(a);return{from:T,restore:M};function M(){r=v,u.previous=A,u.currentConstruct=$,u.events.length=T,a=C,B()}}function B(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function zl(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,l=n.end._bufferIndex;let o;if(t===i)o=[e[t].slice(r,l)];else{if(o=e.slice(t,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function _l(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const l=e[t];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
|
|
2
2
|
`;break}case-3:{o=`\r
|
|
3
3
|
`;break}case-2:{o=n?" ":" ";break}case-1:{if(!n&&i)continue;o=" ";break}default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function Fl(e){const r={constructs:jr([Pl,...(e||{}).extensions||[]]),content:i(Qr),defined:[],document:i(Gr),flow:i(dl),lazy:{},string:i(yl),text:i(xl)};return r;function i(l){return o;function o(a){return Ll(r,l,a)}}}function Rl(e){for(;!Ht(e););return e}const lt=/[\0\t\n\r]/g;function Dl(){let e=1,n="",t=!0,r;return i;function i(l,o,a){const s=[];let u,c,f,p,h;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),f=0,n="",t&&(l.charCodeAt(0)===65279&&f++,t=void 0);f<l.length;){if(lt.lastIndex=f,u=lt.exec(l),p=u&&u.index!==void 0?u.index:l.length,h=l.charCodeAt(p),!u){n=l.slice(f);break}if(h===10&&f===p&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),f<p&&(s.push(l.slice(f,p)),e+=p-f),h){case 0:{s.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,s.push(-2);e++<c;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:r=!0,e=1}f=p+1}return a&&(r&&s.push(-5),n&&s.push(n),s.push(null)),s}}const Ol=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Yt(e){return e.replace(Ol,Bl)}function Bl(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),l=i===120||i===88;return Bt(t.slice(l?2:1),l?16:10)}return Tn(t)||e}function Ne(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ot(e.position):"start"in e||"end"in e?ot(e):"line"in e||"column"in e?xn(e):""}function xn(e){return at(e&&e.line)+":"+at(e&&e.column)}function ot(e){return xn(e&&e.start)+"-"+xn(e&&e.end)}function at(e){return e&&typeof e=="number"?e:1}const Qt={}.hasOwnProperty;function Ml(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),Nl(t)(Rl(Fl(t).document().write(Dl()(e,n,!0))))}function Nl(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Qn),autolinkProtocol:O,autolinkEmail:O,atxHeading:l(Vn),blockQuote:l(Ce),characterEscape:O,characterReference:O,codeFenced:l(qe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(qe,o),codeText:l(Pr,o),codeTextData:O,data:O,codeFlowValue:O,definition:l(Lr),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(zr),hardBreakEscape:l(Wn),hardBreakTrailing:l(Wn),htmlFlow:l(Yn,o),htmlFlowData:O,htmlText:l(Yn,o),htmlTextData:O,image:l(_r),label:o,link:l(Qn),listItem:l(Fr),listItemValue:p,listOrdered:l(Xn,f),listUnordered:l(Xn),paragraph:l(Rr),reference:m,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Vn),strong:l(Dr),thematicBreak:l(Br)},exit:{atxHeading:s(),atxHeadingSequence:H,autolink:s(),autolinkEmail:Se,autolinkProtocol:de,blockQuote:s(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:xe,characterReferenceMarkerNumeric:xe,characterReferenceValue:Q,characterReference:ze,codeFenced:s(I),codeFencedFence:S,codeFencedFenceInfo:h,codeFencedFenceMeta:b,codeFlowValue:B,codeIndented:s(x),codeText:s(C),codeTextData:B,data:B,definition:s(),definitionDestinationString:N,definitionLabelString:L,definitionTitleString:E,emphasis:s(),hardBreakEscape:s(A),hardBreakTrailing:s(A),htmlFlow:s($),htmlFlowData:B,htmlText:s(T),htmlTextData:B,image:s(Y),label:ce,labelText:re,lineEnding:v,link:s(M),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:le,resourceDestinationString:d,resourceTitleString:ie,resource:fe,setextHeading:s(U),setextHeadingLineSequence:R,setextHeadingText:y,strong:s(),thematicBreak:s()}};Xt(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(g){let w={type:"root",children:[]};const z={stack:[w],tokenStack:[],config:n,enter:a,exit:u,buffer:o,resume:c,data:t},F=[];let j=-1;for(;++j<g.length;)if(g[j][1].type==="listOrdered"||g[j][1].type==="listUnordered")if(g[j][0]==="enter")F.push(j);else{const oe=F.pop();j=i(g,oe,j)}for(j=-1;++j<g.length;){const oe=n[g[j][0]];Qt.call(oe,g[j][1].type)&&oe[g[j][1].type].call(Object.assign({sliceSerialize:g[j][2].sliceSerialize},z),g[j][1])}if(z.tokenStack.length>0){const oe=z.tokenStack[z.tokenStack.length-1];(oe[1]||ut).call(z,void 0,oe[0])}for(w.position={start:me(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:me(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},j=-1;++j<n.transforms.length;)w=n.transforms[j](w)||w;return w}function i(g,w,z){let F=w-1,j=-1,oe=!1,ke,he,_e,Fe;for(;++F<=z;){const Z=g[F];switch(Z[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Z[0]==="enter"?j++:j--,Fe=void 0;break}case"lineEndingBlank":{Z[0]==="enter"&&(ke&&!Fe&&!j&&!_e&&(_e=F),Fe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Fe=void 0}if(!j&&Z[0]==="enter"&&Z[1].type==="listItemPrefix"||j===-1&&Z[0]==="exit"&&(Z[1].type==="listUnordered"||Z[1].type==="listOrdered")){if(ke){let Ee=F;for(he=void 0;Ee--;){const pe=g[Ee];if(pe[1].type==="lineEnding"||pe[1].type==="lineEndingBlank"){if(pe[0]==="exit")continue;he&&(g[he][1].type="lineEndingBlank",oe=!0),pe[1].type="lineEnding",he=Ee}else if(!(pe[1].type==="linePrefix"||pe[1].type==="blockQuotePrefix"||pe[1].type==="blockQuotePrefixWhitespace"||pe[1].type==="blockQuoteMarker"||pe[1].type==="listItemIndent"))break}_e&&(!he||_e<he)&&(ke._spread=!0),ke.end=Object.assign({},he?g[he][1].start:Z[1].end),g.splice(he||F,0,["exit",ke,Z[2]]),F++,z++}if(Z[1].type==="listItemPrefix"){const Ee={type:"listItem",_spread:!1,start:Object.assign({},Z[1].start),end:void 0};ke=Ee,g.splice(F,0,["enter",Ee,Z[2]]),F++,z++,_e=void 0,Fe=!0}}}return g[w][1]._spread=oe,z}function l(g,w){return z;function z(F){a.call(this,g(F),F),w&&w.call(this,F)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(g,w,z){this.stack[this.stack.length-1].children.push(g),this.stack.push(g),this.tokenStack.push([w,z||void 0]),g.position={start:me(w.start),end:void 0}}function s(g){return w;function w(z){g&&g.call(this,z),u.call(this,z)}}function u(g,w){const z=this.stack.pop(),F=this.tokenStack.pop();if(F)F[0].type!==g.type&&(w?w.call(this,g,F[0]):(F[1]||ut).call(this,g,F[0]));else throw new Error("Cannot close `"+g.type+"` ("+Ne({start:g.start,end:g.end})+"): it’s not open");z.position.end=me(g.end)}function c(){return vn(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(g){if(this.data.expectingFirstListItemValue){const w=this.stack[this.stack.length-2];w.start=Number.parseInt(this.sliceSerialize(g),10),this.data.expectingFirstListItemValue=void 0}}function h(){const g=this.resume(),w=this.stack[this.stack.length-1];w.lang=g}function b(){const g=this.resume(),w=this.stack[this.stack.length-1];w.meta=g}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function I(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g.replace(/(\r?\n|\r)$/g,"")}function L(g){const w=this.resume(),z=this.stack[this.stack.length-1];z.label=w,z.identifier=ve(this.sliceSerialize(g)).toLowerCase()}function E(){const g=this.resume(),w=this.stack[this.stack.length-1];w.title=g}function N(){const g=this.resume(),w=this.stack[this.stack.length-1];w.url=g}function H(g){const w=this.stack[this.stack.length-1];if(!w.depth){const z=this.sliceSerialize(g).length;w.depth=z}}function y(){this.data.setextHeadingSlurpLineEnding=!0}function R(g){const w=this.stack[this.stack.length-1];w.depth=this.sliceSerialize(g).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function O(g){const z=this.stack[this.stack.length-1].children;let F=z[z.length-1];(!F||F.type!=="text")&&(F=Or(),F.position={start:me(g.start),end:void 0},z.push(F)),this.stack.push(F)}function B(g){const w=this.stack.pop();w.value+=this.sliceSerialize(g),w.position.end=me(g.end)}function v(g){const w=this.stack[this.stack.length-1];if(this.data.atHardBreak){const z=w.children[w.children.length-1];z.position.end=me(g.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(w.type)&&(O.call(this,g),B.call(this,g))}function A(){this.data.atHardBreak=!0}function $(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g}function T(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g}function C(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g}function M(){const g=this.stack[this.stack.length-1];if(this.data.inReference){const w=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=w,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function Y(){const g=this.stack[this.stack.length-1];if(this.data.inReference){const w=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=w,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function re(g){const w=this.sliceSerialize(g),z=this.stack[this.stack.length-2];z.label=Yt(w),z.identifier=ve(w).toLowerCase()}function ce(){const g=this.stack[this.stack.length-1],w=this.resume(),z=this.stack[this.stack.length-1];if(this.data.inReference=!0,z.type==="link"){const F=g.children;z.children=F}else z.alt=w}function d(){const g=this.resume(),w=this.stack[this.stack.length-1];w.url=g}function ie(){const g=this.resume(),w=this.stack[this.stack.length-1];w.title=g}function fe(){this.data.inReference=void 0}function m(){this.data.referenceType="collapsed"}function le(g){const w=this.resume(),z=this.stack[this.stack.length-1];z.label=w,z.identifier=ve(this.sliceSerialize(g)).toLowerCase(),this.data.referenceType="full"}function xe(g){this.data.characterReferenceType=g.type}function Q(g){const w=this.sliceSerialize(g),z=this.data.characterReferenceType;let F;z?(F=Bt(w,z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):F=Tn(w);const j=this.stack[this.stack.length-1];j.value+=F}function ze(g){const w=this.stack.pop();w.position.end=me(g.end)}function de(g){B.call(this,g);const w=this.stack[this.stack.length-1];w.url=this.sliceSerialize(g)}function Se(g){B.call(this,g);const w=this.stack[this.stack.length-1];w.url="mailto:"+this.sliceSerialize(g)}function Ce(){return{type:"blockquote",children:[]}}function qe(){return{type:"code",lang:null,meta:null,value:""}}function Pr(){return{type:"inlineCode",value:""}}function Lr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function zr(){return{type:"emphasis",children:[]}}function Vn(){return{type:"heading",depth:0,children:[]}}function Wn(){return{type:"break"}}function Yn(){return{type:"html",value:""}}function _r(){return{type:"image",title:null,url:"",alt:null}}function Qn(){return{type:"link",title:null,url:"",children:[]}}function Xn(g){return{type:"list",ordered:g.type==="listOrdered",start:null,spread:g._spread,children:[]}}function Fr(g){return{type:"listItem",spread:g._spread,checked:null,children:[]}}function Rr(){return{type:"paragraph",children:[]}}function Dr(){return{type:"strong",children:[]}}function Or(){return{type:"text",value:""}}function Br(){return{type:"thematicBreak"}}}function me(e){return{line:e.line,column:e.column,offset:e.offset}}function Xt(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?Xt(e,r):jl(e,r)}}function jl(e,n){let t;for(t in n)if(Qt.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function ut(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Ne({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Ne({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Ne({start:n.start,end:n.end})+") is still open")}function Hl(e){const n=this;n.parser=t;function t(r){return Ml(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}const st={}.hasOwnProperty;function Ul(e,n){const t=n||{};function r(i,...l){let o=r.invalid;const a=r.handlers;if(i&&st.call(i,e)){const s=String(i[e]);o=st.call(a,s)?a[s]:r.unknown}if(o)return o.call(this,i,...l)}return r.handlers=t.handlers||{},r.invalid=t.invalid,r.unknown=t.unknown,r}const $l={}.hasOwnProperty;function Gt(e,n){let t=-1,r;if(n.extensions)for(;++t<n.extensions.length;)Gt(e,n.extensions[t]);for(r in n)if($l.call(n,r))switch(r){case"extensions":break;case"unsafe":{ct(e[r],n[r]);break}case"join":{ct(e[r],n[r]);break}case"handlers":{ql(e[r],n[r]);break}default:e.options[r]=n[r]}return e}function ct(e,n){n&&e.push(...n)}function ql(e,n){n&&Object.assign(e,n)}function Vl(e,n,t,r){const i=t.enter("blockquote"),l=t.createTracker(r);l.move("> "),l.shift(2);const o=t.indentLines(t.containerFlow(e,l.current()),Wl);return i(),o}function Wl(e,n,t){return">"+(t?"":" ")+e}function Jt(e,n){return ft(e,n.inConstruct,!0)&&!ft(e,n.notInConstruct,!1)}function ft(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function ht(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
|
|
4
4
|
`&&Jt(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|