@anvia/studio 0.7.52 → 0.7.54
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/ui/assets/{evals-page-CEs62ZfO.js → evals-page-qETOz5hz.js} +2 -2
- package/dist/ui/assets/{evals-page-CEs62ZfO.js.map → evals-page-qETOz5hz.js.map} +1 -1
- package/dist/ui/assets/index-CQhv4Ee3.js +56 -0
- package/dist/ui/assets/{index-DY62pnOs.js.map → index-CQhv4Ee3.js.map} +1 -1
- package/dist/ui/assets/{knowledge-page-DMzsYo4t.js → knowledge-page-Zl9WuYXr.js} +2 -2
- package/dist/ui/assets/{knowledge-page-DMzsYo4t.js.map → knowledge-page-Zl9WuYXr.js.map} +1 -1
- package/dist/ui/assets/{mcps-page-ok-rle9j.js → mcps-page-dx-N6xMI.js} +2 -2
- package/dist/ui/assets/{mcps-page-ok-rle9j.js.map → mcps-page-dx-N6xMI.js.map} +1 -1
- package/dist/ui/assets/{memory-page-C7kQQjJR.js → memory-page-De0f9jEy.js} +2 -2
- package/dist/ui/assets/{memory-page-C7kQQjJR.js.map → memory-page-De0f9jEy.js.map} +1 -1
- package/dist/ui/assets/{pipelines-page-P3XgUxJA.js → pipelines-page-DKwpA_KG.js} +2 -2
- package/dist/ui/assets/{pipelines-page-P3XgUxJA.js.map → pipelines-page-DKwpA_KG.js.map} +1 -1
- package/dist/ui/assets/{renderers-BYO0FrBn.js → renderers-B3IhuxP9.js} +21 -20
- package/dist/ui/assets/{renderers-BYO0FrBn.js.map → renderers-B3IhuxP9.js.map} +1 -1
- package/dist/ui/assets/{sandboxes-page-j51ihKpC.js → sandboxes-page-CRLiE4bv.js} +2 -2
- package/dist/ui/assets/{sandboxes-page-j51ihKpC.js.map → sandboxes-page-CRLiE4bv.js.map} +1 -1
- package/dist/ui/assets/{sessions-page-BBwN5yCL.js → sessions-page-CgXxbgEX.js} +2 -2
- package/dist/ui/assets/{sessions-page-BBwN5yCL.js.map → sessions-page-CgXxbgEX.js.map} +1 -1
- package/dist/ui/assets/{status-page-BeUj83WX.js → status-page-BPANk1WS.js} +2 -2
- package/dist/ui/assets/{status-page-BeUj83WX.js.map → status-page-BPANk1WS.js.map} +1 -1
- package/dist/ui/assets/{tool-runner-DPD3YKe-.js → tool-runner-DdnPk1NY.js} +2 -2
- package/dist/ui/assets/{tool-runner-DPD3YKe-.js.map → tool-runner-DdnPk1NY.js.map} +1 -1
- package/dist/ui/assets/{tools-page-DXe7uWe2.js → tools-page-DnCMxRrP.js} +2 -2
- package/dist/ui/assets/{tools-page-DXe7uWe2.js.map → tools-page-DnCMxRrP.js.map} +1 -1
- package/dist/ui/assets/{trace-browser-DLq-cgJu.js → trace-browser-C4ZQweab.js} +2 -2
- package/dist/ui/assets/{trace-browser-DLq-cgJu.js.map → trace-browser-C4ZQweab.js.map} +1 -1
- package/dist/ui/assets/{transcript-item-CNTeNfE-.js → transcript-item-B7FFJ52t.js} +2 -2
- package/dist/ui/assets/{transcript-item-CNTeNfE-.js.map → transcript-item-B7FFJ52t.js.map} +1 -1
- package/dist/ui/index.html +1 -1
- package/package.json +8 -8
- package/dist/ui/assets/index-DY62pnOs.js +0 -56
|
@@ -27,36 +27,37 @@ import{a as e,i as t,o as n,r,s as i,t as a}from"./utils-C9GMruoG.js";import{d a
|
|
|
27
27
|
`,...a.current()});return/^[\t ]/.test(l)&&(l=js(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Ls.peek=Rs;function Ls(e){return e.value||``}function Rs(){return`<`}zs.peek=Bs;function zs(e,t,n,r){let i=Os(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Bs(){return`!`}Vs.peek=Hs;function Vs(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Hs(){return`!`}Us.peek=Ws;function Us(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Ws(){return"`"}function Gs(e,t){let n=Ot(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ks.peek=qs;function Ks(e,t,n,r){let i=Os(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Gs(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function qs(e,t,n){return Gs(e,n)?`<`:`[`}Js.peek=Ys;function Js(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ys(){return`[`}function Xs(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Zs(e){let t=Xs(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Qs(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function $s(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function ec(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Qs(n):Xs(n),s=e.ordered?o===`.`?`)`:`.`:Zs(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),$s(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function tc(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function nc(e,t,n,r){let i=tc(n),a=n.bulletCurrent||Xs(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function rc(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var ic=fa([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function ac(e,t,n,r){return(e.children.some(function(e){return ic(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function oc(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}sc.peek=cc;function sc(e,t,n,r){let i=oc(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Ms(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=js(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Ms(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+js(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function cc(e,t,n){return n.options.strong||`*`}function lc(e,t,n,r){return n.safe(e.value,r)}function uc(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function dc(e,t,n){let r=($s(n)+(n.options.ruleSpaces?` `:``)).repeat(uc(n));return n.options.ruleSpaces?r.slice(0,-1):r}var fc={blockquote:vs,break:Ss,code:Es,definition:ks,emphasis:Ns,hardBreak:Ss,heading:Is,html:Ls,image:zs,imageReference:Vs,inlineCode:Us,link:Ks,linkReference:Js,list:ec,listItem:nc,paragraph:rc,root:ac,strong:sc,text:lc,thematicBreak:dc};function pc(){return{enter:{table:mc,tableData:vc,tableHeader:vc,tableRow:gc},exit:{codeText:yc,table:hc,tableData:_c,tableHeader:_c,tableRow:_c}}}function mc(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function hc(e){this.exit(e),this.data.inTable=void 0}function gc(e){this.enter({type:`tableRow`,children:[]},e)}function _c(e){this.exit(e)}function vc(e){this.enter({type:`tableCell`,children:[]},e)}function yc(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,bc));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function bc(e,t){return t===`|`?t:e}function xc(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
28
28
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
29
29
|
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return hs(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=fc.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Sc(){return{exit:{taskListCheckValueChecked:wc,taskListCheckValueUnchecked:wc,paragraph:Tc}}}function Cc(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Ec}}}function wc(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Tc(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Ec(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=fc.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Dc(){return[No(),rs(),cs(),pc(),Sc()]}function Oc(e){return{extensions:[Po(),is(e),ls(),xc(e),Cc()]}}var kc={tokenize:Uc,partial:!0},Ac={tokenize:Wc,partial:!0},jc={tokenize:Gc,partial:!0},Mc={tokenize:Kc,partial:!0},Nc={tokenize:qc,partial:!0},Pc={name:`wwwAutolink`,tokenize:Vc,previous:Jc},Fc={name:`protocolAutolink`,tokenize:Hc,previous:Yc},Ic={name:`emailAutolink`,tokenize:Bc,previous:Xc},Lc={};function Rc(){return{text:Lc}}for(var zc=48;zc<123;)Lc[zc]=Ic,zc++,zc===58?zc=65:zc===91&&(zc=97);Lc[43]=Ic,Lc[45]=Ic,Lc[46]=Ic,Lc[95]=Ic,Lc[72]=[Ic,Fc],Lc[104]=[Ic,Fc],Lc[87]=[Ic,Pc],Lc[119]=[Ic,Pc];function Bc(e,t,n){let r=this,i,a;return o;function o(t){return!Zc(t)||!Xc.call(r,r.previous)||Qc(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Zc(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Nc,u,l)(t):t===45||t===95||H(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&V(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Vc(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Jc.call(r,r.previous)||Qc(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(kc,e.attempt(Ac,e.attempt(jc,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Hc(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Yc.call(r,r.previous)&&!Qc(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(V(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Bt(t)||W(t)||Gt(t)||Wt(t)?n(t):e.attempt(Ac,e.attempt(jc,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Uc(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Wc(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Mc,c,s)(t):t===null||W(t)||Gt(t)||t!==45&&Wt(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Gc(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Mc,t,a)(o):o===null||W(o)||Gt(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Kc(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||W(o)||Gt(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||W(e)||Gt(e)?t(e):r(e)}function a(e){return V(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):V(t)?(e.consume(t),o):n(t)}}function qc(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return H(e)?n(e):t(e)}}function Jc(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||W(e)}function Yc(e){return!V(e)}function Xc(e){return!(e===47||Zc(e))}function Zc(e){return e===43||e===45||e===46||e===95||H(e)}function Qc(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var $c={tokenize:sl,partial:!0};function el(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:il,continuation:{tokenize:al},exit:ol}},text:{91:{name:`gfmFootnoteCall`,tokenize:rl},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:tl,resolveTo:nl}}}}function tl(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=B(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function nl(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function rl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||W(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(B(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return W(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function il(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||W(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=B(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return W(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),K(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function al(e,t,n){return e.check(ln,t,e.attempt($c,t,n))}function ol(e){e.exit(`gfmFootnoteDefinition`)}function sl(e,t,n){let r=this;return K(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function cl(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&R(o,o.length,0,tn(s,e.slice(r+1,n),t)),R(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),R(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=en(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=en(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var ll=class{constructor(){this.map=[]}add(e,t,n){ul(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function ul(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function dl(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function fl(){return{flow:{null:{name:`table`,tokenize:pl,resolveAll:ml}}}}function pl(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):U(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):G(t)?K(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||W(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,G(t)?K(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return G(t)?K(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||U(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return G(t)?K(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||U(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||U(n)?(e.exit(`tableRow`),t(n)):G(n)?K(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||W(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function ml(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new ll;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(gl(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=hl(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=hl(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=hl(f,t,o,i,n,d)):(o[0]=o[1],d=hl(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&gl(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=dl(t.events,n))}return e}function hl(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},_l(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=_l(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=_l(t.events,n[2]),a=_l(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},_l(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function gl(e,t,n,r,i){let a=[],o=_l(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function _l(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var vl={name:`tasklistCheck`,tokenize:bl};function yl(){return{text:{91:vl}}}function bl(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return W(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return U(r)?t(r):G(r)?e.check({tokenize:xl},t,n)(r):n(r)}}function xl(e,t,n){return K(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Sl(e){return Ft([Rc(),el(),cl(e),fl(),yl()])}var Cl={};function wl(e){let t=this,n=e||Cl,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Sl(n)),a.push(Dc()),o.push(Oc(n))}function Tl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var El=Tl();function Dl(e){El=e}var Ol={exec:()=>null};function kl(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Y(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(X.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Al=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),X={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:kl(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:kl(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:kl(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:kl(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:kl(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:kl(e=>RegExp(`^ {0,${e}}>`))},jl=/^(?:[ \t]*(?:\n|$))+/,Ml=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Nl=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Pl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Fl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Il=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ll=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Rl=Y(Ll).replace(/bull/g,Il).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),zl=Y(Ll).replace(/bull/g,Il).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Bl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Vl=/^[^\n]+/,Hl=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ul=Y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Hl).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Wl=Y(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Il).getRegex(),Gl=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Kl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ql=Y(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Kl).replace(`tag`,Gl).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Jl=e=>Y(Bl).replace(`hr`,Pl).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Gl).getRegex(),Yl=Jl(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Xl=Jl(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Zl={blockquote:Y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Xl).getRegex(),code:Ml,def:Ul,fences:Nl,heading:Fl,hr:Pl,html:ql,lheading:Rl,list:Wl,newline:jl,paragraph:Yl,table:Ol,text:Vl},Ql=Y(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Pl).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Gl).getRegex(),$l={...Zl,lheading:zl,table:Ql,paragraph:Y(Bl).replace(`hr`,Pl).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Ql).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Gl).getRegex()},eu={...Zl,html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Kl).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ol,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Y(Bl).replace(`hr`,Pl).replace(`heading`,` *#{1,6} *[^
|
|
30
|
-
]`).replace(`lheading`,Rl).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},tu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ru=/^( {2,}|\\)\n(?!\s*$)/,iu=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,au=/[\p{P}\p{S}]/u,ou=/[\s\p{P}\p{S}]/u,su=/[^\s\p{P}\p{S}]/u,cu=Y(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,ou).getRegex(),lu=/(?!~)[\p{P}\p{S}]/u,
|
|
30
|
+
]`).replace(`lheading`,Rl).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},tu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ru=/^( {2,}|\\)\n(?!\s*$)/,iu=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,au=/[\p{P}\p{S}]/u,ou=/[\s\p{P}\p{S}]/u,su=/[^\s\p{P}\p{S}]/u,cu=Y(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,ou).getRegex(),lu=/[\p{Pi}\p{Ps}"']/u,uu=/(?!~)[\p{P}\p{S}]/u,du=/(?!~)[\s\p{P}\p{S}]/u,fu=/(?:[^\s\p{P}\p{S}]|~)/u,pu=Y(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Al?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),mu=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,hu=Y(mu,`u`).replace(/punct/g,au).getRegex(),gu=Y(mu,`u`).replace(/punct/g,uu).getRegex(),_u=Y(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,lu).replace(/punct/g,au).getRegex(),vu=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,yu=Y(vu,`gu`).replace(/notPunctSpace/g,su).replace(/punctSpace/g,ou).replace(/punct/g,au).getRegex(),bu=Y(vu,`gu`).replace(/notPunctSpace/g,fu).replace(/punctSpace/g,du).replace(/punct/g,uu).getRegex(),xu=Y(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,su).replace(/punctSpace/g,ou).replace(/punct/g,au).getRegex(),Su=Y(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,su).replace(/punctSpace/g,ou).replace(/punct/g,au).getRegex(),Cu=Y(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,su).replace(/punctSpace/g,ou).replace(/punct/g,au).getRegex(),wu=Y(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,au).getRegex(),Tu=Y(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,su).replace(/punctSpace/g,ou).replace(/punct/g,au).getRegex(),Eu=Y(/\\(punct)/,`gu`).replace(/punct/g,au).getRegex(),Du=Y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ou=Y(Kl).replace(`(?:-->|$)`,`-->`).getRegex(),ku=Y(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Ou).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Au=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ju=Y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Au).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Mu=Y(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Au).replace(`ref`,Hl).getRegex(),Nu=Y(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Hl).getRegex(),Pu=Y(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Mu).replace(`nolink`,Nu).getRegex(),Fu=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Iu={_backpedal:Ol,anyPunctuation:Eu,autolink:Du,blockSkip:pu,br:ru,code:nu,del:Ol,delLDelim:Ol,delRDelim:Ol,emStrongLDelim:hu,emStrongRDelimAst:yu,emStrongRDelimUnd:Su,escape:tu,link:ju,nolink:Nu,punctuation:cu,reflink:Mu,reflinkSearch:Pu,tag:ku,text:iu,url:Ol},Lu={...Iu,emStrongLDelim:_u,emStrongRDelimAst:xu,emStrongRDelimUnd:Cu,link:Y(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Au).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Au).getRegex()},Ru={...Iu,emStrongRDelimAst:bu,emStrongLDelim:gu,delLDelim:wu,delRDelim:Tu,url:Y(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Fu).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Y(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Fu).getRegex()},zu={...Ru,br:Y(ru).replace(`{2,}`,`*`).getRegex(),text:Y(Ru.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Bu={normal:Zl,gfm:$l,pedantic:eu},Vu={normal:Iu,gfm:Ru,breaks:zu,pedantic:Lu},Hu={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Uu=e=>Hu[e];function Wu(e,t){if(t){if(X.escapeTest.test(e))return e.replace(X.escapeReplace,Uu)}else if(X.escapeTestNoEncode.test(e))return e.replace(X.escapeReplaceNoEncode,Uu);return e}function Gu(e){try{e=encodeURI(e).replace(X.percentDecode,`%`)}catch{return null}return e}function Ku(e,t){let n=e.replace(X.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(X.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(X.slashPipe,`|`);return n}function qu(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Ju(e){let t=e.split(`
|
|
31
31
|
`),n=t.length-1;for(;n>=0&&X.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
32
|
-
`)}function
|
|
32
|
+
`)}function Yu(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Xu(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Zu(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Qu(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
33
33
|
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
34
|
-
`)}var
|
|
35
|
-
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:
|
|
36
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=
|
|
34
|
+
`)}var $u=class{options;rules;lexer;constructor(e){this.options=e||El}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Ju(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Qu(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=qu(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:qu(t[0],`
|
|
35
|
+
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:qu(t[0],`
|
|
36
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=qu(t[0],`
|
|
37
37
|
`).split(`
|
|
38
38
|
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
39
39
|
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
40
40
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
41
41
|
${s}`:s,r=r?`${r}
|
|
42
|
-
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
|
|
43
|
+
`),o=t.raw+`
|
|
44
|
+
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s,n=`${n}
|
|
45
|
+
${a}`,r=r.substring(0,r.length-t.text.length)+s.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
45
46
|
`+e.join(`
|
|
46
47
|
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
47
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=
|
|
48
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=Xu(t[2].split(`
|
|
48
49
|
`,1)[0],t[1].length),l=e.split(`
|
|
49
50
|
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
50
51
|
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
51
52
|
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
52
53
|
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
53
54
|
`+l}u=!l.trim(),r+=p+`
|
|
54
|
-
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=
|
|
55
|
-
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=
|
|
56
|
-
`):[],a={type:`table`,raw:
|
|
57
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(
|
|
55
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Ju(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:qu(t[0],`
|
|
56
|
+
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Ku(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
57
|
+
`):[],a={type:`table`,raw:qu(t[0],`
|
|
58
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Ku(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:qu(t[0],`
|
|
58
59
|
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
59
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=
|
|
60
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=qu(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Yu(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Zu(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Zu(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}else if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},Z=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||El,this.options.tokenizer=this.options.tokenizer||new $u,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:X,block:Bu.normal,inline:Vu.normal};this.options.pedantic?(t.block=Bu.pedantic,t.inline=Vu.pedantic):this.options.gfm&&(t.block=Bu.gfm,this.options.breaks?t.inline=Vu.breaks:t.inline=Vu.gfm),this.tokenizer.rules=t}static get rules(){return{block:Bu,inline:Vu}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(X.carriageReturn,`
|
|
60
61
|
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(X.tabCharGlobal,` `).replace(X.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
61
62
|
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
62
63
|
`)?``:`
|
|
@@ -70,9 +71,9 @@ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
70
71
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
71
72
|
`)?``:`
|
|
72
73
|
`)+i.raw,n.text+=`
|
|
73
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links){let e=Object.keys(this.tokens.links);e.length>0&&(n=n.replace(this.tokenizer.rules.inline.reflinkSearch,t=>e.includes(t.slice(t.lastIndexOf(`[`)+1,-1))?`[`+`a`.repeat(t.length-2)+`]`:t))}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,`++`),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},
|
|
74
|
-
`;return r?`<pre><code class="language-`+
|
|
75
|
-
`:`<pre><code>`+(n?i:
|
|
74
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links){let e=Object.keys(this.tokens.links);e.length>0&&(n=n.replace(this.tokenizer.rules.inline.reflinkSearch,t=>e.includes(t.slice(t.lastIndexOf(`[`)+1,-1))?`[`+`a`.repeat(t.length-2)+`]`:t))}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,`++`),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},ed=class{options;parser;constructor(e){this.options=e||El}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(X.notSpaceStart)?.[0],i=e.replace(X.endingNewline,``)+`
|
|
75
|
+
`;return r?`<pre><code class="language-`+Wu(r)+`">`+(n?i:Wu(i,!0))+`</code></pre>
|
|
76
|
+
`:`<pre><code>`+(n?i:Wu(i,!0))+`</code></pre>
|
|
76
77
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
77
78
|
${this.parser.parse(e)}</blockquote>
|
|
78
79
|
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
@@ -88,6 +89,6 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
88
89
|
`}tablerow({text:e}){return`<tr>
|
|
89
90
|
${e}</tr>
|
|
90
91
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
91
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${
|
|
92
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Bu(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return $u.parse(e,t)}$.options=$.setOptions=function(e){return $u.setOptions(e),$.defaults=$u.defaults,Dl($.defaults),$},$.getDefaults=Tl,$.defaults=El,$.use=function(...e){return $u.use(...e),$.defaults=$u.defaults,Dl($.defaults),$},$.walkTokens=function(e,t){return $u.walkTokens(e,t)},$.parseInline=$u.parseInline,$.Parser=Q,$.parser=Q.parse,$.Renderer=Xu,$.TextRenderer=Zu,$.Lexer=Z,$.lexer=Z.lex,$.Tokenizer=Yu,$.Hooks=Qu,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,Q.parse;var ed=Z.lex;function td(e,t={}){if(e.length===0)return[];if(t.singleDocument===!0)return[{content:e,startOffset:0}];try{let t=ed(e,{gfm:!1});if(t.some(e=>e.type===`def`)||Object.keys(t.links).length>0)return[{content:e,startOffset:0}];let n=[];for(let e of t)if(e.type===`space`&&n.length>0){let t=n.length-1;n[t]=`${n[t]??``}${e.raw}`}else n.push(e.raw);if(n.length===0||n.join(``)!==e)return[{content:e,startOffset:0}];let r=0;return n.map(e=>{let t={content:e,startOffset:r};return r+=e.length,t})}catch{return[{content:e,startOffset:0}]}}var nd={bandGraphemes:2,durationMs:180,minimumOpacity:.12,tailGraphemes:24};function rd(e,t){return function(){return n=>{t.activeScope!==e&&(t.activeScope=e,t.settledRevealIds.clear(),t.startedAtByRevealId.clear());let r=id(n);od(r,ad(r.map(e=>e.node.value??``).join(``)),e,t)}}}function id(e){let t=[],n=0;function r(e,i,a){if(!(e.type===`element`&&e.tagName===`pre`)){if(e.type===`text`&&e.value!==void 0&&i!==void 0){if(!/\S/u.test(e.value))return;let r=n;n+=e.value.length,t.push({endOffset:n,index:a,node:e,parent:i,startOffset:r});return}for(let[t,n]of(e.children??[]).entries())r(n,e,t)}}return r(e,void 0,0),t}function ad(e){let t=ld(e,nd.tailGraphemes),n=[];for(let e=0;e<t.length;e+=1){let r=t[e],i=Math.floor(e/nd.bandGraphemes)*nd.bandGraphemes,a=Math.min(i+nd.bandGraphemes,t.length)-1;if(r===void 0)continue;let o=t.length===1?1:a/(t.length-1);n.push({startOffset:r.startOffset,endOffset:r.endOffset,opacity:Math.max(nd.minimumOpacity,1-o*(1-nd.minimumOpacity))})}return n}function od(e,t,n,r){let i=new Set,a=Date.now();for(let o of[...e].reverse()){let e=o.node.value??``,s=t.filter(e=>e.endOffset>o.startOffset&&e.startOffset<o.endOffset);if(s.length===0)continue;let c=[],l=0;for(let t of s){let s=Math.max(0,t.startOffset-o.startOffset),u=Math.min(e.length,t.endOffset-o.startOffset);if(s>l&&c.push({type:`text`,value:e.slice(l,s)}),u>s){let l=e.slice(s,u),d=`${n}:${o.startOffset+s}:${o.startOffset+u}:${cd(l)}`;i.add(d);let f=r.startedAtByRevealId.get(d)??a;r.startedAtByRevealId.set(d,f);let p=Math.max(0,a-f);if(p>=nd.durationMs&&r.settledRevealIds.add(d),r.settledRevealIds.has(d))c.push({type:`text`,value:l});else{let e=Math.min(p/nd.durationMs,1),n=t.opacity+(1-t.opacity)*e,r=Math.max(1,nd.durationMs-p);c.push({type:`element`,tagName:`span`,properties:{"data-anvia-stream-duration-ms":String(r),"data-anvia-stream-opacity":String(n),"data-anvia-stream-reveal":``,"data-anvia-stream-reveal-id":d},children:[{type:`text`,value:l}]})}}l=Math.max(l,u)}l<e.length&&c.push({type:`text`,value:e.slice(l)}),o.parent.children?.splice(o.index,1,...c)}sd(r,i)}function sd(e,t){for(let n of e.startedAtByRevealId.keys())t.has(n)||e.startedAtByRevealId.delete(n);for(let n of e.settledRevealIds)t.has(n)||e.settledRevealIds.delete(n)}function cd(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function ld(e,t){if(typeof Intl<`u`&&typeof Intl.Segmenter==`function`){let n=new Intl.Segmenter(void 0,{granularity:`grapheme`}).segment(e),r=[],i=e.length;for(;i>0&&r.length<t;){let e=n.containing(i-1);if(e===void 0)break;r.unshift({startOffset:e.index,endOffset:e.index+e.segment.length}),i=e.index}return r}let n=[],r=e.length;for(;r>0&&n.length<t;){let t=r-1,i=e.charCodeAt(t);if(i>=56320&&i<=57343&&t>0){let n=e.charCodeAt(t-1);n>=55296&&n<=56319&&--t}n.unshift({startOffset:t,endOffset:r}),r=t}return n}var ud=[wl],dd=(0,l.forwardRef)(function({components:e,content:t,live:n=!1,remarkPlugins:r,remarkRehypeOptions:i,...a},o){let s=(0,l.useRef)({activeScope:null,content:t,id:0,settledRevealIds:new Set,startedAtByRevealId:new Map}),u=s.current;if(u.content!==t&&(t.startsWith(u.content)||(u.id+=1,u.activeScope=null,u.settledRevealIds.clear(),u.startedAtByRevealId.clear()),u.content=t),!n&&u.activeScope!==null)for(let e of u.startedAtByRevealId.keys())u.settledRevealIds.add(e);let d=(0,l.useCallback)(e=>{s.current.settledRevealIds.add(e)},[]),f=(0,l.useMemo)(()=>td(t,{singleDocument:r!==void 0}),[t,r]),p=(0,l.useMemo)(()=>pd(e,d),[e,d]);return re(`div`,{...a,children:f.map((e,t)=>(0,c.jsx)(fd,{components:p,content:e.content,live:n&&t===f.length-1,revealLifecycle:u,revealScope:`${u.id}:${e.startOffset}`,remarkPlugins:r??ud,remarkRehypeOptions:i},e.startOffset)),"data-anvia-stream-markdown":``,"data-live":n?``:void 0},o)}),fd=(0,l.memo)(function(e){let t=(0,l.useMemo)(()=>rd(e.revealScope,e.revealLifecycle),[e.revealScope,e.revealLifecycle]);return(0,c.jsx)(bo,{components:e.components,rehypePlugins:e.live?[t]:void 0,remarkPlugins:e.remarkPlugins,remarkRehypeOptions:e.remarkRehypeOptions,children:e.content})});function pd(e,t){let n=e?.span;return{...e,span(e){let r=md(e),i=r;if(i[`data-anvia-stream-reveal`]!==void 0)return hd(i,t);if(n!==void 0)return(0,l.createElement)(n,r);let{node:a,...o}=r;return(0,c.jsx)(`span`,{...o})}}}function md(e){let t={};for(let n of Object.keys(e))n!==`key`&&(t[n]=e[n]);return t}function hd(e,t){let{children:n,node:r,"data-anvia-stream-duration-ms":i,"data-anvia-stream-opacity":a,"data-anvia-stream-reveal-id":o,onAnimationEnd:s,...c}=e,u=Number(a),d=Number(i);return(0,l.createElement)(`span`,{...c,"data-anvia-stream-reveal-id":o,key:o??`stream-reveal`,onAnimationEnd:e=>{s?.(e),o!==void 0&&t(o)},style:{"--anvia-stream-reveal-opacity":Number.isFinite(u)?u:1,"--anvia-stream-reveal-duration":`${Number.isFinite(d)?d:180}ms`}},n)}var gd={base:vd(`base`),sm:vd(`sm`)};function _d(e){let t=e.size??`sm`;return(0,c.jsx)(dd,{className:a(`prose max-w-none text-current [overflow-wrap:anywhere] prose-headings:text-current prose-headings:font-semibold prose-p:text-current prose-p:leading-7 prose-a:text-current prose-a:decoration-muted-foreground prose-a:underline-offset-2 prose-strong:text-current prose-code:rounded-lg prose-code:border prose-code:border-border/80 prose-code:bg-muted/80 prose-code:px-1 prose-code:py-0.5 prose-code:text-sm prose-code:font-semibold prose-code:text-current prose-code:before:content-none prose-code:after:content-none prose-pre:overflow-auto prose-pre:rounded-lg prose-pre:border prose-pre:border-border/80 prose-pre:bg-card/90 prose-pre:text-current prose-blockquote:border-border prose-blockquote:text-muted-foreground prose-li:marker:text-muted-foreground prose-hr:border-border prose-table:m-0 prose-thead:border-0 prose-tr:border-0 prose-th:p-0 prose-td:p-0 dark:prose-invert dark:prose-headings:text-current dark:prose-p:text-current dark:prose-strong:text-current dark:prose-code:text-current dark:prose-pre:bg-card dark:prose-pre:text-current`,t===`base`?`text-base`:`prose-sm`),components:gd[t],content:e.text,live:e.live===!0})}function vd(e){return{table({children:t}){return(0,c.jsx)(`div`,{className:`my-4 w-full min-w-0 overflow-hidden rounded-lg border border-border/80 bg-card/90 shadow-sm`,children:(0,c.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,c.jsx)(`table`,{className:a(`m-0 w-full min-w-full border-separate border-spacing-0 text-left`,e===`base`?`text-base`:`text-sm`),children:t})})})},thead({children:e}){return(0,c.jsx)(`thead`,{className:`bg-muted/45`,children:e})},tbody({children:e}){return(0,c.jsx)(`tbody`,{children:e})},tr({children:e}){return(0,c.jsx)(`tr`,{className:`group/row align-top`,children:e})},th({children:e}){return(0,c.jsx)(`th`,{className:`border-b border-border px-4 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground first:pl-5 last:pr-5`,style:{paddingBottom:`0.625rem`,paddingTop:`0.625rem`},children:e})},td({children:t}){return(0,c.jsx)(`td`,{className:a(`border-b border-border/70 px-4 leading-6 text-foreground [overflow-wrap:anywhere] first:pl-5 last:pr-5 group-last/row:border-b-0`,e===`base`?`text-base`:`text-sm`),style:{paddingBottom:`0.75rem`,paddingTop:`0.75rem`},children:t})}}}function yd(e){let t=bd(e.value);return(0,c.jsxs)(`section`,{className:`overflow-hidden rounded-lg border border-border/80 bg-background/70`,children:[(0,c.jsx)(`div`,{className:`flex min-h-9 items-center gap-3 border-b border-border/80 bg-muted/20 px-3`,children:(0,c.jsx)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:e.title})}),(0,c.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,c.jsx)(`pre`,{className:`m-0 min-w-max p-3 text-sm leading-6 text-foreground`,children:(0,c.jsx)(`code`,{children:(0,c.jsx)(xd,{text:t})})})})]})}function bd(e){let t=o(e),n=t.kind===`json`?t.value:e;try{return JSON.stringify(n,null,2)}catch{return JSON.stringify(String(n),null,2)}}function xd(e){let t=/"(?:\\.|[^"\\])*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|\btrue\b|\bfalse\b|\bnull\b|[{}[\],:]/g,n=[],r=0,i=t.exec(e.text);for(;i!==null;){i.index>r&&n.push(e.text.slice(r,i.index));let a=i[0],o=e.text.slice(t.lastIndex).match(/\S/)?.[0],s=Sd(a,o);n.push((0,c.jsx)(`span`,{className:Cd(s),children:a},`${i.index}:${a}`)),r=t.lastIndex,i=t.exec(e.text)}return r<e.text.length&&n.push(e.text.slice(r)),(0,c.jsx)(c.Fragment,{children:n})}function Sd(e,t){return e.startsWith(`"`)?t===`:`?`key`:`string`:e===`true`||e===`false`?`boolean`:e===`null`?`null`:/^-?\d/.test(e)?`number`:`punctuation`}function Cd(e){switch(e){case`key`:return`text-foreground`;case`string`:return`text-foreground dark:text-zinc-100`;case`number`:return`text-muted-foreground dark:text-muted-foreground`;case`boolean`:return`text-destructive dark:text-destructive`;case`null`:return`text-muted-foreground`;case`punctuation`:return`text-muted-foreground`}}function wd(e){if(Array.isArray(e.value))return e.value.length===0?(0,c.jsx)(`span`,{className:`italic text-muted-foreground`,children:`Empty array`}):(0,c.jsx)(`div`,{className:`grid gap-1.5`,children:Object.entries(e.value).map(([e,t])=>(0,c.jsx)(Td,{label:e,value:t},e))});if(s(e.value)){let t=Object.entries(e.value);return t.length===0?(0,c.jsx)(`span`,{className:`italic text-muted-foreground`,children:`Empty object`}):(0,c.jsx)(`div`,{className:`grid gap-1.5`,children:t.map(([e,t])=>(0,c.jsx)(Td,{label:e,value:t},e))})}return(0,c.jsx)(Ed,{value:e.value})}function Td(e){let t=Array.isArray(e.value)||s(e.value);return(0,c.jsxs)(`div`,{className:a(`grid min-w-0 grid-cols-[minmax(92px,max-content)_minmax(0,1fr)] items-baseline gap-2.5`,t&&`items-start`),children:[(0,c.jsx)(`div`,{className:`text-xs font-semibold text-muted-foreground [overflow-wrap:anywhere]`,children:e.label}),(0,c.jsx)(`div`,{className:`min-w-0 text-sm leading-5 text-foreground [overflow-wrap:anywhere] [&_.grid]:mt-2 [&_.grid]:border-l [&_.grid]:border-border [&_.grid]:pl-3`,children:t?(0,c.jsx)(wd,{value:e.value}):(0,c.jsx)(Ed,{value:e.value})})]})}function Ed(e){return e.value===null?(0,c.jsx)(`span`,{className:`italic text-muted-foreground`,children:`null`}):typeof e.value==`string`||typeof e.value==`number`?(0,c.jsx)(`span`,{children:e.value}):(e.value,(0,c.jsx)(`span`,{children:String(e.value)}))}export{yd as i,wd as n,_d as r,xd as t};
|
|
93
|
-
//# sourceMappingURL=renderers-
|
|
92
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Wu(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Gu(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Wu(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Gu(e);if(i===null)return Wu(n);e=i;let a=`<img src="${e}" alt="${Wu(n)}"`;return t&&(a+=` title="${Wu(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Wu(e.text)}},td=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Q=class e{options;renderer;textRenderer;constructor(e){this.options=e||El,this.options.renderer=this.options.renderer||new ed,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new td}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},nd=class{options;block;constructor(e){this.options=e||El}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Z.lex:Z.lexInline}provideParser(e=this.block){return e?Q.parse:Q.parseInline}},rd=new class{defaults=Tl();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Q;Renderer=ed;TextRenderer=td;Lexer=Z;Tokenizer=$u;Hooks=nd;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ed(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new $u(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new nd;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];nd.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&nd.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Z.lex(e,t??this.defaults)}parser(e,t){return Q.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?Z.lex:Z.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Q.parse:Q.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?Z.lex:Z.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Q.parse:Q.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
93
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Wu(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return rd.parse(e,t)}$.options=$.setOptions=function(e){return rd.setOptions(e),$.defaults=rd.defaults,Dl($.defaults),$},$.getDefaults=Tl,$.defaults=El;function id(...e){return rd.use(...e),$.defaults=rd.defaults,Dl($.defaults),$}$.use=id,$.walkTokens=function(e,t){return rd.walkTokens(e,t)},$.parseInline=rd.parseInline,$.Parser=Q,$.parser=Q.parse,$.Renderer=ed,$.TextRenderer=td,$.Lexer=Z,$.lexer=Z.lex,$.Tokenizer=$u,$.Hooks=nd,$.parse=$,$.options,$.setOptions,$.walkTokens,$.parseInline,Q.parse;var ad=Z.lex;function od(e,t={}){if(e.length===0)return[];if(t.singleDocument===!0)return[{content:e,startOffset:0}];try{let t=ad(e,{gfm:!1});if(t.some(e=>e.type===`def`)||Object.keys(t.links).length>0)return[{content:e,startOffset:0}];let n=[];for(let e of t)if(e.type===`space`&&n.length>0){let t=n.length-1;n[t]=`${n[t]??``}${e.raw}`}else n.push(e.raw);if(n.length===0||n.join(``)!==e)return[{content:e,startOffset:0}];let r=0;return n.map(e=>{let t={content:e,startOffset:r};return r+=e.length,t})}catch{return[{content:e,startOffset:0}]}}var sd={bandGraphemes:2,durationMs:180,minimumOpacity:.12,tailGraphemes:24};function cd(e,t){return function(){return n=>{t.activeScope!==e&&(t.activeScope=e,t.settledRevealIds.clear(),t.startedAtByRevealId.clear());let r=ld(n);dd(r,ud(r.map(e=>e.node.value??``).join(``)),e,t)}}}function ld(e){let t=[],n=0;function r(e,i,a){if(!(e.type===`element`&&e.tagName===`pre`)){if(e.type===`text`&&e.value!==void 0&&i!==void 0){if(!/\S/u.test(e.value))return;let r=n;n+=e.value.length,t.push({endOffset:n,index:a,node:e,parent:i,startOffset:r});return}for(let[t,n]of(e.children??[]).entries())r(n,e,t)}}return r(e,void 0,0),t}function ud(e){let t=md(e,sd.tailGraphemes),n=[];for(let e=0;e<t.length;e+=1){let r=t[e],i=Math.floor(e/sd.bandGraphemes)*sd.bandGraphemes,a=Math.min(i+sd.bandGraphemes,t.length)-1;if(r===void 0)continue;let o=t.length===1?1:a/(t.length-1);n.push({startOffset:r.startOffset,endOffset:r.endOffset,opacity:Math.max(sd.minimumOpacity,1-o*(1-sd.minimumOpacity))})}return n}function dd(e,t,n,r){let i=new Set,a=Date.now();for(let o of[...e].reverse()){let e=o.node.value??``,s=t.filter(e=>e.endOffset>o.startOffset&&e.startOffset<o.endOffset);if(s.length===0)continue;let c=[],l=0;for(let t of s){let s=Math.max(0,t.startOffset-o.startOffset),u=Math.min(e.length,t.endOffset-o.startOffset);if(s>l&&c.push({type:`text`,value:e.slice(l,s)}),u>s){let l=e.slice(s,u),d=`${n}:${o.startOffset+s}:${o.startOffset+u}:${pd(l)}`;i.add(d);let f=r.startedAtByRevealId.get(d)??a;r.startedAtByRevealId.set(d,f);let p=Math.max(0,a-f);if(p>=sd.durationMs&&r.settledRevealIds.add(d),r.settledRevealIds.has(d))c.push({type:`text`,value:l});else{let e=Math.min(p/sd.durationMs,1),n=t.opacity+(1-t.opacity)*e,r=Math.max(1,sd.durationMs-p);c.push({type:`element`,tagName:`span`,properties:{"data-anvia-stream-duration-ms":String(r),"data-anvia-stream-opacity":String(n),"data-anvia-stream-reveal":``,"data-anvia-stream-reveal-id":d},children:[{type:`text`,value:l}]})}}l=Math.max(l,u)}l<e.length&&c.push({type:`text`,value:e.slice(l)}),o.parent.children?.splice(o.index,1,...c)}fd(r,i)}function fd(e,t){for(let n of e.startedAtByRevealId.keys())t.has(n)||e.startedAtByRevealId.delete(n);for(let n of e.settledRevealIds)t.has(n)||e.settledRevealIds.delete(n)}function pd(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function md(e,t){if(typeof Intl<`u`&&typeof Intl.Segmenter==`function`){let n=new Intl.Segmenter(void 0,{granularity:`grapheme`}).segment(e),r=[],i=e.length;for(;i>0&&r.length<t;){let e=n.containing(i-1);if(e===void 0)break;r.unshift({startOffset:e.index,endOffset:e.index+e.segment.length}),i=e.index}return r}let n=[],r=e.length;for(;r>0&&n.length<t;){let t=r-1,i=e.charCodeAt(t);if(i>=56320&&i<=57343&&t>0){let n=e.charCodeAt(t-1);n>=55296&&n<=56319&&--t}n.unshift({startOffset:t,endOffset:r}),r=t}return n}var hd=[wl],gd=(0,l.forwardRef)(function({components:e,content:t,live:n=!1,remarkPlugins:r,remarkRehypeOptions:i,...a},o){let s=(0,l.useRef)({activeScope:null,content:t,id:0,settledRevealIds:new Set,startedAtByRevealId:new Map}),u=s.current;if(u.content!==t&&(t.startsWith(u.content)||(u.id+=1,u.activeScope=null,u.settledRevealIds.clear(),u.startedAtByRevealId.clear()),u.content=t),!n&&u.activeScope!==null)for(let e of u.startedAtByRevealId.keys())u.settledRevealIds.add(e);let d=(0,l.useCallback)(e=>{s.current.settledRevealIds.add(e)},[]),f=(0,l.useMemo)(()=>od(t,{singleDocument:r!==void 0}),[t,r]),p=(0,l.useMemo)(()=>vd(e,d),[e,d]);return re(`div`,{...a,children:f.map((e,t)=>(0,c.jsx)(_d,{components:p,content:e.content,live:n&&t===f.length-1,revealLifecycle:u,revealScope:`${u.id}:${e.startOffset}`,remarkPlugins:r??hd,remarkRehypeOptions:i},e.startOffset)),"data-anvia-stream-markdown":``,"data-live":n?``:void 0},o)}),_d=(0,l.memo)(function(e){let t=(0,l.useMemo)(()=>cd(e.revealScope,e.revealLifecycle),[e.revealScope,e.revealLifecycle]);return(0,c.jsx)(bo,{components:e.components,rehypePlugins:e.live?[t]:void 0,remarkPlugins:e.remarkPlugins,remarkRehypeOptions:e.remarkRehypeOptions,children:e.content})});function vd(e,t){let n=e?.span;return{...e,span(e){let r=yd(e),i=r;if(i[`data-anvia-stream-reveal`]!==void 0)return bd(i,t);if(n!==void 0)return(0,l.createElement)(n,r);let{node:a,...o}=r;return(0,c.jsx)(`span`,{...o})}}}function yd(e){let t={};for(let n of Object.keys(e))n!==`key`&&(t[n]=e[n]);return t}function bd(e,t){let{children:n,node:r,"data-anvia-stream-duration-ms":i,"data-anvia-stream-opacity":a,"data-anvia-stream-reveal-id":o,onAnimationEnd:s,...c}=e,u=Number(a),d=Number(i);return(0,l.createElement)(`span`,{...c,"data-anvia-stream-reveal-id":o,key:o??`stream-reveal`,onAnimationEnd:e=>{s?.(e),o!==void 0&&t(o)},style:{"--anvia-stream-reveal-opacity":Number.isFinite(u)?u:1,"--anvia-stream-reveal-duration":`${Number.isFinite(d)?d:180}ms`}},n)}var xd={base:Cd(`base`),sm:Cd(`sm`)};function Sd(e){let t=e.size??`sm`;return(0,c.jsx)(gd,{className:a(`prose max-w-none text-current [overflow-wrap:anywhere] prose-headings:text-current prose-headings:font-semibold prose-p:text-current prose-p:leading-7 prose-a:text-current prose-a:decoration-muted-foreground prose-a:underline-offset-2 prose-strong:text-current prose-code:rounded-lg prose-code:border prose-code:border-border/80 prose-code:bg-muted/80 prose-code:px-1 prose-code:py-0.5 prose-code:text-sm prose-code:font-semibold prose-code:text-current prose-code:before:content-none prose-code:after:content-none prose-pre:overflow-auto prose-pre:rounded-lg prose-pre:border prose-pre:border-border/80 prose-pre:bg-card/90 prose-pre:text-current prose-blockquote:border-border prose-blockquote:text-muted-foreground prose-li:marker:text-muted-foreground prose-hr:border-border prose-table:m-0 prose-thead:border-0 prose-tr:border-0 prose-th:p-0 prose-td:p-0 dark:prose-invert dark:prose-headings:text-current dark:prose-p:text-current dark:prose-strong:text-current dark:prose-code:text-current dark:prose-pre:bg-card dark:prose-pre:text-current`,t===`base`?`text-base`:`prose-sm`),components:xd[t],content:e.text,live:e.live===!0})}function Cd(e){return{table({children:t}){return(0,c.jsx)(`div`,{className:`my-4 w-full min-w-0 overflow-hidden rounded-lg border border-border/80 bg-card/90 shadow-sm`,children:(0,c.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,c.jsx)(`table`,{className:a(`m-0 w-full min-w-full border-separate border-spacing-0 text-left`,e===`base`?`text-base`:`text-sm`),children:t})})})},thead({children:e}){return(0,c.jsx)(`thead`,{className:`bg-muted/45`,children:e})},tbody({children:e}){return(0,c.jsx)(`tbody`,{children:e})},tr({children:e}){return(0,c.jsx)(`tr`,{className:`group/row align-top`,children:e})},th({children:e}){return(0,c.jsx)(`th`,{className:`border-b border-border px-4 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground first:pl-5 last:pr-5`,style:{paddingBottom:`0.625rem`,paddingTop:`0.625rem`},children:e})},td({children:t}){return(0,c.jsx)(`td`,{className:a(`border-b border-border/70 px-4 leading-6 text-foreground [overflow-wrap:anywhere] first:pl-5 last:pr-5 group-last/row:border-b-0`,e===`base`?`text-base`:`text-sm`),style:{paddingBottom:`0.75rem`,paddingTop:`0.75rem`},children:t})}}}function wd(e){let t=Td(e.value);return(0,c.jsxs)(`section`,{className:`overflow-hidden rounded-lg border border-border/80 bg-background/70`,children:[(0,c.jsx)(`div`,{className:`flex min-h-9 items-center gap-3 border-b border-border/80 bg-muted/20 px-3`,children:(0,c.jsx)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:e.title})}),(0,c.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,c.jsx)(`pre`,{className:`m-0 min-w-max p-3 text-sm leading-6 text-foreground`,children:(0,c.jsx)(`code`,{children:(0,c.jsx)(Ed,{text:t})})})})]})}function Td(e){let t=o(e),n=t.kind===`json`?t.value:e;try{return JSON.stringify(n,null,2)}catch{return JSON.stringify(String(n),null,2)}}function Ed(e){let t=/"(?:\\.|[^"\\])*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|\btrue\b|\bfalse\b|\bnull\b|[{}[\],:]/g,n=[],r=0,i=t.exec(e.text);for(;i!==null;){i.index>r&&n.push(e.text.slice(r,i.index));let a=i[0],o=e.text.slice(t.lastIndex).match(/\S/)?.[0],s=Dd(a,o);n.push((0,c.jsx)(`span`,{className:Od(s),children:a},`${i.index}:${a}`)),r=t.lastIndex,i=t.exec(e.text)}return r<e.text.length&&n.push(e.text.slice(r)),(0,c.jsx)(c.Fragment,{children:n})}function Dd(e,t){return e.startsWith(`"`)?t===`:`?`key`:`string`:e===`true`||e===`false`?`boolean`:e===`null`?`null`:/^-?\d/.test(e)?`number`:`punctuation`}function Od(e){switch(e){case`key`:return`text-foreground`;case`string`:return`text-foreground dark:text-zinc-100`;case`number`:return`text-muted-foreground dark:text-muted-foreground`;case`boolean`:return`text-destructive dark:text-destructive`;case`null`:return`text-muted-foreground`;case`punctuation`:return`text-muted-foreground`}}function kd(e){if(Array.isArray(e.value))return e.value.length===0?(0,c.jsx)(`span`,{className:`italic text-muted-foreground`,children:`Empty array`}):(0,c.jsx)(`div`,{className:`grid gap-1.5`,children:Object.entries(e.value).map(([e,t])=>(0,c.jsx)(Ad,{label:e,value:t},e))});if(s(e.value)){let t=Object.entries(e.value);return t.length===0?(0,c.jsx)(`span`,{className:`italic text-muted-foreground`,children:`Empty object`}):(0,c.jsx)(`div`,{className:`grid gap-1.5`,children:t.map(([e,t])=>(0,c.jsx)(Ad,{label:e,value:t},e))})}return(0,c.jsx)(jd,{value:e.value})}function Ad(e){let t=Array.isArray(e.value)||s(e.value);return(0,c.jsxs)(`div`,{className:a(`grid min-w-0 grid-cols-[minmax(92px,max-content)_minmax(0,1fr)] items-baseline gap-2.5`,t&&`items-start`),children:[(0,c.jsx)(`div`,{className:`text-xs font-semibold text-muted-foreground [overflow-wrap:anywhere]`,children:e.label}),(0,c.jsx)(`div`,{className:`min-w-0 text-sm leading-5 text-foreground [overflow-wrap:anywhere] [&_.grid]:mt-2 [&_.grid]:border-l [&_.grid]:border-border [&_.grid]:pl-3`,children:t?(0,c.jsx)(kd,{value:e.value}):(0,c.jsx)(jd,{value:e.value})})]})}function jd(e){return e.value===null?(0,c.jsx)(`span`,{className:`italic text-muted-foreground`,children:`null`}):typeof e.value==`string`||typeof e.value==`number`?(0,c.jsx)(`span`,{children:e.value}):(e.value,(0,c.jsx)(`span`,{children:String(e.value)}))}export{wd as i,kd as n,Sd as r,Ed as t};
|
|
94
|
+
//# sourceMappingURL=renderers-B3IhuxP9.js.map
|