import{d as Zt,o as wt}from"./vendor-d-100-DUwYIYiB.js";import{s as _t,p as Sn,a as Cn,v as ze,b as In,c as Fe,d as zn,E as Fn}from"./vendor-u-117-DC4Cwaa0.js";import{A as vt}from"./vendor-misc-bJru-SXh.js";import{a as Tn}from"./vendor-t-116-CEUFdAEd.js";import{c as ae}from"./vendor-c-99-Gw4UEZta.js";import{l as An}from"./vendor-l-108-biR2a0RG.js";const En={};function Jt(t,n){const e=En,r=typeof e.includeImageAlt=="boolean"?e.includeImageAlt:!0,l=typeof e.includeHtml=="boolean"?e.includeHtml:!0;return Te(t,r,l)}function Te(t,n,e){if(Dn(t)){if("value"in t)return t.type==="html"&&!e?"":t.value;if(n&&"alt"in t&&t.alt)return t.alt;if("children"in t)return oe(t.children,n,e)}return Array.isArray(t)?oe(t,n,e):""}function oe(t,n,e){const r=[];let l=-1;for(;++ll?0:l+n:n=n>l?l:n,e=e>0?e:0,r.length<1e4)i=Array.from(r),i.unshift(n,e),t.splice(...i);else for(e&&t.splice(n,e);u0?(Z(t,t.length,0,n),t):n}const se={}.hasOwnProperty;function Ae(t){const n={};let e=-1;for(;++e13&&e<32||e>126&&e<160||e>55295&&e<57344||e>64975&&e<65008||(e&65535)===65535||(e&65535)===65534||e>1114111?"�":String.fromCodePoint(e)}function nt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Q=ht(/[A-Za-z]/),W=ht(/[\dA-Za-z]/),_n=ht(/[#-'*+\--9=?A-Z^-~]/);function Mt(t){return t!==null&&(t<32||t===127)}const Wt=ht(/\d/),Bn=ht(/[\dA-Fa-f]/),vn=ht(/[!-/:-@[-`{-~]/);function A(t){return t!==null&&t<-2}function q(t){return t!==null&&(t<0||t===32)}function P(t){return t===-2||t===-1||t===32}const Rt=ht(/\p{P}|\p{S}/u),gt=ht(/\s/);function ht(t){return n;function n(e){return e!==null&&e>-1&&t.test(String.fromCharCode(e))}}function St(t){const n=[];let e=-1,r=0,l=0;for(;++e55295&&u<57344){const a=t.charCodeAt(e+1);u<56320&&a>56319&&a<57344?(i=String.fromCharCode(u,a),l=1):i="�"}else i=String.fromCharCode(u);i&&(n.push(t.slice(r,e),encodeURIComponent(i)),r=e+l+1,i=""),l&&(e+=l,l=0)}return n.join("")+t.slice(r)}function B(t,n,e,r){const l=r?r-1:Number.POSITIVE_INFINITY;let u=0;return i;function i(o){return P(o)?(t.enter(e),a(o)):n(o)}function a(o){return P(o)&&u++i))return;const v=n.events.length;let H=v,O,x;for(;H--;)if(n.events[H][0]==="exit"&&n.events[H][1].type==="chunkFlow"){if(O){x=n.events[H][1].end;break}O=!0}for(d(r),y=v;yw;){const L=e[D];n.containerState=L[1],L[0].exit.call(n,t)}e.length=w}function z(){l.write([null]),u=void 0,l=void 0,n.containerState._closeFlow=void 0}}function qn(t,n,e){return B(t,t.attempt(this.parser.constructs.document,n,e),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function yt(t){if(t===null||q(t)||gt(t))return 1;if(Rt(t))return 2}function Nt(t,n,e){const r=[];let l=-1;for(;++l1&&t[e][1].end.offset-t[e][1].start.offset>1?2:1;const c={...t[r][1].end},p={...t[e][1].start};he(c,-o),he(p,o),i={type:o>1?"strongSequence":"emphasisSequence",start:c,end:{...t[r][1].end}},a={type:o>1?"strongSequence":"emphasisSequence",start:{...t[e][1].start},end:p},u={type:o>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[e][1].start}},l={type:o>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},t[r][1].end={...i.start},t[e][1].start={...a.end},s=[],t[r][1].end.offset-t[r][1].start.offset&&(s=J(s,[["enter",t[r][1],n],["exit",t[r][1],n]])),s=J(s,[["enter",l,n],["enter",i,n],["exit",i,n],["enter",u,n]]),s=J(s,Nt(n.parser.constructs.insideSpan.null,t.slice(r+1,e),n)),s=J(s,[["exit",u,n],["enter",a,n],["exit",a,n],["exit",l,n]]),t[e][1].end.offset-t[e][1].start.offset?(h=2,s=J(s,[["enter",t[e][1],n],["exit",t[e][1],n]])):h=0,Z(t,r-1,e-r+3,s),e=r+s.length-h-2;break}}for(e=-1;++e0&&P(y)?B(t,z,"linePrefix",u+1)(y):z(y)}function z(y){return y===null||A(y)?t.check(fe,C,D)(y):(t.enter("codeFlowValue"),w(y))}function w(y){return y===null||A(y)?(t.exit("codeFlowValue"),z(y)):(t.consume(y),w)}function D(y){return t.exit("codeFenced"),n(y)}function L(y,v,H){let O=0;return x;function x(M){return y.enter("lineEnding"),y.consume(M),y.exit("lineEnding"),F}function F(M){return y.enter("codeFencedFence"),P(M)?B(y,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):T(M)}function T(M){return M===a?(y.enter("codeFencedFenceSequence"),R(M)):H(M)}function R(M){return M===a?(O++,y.consume(M),R):O>=i?(y.exit("codeFencedFenceSequence"),P(M)?B(y,$,"whitespace")(M):$(M)):H(M)}function $(M){return M===null||A(M)?(y.exit("codeFencedFence"),v(M)):H(M)}}}function Kn(t,n,e){const r=this;return l;function l(i){return i===null?e(i):(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),u)}function u(i){return r.parser.lazy[r.now().line]?e(i):n(i)}}const qt={name:"codeIndented",tokenize:tr},Xn={partial:!0,tokenize:er};function tr(t,n,e){const r=this;return l;function l(s){return t.enter("codeIndented"),B(t,u,"linePrefix",5)(s)}function u(s){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?i(s):e(s)}function i(s){return s===null?o(s):A(s)?t.attempt(Xn,i,o)(s):(t.enter("codeFlowValue"),a(s))}function a(s){return s===null||A(s)?(t.exit("codeFlowValue"),i(s)):(t.consume(s),a)}function o(s){return t.exit("codeIndented"),n(s)}}function er(t,n,e){const r=this;return l;function l(i){return r.parser.lazy[r.now().line]?e(i):A(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),l):B(t,u,"linePrefix",5)(i)}function u(i){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(i):A(i)?l(i):e(i)}}const nr={name:"codeText",previous:ir,resolve:rr,tokenize:lr};function rr(t){let n=t.length-4,e=3,r,l;if((t[e][1].type==="lineEnding"||t[e][1].type==="space")&&(t[n][1].type==="lineEnding"||t[n][1].type==="space")){for(r=e;++r=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 nthis.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,e,r){const l=e||0;this.setCursor(Math.trunc(n));const u=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return r&&Ft(this.left,r),u.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),Ft(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Ft(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=4?n(i):t.interrupt(r.parser.constructs.flow,e,n)(i)}}function Be(t,n,e,r,l,u,i,a,o){const s=o||Number.POSITIVE_INFINITY;let h=0;return c;function c(d){return d===60?(t.enter(r),t.enter(l),t.enter(u),t.consume(d),t.exit(u),p):d===null||d===32||d===41||Mt(d)?e(d):(t.enter(r),t.enter(i),t.enter(a),t.enter("chunkString",{contentType:"string"}),C(d))}function p(d){return d===62?(t.enter(u),t.consume(d),t.exit(u),t.exit(l),t.exit(r),n):(t.enter(a),t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===62?(t.exit("chunkString"),t.exit(a),p(d)):d===null||d===60||A(d)?e(d):(t.consume(d),d===92?k:f)}function k(d){return d===60||d===62||d===92?(t.consume(d),f):f(d)}function C(d){return!h&&(d===null||d===41||q(d))?(t.exit("chunkString"),t.exit(a),t.exit(i),t.exit(r),n(d)):h999||f===null||f===91||f===93&&!o||f===94&&!a&&"_hiddenFootnoteSupport"in i.parser.constructs?e(f):f===93?(t.exit(u),t.enter(l),t.consume(f),t.exit(l),t.exit(r),n):A(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),h):(t.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||A(f)||a++>999?(t.exit("chunkString"),h(f)):(t.consume(f),o||(o=!P(f)),f===92?p:c)}function p(f){return f===91||f===92||f===93?(t.consume(f),a++,c):c(f)}}function Me(t,n,e,r,l,u){let i;return a;function a(p){return p===34||p===39||p===40?(t.enter(r),t.enter(l),t.consume(p),t.exit(l),i=p===40?41:p,o):e(p)}function o(p){return p===i?(t.enter(l),t.consume(p),t.exit(l),t.exit(r),n):(t.enter(u),s(p))}function s(p){return p===i?(t.exit(u),o(i)):p===null?e(p):A(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),B(t,s,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===i||p===null||A(p)?(t.exit("chunkString"),s(p)):(t.consume(p),p===92?c:h)}function c(p){return p===i||p===92?(t.consume(p),h):h(p)}}function Tt(t,n){let e;return r;function r(l){return A(l)?(t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),e=!0,r):P(l)?B(t,r,e?"linePrefix":"lineSuffix")(l):n(l)}}const pr={name:"definition",tokenize:gr},mr={partial:!0,tokenize:kr};function gr(t,n,e){const r=this;let l;return u;function u(f){return t.enter("definition"),i(f)}function i(f){return ve.call(r,t,a,e,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return l=nt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(t.enter("definitionMarker"),t.consume(f),t.exit("definitionMarker"),o):e(f)}function o(f){return q(f)?Tt(t,s)(f):s(f)}function s(f){return Be(t,h,e,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function h(f){return t.attempt(mr,c,c)(f)}function c(f){return P(f)?B(t,p,"whitespace")(f):p(f)}function p(f){return f===null||A(f)?(t.exit("definition"),r.parser.defined.push(l),n(f)):e(f)}}function kr(t,n,e){return r;function r(a){return q(a)?Tt(t,l)(a):e(a)}function l(a){return Me(t,u,e,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function u(a){return P(a)?B(t,i,"whitespace")(a):i(a)}function i(a){return a===null||A(a)?n(a):e(a)}}const xr={name:"hardBreakEscape",tokenize:dr};function dr(t,n,e){return r;function r(u){return t.enter("hardBreakEscape"),t.consume(u),l}function l(u){return A(u)?(t.exit("hardBreakEscape"),n(u)):e(u)}}const br={name:"headingAtx",resolve:yr,tokenize:wr};function yr(t,n){let e=t.length-2,r=3,l,u;return t[r][1].type==="whitespace"&&(r+=2),e-2>r&&t[e][1].type==="whitespace"&&(e-=2),t[e][1].type==="atxHeadingSequence"&&(r===e-1||e-4>r&&t[e-2][1].type==="whitespace")&&(e-=r+1===e?2:4),e>r&&(l={type:"atxHeadingText",start:t[r][1].start,end:t[e][1].end},u={type:"chunkText",start:t[r][1].start,end:t[e][1].end,contentType:"text"},Z(t,r,e-r+1,[["enter",l,n],["enter",u,n],["exit",u,n],["exit",l,n]])),t}function wr(t,n,e){let r=0;return l;function l(h){return t.enter("atxHeading"),u(h)}function u(h){return t.enter("atxHeadingSequence"),i(h)}function i(h){return h===35&&r++<6?(t.consume(h),i):h===null||q(h)?(t.exit("atxHeadingSequence"),a(h)):e(h)}function a(h){return h===35?(t.enter("atxHeadingSequence"),o(h)):h===null||A(h)?(t.exit("atxHeading"),n(h)):P(h)?B(t,a,"whitespace")(h):(t.enter("atxHeadingText"),s(h))}function o(h){return h===35?(t.consume(h),o):(t.exit("atxHeadingSequence"),a(h))}function s(h){return h===null||h===35||q(h)?(t.exit("atxHeadingText"),a(h)):(t.consume(h),s)}}const Sr=["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"],me=["pre","script","style","textarea"],Cr={concrete:!0,name:"htmlFlow",resolveTo:Fr,tokenize:Tr},Ir={partial:!0,tokenize:Er},zr={partial:!0,tokenize:Ar};function Fr(t){let n=t.length;for(;n--&&!(t[n][0]==="enter"&&t[n][1].type==="htmlFlow"););return n>1&&t[n-2][1].type==="linePrefix"&&(t[n][1].start=t[n-2][1].start,t[n+1][1].start=t[n-2][1].start,t.splice(n-2,2)),t}function Tr(t,n,e){const r=this;let l,u,i,a,o;return s;function s(g){return h(g)}function h(g){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(g),c}function c(g){return g===33?(t.consume(g),p):g===47?(t.consume(g),u=!0,C):g===63?(t.consume(g),l=3,r.interrupt?n:m):Q(g)?(t.consume(g),i=String.fromCharCode(g),I):e(g)}function p(g){return g===45?(t.consume(g),l=2,f):g===91?(t.consume(g),l=5,a=0,k):Q(g)?(t.consume(g),l=4,r.interrupt?n:m):e(g)}function f(g){return g===45?(t.consume(g),r.interrupt?n:m):e(g)}function k(g){const tt="CDATA[";return g===tt.charCodeAt(a++)?(t.consume(g),a===tt.length?r.interrupt?n:T:k):e(g)}function C(g){return Q(g)?(t.consume(g),i=String.fromCharCode(g),I):e(g)}function I(g){if(g===null||g===47||g===62||q(g)){const tt=g===47,ft=i.toLowerCase();return!tt&&!u&&me.includes(ft)?(l=1,r.interrupt?n(g):T(g)):Sr.includes(i.toLowerCase())?(l=6,tt?(t.consume(g),d):r.interrupt?n(g):T(g)):(l=7,r.interrupt&&!r.parser.lazy[r.now().line]?e(g):u?z(g):w(g))}return g===45||W(g)?(t.consume(g),i+=String.fromCharCode(g),I):e(g)}function d(g){return g===62?(t.consume(g),r.interrupt?n:T):e(g)}function z(g){return P(g)?(t.consume(g),z):x(g)}function w(g){return g===47?(t.consume(g),x):g===58||g===95||Q(g)?(t.consume(g),D):P(g)?(t.consume(g),w):x(g)}function D(g){return g===45||g===46||g===58||g===95||W(g)?(t.consume(g),D):L(g)}function L(g){return g===61?(t.consume(g),y):P(g)?(t.consume(g),L):w(g)}function y(g){return g===null||g===60||g===61||g===62||g===96?e(g):g===34||g===39?(t.consume(g),o=g,v):P(g)?(t.consume(g),y):H(g)}function v(g){return g===o?(t.consume(g),o=null,O):g===null||A(g)?e(g):(t.consume(g),v)}function H(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||q(g)?L(g):(t.consume(g),H)}function O(g){return g===47||g===62||P(g)?w(g):e(g)}function x(g){return g===62?(t.consume(g),F):e(g)}function F(g){return g===null||A(g)?T(g):P(g)?(t.consume(g),F):e(g)}function T(g){return g===45&&l===2?(t.consume(g),U):g===60&&l===1?(t.consume(g),V):g===62&&l===4?(t.consume(g),X):g===63&&l===3?(t.consume(g),m):g===93&&l===5?(t.consume(g),it):A(g)&&(l===6||l===7)?(t.exit("htmlFlowData"),t.check(Ir,lt,R)(g)):g===null||A(g)?(t.exit("htmlFlowData"),R(g)):(t.consume(g),T)}function R(g){return t.check(zr,$,lt)(g)}function $(g){return t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),M}function M(g){return g===null||A(g)?R(g):(t.enter("htmlFlowData"),T(g))}function U(g){return g===45?(t.consume(g),m):T(g)}function V(g){return g===47?(t.consume(g),i="",K):T(g)}function K(g){if(g===62){const tt=i.toLowerCase();return me.includes(tt)?(t.consume(g),X):T(g)}return Q(g)&&i.length<8?(t.consume(g),i+=String.fromCharCode(g),K):T(g)}function it(g){return g===93?(t.consume(g),m):T(g)}function m(g){return g===62?(t.consume(g),X):g===45&&l===2?(t.consume(g),m):T(g)}function X(g){return g===null||A(g)?(t.exit("htmlFlowData"),lt(g)):(t.consume(g),X)}function lt(g){return t.exit("htmlFlow"),n(g)}}function Ar(t,n,e){const r=this;return l;function l(i){return A(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),u):e(i)}function u(i){return r.parser.lazy[r.now().line]?e(i):n(i)}}function Er(t,n,e){return r;function r(l){return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),t.attempt(Et,n,e)}}const Dr={name:"htmlText",tokenize:Lr};function Lr(t,n,e){const r=this;let l,u,i;return a;function a(m){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(m),o}function o(m){return m===33?(t.consume(m),s):m===47?(t.consume(m),L):m===63?(t.consume(m),w):Q(m)?(t.consume(m),H):e(m)}function s(m){return m===45?(t.consume(m),h):m===91?(t.consume(m),u=0,k):Q(m)?(t.consume(m),z):e(m)}function h(m){return m===45?(t.consume(m),f):e(m)}function c(m){return m===null?e(m):m===45?(t.consume(m),p):A(m)?(i=c,V(m)):(t.consume(m),c)}function p(m){return m===45?(t.consume(m),f):c(m)}function f(m){return m===62?U(m):m===45?p(m):c(m)}function k(m){const X="CDATA[";return m===X.charCodeAt(u++)?(t.consume(m),u===X.length?C:k):e(m)}function C(m){return m===null?e(m):m===93?(t.consume(m),I):A(m)?(i=C,V(m)):(t.consume(m),C)}function I(m){return m===93?(t.consume(m),d):C(m)}function d(m){return m===62?U(m):m===93?(t.consume(m),d):C(m)}function z(m){return m===null||m===62?U(m):A(m)?(i=z,V(m)):(t.consume(m),z)}function w(m){return m===null?e(m):m===63?(t.consume(m),D):A(m)?(i=w,V(m)):(t.consume(m),w)}function D(m){return m===62?U(m):w(m)}function L(m){return Q(m)?(t.consume(m),y):e(m)}function y(m){return m===45||W(m)?(t.consume(m),y):v(m)}function v(m){return A(m)?(i=v,V(m)):P(m)?(t.consume(m),v):U(m)}function H(m){return m===45||W(m)?(t.consume(m),H):m===47||m===62||q(m)?O(m):e(m)}function O(m){return m===47?(t.consume(m),U):m===58||m===95||Q(m)?(t.consume(m),x):A(m)?(i=O,V(m)):P(m)?(t.consume(m),O):U(m)}function x(m){return m===45||m===46||m===58||m===95||W(m)?(t.consume(m),x):F(m)}function F(m){return m===61?(t.consume(m),T):A(m)?(i=F,V(m)):P(m)?(t.consume(m),F):O(m)}function T(m){return m===null||m===60||m===61||m===62||m===96?e(m):m===34||m===39?(t.consume(m),l=m,R):A(m)?(i=T,V(m)):P(m)?(t.consume(m),T):(t.consume(m),$)}function R(m){return m===l?(t.consume(m),l=void 0,M):m===null?e(m):A(m)?(i=R,V(m)):(t.consume(m),R)}function $(m){return m===null||m===34||m===39||m===60||m===61||m===96?e(m):m===47||m===62||q(m)?O(m):(t.consume(m),$)}function M(m){return m===47||m===62||q(m)?O(m):e(m)}function U(m){return m===62?(t.consume(m),t.exit("htmlTextData"),t.exit("htmlText"),n):e(m)}function V(m){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),K}function K(m){return P(m)?B(t,it,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):it(m)}function it(m){return t.enter("htmlTextData"),i(m)}}const Kt={name:"labelEnd",resolveAll:vr,resolveTo:Mr,tokenize:Or},Pr={tokenize:Rr},_r={tokenize:Nr},Br={tokenize:qr};function vr(t){let n=-1;const e=[];for(;++n=3&&(s===null||A(s))?(t.exit("thematicBreak"),n(s)):e(s)}function o(s){return s===l?(t.consume(s),r++,o):(t.exit("thematicBreakSequence"),P(s)?B(t,a,"whitespace")(s):a(s))}}const Y={continuation:{tokenize:Zr},exit:Kr,name:"list",tokenize:Gr},Qr={partial:!0,tokenize:Xr},Yr={partial:!0,tokenize:Jr};function Gr(t,n,e){const r=this,l=r.events[r.events.length-1];let u=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,i=0;return a;function a(f){const k=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Wt(f)){if(r.containerState.type||(r.containerState.type=k,t.enter(k,{_container:!0})),k==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(Bt,e,s)(f):s(f);if(!r.interrupt||f===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),o(f)}return e(f)}function o(f){return Wt(f)&&++i<10?(t.consume(f),o):(!r.interrupt||i<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(t.exit("listItemValue"),s(f)):e(f)}function s(f){return t.enter("listItemMarker"),t.consume(f),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,t.check(Et,r.interrupt?e:h,t.attempt(Qr,p,c))}function h(f){return r.containerState.initialBlankLine=!0,u++,p(f)}function c(f){return P(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),p):e(f)}function p(f){return r.containerState.size=u+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,n(f)}}function Zr(t,n,e){const r=this;return r.containerState._closeFlow=void 0,t.check(Et,l,u);function l(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(t,n,"listItemIndent",r.containerState.size+1)(a)}function u(a){return r.containerState.furtherBlankLines||!P(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Yr,n,i)(a))}function i(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(t,t.attempt(Y,n,e),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Jr(t,n,e){const r=this;return B(t,l,"listItemIndent",r.containerState.size+1);function l(u){const i=r.events[r.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?n(u):e(u)}}function Kr(t){t.exit(this.containerState.type)}function Xr(t,n,e){const r=this;return B(t,l,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(u){const i=r.events[r.events.length-1];return!P(u)&&i&&i[1].type==="listItemPrefixWhitespace"?n(u):e(u)}}const ge={name:"setextUnderline",resolveTo:ti,tokenize:ei};function ti(t,n){let e=t.length,r,l,u;for(;e--;)if(t[e][0]==="enter"){if(t[e][1].type==="content"){r=e;break}t[e][1].type==="paragraph"&&(l=e)}else t[e][1].type==="content"&&t.splice(e,1),!u&&t[e][1].type==="definition"&&(u=e);const i={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[l][1].type="setextHeadingText",u?(t.splice(l,0,["enter",i,n]),t.splice(u+1,0,["exit",t[r][1],n]),t[r][1].end={...t[u][1].end}):t[r][1]=i,t.push(["exit",i,n]),t}function ei(t,n,e){const r=this;let l;return u;function u(s){let h=r.events.length,c;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){c=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(t.enter("setextHeadingLine"),l=s,i(s)):e(s)}function i(s){return t.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===l?(t.consume(s),a):(t.exit("setextHeadingLineSequence"),P(s)?B(t,o,"lineSuffix")(s):o(s))}function o(s){return s===null||A(s)?(t.exit("setextHeadingLine"),n(s)):e(s)}}const ni={tokenize:ri};function ri(t){const n=this,e=t.attempt(Et,r,t.attempt(this.parser.constructs.flowInitial,l,B(t,t.attempt(this.parser.constructs.flow,l,t.attempt(or,l)),"linePrefix")));return e;function r(u){if(u===null){t.consume(u);return}return t.enter("lineEndingBlank"),t.consume(u),t.exit("lineEndingBlank"),n.currentConstruct=void 0,e}function l(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),n.currentConstruct=void 0,e}}const ii={resolveAll:Re()},li=Oe("string"),ui=Oe("text");function Oe(t){return{resolveAll:Re(t==="text"?ai:void 0),tokenize:n};function n(e){const r=this,l=this.parser.constructs[t],u=e.attempt(l,i,a);return i;function i(h){return s(h)?u(h):a(h)}function a(h){if(h===null){e.consume(h);return}return e.enter("data"),e.consume(h),o}function o(h){return s(h)?(e.exit("data"),u(h)):(e.consume(h),o)}function s(h){if(h===null)return!0;const c=l[h];let p=-1;if(c)for(;++p-1){const a=i[0];typeof a=="string"?i[0]=a.slice(r):i.shift()}u>0&&i.push(t[l].slice(0,u))}return i}function yi(t,n){let e=-1;const r=[];let l;for(;++e0){const et=E.tokenStack[E.tokenStack.length-1];(et[1]||xe).call(E,void 0,et[0])}for(S.position={start:ct(b.length>0?b[0][1].start:{line:1,column:1,offset:0}),end:ct(b.length>0?b[b.length-2][1].end:{line:1,column:1,offset:0})},N=-1;++N1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};t.patch(n,o);const s={type:"element",tagName:"sup",properties:{},children:[o]};return t.patch(n,s),t.applyData(n,s)}function vi(t,n){const e={type:"element",tagName:"h"+n.depth,properties:{},children:t.all(n)};return t.patch(n,e),t.applyData(n,e)}function Mi(t,n){if(t.options.allowDangerousHtml){const e={type:"raw",value:n.value};return t.patch(n,e),t.applyData(n,e)}}function He(t,n){const e=n.referenceType;let r="]";if(e==="collapsed"?r+="[]":e==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const l=t.all(n),u=l[0];u&&u.type==="text"?u.value="["+u.value:l.unshift({type:"text",value:"["});const i=l[l.length-1];return i&&i.type==="text"?i.value+=r:l.push({type:"text",value:r}),l}function Oi(t,n){const e=String(n.identifier).toUpperCase(),r=t.definitionById.get(e);if(!r)return He(t,n);const l={src:St(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(l.title=r.title);const u={type:"element",tagName:"img",properties:l,children:[]};return t.patch(n,u),t.applyData(n,u)}function Ri(t,n){const e={src:St(n.url)};n.alt!==null&&n.alt!==void 0&&(e.alt=n.alt),n.title!==null&&n.title!==void 0&&(e.title=n.title);const r={type:"element",tagName:"img",properties:e,children:[]};return t.patch(n,r),t.applyData(n,r)}function Ni(t,n){const e={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};t.patch(n,e);const r={type:"element",tagName:"code",properties:{},children:[e]};return t.patch(n,r),t.applyData(n,r)}function qi(t,n){const e=String(n.identifier).toUpperCase(),r=t.definitionById.get(e);if(!r)return He(t,n);const l={href:St(r.url||"")};r.title!==null&&r.title!==void 0&&(l.title=r.title);const u={type:"element",tagName:"a",properties:l,children:t.all(n)};return t.patch(n,u),t.applyData(n,u)}function Hi(t,n){const e={href:St(n.url)};n.title!==null&&n.title!==void 0&&(e.title=n.title);const r={type:"element",tagName:"a",properties:e,children:t.all(n)};return t.patch(n,r),t.applyData(n,r)}function $i(t,n,e){const r=t.all(n),l=e?Vi(e):$e(n),u={},i=[];if(typeof n.checked=="boolean"){const h=r[0];let c;h&&h.type==="element"&&h.tagName==="p"?c=h:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let a=-1;for(;++a1}function ji(t,n){const e={},r=t.all(n);let l=-1;for(typeof n.start=="number"&&n.start!==1&&(e.start=n.start);++l0){const i={type:"element",tagName:"tbody",properties:{},children:t.wrap(e,!0)},a=Sn(n.children[1]),o=Cn(n.children[n.children.length-1]);a&&o&&(i.position={start:a,end:o}),l.push(i)}const u={type:"element",tagName:"table",properties:{},children:t.wrap(l,!0)};return t.patch(n,u),t.applyData(n,u)}function Gi(t,n,e){const r=e?e.children:void 0,u=(r?r.indexOf(n):1)===0?"th":"td",i=e&&e.type==="table"?e.align:void 0,a=i?i.length:n.children.length;let o=-1;const s=[];for(;++o1&&e.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),e}function el(t,n){return"Back to reference "+(t+1)+(n>1?"-"+n:"")}function nl(t){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",e=t.options.footnoteBackContent||tl,r=t.options.footnoteBackLabel||el,l=t.options.footnoteLabel||"Footnotes",u=t.options.footnoteLabelTagName||"h2",i=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let o=-1;for(;++o0&&k.push({type:"text",value:" "});let z=typeof e=="string"?e:e(o,f);typeof z=="string"&&(z={type:"text",value:z}),k.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(o,f),className:["data-footnote-backref"]},children:Array.isArray(z)?z:[z]})}const I=h[h.length-1];if(I&&I.type==="element"&&I.tagName==="p"){const z=I.children[I.children.length-1];z&&z.type==="text"?z.value+=" ":I.children.push({type:"text",value:" "}),I.children.push(...k)}else h.push(...k);const d={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:t.wrap(h,!0)};t.patch(s,d),a.push(d)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...vt(i),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:` `}]}}const Yt={}.hasOwnProperty,rl={};function il(t,n){const e=n||rl,r=new Map,l=new Map,u=new Map,i={...Xi,...e.handlers},a={all:s,applyData:ul,definitionById:r,footnoteById:l,footnoteCounts:u,footnoteOrder:[],handlers:i,one:o,options:e,patch:ll,wrap:ol};return ze(t,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const c=h.type==="definition"?r:l,p=String(h.identifier).toUpperCase();c.has(p)||c.set(p,h)}}),a;function o(h,c){const p=h.type,f=a.handlers[p];if(Yt.call(a.handlers,p)&&f)return f(a,h,c);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in h){const{children:C,...I}=h,d=vt(I);return d.children=a.all(h),d}return vt(h)}return(a.options.unknownHandler||al)(a,h,c)}function s(h){const c=[];if("children"in h){const p=h.children;let f=-1;for(;++f0&&e.push({type:"text",value:` `}),e}function de(t){let n=0,e=t.charCodeAt(n);for(;e===9||e===32;)n++,e=t.charCodeAt(n);return t.slice(n)}function wa(t,n){const e=il(t,n),r=e.one(t,void 0),l=nl(e),u=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return l&&u.children.push({type:"text",value:` `},l),u}function sl(t,n){t.indexOf(n)===-1&&t.push(n)}function cl(t,n){const e=t.indexOf(n);e>-1&&t.splice(e,1)}let Sa=()=>{};const Ca={useManualTiming:!1};function Ia(t){let n;return()=>(n===void 0&&(n=t()),n)}const za=t=>t,Fa=(t,n,e)=>{const r=n-t;return r===0?1:(e-t)/r};class Ta{constructor(){this.subscriptions=[]}add(n){return sl(this.subscriptions,n),()=>cl(this.subscriptions,n)}notify(n,e,r){const l=this.subscriptions.length;if(l)if(l===1)this.subscriptions[0](n,e,r);else for(let u=0;ut*1e3,Ea=t=>t/1e3;function Da(t,n){return n?t*(1e3/n):0}function hl(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function fl(t,n,e){const l=Fe((e||{}).ignore||[]),u=pl(n);let i=-1;for(;++i0?{type:"text",value:y}:void 0),y===!1?p.lastIndex=D+1:(k!==D&&z.push({type:"text",value:s.value.slice(k,D)}),Array.isArray(y)?z.push(...y):y&&z.push(y),k=D+w[0].length,d=!0),!p.global)break;w=p.exec(s.value)}return d?(k?\]}]+$/.exec(t);if(!n)return[t,void 0];t=t.slice(0,n.index);let e=n[0],r=e.indexOf(")");const l=ae(t,"(");let u=ae(t,")");for(;r!==-1&&l>u;)t+=e.slice(0,r+1),e=e.slice(r+1),r=e.indexOf(")"),u++;return[t,e]}function Ve(t,n){const e=t.input.charCodeAt(t.index-1);return(t.index===0||gt(e)||Rt(e))&&(!n||e!==47)}je.peek=Ml;function Al(){this.buffer()}function El(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Dl(){this.buffer()}function Ll(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Pl(t){const n=this.resume(),e=this.stack[this.stack.length-1];wt(e.type==="footnoteReference"),e.identifier=nt(this.sliceSerialize(t)).toLowerCase(),e.label=n}function _l(t){this.exit(t)}function Bl(t){const n=this.resume(),e=this.stack[this.stack.length-1];wt(e.type==="footnoteDefinition"),e.identifier=nt(this.sliceSerialize(t)).toLowerCase(),e.label=n}function vl(t){this.exit(t)}function Ml(){return"["}function je(t,n,e,r){const l=e.createTracker(r);let u=l.move("[^");const i=e.enter("footnoteReference"),a=e.enter("reference");return u+=l.move(e.safe(e.associationId(t),{after:"]",before:u})),a(),i(),u+=l.move("]"),u}function Ol(){return{enter:{gfmFootnoteCallString:Al,gfmFootnoteCall:El,gfmFootnoteDefinitionLabelString:Dl,gfmFootnoteDefinition:Ll},exit:{gfmFootnoteCallString:Pl,gfmFootnoteCall:_l,gfmFootnoteDefinitionLabelString:Bl,gfmFootnoteDefinition:vl}}}function Rl(t){let n=!1;return t&&t.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:e,footnoteReference:je},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function e(r,l,u,i){const a=u.createTracker(i);let o=a.move("[^");const s=u.enter("footnoteDefinition"),h=u.enter("label");return o+=a.move(u.safe(u.associationId(r),{before:o,after:"]"})),h(),o+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),o+=a.move((n?` `:" ")+u.indentLines(u.containerFlow(r,a.current()),n?Ue:Nl))),s(),o}}function Nl(t,n,e){return n===0?t:Ue(t,n,e)}function Ue(t,n,e){return(e?"":" ")+t}const ql=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];We.peek=Ul;function Hl(){return{canContainEols:["delete"],enter:{strikethrough:Vl},exit:{strikethrough:jl}}}function $l(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ql}],handlers:{delete:We}}}function Vl(t){this.enter({type:"delete",children:[]},t)}function jl(t){this.exit(t)}function We(t,n,e,r){const l=e.createTracker(r),u=e.enter("strikethrough");let i=l.move("~~");return i+=e.containerPhrasing(t,{...l.current(),before:i,after:"~"}),i+=l.move("~~"),u(),i}function Ul(){return"~"}function Wl(t){return t.length}function Ql(t,n){const e=n||{},r=(e.align||[]).concat(),l=e.stringLength||Wl,u=[],i=[],a=[],o=[];let s=0,h=-1;for(;++hs&&(s=t[h].length);++do[d])&&(o[d]=w)}C.push(z)}i[h]=C,a[h]=I}let c=-1;if(typeof r=="object"&&"length"in r)for(;++co[c]&&(o[c]=z),f[c]=z),p[c]=w}i.splice(1,0,p),a.splice(1,0,f),h=-1;const k=[];for(;++h "),u.shift(2);const i=e.indentLines(e.containerFlow(t,u.current()),Zl);return l(),i}function Zl(t,n,e){return">"+(e?"":" ")+t}function Jl(t,n){return ye(t,n.inConstruct,!0)&&!ye(t,n.notInConstruct,!1)}function ye(t,n,e){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return e;let r=-1;for(;++r",...o.current()})),s+=o.move(">")):(a=e.enter("destinationRaw"),s+=o.move(e.safe(t.url,{before:s,after:t.title?" ":` `,...o.current()}))),a(),t.title&&(a=e.enter(`title${u}`),s+=o.move(" "+l),s+=o.move(e.safe(t.title,{before:s,after:l,...o.current()})),s+=o.move(l),a()),i(),s}function ru(t){const n=t.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function At(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Ot(t,n,e){const r=yt(t),l=yt(n);return r===void 0?l===void 0?e==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Qe.peek=iu;function Qe(t,n,e,r){const l=ru(e),u=e.enter("emphasis"),i=e.createTracker(r),a=i.move(l);let o=i.move(e.containerPhrasing(t,{after:l,before:a,...i.current()}));const s=o.charCodeAt(0),h=Ot(r.before.charCodeAt(r.before.length-1),s,l);h.inside&&(o=At(s)+o.slice(1));const c=o.charCodeAt(o.length-1),p=Ot(r.after.charCodeAt(0),c,l);p.inside&&(o=o.slice(0,-1)+At(c));const f=i.move(l);return u(),e.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},a+o+f}function iu(t,n,e){return e.options.emphasis||"*"}function lu(t,n){let e=!1;return ze(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return e=!0,Fn}),!!((!t.depth||t.depth<3)&&Jt(t)&&(n.options.setext||e))}function uu(t,n,e,r){const l=Math.max(Math.min(6,t.depth||1),1),u=e.createTracker(r);if(lu(t,e)){const h=e.enter("headingSetext"),c=e.enter("phrasing"),p=e.containerPhrasing(t,{...u.current(),before:` `,after:` `});return c(),h(),p+` `+(l===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` `))+1))}const i="#".repeat(l),a=e.enter("headingAtx"),o=e.enter("phrasing");u.move(i+" ");let s=e.containerPhrasing(t,{before:"# ",after:` `,...u.current()});return/^[\t ]/.test(s)&&(s=At(s.charCodeAt(0))+s.slice(1)),s=s?i+" "+s:i,e.options.closeAtx&&(s+=" "+i),o(),a(),s}Ye.peek=au;function Ye(t){return t.value||""}function au(){return"<"}Ge.peek=ou;function Ge(t,n,e,r){const l=Xt(e),u=l==='"'?"Quote":"Apostrophe",i=e.enter("image");let a=e.enter("label");const o=e.createTracker(r);let s=o.move("![");return s+=o.move(e.safe(t.alt,{before:s,after:"]",...o.current()})),s+=o.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=e.enter("destinationLiteral"),s+=o.move("<"),s+=o.move(e.safe(t.url,{before:s,after:">",...o.current()})),s+=o.move(">")):(a=e.enter("destinationRaw"),s+=o.move(e.safe(t.url,{before:s,after:t.title?" ":")",...o.current()}))),a(),t.title&&(a=e.enter(`title${u}`),s+=o.move(" "+l),s+=o.move(e.safe(t.title,{before:s,after:l,...o.current()})),s+=o.move(l),a()),s+=o.move(")"),i(),s}function ou(){return"!"}Ze.peek=su;function Ze(t,n,e,r){const l=t.referenceType,u=e.enter("imageReference");let i=e.enter("label");const a=e.createTracker(r);let o=a.move("![");const s=e.safe(t.alt,{before:o,after:"]",...a.current()});o+=a.move(s+"]["),i();const h=e.stack;e.stack=[],i=e.enter("reference");const c=e.safe(e.associationId(t),{before:o,after:"]",...a.current()});return i(),e.stack=h,u(),l==="full"||!s||s!==c?o+=a.move(c+"]"):l==="shortcut"?o=o.slice(0,-1):o+=a.move("]"),o}function su(){return"!"}Je.peek=cu;function Je(t,n,e){let r=t.value||"",l="`",u=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(r);)l+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++u\u007F]/.test(t.url))}Xe.peek=hu;function Xe(t,n,e,r){const l=Xt(e),u=l==='"'?"Quote":"Apostrophe",i=e.createTracker(r);let a,o;if(Ke(t,e)){const h=e.stack;e.stack=[],a=e.enter("autolink");let c=i.move("<");return c+=i.move(e.containerPhrasing(t,{before:c,after:">",...i.current()})),c+=i.move(">"),a(),e.stack=h,c}a=e.enter("link"),o=e.enter("label");let s=i.move("[");return s+=i.move(e.containerPhrasing(t,{before:s,after:"](",...i.current()})),s+=i.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=e.enter("destinationLiteral"),s+=i.move("<"),s+=i.move(e.safe(t.url,{before:s,after:">",...i.current()})),s+=i.move(">")):(o=e.enter("destinationRaw"),s+=i.move(e.safe(t.url,{before:s,after:t.title?" ":")",...i.current()}))),o(),t.title&&(o=e.enter(`title${u}`),s+=i.move(" "+l),s+=i.move(e.safe(t.title,{before:s,after:l,...i.current()})),s+=i.move(l),o()),s+=i.move(")"),a(),s}function hu(t,n,e){return Ke(t,e)?"<":"["}tn.peek=fu;function tn(t,n,e,r){const l=t.referenceType,u=e.enter("linkReference");let i=e.enter("label");const a=e.createTracker(r);let o=a.move("[");const s=e.containerPhrasing(t,{before:o,after:"]",...a.current()});o+=a.move(s+"]["),i();const h=e.stack;e.stack=[],i=e.enter("reference");const c=e.safe(e.associationId(t),{before:o,after:"]",...a.current()});return i(),e.stack=h,u(),l==="full"||!s||s!==c?o+=a.move(c+"]"):l==="shortcut"?o=o.slice(0,-1):o+=a.move("]"),o}function fu(){return"["}function te(t){const n=t.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function pu(t){const n=te(t),e=t.options.bulletOther;if(!e)return n==="*"?"-":"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(e===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+e+"`) to be different");return e}function mu(t){const n=t.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function en(t){const n=t.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function gu(t,n,e,r){const l=e.enter("list"),u=e.bulletCurrent;let i=t.ordered?mu(e):te(e);const a=t.ordered?i==="."?")":".":pu(e);let o=n&&e.bulletLastUsed?i===e.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((i==="*"||i==="-")&&h&&(!h.children||!h.children[0])&&e.stack[e.stack.length-1]==="list"&&e.stack[e.stack.length-2]==="listItem"&&e.stack[e.stack.length-3]==="list"&&e.stack[e.stack.length-4]==="listItem"&&e.indexStack[e.indexStack.length-1]===0&&e.indexStack[e.indexStack.length-2]===0&&e.indexStack[e.indexStack.length-3]===0&&(o=!0),en(e)===i&&h){let c=-1;for(;++c-1?n.start:1)+(e.options.incrementListMarker===!1?0:n.children.indexOf(t))+u);let i=u.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||t.spread))&&(i=Math.ceil(i/4)*4);const a=e.createTracker(r);a.move(u+" ".repeat(i-u.length)),a.shift(i);const o=e.enter("listItem"),s=e.indentLines(e.containerFlow(t,a.current()),h);return o(),s;function h(c,p,f){return p?(f?"":" ".repeat(i))+c:(f?u:u+" ".repeat(i-u.length))+c}}function du(t,n,e,r){const l=e.enter("paragraph"),u=e.enter("phrasing"),i=e.containerPhrasing(t,r);return u(),l(),i}const bu=Fe(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function yu(t,n,e,r){return(t.children.some(function(i){return bu(i)})?e.containerPhrasing:e.containerFlow).call(e,t,r)}function wu(t){const n=t.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}nn.peek=Su;function nn(t,n,e,r){const l=wu(e),u=e.enter("strong"),i=e.createTracker(r),a=i.move(l+l);let o=i.move(e.containerPhrasing(t,{after:l,before:a,...i.current()}));const s=o.charCodeAt(0),h=Ot(r.before.charCodeAt(r.before.length-1),s,l);h.inside&&(o=At(s)+o.slice(1));const c=o.charCodeAt(o.length-1),p=Ot(r.after.charCodeAt(0),c,l);p.inside&&(o=o.slice(0,-1)+At(c));const f=i.move(l+l);return u(),e.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},a+o+f}function Su(t,n,e){return e.options.strong||"*"}function Cu(t,n,e,r){return e.safe(t.value,r)}function Iu(t){const n=t.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function zu(t,n,e){const r=(en(e)+(e.options.ruleSpaces?" ":"")).repeat(Iu(e));return e.options.ruleSpaces?r.slice(0,-1):r}const rn={blockquote:Gl,break:we,code:tu,definition:nu,emphasis:Qe,hardBreak:we,heading:uu,html:Ye,image:Ge,imageReference:Ze,inlineCode:Je,link:Xe,linkReference:tn,list:gu,listItem:xu,paragraph:du,root:yu,strong:nn,text:Cu,thematicBreak:zu};function Fu(){return{enter:{table:Tu,tableData:Se,tableHeader:Se,tableRow:Eu},exit:{codeText:Du,table:Au,tableData:Ut,tableHeader:Ut,tableRow:Ut}}}function Tu(t){const n=t._align;this.enter({type:"table",align:n.map(function(e){return e==="none"?null:e}),children:[]},t),this.data.inTable=!0}function Au(t){this.exit(t),this.data.inTable=void 0}function Eu(t){this.enter({type:"tableRow",children:[]},t)}function Ut(t){this.exit(t)}function Se(t){this.enter({type:"tableCell",children:[]},t)}function Du(t){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,Lu));const e=this.stack[this.stack.length-1];wt(e.type==="inlineCode"),e.value=n,this.exit(t)}function Lu(t,n){return n==="|"?n:t}function Pu(t){const n=t||{},e=n.tableCellPadding,r=n.tablePipeAlign,l=n.stringLength,u=e?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:i,tableCell:o,tableRow:a}};function i(f,k,C,I){return s(h(f,C,I),f.align)}function a(f,k,C,I){const d=c(f,C,I),z=s([d]);return z.slice(0,z.indexOf(` `))}function o(f,k,C,I){const d=C.enter("tableCell"),z=C.enter("phrasing"),w=C.containerPhrasing(f,{...I,before:u,after:u});return z(),d(),w}function s(f,k){return Ql(f,{align:k,alignDelimiters:r,padding:e,stringLength:l})}function h(f,k,C){const I=f.children;let d=-1;const z=[],w=k.enter("table");for(;++d0&&!e&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),e}const Yu={tokenize:na,partial:!0};function Gu(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Xu,continuation:{tokenize:ta},exit:ea}},text:{91:{name:"gfmFootnoteCall",tokenize:Ku},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Zu,resolveTo:Ju}}}}function Zu(t,n,e){const r=this;let l=r.events.length;const u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i;for(;l--;){const o=r.events[l][1];if(o.type==="labelImage"){i=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return a;function a(o){if(!i||!i._balanced)return e(o);const s=nt(r.sliceSerialize({start:i.end,end:r.now()}));return s.codePointAt(0)!==94||!u.includes(s.slice(1))?e(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),n(o))}}function Ju(t,n){let e=t.length;for(;e--;)if(t[e][1].type==="labelImage"&&t[e][0]==="enter"){t[e][1];break}t[e+1][1].type="data",t[e+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[e+3][1].start),end:Object.assign({},t[t.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},t[e+3][1].end),end:Object.assign({},t[e+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},t[t.length-1][1].start)},i={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},a=[t[e+1],t[e+2],["enter",r,n],t[e+3],t[e+4],["enter",l,n],["exit",l,n],["enter",u,n],["enter",i,n],["exit",i,n],["exit",u,n],t[t.length-2],t[t.length-1],["exit",r,n]];return t.splice(e,t.length-e+1,...a),t}function Ku(t,n,e){const r=this,l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u=0,i;return a;function a(c){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),o}function o(c){return c!==94?e(c):(t.enter("gfmFootnoteCallMarker"),t.consume(c),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",s)}function s(c){if(u>999||c===93&&!i||c===null||c===91||q(c))return e(c);if(c===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return l.includes(nt(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),n):e(c)}return q(c)||(i=!0),u++,t.consume(c),c===92?h:s}function h(c){return c===91||c===92||c===93?(t.consume(c),u++,s):s(c)}}function Xu(t,n,e){const r=this,l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u,i=0,a;return o;function o(k){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionLabelMarker"),s}function s(k){return k===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",h):e(k)}function h(k){if(i>999||k===93&&!a||k===null||k===91||q(k))return e(k);if(k===93){t.exit("chunkString");const C=t.exit("gfmFootnoteDefinitionLabelString");return u=nt(r.sliceSerialize(C)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return q(k)||(a=!0),i++,t.consume(k),k===92?c:h}function c(k){return k===91||k===92||k===93?(t.consume(k),i++,h):h(k)}function p(k){return k===58?(t.enter("definitionMarker"),t.consume(k),t.exit("definitionMarker"),l.includes(u)||l.push(u),B(t,f,"gfmFootnoteDefinitionWhitespace")):e(k)}function f(k){return n(k)}}function ta(t,n,e){return t.check(Et,n,t.attempt(Yu,n,e))}function ea(t){t.exit("gfmFootnoteDefinition")}function na(t,n,e){const r=this;return B(t,l,"gfmFootnoteDefinitionIndent",5);function l(u){const i=r.events[r.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?n(u):e(u)}}function ra(t){let e=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:u,resolveAll:l};return e==null&&(e=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function l(i,a){let o=-1;for(;++o1?o(k):(i.consume(k),c++,f);if(c<2&&!e)return o(k);const I=i.exit("strikethroughSequenceTemporary"),d=yt(k);return I._open=!d||d===2&&!!C,I._close=!C||C===2&&!!d,a(k)}}}class ia{constructor(){this.map=[]}add(n,e,r){la(this,n,e,r)}consume(n){if(this.map.sort(function(u,i){return u[0]-i[0]}),this.map.length===0)return;let e=this.map.length;const r=[];for(;e>0;)e-=1,r.push(n.slice(this.map[e][0]+this.map[e][1]),this.map[e][2]),n.length=this.map[e][0];r.push(n.slice()),n.length=0;let l=r.pop();for(;l;){for(const u of l)n.push(u);l=r.pop()}this.map.length=0}}function la(t,n,e,r){let l=0;if(!(e===0&&r.length===0)){for(;l-1;){const $=r.events[F][1].type;if($==="lineEnding"||$==="linePrefix")F--;else break}const T=F>-1?r.events[F][1].type:null,R=T==="tableHead"||T==="tableRow"?y:o;return R===y&&r.parser.lazy[r.now().line]?e(x):R(x)}function o(x){return t.enter("tableHead"),t.enter("tableRow"),s(x)}function s(x){return x===124||(i=!0,u+=1),h(x)}function h(x){return x===null?e(x):A(x)?u>1?(u=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),f):e(x):P(x)?B(t,h,"whitespace")(x):(u+=1,i&&(i=!1,l+=1),x===124?(t.enter("tableCellDivider"),t.consume(x),t.exit("tableCellDivider"),i=!0,h):(t.enter("data"),c(x)))}function c(x){return x===null||x===124||q(x)?(t.exit("data"),h(x)):(t.consume(x),x===92?p:c)}function p(x){return x===92||x===124?(t.consume(x),c):c(x)}function f(x){return r.interrupt=!1,r.parser.lazy[r.now().line]?e(x):(t.enter("tableDelimiterRow"),i=!1,P(x)?B(t,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):k(x))}function k(x){return x===45||x===58?I(x):x===124?(i=!0,t.enter("tableCellDivider"),t.consume(x),t.exit("tableCellDivider"),C):L(x)}function C(x){return P(x)?B(t,I,"whitespace")(x):I(x)}function I(x){return x===58?(u+=1,i=!0,t.enter("tableDelimiterMarker"),t.consume(x),t.exit("tableDelimiterMarker"),d):x===45?(u+=1,d(x)):x===null||A(x)?D(x):L(x)}function d(x){return x===45?(t.enter("tableDelimiterFiller"),z(x)):L(x)}function z(x){return x===45?(t.consume(x),z):x===58?(i=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(x),t.exit("tableDelimiterMarker"),w):(t.exit("tableDelimiterFiller"),w(x))}function w(x){return P(x)?B(t,D,"whitespace")(x):D(x)}function D(x){return x===124?k(x):x===null||A(x)?!i||l!==u?L(x):(t.exit("tableDelimiterRow"),t.exit("tableHead"),n(x)):L(x)}function L(x){return e(x)}function y(x){return t.enter("tableRow"),v(x)}function v(x){return x===124?(t.enter("tableCellDivider"),t.consume(x),t.exit("tableCellDivider"),v):x===null||A(x)?(t.exit("tableRow"),n(x)):P(x)?B(t,v,"whitespace")(x):(t.enter("data"),H(x))}function H(x){return x===null||x===124||q(x)?(t.exit("data"),v(x)):(t.consume(x),x===92?O:H)}function O(x){return x===92||x===124?(t.consume(x),H):H(x)}}function sa(t,n){let e=-1,r=!0,l=0,u=[0,0,0,0],i=[0,0,0,0],a=!1,o=0,s,h,c;const p=new ia;for(;++ee[2]+1){const k=e[2]+1,C=e[3]-e[2]-1;t.add(k,C,[])}}t.add(e[3]+1,0,[["exit",c,n]])}return l!==void 0&&(u.end=Object.assign({},bt(n.events,l)),t.add(l,0,[["exit",u,n]]),u=void 0),u}function Ie(t,n,e,r,l){const u=[],i=bt(n.events,e);l&&(l.end=Object.assign({},i),u.push(["exit",l,n])),r.end=Object.assign({},i),u.push(["exit",r,n]),t.add(e+1,0,u)}function bt(t,n){const e=t[n],r=e[0]==="enter"?"start":"end";return e[1][r]}const ca={name:"tasklistCheck",tokenize:fa};function ha(){return{text:{91:ca}}}function fa(t,n,e){const r=this;return l;function l(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?e(o):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),u)}function u(o){return q(o)?(t.enter("taskListCheckValueUnchecked"),t.consume(o),t.exit("taskListCheckValueUnchecked"),i):o===88||o===120?(t.enter("taskListCheckValueChecked"),t.consume(o),t.exit("taskListCheckValueChecked"),i):e(o)}function i(o){return o===93?(t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):e(o)}function a(o){return A(o)?n(o):P(o)?t.check({tokenize:pa},n,e)(o):e(o)}}function pa(t,n,e){return B(t,r,"whitespace");function r(l){return l===null?e(l):n(l)}}function _a(t){return Ae([Nu(),Gu(),ra(t),aa(),ha()])}export{Ca as M,Ta as S,Ea as a,sl as b,La as c,Pa as d,ya as f,_a as g,Sa as i,Ia as m,za as n,Fa as p,cl as r,Aa as s,wa as t,Da as v};