@likec4/mcp 1.48.0 → 1.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +11 -1
  2. package/dist/THIRD-PARTY-LICENSES.md +2413 -0
  3. package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +30 -0
  4. package/dist/_chunks/libs/@hono/mcp.mjs +34 -0
  5. package/dist/_chunks/libs/@mantine/colors-generator.mjs +2 -2
  6. package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +7 -36
  7. package/dist/_chunks/libs/@radix-ui/colors.mjs +1 -0
  8. package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +1 -0
  9. package/dist/_chunks/libs/chevrotain-allstar.mjs +2 -2
  10. package/dist/_chunks/libs/chevrotain.mjs +35 -35
  11. package/dist/_chunks/libs/citty.mjs +1 -1
  12. package/dist/_chunks/libs/is-error-instance.mjs +1 -1
  13. package/dist/_chunks/libs/isexe.mjs +1 -0
  14. package/dist/_chunks/libs/khroma.mjs +1 -1
  15. package/dist/_chunks/libs/langium.mjs +18 -17
  16. package/dist/_chunks/libs/mdast-util-from-markdown.mjs +2 -2
  17. package/dist/_chunks/libs/mdast-util-gfm.mjs +9 -9
  18. package/dist/_chunks/libs/mdast-util-to-hast.mjs +7 -7
  19. package/dist/_chunks/libs/merge-error-cause.mjs +2 -2
  20. package/dist/_chunks/libs/micromark-extension-gfm.mjs +1 -1
  21. package/dist/_chunks/libs/mnemonist.mjs +1 -1
  22. package/dist/_chunks/libs/nano-spawn.mjs +3 -0
  23. package/dist/_chunks/libs/p-limit.mjs +1 -1
  24. package/dist/_chunks/libs/remeda.mjs +2 -1
  25. package/dist/_chunks/libs/safe-stringify.mjs +1 -1
  26. package/dist/_chunks/libs/ufo.mjs +1 -1
  27. package/dist/_chunks/libs/unified.mjs +1 -1
  28. package/dist/_chunks/libs/which.mjs +1 -0
  29. package/dist/_chunks/rolldown-runtime.mjs +1 -1
  30. package/dist/index.mjs +749 -69
  31. package/package.json +16 -16
  32. package/dist/_chunks/libs/@chevrotain/gast.mjs +0 -1
  33. package/dist/_chunks/libs/hono.mjs +0 -1
  34. package/dist/_chunks/libs/nanoid.mjs +0 -1
@@ -1,3 +1,3 @@
1
- import{r as e}from"../rolldown-runtime.mjs";import{t}from"./decode-named-character-reference.mjs";const n=m(/[A-Za-z]/),r=m(/[\dA-Za-z]/),i=m(/[#-'*+\--9=?A-Z^-~]/);function a(e){return e!==null&&(e<32||e===127)}const o=m(/\d/),s=m(/[\dA-Fa-f]/),c=m(/[!-/:-@[-`{-~]/);function l(e){return e!==null&&e<-2}function u(e){return e!==null&&(e<0||e===32)}function d(e){return e===-2||e===-1||e===32}const f=m(/\p{P}|\p{S}/u),p=m(/\s/);function m(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function h(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}function g(e){if(e===null||u(e)||p(e))return 1;if(f(e))return 2}const _={};function v(e,t){let n=t||_;return y(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function y(e,t,n){if(x(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return b(e.children,t,n)}return Array.isArray(e)?b(e,t,n):``}function b(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=y(e[i],t,n);return r.join(``)}function x(e){return!!(e&&typeof e==`object`)}function S(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}const C=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function w(e){return e.replace(C,T)}function T(e,n,r){if(n)return n;if(r.charCodeAt(0)===35){let e=r.charCodeAt(1),t=e===120||e===88;return S(r.slice(t?2:1),t?16:10)}return t(r)||e}function E(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function D(e,t){return e.length>0?(E(e,e.length,0,t),e):t}const O={}.hasOwnProperty;function k(e){let t={},n=-1;for(;++n<e.length;)A(t,e[n]);return t}function A(e,t){let n;for(n in t){let r=(O.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){O.call(r,a)||(r[a]=[]);let e=i[a];j(r[a],Array.isArray(e)?e:e?[e]:[])}}}function j(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);E(e,0,0,r)}function M(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const N={name:`attention`,resolveAll:P,tokenize:F};function P(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};I(d,-c),I(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=D(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=D(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=D(l,M(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=D(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=D(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,E(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function F(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=g(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=g(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function I(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const L={name:`autolink`,tokenize:R};function R(e,t,o){let s=0;return c;function c(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),l}function l(t){return n(t)?(e.consume(t),u):t===64?o(t):p(t)}function u(e){return e===43||e===45||e===46||r(e)?(s=1,d(e)):p(e)}function d(t){return t===58?(e.consume(t),s=0,f):(t===43||t===45||t===46||r(t))&&s++<32?(e.consume(t),d):(s=0,p(t))}function f(n){return n===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):n===null||n===32||n===60||a(n)?o(n):(e.consume(n),f)}function p(t){return t===64?(e.consume(t),m):i(t)?(e.consume(t),p):o(t)}function m(e){return r(e)?h(e):o(e)}function h(n){return n===46?(e.consume(n),s=0,m):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):g(n)}function g(t){if((t===45||r(t))&&s++<63){let n=t===45?g:h;return e.consume(t),n}return o(t)}}function z(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return d(r)?(e.enter(n),s(r)):t(r)}function s(r){return d(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const B={partial:!0,tokenize:V};function V(e,t,n){return r;function r(t){return d(t)?z(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||l(e)?t(e):n(e)}}const H={continuation:{tokenize:ee},exit:te,name:`blockQuote`,tokenize:U};function U(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return d(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ee(e,t,n){let r=this;return i;function i(t){return d(t)?z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(H,t,n)(r)}}function te(e){e.exit(`blockQuote`)}const W={name:`characterEscape`,tokenize:ne};function ne(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return c(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const re={name:`characterReference`,tokenize:ie};function ie(e,n,i){let a=this,c=0,l,u;return d;function d(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),f}function f(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),p):(e.enter(`characterReferenceValue`),l=31,u=r,m(t))}function p(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),l=6,u=s,m):(e.enter(`characterReferenceValue`),l=7,u=o,m(t))}function m(o){if(o===59&&c){let s=e.exit(`characterReferenceValue`);return u===r&&!t(a.sliceSerialize(s))?i(o):(e.enter(`characterReferenceMarker`),e.consume(o),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),n)}return u(o)&&c++<l?(e.consume(o),m):i(o)}}const ae={partial:!0,tokenize:oe},G={concrete:!0,name:`codeFenced`,tokenize:K};function K(e,t,n){let r=this,i={partial:!0,tokenize:C},a=0,o=0,s;return c;function c(e){return u(e)}function u(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),f(t)}function f(t){return t===s?(o++,e.consume(t),f):o<3?n(t):(e.exit(`codeFencedFenceSequence`),d(t)?z(e,p,`whitespace`)(t):p(t))}function p(n){return n===null||l(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ae,_,S)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),m(n))}function m(t){return t===null||l(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),p(t)):d(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),z(e,h,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return t===null||l(t)?p(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),g(t))}function g(t){return t===null||l(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),p(t)):t===96&&t===s?n(t):(e.consume(t),g)}function _(t){return e.attempt(i,S,v)(t)}function v(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),y}function y(t){return a>0&&d(t)?z(e,b,`linePrefix`,a+1)(t):b(t)}function b(t){return t===null||l(t)?e.check(ae,_,S)(t):(e.enter(`codeFlowValue`),x(t))}function x(t){return t===null||l(t)?(e.exit(`codeFlowValue`),b(t)):(e.consume(t),x)}function S(n){return e.exit(`codeFenced`),t(n)}function C(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),d(t)?z(e,u,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):u(t)}function u(t){return t===s?(e.enter(`codeFencedFenceSequence`),f(t)):n(t)}function f(t){return t===s?(i++,e.consume(t),f):i>=o?(e.exit(`codeFencedFenceSequence`),d(t)?z(e,p,`whitespace`)(t):p(t)):n(t)}function p(r){return r===null||l(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function oe(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const q={name:`codeIndented`,tokenize:ce},se={partial:!0,tokenize:le};function ce(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),z(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):l(t)?e.attempt(se,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||l(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function le(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):l(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):z(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):l(e)?i(e):n(e)}}const ue={name:`codeText`,previous:fe,resolve:de,tokenize:pe};function de(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function fe(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function pe(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,d(t)):l(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),u(t))}function u(t){return t===null||t===32||t===96||l(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),u)}function d(n){return n===96?(e.consume(n),i++,d):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,u(n))}}var me=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&J(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),J(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),J(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);J(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);J(this.left,t.reverse())}}};function J(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function he(e){let t={},n=-1,r,i,a,o,s,c,l,u=new me(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,ge(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return E(e,0,1/0,u.slice(0)),!l}function ge(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const _e={resolve:ye,tokenize:be},ve={partial:!0,tokenize:xe};function ye(e){return he(e),e}function be(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):l(t)?e.check(ve,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function xe(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),z(e,a,`linePrefix`)}function a(i){if(i===null||l(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Se(e,t,n,r,i,o,s,c,d){let f=d||1/0,p=0;return m;function m(t){return t===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),h):t===null||t===32||t===41||a(t)?n(t):(e.enter(r),e.enter(s),e.enter(c),e.enter(`chunkString`,{contentType:`string`}),v(t))}function h(n){return n===62?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(c),e.enter(`chunkString`,{contentType:`string`}),g(n))}function g(t){return t===62?(e.exit(`chunkString`),e.exit(c),h(t)):t===null||t===60||l(t)?n(t):(e.consume(t),t===92?_:g)}function _(t){return t===60||t===62||t===92?(e.consume(t),g):g(t)}function v(i){return!p&&(i===null||i===41||u(i))?(e.exit(`chunkString`),e.exit(c),e.exit(s),e.exit(r),t(i)):p<f&&i===40?(e.consume(i),p++,v):i===41?(e.consume(i),p--,v):i===null||i===32||i===40||a(i)?n(i):(e.consume(i),i===92?y:v)}function y(t){return t===40||t===41||t===92?(e.consume(t),v):v(t)}}function Ce(e,t,n,r,i,a){let o=this,s=0,c;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),f}function f(u){return s>999||u===null||u===91||u===93&&!c||u===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(u):u===93?(e.exit(a),e.enter(i),e.consume(u),e.exit(i),e.exit(r),t):l(u)?(e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),f):(e.enter(`chunkString`,{contentType:`string`}),p(u))}function p(t){return t===null||t===91||t===93||l(t)||s++>999?(e.exit(`chunkString`),f(t)):(e.consume(t),c||=!d(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}}function we(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),u(n))}function u(t){return t===o?(e.exit(a),c(o)):t===null?n(t):l(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),z(e,u,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),d(t))}function d(t){return t===o||t===null||l(t)?(e.exit(`chunkString`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===o||t===92?(e.consume(t),d):d(t)}}function Y(e,t){let n;return r;function r(i){return l(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):d(i)?z(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const Te={name:`definition`,tokenize:De},Ee={partial:!0,tokenize:Oe};function De(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Ce.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=h(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return u(t)?Y(e,f)(t):f(t)}function f(t){return Se(e,p,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function p(t){return e.attempt(Ee,m,m)(t)}function m(t){return d(t)?z(e,g,`whitespace`)(t):g(t)}function g(a){return a===null||l(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Oe(e,t,n){return r;function r(t){return u(t)?Y(e,i)(t):n(t)}function i(t){return we(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return d(t)?z(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||l(e)?t(e):n(e)}}const ke={name:`hardBreakEscape`,tokenize:Ae};function Ae(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return l(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const je={name:`headingAtx`,resolve:Me,tokenize:Ne};function Me(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},E(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Ne(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||u(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||l(n)?(e.exit(`atxHeading`),t(n)):d(n)?z(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),f(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function f(t){return t===null||t===35||u(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),f)}}const Pe=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Fe=[`pre`,`script`,`style`,`textarea`],Ie={concrete:!0,name:`htmlFlow`,resolveTo:ze,tokenize:Be},Le={partial:!0,tokenize:He},Re={partial:!0,tokenize:Ve};function ze(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Be(e,t,i){let a=this,o,s,c,f,p;return m;function m(e){return h(e)}function h(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),g}function g(r){return r===33?(e.consume(r),_):r===47?(e.consume(r),s=!0,b):r===63?(e.consume(r),o=3,a.interrupt?t:V):n(r)?(e.consume(r),c=String.fromCharCode(r),x):i(r)}function _(r){return r===45?(e.consume(r),o=2,v):r===91?(e.consume(r),o=5,f=0,y):n(r)?(e.consume(r),o=4,a.interrupt?t:V):i(r)}function v(n){return n===45?(e.consume(n),a.interrupt?t:V):i(n)}function y(n){return n===`CDATA[`.charCodeAt(f++)?(e.consume(n),f===6?a.interrupt?t:N:y):i(n)}function b(t){return n(t)?(e.consume(t),c=String.fromCharCode(t),x):i(t)}function x(n){if(n===null||n===47||n===62||u(n)){let r=n===47,l=c.toLowerCase();return!r&&!s&&Fe.includes(l)?(o=1,a.interrupt?t(n):N(n)):Pe.includes(c.toLowerCase())?(o=6,r?(e.consume(n),S):a.interrupt?t(n):N(n)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?i(n):s?C(n):w(n))}return n===45||r(n)?(e.consume(n),c+=String.fromCharCode(n),x):i(n)}function S(n){return n===62?(e.consume(n),a.interrupt?t:N):i(n)}function C(t){return d(t)?(e.consume(t),C):j(t)}function w(t){return t===47?(e.consume(t),j):t===58||t===95||n(t)?(e.consume(t),T):d(t)?(e.consume(t),w):j(t)}function T(t){return t===45||t===46||t===58||t===95||r(t)?(e.consume(t),T):E(t)}function E(t){return t===61?(e.consume(t),D):d(t)?(e.consume(t),E):w(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?i(t):t===34||t===39?(e.consume(t),p=t,O):d(t)?(e.consume(t),D):k(t)}function O(t){return t===p?(e.consume(t),p=null,A):t===null||l(t)?i(t):(e.consume(t),O)}function k(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||u(t)?E(t):(e.consume(t),k)}function A(e){return e===47||e===62||d(e)?w(e):i(e)}function j(t){return t===62?(e.consume(t),M):i(t)}function M(t){return t===null||l(t)?N(t):d(t)?(e.consume(t),M):i(t)}function N(t){return t===45&&o===2?(e.consume(t),L):t===60&&o===1?(e.consume(t),R):t===62&&o===4?(e.consume(t),H):t===63&&o===3?(e.consume(t),V):t===93&&o===5?(e.consume(t),B):l(t)&&(o===6||o===7)?(e.exit(`htmlFlowData`),e.check(Le,U,P)(t)):t===null||l(t)?(e.exit(`htmlFlowData`),P(t)):(e.consume(t),N)}function P(t){return e.check(Re,F,U)(t)}function F(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),I}function I(t){return t===null||l(t)?P(t):(e.enter(`htmlFlowData`),N(t))}function L(t){return t===45?(e.consume(t),V):N(t)}function R(t){return t===47?(e.consume(t),c=``,z):N(t)}function z(t){if(t===62){let n=c.toLowerCase();return Fe.includes(n)?(e.consume(t),H):N(t)}return n(t)&&c.length<8?(e.consume(t),c+=String.fromCharCode(t),z):N(t)}function B(t){return t===93?(e.consume(t),V):N(t)}function V(t){return t===62?(e.consume(t),H):t===45&&o===2?(e.consume(t),V):N(t)}function H(t){return t===null||l(t)?(e.exit(`htmlFlowData`),U(t)):(e.consume(t),H)}function U(n){return e.exit(`htmlFlow`),t(n)}}function Ve(e,t,n){let r=this;return i;function i(t){return l(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function He(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(B,t,n)}}const Ue={name:`htmlText`,tokenize:We};function We(e,t,i){let a=this,o,s,c;return f;function f(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),p}function p(t){return t===33?(e.consume(t),m):t===47?(e.consume(t),E):t===63?(e.consume(t),w):n(t)?(e.consume(t),k):i(t)}function m(t){return t===45?(e.consume(t),h):t===91?(e.consume(t),s=0,y):n(t)?(e.consume(t),C):i(t)}function h(t){return t===45?(e.consume(t),v):i(t)}function g(t){return t===null?i(t):t===45?(e.consume(t),_):l(t)?(c=g,R(t)):(e.consume(t),g)}function _(t){return t===45?(e.consume(t),v):g(t)}function v(e){return e===62?L(e):e===45?_(e):g(e)}function y(t){return t===`CDATA[`.charCodeAt(s++)?(e.consume(t),s===6?b:y):i(t)}function b(t){return t===null?i(t):t===93?(e.consume(t),x):l(t)?(c=b,R(t)):(e.consume(t),b)}function x(t){return t===93?(e.consume(t),S):b(t)}function S(t){return t===62?L(t):t===93?(e.consume(t),S):b(t)}function C(t){return t===null||t===62?L(t):l(t)?(c=C,R(t)):(e.consume(t),C)}function w(t){return t===null?i(t):t===63?(e.consume(t),T):l(t)?(c=w,R(t)):(e.consume(t),w)}function T(e){return e===62?L(e):w(e)}function E(t){return n(t)?(e.consume(t),D):i(t)}function D(t){return t===45||r(t)?(e.consume(t),D):O(t)}function O(t){return l(t)?(c=O,R(t)):d(t)?(e.consume(t),O):L(t)}function k(t){return t===45||r(t)?(e.consume(t),k):t===47||t===62||u(t)?A(t):i(t)}function A(t){return t===47?(e.consume(t),L):t===58||t===95||n(t)?(e.consume(t),j):l(t)?(c=A,R(t)):d(t)?(e.consume(t),A):L(t)}function j(t){return t===45||t===46||t===58||t===95||r(t)?(e.consume(t),j):M(t)}function M(t){return t===61?(e.consume(t),N):l(t)?(c=M,R(t)):d(t)?(e.consume(t),M):A(t)}function N(t){return t===null||t===60||t===61||t===62||t===96?i(t):t===34||t===39?(e.consume(t),o=t,P):l(t)?(c=N,R(t)):d(t)?(e.consume(t),N):(e.consume(t),F)}function P(t){return t===o?(e.consume(t),o=void 0,I):t===null?i(t):l(t)?(c=P,R(t)):(e.consume(t),P)}function F(t){return t===null||t===34||t===39||t===60||t===61||t===96?i(t):t===47||t===62||u(t)?A(t):(e.consume(t),F)}function I(e){return e===47||e===62||u(e)?A(e):i(e)}function L(n){return n===62?(e.consume(n),e.exit(`htmlTextData`),e.exit(`htmlText`),t):i(n)}function R(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),B}function B(t){return d(t)?z(e,V,`linePrefix`,a.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):V(t)}function V(t){return e.enter(`htmlTextData`),c(t)}}const Ge={name:`labelEnd`,resolveAll:Ye,resolveTo:Xe,tokenize:Ze},Ke={tokenize:Qe},qe={tokenize:$e},Je={tokenize:et};function Ye(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&E(e,0,e.length,n),e}function Xe(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=D(s,e.slice(a+1,a+r+3)),s=D(s,[[`enter`,u,t]]),s=D(s,M(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=D(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=D(s,e.slice(o+1)),s=D(s,[[`exit`,c,t]]),E(e,a,e.length,s),e}function Ze(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(h(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Ke,u,o?u:d)(t):t===91?e.attempt(qe,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Je,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Qe(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return u(t)?Y(e,a)(t):a(t)}function a(t){return t===41?d(t):Se(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return u(t)?Y(e,c)(t):d(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?we(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):d(t)}function l(t){return u(t)?Y(e,d)(t):d(t)}function d(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function $e(e,t,n){let r=this;return i;function i(t){return Ce.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(h(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function et(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const tt={name:`labelStartImage`,resolveAll:Ge.resolveAll,tokenize:nt};function nt(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const rt={name:`labelStartLink`,resolveAll:Ge.resolveAll,tokenize:it};function it(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const at={name:`lineEnding`,tokenize:ot};function ot(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),z(e,t,`linePrefix`)}}const X={name:`thematicBreak`,tokenize:st};function st(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||l(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),d(t)?z(e,s,`whitespace`)(t):s(t))}}const Z={continuation:{tokenize:dt},exit:pt,name:`list`,tokenize:ut},ct={partial:!0,tokenize:mt},lt={partial:!0,tokenize:ft};function ut(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,s=0;return c;function c(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:o(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(X,n,u)(t):u(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),l(t)}return n(t)}function l(t){return o(t)&&++s<10?(e.consume(t),l):(!r.interrupt||s<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),u(t)):n(t)}function u(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(B,r.interrupt?n:f,e.attempt(ct,m,p))}function f(e){return r.containerState.initialBlankLine=!0,a++,m(e)}function p(t){return d(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),m):n(t)}function m(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function dt(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(B,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,z(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!d(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(lt,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,z(e,e.attempt(Z,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ft(e,t,n){let r=this;return z(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function pt(e){e.exit(this.containerState.type)}function mt(e,t,n){let r=this;return z(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!d(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const ht={name:`setextUnderline`,resolveTo:gt,tokenize:_t};function gt(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function _t(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),d(t)?z(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||l(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const vt={tokenize:yt};function yt(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),z(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return l(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const bt={tokenize:St},xt={tokenize:Ct};function St(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,u)(i)}return u(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}v(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return E(t.events,a+1,0,t.events.slice(n)),t.events.length=s,u(e)}return s(e)}function u(a){if(r===n.length){if(!i)return p(a);if(i.currentConstruct&&i.currentConstruct.concrete)return h(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(xt,d,f)(a)}function d(e){return i&&y(),v(r),p(e)}function f(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,h(e)}function p(n){return t.containerState={},e.attempt(xt,m,h)(n)}function m(e){return r++,n.push([t.currentConstruct,t.containerState]),p(e)}function h(n){if(n===null){i&&y(),v(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),g(n)}function g(n){if(n===null){_(e.exit(`chunkFlow`),!0),v(0),e.consume(n);return}return l(n)?(e.consume(n),_(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),g)}function _(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(v(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;E(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function v(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function y(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Ct(e,t,n){return z(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}const wt={tokenize:Tt};function Tt(e){let t=this,n=e.attempt(B,r,e.attempt(this.parser.constructs.flowInitial,i,z(e,e.attempt(this.parser.constructs.flow,i,e.attempt(_e,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const Et={resolveAll:At()},Dt=kt(`string`),Ot=kt(`text`);function kt(e){return{resolveAll:At(e===`text`?jt:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function At(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function jt(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Mt=e({attentionMarkers:()=>Bt,contentInitial:()=>Pt,disable:()=>Vt,document:()=>Nt,flow:()=>It,flowInitial:()=>Ft,insideSpan:()=>zt,string:()=>Lt,text:()=>Rt});const Nt={42:Z,43:Z,45:Z,48:Z,49:Z,50:Z,51:Z,52:Z,53:Z,54:Z,55:Z,56:Z,57:Z,62:H},Pt={91:Te},Ft={[-2]:q,[-1]:q,32:q},It={35:je,42:X,45:[ht,X],60:Ie,61:ht,95:X,96:G,126:G},Lt={38:re,92:W},Rt={[-5]:at,[-4]:at,[-3]:at,33:tt,38:re,42:N,60:[L,Ue],91:rt,92:[ke,W],93:Ge,95:N,96:ue},zt={null:[N,Et]},Bt={null:[42,95]},Vt={null:[]};function Ht(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:w(S),check:w(C),consume:y,enter:b,exit:x,interrupt:w(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:h,parser:e,previous:null,sliceSerialize:p,sliceStream:m,write:f},d=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function f(e){return o=D(o,e),_(),o[o.length-1]===null?(T(t,0),u.events=M(a,u.events,u),u.events):[]}function p(e,t){return Wt(m(e),t)}function m(e){return Ut(o,e)}function h(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function g(e){i[e.line]=e.column,k()}function _(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)v(t.charCodeAt(r._bufferIndex));else v(t)}}function v(e){d=d(e)}function y(e){l(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,k()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e}function b(e,t){let n=t||{};return n.type=e,n.start=h(),u.events.push([`enter`,n,u]),s.push(n),n}function x(e){let t=s.pop();return t.end=h(),u.events.push([`exit`,t,u]),t}function S(e,t){T(e,t.from)}function C(e,t){t.restore()}function w(e,t){return n;function n(n,r,i){let a,o,s,l;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return l=O(),s=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,m,h)(n)}}function m(t){return e(s,l),r}function h(e){return l.restore(),++o<a.length?p(a[o]):i}}}function T(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&E(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function O(){let e=h(),t=u.previous,n=u.currentConstruct,i=u.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=i,s=a,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ut(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Wt(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
1
+ import{r as e}from"../rolldown-runtime.mjs";import{t}from"./decode-named-character-reference.mjs";const n=m(/[A-Za-z]/),r=m(/[\dA-Za-z]/),i=m(/[#-'*+\--9=?A-Z^-~]/);function a(e){return e!==null&&(e<32||e===127)}const o=m(/\d/),s=m(/[\dA-Fa-f]/),c=m(/[!-/:-@[-`{-~]/);function l(e){return e!==null&&e<-2}function u(e){return e!==null&&(e<0||e===32)}function d(e){return e===-2||e===-1||e===32}const f=m(/\p{P}|\p{S}/u),p=m(/\s/);function m(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function h(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}function g(e){if(e===null||u(e)||p(e))return 1;if(f(e))return 2}const _={};function v(e,t){let n=t||_;return y(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function y(e,t,n){if(x(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return b(e.children,t,n)}return Array.isArray(e)?b(e,t,n):``}function b(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=y(e[i],t,n);return r.join(``)}function x(e){return!!(e&&typeof e==`object`)}function S(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}const C=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function w(e){return e.replace(C,T)}function T(e,n,r){if(n)return n;if(r.charCodeAt(0)===35){let e=r.charCodeAt(1),t=e===120||e===88;return S(r.slice(t?2:1),t?16:10)}return t(r)||e}function E(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function D(e,t){return e.length>0?(E(e,e.length,0,t),e):t}const O={}.hasOwnProperty;function k(e){let t={},n=-1;for(;++n<e.length;)A(t,e[n]);return t}function A(e,t){let n;for(n in t){let r=(O.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){O.call(r,a)||(r[a]=[]);let e=i[a];j(r[a],Array.isArray(e)?e:e?[e]:[])}}}function j(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);E(e,0,0,r)}function M(e){let t=[],n=-1,i=0,a=0;for(;++n<e.length;){let o=e.charCodeAt(n),s=``;if(o===37&&r(e.charCodeAt(n+1))&&r(e.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){let t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(s=String.fromCharCode(o,t),a=1):s=`�`}else s=String.fromCharCode(o);s&&=(t.push(e.slice(i,n),encodeURIComponent(s)),i=n+a+1,``),a&&=(n+=a,0)}return t.join(``)+e.slice(i)}function N(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const P={name:`attention`,resolveAll:F,tokenize:I};function F(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};L(d,-c),L(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=D(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=D(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=D(l,N(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=D(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=D(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,E(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function I(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=g(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=g(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function L(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const R={name:`autolink`,tokenize:z};function z(e,t,o){let s=0;return c;function c(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),l}function l(t){return n(t)?(e.consume(t),u):t===64?o(t):p(t)}function u(e){return e===43||e===45||e===46||r(e)?(s=1,d(e)):p(e)}function d(t){return t===58?(e.consume(t),s=0,f):(t===43||t===45||t===46||r(t))&&s++<32?(e.consume(t),d):(s=0,p(t))}function f(n){return n===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):n===null||n===32||n===60||a(n)?o(n):(e.consume(n),f)}function p(t){return t===64?(e.consume(t),m):i(t)?(e.consume(t),p):o(t)}function m(e){return r(e)?h(e):o(e)}function h(n){return n===46?(e.consume(n),s=0,m):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):g(n)}function g(t){if((t===45||r(t))&&s++<63){let n=t===45?g:h;return e.consume(t),n}return o(t)}}function B(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return d(r)?(e.enter(n),s(r)):t(r)}function s(r){return d(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const V={partial:!0,tokenize:H};function H(e,t,n){return r;function r(t){return d(t)?B(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||l(e)?t(e):n(e)}}const U={continuation:{tokenize:te},exit:W,name:`blockQuote`,tokenize:ee};function ee(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return d(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function te(e,t,n){let r=this;return i;function i(t){return d(t)?B(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(U,t,n)(r)}}function W(e){e.exit(`blockQuote`)}const ne={name:`characterEscape`,tokenize:re};function re(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return c(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const G={name:`characterReference`,tokenize:ie};function ie(e,n,i){let a=this,c=0,l,u;return d;function d(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),f}function f(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),p):(e.enter(`characterReferenceValue`),l=31,u=r,m(t))}function p(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),l=6,u=s,m):(e.enter(`characterReferenceValue`),l=7,u=o,m(t))}function m(o){if(o===59&&c){let s=e.exit(`characterReferenceValue`);return u===r&&!t(a.sliceSerialize(s))?i(o):(e.enter(`characterReferenceMarker`),e.consume(o),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),n)}return u(o)&&c++<l?(e.consume(o),m):i(o)}}const ae={partial:!0,tokenize:se},K={concrete:!0,name:`codeFenced`,tokenize:oe};function oe(e,t,n){let r=this,i={partial:!0,tokenize:C},a=0,o=0,s;return c;function c(e){return u(e)}function u(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),f(t)}function f(t){return t===s?(o++,e.consume(t),f):o<3?n(t):(e.exit(`codeFencedFenceSequence`),d(t)?B(e,p,`whitespace`)(t):p(t))}function p(n){return n===null||l(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ae,_,S)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),m(n))}function m(t){return t===null||l(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),p(t)):d(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),B(e,h,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return t===null||l(t)?p(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),g(t))}function g(t){return t===null||l(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),p(t)):t===96&&t===s?n(t):(e.consume(t),g)}function _(t){return e.attempt(i,S,v)(t)}function v(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),y}function y(t){return a>0&&d(t)?B(e,b,`linePrefix`,a+1)(t):b(t)}function b(t){return t===null||l(t)?e.check(ae,_,S)(t):(e.enter(`codeFlowValue`),x(t))}function x(t){return t===null||l(t)?(e.exit(`codeFlowValue`),b(t)):(e.consume(t),x)}function S(n){return e.exit(`codeFenced`),t(n)}function C(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),d(t)?B(e,u,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):u(t)}function u(t){return t===s?(e.enter(`codeFencedFenceSequence`),f(t)):n(t)}function f(t){return t===s?(i++,e.consume(t),f):i>=o?(e.exit(`codeFencedFenceSequence`),d(t)?B(e,p,`whitespace`)(t):p(t)):n(t)}function p(r){return r===null||l(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function se(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const q={name:`codeIndented`,tokenize:le},ce={partial:!0,tokenize:ue};function le(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),B(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):l(t)?e.attempt(ce,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||l(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function ue(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):l(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):B(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):l(e)?i(e):n(e)}}const de={name:`codeText`,previous:pe,resolve:fe,tokenize:me};function fe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function pe(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function me(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,d(t)):l(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),u(t))}function u(t){return t===null||t===32||t===96||l(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),u)}function d(n){return n===96?(e.consume(n),i++,d):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,u(n))}}var he=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&J(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),J(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),J(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);J(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);J(this.left,t.reverse())}}};function J(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ge(e){let t={},n=-1,r,i,a,o,s,c,l,u=new he(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,_e(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return E(e,0,1/0,u.slice(0)),!l}function _e(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const ve={resolve:be,tokenize:xe},ye={partial:!0,tokenize:Se};function be(e){return ge(e),e}function xe(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):l(t)?e.check(ye,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Se(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),B(e,a,`linePrefix`)}function a(i){if(i===null||l(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Ce(e,t,n,r,i,o,s,c,d){let f=d||1/0,p=0;return m;function m(t){return t===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),h):t===null||t===32||t===41||a(t)?n(t):(e.enter(r),e.enter(s),e.enter(c),e.enter(`chunkString`,{contentType:`string`}),v(t))}function h(n){return n===62?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(c),e.enter(`chunkString`,{contentType:`string`}),g(n))}function g(t){return t===62?(e.exit(`chunkString`),e.exit(c),h(t)):t===null||t===60||l(t)?n(t):(e.consume(t),t===92?_:g)}function _(t){return t===60||t===62||t===92?(e.consume(t),g):g(t)}function v(i){return!p&&(i===null||i===41||u(i))?(e.exit(`chunkString`),e.exit(c),e.exit(s),e.exit(r),t(i)):p<f&&i===40?(e.consume(i),p++,v):i===41?(e.consume(i),p--,v):i===null||i===32||i===40||a(i)?n(i):(e.consume(i),i===92?y:v)}function y(t){return t===40||t===41||t===92?(e.consume(t),v):v(t)}}function we(e,t,n,r,i,a){let o=this,s=0,c;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),f}function f(u){return s>999||u===null||u===91||u===93&&!c||u===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(u):u===93?(e.exit(a),e.enter(i),e.consume(u),e.exit(i),e.exit(r),t):l(u)?(e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),f):(e.enter(`chunkString`,{contentType:`string`}),p(u))}function p(t){return t===null||t===91||t===93||l(t)||s++>999?(e.exit(`chunkString`),f(t)):(e.consume(t),c||=!d(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}}function Te(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),u(n))}function u(t){return t===o?(e.exit(a),c(o)):t===null?n(t):l(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),B(e,u,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),d(t))}function d(t){return t===o||t===null||l(t)?(e.exit(`chunkString`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===o||t===92?(e.consume(t),d):d(t)}}function Y(e,t){let n;return r;function r(i){return l(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):d(i)?B(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const Ee={name:`definition`,tokenize:Oe},De={partial:!0,tokenize:ke};function Oe(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return we.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=h(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return u(t)?Y(e,f)(t):f(t)}function f(t){return Ce(e,p,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function p(t){return e.attempt(De,m,m)(t)}function m(t){return d(t)?B(e,g,`whitespace`)(t):g(t)}function g(a){return a===null||l(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function ke(e,t,n){return r;function r(t){return u(t)?Y(e,i)(t):n(t)}function i(t){return Te(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return d(t)?B(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||l(e)?t(e):n(e)}}const Ae={name:`hardBreakEscape`,tokenize:je};function je(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return l(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const Me={name:`headingAtx`,resolve:Ne,tokenize:Pe};function Ne(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},E(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Pe(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||u(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||l(n)?(e.exit(`atxHeading`),t(n)):d(n)?B(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),f(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function f(t){return t===null||t===35||u(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),f)}}const Fe=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Ie=[`pre`,`script`,`style`,`textarea`],Le={concrete:!0,name:`htmlFlow`,resolveTo:Be,tokenize:Ve},Re={partial:!0,tokenize:Ue},ze={partial:!0,tokenize:He};function Be(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ve(e,t,i){let a=this,o,s,c,f,p;return m;function m(e){return h(e)}function h(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),g}function g(r){return r===33?(e.consume(r),_):r===47?(e.consume(r),s=!0,b):r===63?(e.consume(r),o=3,a.interrupt?t:V):n(r)?(e.consume(r),c=String.fromCharCode(r),x):i(r)}function _(r){return r===45?(e.consume(r),o=2,v):r===91?(e.consume(r),o=5,f=0,y):n(r)?(e.consume(r),o=4,a.interrupt?t:V):i(r)}function v(n){return n===45?(e.consume(n),a.interrupt?t:V):i(n)}function y(n){return n===`CDATA[`.charCodeAt(f++)?(e.consume(n),f===6?a.interrupt?t:N:y):i(n)}function b(t){return n(t)?(e.consume(t),c=String.fromCharCode(t),x):i(t)}function x(n){if(n===null||n===47||n===62||u(n)){let r=n===47,l=c.toLowerCase();return!r&&!s&&Ie.includes(l)?(o=1,a.interrupt?t(n):N(n)):Fe.includes(c.toLowerCase())?(o=6,r?(e.consume(n),S):a.interrupt?t(n):N(n)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?i(n):s?C(n):w(n))}return n===45||r(n)?(e.consume(n),c+=String.fromCharCode(n),x):i(n)}function S(n){return n===62?(e.consume(n),a.interrupt?t:N):i(n)}function C(t){return d(t)?(e.consume(t),C):j(t)}function w(t){return t===47?(e.consume(t),j):t===58||t===95||n(t)?(e.consume(t),T):d(t)?(e.consume(t),w):j(t)}function T(t){return t===45||t===46||t===58||t===95||r(t)?(e.consume(t),T):E(t)}function E(t){return t===61?(e.consume(t),D):d(t)?(e.consume(t),E):w(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?i(t):t===34||t===39?(e.consume(t),p=t,O):d(t)?(e.consume(t),D):k(t)}function O(t){return t===p?(e.consume(t),p=null,A):t===null||l(t)?i(t):(e.consume(t),O)}function k(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||u(t)?E(t):(e.consume(t),k)}function A(e){return e===47||e===62||d(e)?w(e):i(e)}function j(t){return t===62?(e.consume(t),M):i(t)}function M(t){return t===null||l(t)?N(t):d(t)?(e.consume(t),M):i(t)}function N(t){return t===45&&o===2?(e.consume(t),L):t===60&&o===1?(e.consume(t),R):t===62&&o===4?(e.consume(t),H):t===63&&o===3?(e.consume(t),V):t===93&&o===5?(e.consume(t),B):l(t)&&(o===6||o===7)?(e.exit(`htmlFlowData`),e.check(Re,U,P)(t)):t===null||l(t)?(e.exit(`htmlFlowData`),P(t)):(e.consume(t),N)}function P(t){return e.check(ze,F,U)(t)}function F(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),I}function I(t){return t===null||l(t)?P(t):(e.enter(`htmlFlowData`),N(t))}function L(t){return t===45?(e.consume(t),V):N(t)}function R(t){return t===47?(e.consume(t),c=``,z):N(t)}function z(t){if(t===62){let n=c.toLowerCase();return Ie.includes(n)?(e.consume(t),H):N(t)}return n(t)&&c.length<8?(e.consume(t),c+=String.fromCharCode(t),z):N(t)}function B(t){return t===93?(e.consume(t),V):N(t)}function V(t){return t===62?(e.consume(t),H):t===45&&o===2?(e.consume(t),V):N(t)}function H(t){return t===null||l(t)?(e.exit(`htmlFlowData`),U(t)):(e.consume(t),H)}function U(n){return e.exit(`htmlFlow`),t(n)}}function He(e,t,n){let r=this;return i;function i(t){return l(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Ue(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(V,t,n)}}const We={name:`htmlText`,tokenize:Ge};function Ge(e,t,i){let a=this,o,s,c;return f;function f(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),p}function p(t){return t===33?(e.consume(t),m):t===47?(e.consume(t),E):t===63?(e.consume(t),w):n(t)?(e.consume(t),k):i(t)}function m(t){return t===45?(e.consume(t),h):t===91?(e.consume(t),s=0,y):n(t)?(e.consume(t),C):i(t)}function h(t){return t===45?(e.consume(t),v):i(t)}function g(t){return t===null?i(t):t===45?(e.consume(t),_):l(t)?(c=g,R(t)):(e.consume(t),g)}function _(t){return t===45?(e.consume(t),v):g(t)}function v(e){return e===62?L(e):e===45?_(e):g(e)}function y(t){return t===`CDATA[`.charCodeAt(s++)?(e.consume(t),s===6?b:y):i(t)}function b(t){return t===null?i(t):t===93?(e.consume(t),x):l(t)?(c=b,R(t)):(e.consume(t),b)}function x(t){return t===93?(e.consume(t),S):b(t)}function S(t){return t===62?L(t):t===93?(e.consume(t),S):b(t)}function C(t){return t===null||t===62?L(t):l(t)?(c=C,R(t)):(e.consume(t),C)}function w(t){return t===null?i(t):t===63?(e.consume(t),T):l(t)?(c=w,R(t)):(e.consume(t),w)}function T(e){return e===62?L(e):w(e)}function E(t){return n(t)?(e.consume(t),D):i(t)}function D(t){return t===45||r(t)?(e.consume(t),D):O(t)}function O(t){return l(t)?(c=O,R(t)):d(t)?(e.consume(t),O):L(t)}function k(t){return t===45||r(t)?(e.consume(t),k):t===47||t===62||u(t)?A(t):i(t)}function A(t){return t===47?(e.consume(t),L):t===58||t===95||n(t)?(e.consume(t),j):l(t)?(c=A,R(t)):d(t)?(e.consume(t),A):L(t)}function j(t){return t===45||t===46||t===58||t===95||r(t)?(e.consume(t),j):M(t)}function M(t){return t===61?(e.consume(t),N):l(t)?(c=M,R(t)):d(t)?(e.consume(t),M):A(t)}function N(t){return t===null||t===60||t===61||t===62||t===96?i(t):t===34||t===39?(e.consume(t),o=t,P):l(t)?(c=N,R(t)):d(t)?(e.consume(t),N):(e.consume(t),F)}function P(t){return t===o?(e.consume(t),o=void 0,I):t===null?i(t):l(t)?(c=P,R(t)):(e.consume(t),P)}function F(t){return t===null||t===34||t===39||t===60||t===61||t===96?i(t):t===47||t===62||u(t)?A(t):(e.consume(t),F)}function I(e){return e===47||e===62||u(e)?A(e):i(e)}function L(n){return n===62?(e.consume(n),e.exit(`htmlTextData`),e.exit(`htmlText`),t):i(n)}function R(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),z}function z(t){return d(t)?B(e,V,`linePrefix`,a.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):V(t)}function V(t){return e.enter(`htmlTextData`),c(t)}}const Ke={name:`labelEnd`,resolveAll:Xe,resolveTo:Ze,tokenize:Qe},qe={tokenize:$e},Je={tokenize:et},Ye={tokenize:tt};function Xe(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&E(e,0,e.length,n),e}function Ze(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=D(s,e.slice(a+1,a+r+3)),s=D(s,[[`enter`,u,t]]),s=D(s,N(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=D(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=D(s,e.slice(o+1)),s=D(s,[[`exit`,c,t]]),E(e,a,e.length,s),e}function Qe(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(h(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(qe,u,o?u:d)(t):t===91?e.attempt(Je,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Ye,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function $e(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return u(t)?Y(e,a)(t):a(t)}function a(t){return t===41?d(t):Ce(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return u(t)?Y(e,c)(t):d(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Te(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):d(t)}function l(t){return u(t)?Y(e,d)(t):d(t)}function d(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function et(e,t,n){let r=this;return i;function i(t){return we.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(h(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function tt(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const nt={name:`labelStartImage`,resolveAll:Ke.resolveAll,tokenize:rt};function rt(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const it={name:`labelStartLink`,resolveAll:Ke.resolveAll,tokenize:at};function at(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const ot={name:`lineEnding`,tokenize:st};function st(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),B(e,t,`linePrefix`)}}const X={name:`thematicBreak`,tokenize:ct};function ct(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||l(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),d(t)?B(e,s,`whitespace`)(t):s(t))}}const Z={continuation:{tokenize:ft},exit:mt,name:`list`,tokenize:dt},lt={partial:!0,tokenize:ht},ut={partial:!0,tokenize:pt};function dt(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,s=0;return c;function c(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:o(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(X,n,u)(t):u(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),l(t)}return n(t)}function l(t){return o(t)&&++s<10?(e.consume(t),l):(!r.interrupt||s<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),u(t)):n(t)}function u(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(V,r.interrupt?n:f,e.attempt(lt,m,p))}function f(e){return r.containerState.initialBlankLine=!0,a++,m(e)}function p(t){return d(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),m):n(t)}function m(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function ft(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(V,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!d(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ut,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(Z,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function pt(e,t,n){let r=this;return B(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function mt(e){e.exit(this.containerState.type)}function ht(e,t,n){let r=this;return B(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!d(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const gt={name:`setextUnderline`,resolveTo:_t,tokenize:vt};function _t(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function vt(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),d(t)?B(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||l(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}({}).hasOwnProperty;const yt={tokenize:bt};function bt(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),B(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return l(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const xt={tokenize:Ct},St={tokenize:wt};function Ct(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,u)(i)}return u(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}v(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return E(t.events,a+1,0,t.events.slice(n)),t.events.length=s,u(e)}return s(e)}function u(a){if(r===n.length){if(!i)return p(a);if(i.currentConstruct&&i.currentConstruct.concrete)return h(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(St,d,f)(a)}function d(e){return i&&y(),v(r),p(e)}function f(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,h(e)}function p(n){return t.containerState={},e.attempt(St,m,h)(n)}function m(e){return r++,n.push([t.currentConstruct,t.containerState]),p(e)}function h(n){if(n===null){i&&y(),v(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),g(n)}function g(n){if(n===null){_(e.exit(`chunkFlow`),!0),v(0),e.consume(n);return}return l(n)?(e.consume(n),_(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),g)}function _(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(v(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;E(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function v(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function y(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function wt(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}const Tt={tokenize:Et};function Et(e){let t=this,n=e.attempt(V,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ve,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const Dt={resolveAll:jt()},Ot=At(`string`),kt=At(`text`);function At(e){return{resolveAll:jt(e===`text`?Mt:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function jt(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Mt(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Nt=e({attentionMarkers:()=>Vt,contentInitial:()=>Ft,disable:()=>Ht,document:()=>Pt,flow:()=>Lt,flowInitial:()=>It,insideSpan:()=>Bt,string:()=>Rt,text:()=>zt});const Pt={42:Z,43:Z,45:Z,48:Z,49:Z,50:Z,51:Z,52:Z,53:Z,54:Z,55:Z,56:Z,57:Z,62:U},Ft={91:Ee},It={[-2]:q,[-1]:q,32:q},Lt={35:Me,42:X,45:[gt,X],60:Le,61:gt,95:X,96:K,126:K},Rt={38:G,92:ne},zt={[-5]:ot,[-4]:ot,[-3]:ot,33:nt,38:G,42:P,60:[R,We],91:it,92:[Ae,ne],93:Ke,95:P,96:de},Bt={null:[P,Dt]},Vt={null:[42,95]},Ht={null:[]};function Ut(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:w(S),check:w(C),consume:y,enter:b,exit:x,interrupt:w(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:h,parser:e,previous:null,sliceSerialize:p,sliceStream:m,write:f},d=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function f(e){return o=D(o,e),_(),o[o.length-1]===null?(T(t,0),u.events=N(a,u.events,u),u.events):[]}function p(e,t){return Gt(m(e),t)}function m(e){return Wt(o,e)}function h(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function g(e){i[e.line]=e.column,k()}function _(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)v(t.charCodeAt(r._bufferIndex));else v(t)}}function v(e){d=d(e)}function y(e){l(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,k()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e}function b(e,t){let n=t||{};return n.type=e,n.start=h(),u.events.push([`enter`,n,u]),s.push(n),n}function x(e){let t=s.pop();return t.end=h(),u.events.push([`exit`,t,u]),t}function S(e,t){T(e,t.from)}function C(e,t){t.restore()}function w(e,t){return n;function n(n,r,i){let a,o,s,l;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return l=O(),s=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,m,h)(n)}}function m(t){return e(s,l),r}function h(e){return l.restore(),++o<a.length?p(a[o]):i}}}function T(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&E(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function O(){let e=h(),t=u.previous,n=u.currentConstruct,i=u.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=i,s=a,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Wt(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Gt(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
2
2
  `;break;case-3:o=`\r
3
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Gt(e){let t={constructs:k([Mt,...(e||{}).extensions||[]]),content:n(vt),defined:[],document:n(bt),flow:n(wt),lazy:{},string:n(Dt),text:n(Ot)};return t;function n(e){return n;function n(n){return Ht(t,e,n)}}}function Kt(e){for(;!he(e););return e}const qt=/[\0\t\n\r]/g;function Jt(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(qt.lastIndex=u,c=qt.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}function Q(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Xt(e.position):`start`in e||`end`in e?Xt(e):`line`in e||`column`in e?Yt(e):``}function Yt(e){return Zt(e&&e.line)+`:`+Zt(e&&e.column)}function Xt(e){return Yt(e&&e.start)+`-`+Yt(e&&e.end)}function Zt(e){return e&&typeof e==`number`?e:1}const Qt={}.hasOwnProperty;function $t(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),en(n)(Kt(Gt(n).document().write(Jt()(e,t,!0))))}function en(e){let n={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(fe),autolinkProtocol:A,autolinkEmail:A,atxHeading:o(ce),blockQuote:o(G),characterEscape:A,characterReference:A,codeFenced:o(K),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(K,s),codeText:o(oe,s),codeTextData:A,data:A,codeFlowValue:A,definition:o(q),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(se),hardBreakEscape:o(le),hardBreakTrailing:o(le),htmlFlow:o(ue,s),htmlFlowData:A,htmlText:o(ue,s),htmlTextData:A,image:o(de),label:s,link:o(fe),listItem:o(me),listItemValue:p,listOrdered:o(pe,f),listUnordered:o(pe),paragraph:o(J),reference:ee,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ce),strong:o(he),thematicBreak:o(_e)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:ae,autolinkProtocol:ie,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:W,characterReferenceMarkerNumeric:W,characterReferenceValue:ne,characterReference:re,codeFenced:l(y),codeFencedFence:_,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:j,codeIndented:l(b),codeText:l(I),codeTextData:j,data:j,definition:l(),definitionDestinationString:T,definitionLabelString:x,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(P),htmlFlowData:j,htmlText:l(F),htmlTextData:j,image:l(R),label:B,labelText:z,lineEnding:M,link:l(L),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:te,resourceDestinationString:V,resourceTitleString:H,resource:U,setextHeading:l(k),setextHeadingLineSequence:O,setextHeadingText:D,strong:l(),thematicBreak:l()}};tn(n,(e||{}).mdastExtensions||[]);let r={};return i;function i(e){let t={type:`root`,children:[]},i={stack:[t],tokenStack:[],config:n,enter:c,exit:u,buffer:s,resume:d,data:r},o=[],l=-1;for(;++l<e.length;)(e[l][1].type===`listOrdered`||e[l][1].type===`listUnordered`)&&(e[l][0]===`enter`?o.push(l):l=a(e,o.pop(),l));for(l=-1;++l<e.length;){let t=n[e[l][0]];Qt.call(t,e[l][1].type)&&t[e[l][1].type].call(Object.assign({sliceSerialize:e[l][2].sliceSerialize},i),e[l][1])}if(i.tokenStack.length>0){let e=i.tokenStack[i.tokenStack.length-1];(e[1]||rn).call(i,void 0,e[0])}for(t.position={start:$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},l=-1;++l<n.transforms.length;)t=n.transforms[l](t)||t;return t}function a(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:$(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||rn).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Q({start:e.start,end:e.end})+`): it’s not open`);n.position.end=$(e.end)}function d(){return v(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function x(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=h(this.sliceSerialize(e)).toLowerCase()}function C(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function T(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function E(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function D(){this.data.setextHeadingSlurpLineEnding=!0}function O(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function A(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ge(),n.position={start:$(e.start),end:void 0},t.push(n)),this.stack.push(n)}function j(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=$(e.end)}function M(e){let t=this.stack[this.stack.length-1];if(this.data.atHardBreak){let n=t.children[t.children.length-1];n.position.end=$(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(t.type)&&(A.call(this,e),j.call(this,e))}function N(){this.data.atHardBreak=!0}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function L(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function R(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function z(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=w(t),n.identifier=h(t).toLowerCase()}function B(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function V(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function H(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function U(){this.data.inReference=void 0}function ee(){this.data.referenceType=`collapsed`}function te(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=h(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function W(e){this.data.characterReferenceType=e.type}function ne(e){let n=this.sliceSerialize(e),r=this.data.characterReferenceType,i;r?(i=S(n,r===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):i=t(n);let a=this.stack[this.stack.length-1];a.value+=i}function re(e){let t=this.stack.pop();t.position.end=$(e.end)}function ie(e){j.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ae(e){j.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function G(){return{type:`blockquote`,children:[]}}function K(){return{type:`code`,lang:null,meta:null,value:``}}function oe(){return{type:`inlineCode`,value:``}}function q(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function se(){return{type:`emphasis`,children:[]}}function ce(){return{type:`heading`,depth:0,children:[]}}function le(){return{type:`break`}}function ue(){return{type:`html`,value:``}}function de(){return{type:`image`,title:null,url:``,alt:null}}function fe(){return{type:`link`,title:null,url:``,children:[]}}function pe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function me(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function J(){return{type:`paragraph`,children:[]}}function he(){return{type:`strong`,children:[]}}function ge(){return{type:`text`,value:``}}function _e(){return{type:`thematicBreak`}}}function $(e){return{line:e.line,column:e.column,offset:e.offset}}function tn(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?tn(e,r):nn(e,r)}}function nn(e,t){let n;for(n in t)if(Qt.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function rn(e,t){throw e?Error("Cannot close `"+e.type+"` ("+Q({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Q({start:t.start,end:t.end})+`) is open`):Error("Cannot close document, a token (`"+t.type+"`, "+Q({start:t.start,end:t.end})+`) is still open`)}export{f as _,M as a,v as c,n as d,r as f,d as g,u as h,z as i,g as l,l as m,Q as n,k as o,a as p,B as r,E as s,$t as t,h as u,p as v};
3
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Kt(e){let t={constructs:k([Nt,...(e||{}).extensions||[]]),content:n(yt),defined:[],document:n(xt),flow:n(Tt),lazy:{},string:n(Ot),text:n(kt)};return t;function n(e){return n;function n(n){return Ut(t,e,n)}}}function qt(e){for(;!ge(e););return e}const Jt=/[\0\t\n\r]/g;function Yt(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Jt.lastIndex=u,c=Jt.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}function Q(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Zt(e.position):`start`in e||`end`in e?Zt(e):`line`in e||`column`in e?Xt(e):``}function Xt(e){return Qt(e&&e.line)+`:`+Qt(e&&e.column)}function Zt(e){return Xt(e&&e.start)+`-`+Xt(e&&e.end)}function Qt(e){return e&&typeof e==`number`?e:1}const $t={}.hasOwnProperty;function en(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),tn(n)(qt(Kt(n).document().write(Yt()(e,t,!0))))}function tn(e){let n={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(fe),autolinkProtocol:A,autolinkEmail:A,atxHeading:o(ce),blockQuote:o(ae),characterEscape:A,characterReference:A,codeFenced:o(K),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(K,s),codeText:o(oe,s),codeTextData:A,data:A,codeFlowValue:A,definition:o(se),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(q),hardBreakEscape:o(le),hardBreakTrailing:o(le),htmlFlow:o(ue,s),htmlFlowData:A,htmlText:o(ue,s),htmlTextData:A,image:o(de),label:s,link:o(fe),listItem:o(me),listItemValue:p,listOrdered:o(pe,f),listUnordered:o(pe),paragraph:o(he),reference:ee,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ce),strong:o(J),thematicBreak:o(_e)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:ie,autolinkProtocol:G,blockQuote:l(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:W,characterReferenceMarkerNumeric:W,characterReferenceValue:ne,characterReference:re,codeFenced:l(y),codeFencedFence:_,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:j,codeIndented:l(b),codeText:l(I),codeTextData:j,data:j,definition:l(),definitionDestinationString:T,definitionLabelString:x,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(P),htmlFlowData:j,htmlText:l(F),htmlTextData:j,image:l(R),label:B,labelText:z,lineEnding:M,link:l(L),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:te,resourceDestinationString:V,resourceTitleString:H,resource:U,setextHeading:l(k),setextHeadingLineSequence:O,setextHeadingText:D,strong:l(),thematicBreak:l()}};nn(n,(e||{}).mdastExtensions||[]);let r={};return i;function i(e){let t={type:`root`,children:[]},i={stack:[t],tokenStack:[],config:n,enter:c,exit:u,buffer:s,resume:d,data:r},o=[],l=-1;for(;++l<e.length;)(e[l][1].type===`listOrdered`||e[l][1].type===`listUnordered`)&&(e[l][0]===`enter`?o.push(l):l=a(e,o.pop(),l));for(l=-1;++l<e.length;){let t=n[e[l][0]];$t.call(t,e[l][1].type)&&t[e[l][1].type].call(Object.assign({sliceSerialize:e[l][2].sliceSerialize},i),e[l][1])}if(i.tokenStack.length>0){let e=i.tokenStack[i.tokenStack.length-1];(e[1]||an).call(i,void 0,e[0])}for(t.position={start:$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},l=-1;++l<n.transforms.length;)t=n.transforms[l](t)||t;return t}function a(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:$(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||an).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Q({start:e.start,end:e.end})+`): it’s not open`);n.position.end=$(e.end)}function d(){return v(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function x(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=h(this.sliceSerialize(e)).toLowerCase()}function C(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function T(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function E(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function D(){this.data.setextHeadingSlurpLineEnding=!0}function O(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function A(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ge(),n.position={start:$(e.start),end:void 0},t.push(n)),this.stack.push(n)}function j(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=$(e.end)}function M(e){let t=this.stack[this.stack.length-1];if(this.data.atHardBreak){let n=t.children[t.children.length-1];n.position.end=$(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(t.type)&&(A.call(this,e),j.call(this,e))}function N(){this.data.atHardBreak=!0}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function L(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function R(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function z(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=w(t),n.identifier=h(t).toLowerCase()}function B(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function V(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function H(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function U(){this.data.inReference=void 0}function ee(){this.data.referenceType=`collapsed`}function te(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=h(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function W(e){this.data.characterReferenceType=e.type}function ne(e){let n=this.sliceSerialize(e),r=this.data.characterReferenceType,i;r?(i=S(n,r===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):i=t(n);let a=this.stack[this.stack.length-1];a.value+=i}function re(e){let t=this.stack.pop();t.position.end=$(e.end)}function G(e){j.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ie(e){j.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ae(){return{type:`blockquote`,children:[]}}function K(){return{type:`code`,lang:null,meta:null,value:``}}function oe(){return{type:`inlineCode`,value:``}}function se(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function q(){return{type:`emphasis`,children:[]}}function ce(){return{type:`heading`,depth:0,children:[]}}function le(){return{type:`break`}}function ue(){return{type:`html`,value:``}}function de(){return{type:`image`,title:null,url:``,alt:null}}function fe(){return{type:`link`,title:null,url:``,children:[]}}function pe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function me(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function he(){return{type:`paragraph`,children:[]}}function J(){return{type:`strong`,children:[]}}function ge(){return{type:`text`,value:``}}function _e(){return{type:`thematicBreak`}}}function $(e){return{line:e.line,column:e.column,offset:e.offset}}function nn(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?nn(e,r):rn(e,r)}}function rn(e,t){let n;for(n in t)if($t.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function an(e,t){throw e?Error("Cannot close `"+e.type+"` ("+Q({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Q({start:t.start,end:t.end})+`) is open`):Error("Cannot close document, a token (`"+t.type+"`, "+Q({start:t.start,end:t.end})+`) is still open`)}export{d as _,N as a,E as c,h as d,n as f,u as g,l as h,B as i,v as l,a as m,Q as n,M as o,r as p,V as r,k as s,en as t,g as u,f as v,p as y};
@@ -1,15 +1,15 @@
1
- import{t as e}from"./ccount.mjs";import{t}from"./devlop.mjs";import{_ as n,c as r,l as i,u as a,v as o}from"./mdast-util-from-markdown.mjs";import{i as s,n as c,r as l,t as u}from"./mdast-util-find-and-replace.mjs";import{t as d}from"./markdown-table.mjs";import{t as f}from"./longest-streak.mjs";const p=`phrasing`,m=[`autolink`,`link`,`image`,`label`];function ee(){return{transforms:[ie],enter:{literalAutolink:ne,literalAutolinkEmail:h,literalAutolinkHttp:h,literalAutolinkWww:h},exit:{literalAutolink:re,literalAutolinkEmail:v,literalAutolinkHttp:g,literalAutolinkWww:_}}}function te(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:p,notInConstruct:m},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:p,notInConstruct:m},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:p,notInConstruct:m}]}}function ne(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function h(e){this.config.enter.autolinkProtocol.call(this,e)}function g(e){this.config.exit.autolinkProtocol.call(this,e)}function _(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function v(e){this.config.exit.autolinkEmail.call(this,e)}function re(e){this.exit(e)}function ie(e){u(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ae],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,oe]],{ignore:[`link`,`linkReference`]})}function ae(e,t,n,r,i){let a=``;if(!y(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!se(n)))return!1;let o=ce(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function oe(e,t,n,r){return!y(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function se(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ce(t){let n=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!n)return[t,void 0];t=t.slice(0,n.index);let r=n[0],i=r.indexOf(`)`),a=e(t,`(`),o=e(t,`)`);for(;i!==-1&&a>o;)t+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(`)`),o++;return[t,r]}function y(e,t){let r=e.input.charCodeAt(e.index-1);return(e.index===0||o(r)||n(r))&&(!t||r!==47)}b.peek=_e;function le(){this.buffer()}function ue(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function de(){this.buffer()}function fe(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function pe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=a(this.sliceSerialize(e)).toLowerCase(),n.label=t}function me(e){this.exit(e)}function he(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=a(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ge(e){this.exit(e)}function _e(){return`[`}function b(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function ve(){return{enter:{gfmFootnoteCallString:le,gfmFootnoteCall:ue,gfmFootnoteDefinitionLabelString:de,gfmFootnoteDefinition:fe},exit:{gfmFootnoteCallString:pe,gfmFootnoteCall:me,gfmFootnoteDefinitionLabelString:he,gfmFootnoteDefinition:ge}}}function ye(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:b},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
2
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?x:be))),s(),o}}function be(e,t,n){return t===0?e:x(e,t,n)}function x(e,t,n){return(n?``:` `)+e}const S=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];D.peek=O;function C(){return{canContainEols:[`delete`],enter:{strikethrough:T},exit:{strikethrough:E}}}function w(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:S}],handlers:{delete:D}}}function T(e){this.enter({type:`delete`,children:[]},e)}function E(e){this.exit(e)}function D(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function O(){return`~`}function k(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),A);return i(),o}function A(e,t,n){return`>`+(n?``:` `)+e}function j(e,t){return M(e,t.inConstruct,!0)&&!M(e,t.notInConstruct,!1)}function M(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function N(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
3
- `&&j(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
4
- `}function xe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Se(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Ce(e,t,n,r){let i=Se(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(xe(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,we);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(f(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
1
+ import{t as e}from"./ccount.mjs";import"./devlop.mjs";import{d as t,l as n,u as r,v as i,y as a}from"./mdast-util-from-markdown.mjs";import{i as o,n as s,r as c,t as l}from"./mdast-util-find-and-replace.mjs";import{t as u}from"./markdown-table.mjs";import{t as d}from"./longest-streak.mjs";const f=`phrasing`,p=[`autolink`,`link`,`image`,`label`];function ee(){return{transforms:[ie],enter:{literalAutolink:ne,literalAutolinkEmail:m,literalAutolinkHttp:m,literalAutolinkWww:m},exit:{literalAutolink:re,literalAutolinkEmail:_,literalAutolinkHttp:h,literalAutolinkWww:g}}}function te(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:f,notInConstruct:p},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:f,notInConstruct:p},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:f,notInConstruct:p}]}}function ne(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function m(e){this.config.enter.autolinkProtocol.call(this,e)}function h(e){this.config.exit.autolinkProtocol.call(this,e)}function g(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function _(e){this.config.exit.autolinkEmail.call(this,e)}function re(e){this.exit(e)}function ie(e){l(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ae],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,oe]],{ignore:[`link`,`linkReference`]})}function ae(e,t,n,r,i){let a=``;if(!v(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!se(n)))return!1;let o=ce(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function oe(e,t,n,r){return!v(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function se(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ce(t){let n=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!n)return[t,void 0];t=t.slice(0,n.index);let r=n[0],i=r.indexOf(`)`),a=e(t,`(`),o=e(t,`)`);for(;i!==-1&&a>o;)t+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(`)`),o++;return[t,r]}function v(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||a(n)||i(n))&&(!t||n!==47)}y.peek=_e;function le(){this.buffer()}function ue(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function de(){this.buffer()}function fe(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function pe(e){let n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=t(this.sliceSerialize(e)).toLowerCase(),r.label=n}function me(e){this.exit(e)}function he(e){let n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=t(this.sliceSerialize(e)).toLowerCase(),r.label=n}function ge(e){this.exit(e)}function _e(){return`[`}function y(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function ve(){return{enter:{gfmFootnoteCallString:le,gfmFootnoteCall:ue,gfmFootnoteDefinitionLabelString:de,gfmFootnoteDefinition:fe},exit:{gfmFootnoteCallString:pe,gfmFootnoteCall:me,gfmFootnoteDefinitionLabelString:he,gfmFootnoteDefinition:ge}}}function ye(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:y},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
2
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?b:be))),s(),o}}function be(e,t,n){return t===0?e:b(e,t,n)}function b(e,t,n){return(n?``:` `)+e}const x=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];E.peek=D;function S(){return{canContainEols:[`delete`],enter:{strikethrough:w},exit:{strikethrough:T}}}function C(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:x}],handlers:{delete:E}}}function w(e){this.enter({type:`delete`,children:[]},e)}function T(e){this.exit(e)}function E(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function D(){return`~`}({}).hasOwnProperty;function O(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),k);return i(),o}function k(e,t,n){return`>`+(n?``:` `)+e}function A(e,t){return j(e,t.inConstruct,!0)&&!j(e,t.notInConstruct,!1)}function j(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function M(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
3
+ `&&A(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
4
+ `}function N(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function xe(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Se(e,t,n,r){let i=xe(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(N(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Ce);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(d(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
5
5
  `,encode:["`"],...s.current()})),t()}return u+=s.move(`
6
6
  `),a&&(u+=s.move(a+`
7
- `)),u+=s.move(c),l(),u}function we(e,t,n){return(n?``:` `)+e}function P(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Te(e,t,n,r){let i=P(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\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?` `:`
8
- `,...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()),o(),l}function Ee(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function F(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function I(e,t,n){let r=i(e),a=i(t);return r===void 0?a===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}L.peek=De;function L(e,t,n,r){let i=Ee(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=I(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=F(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=I(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+F(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function De(e,t,n){return n.options.emphasis||`*`}function R(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),l(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}function Oe(e,t){let n=!1;return R(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,c}),!!((!e.depth||e.depth<3)&&r(e)&&(t.options.setext||n))}function ke(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Oe(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
7
+ `)),u+=s.move(c),l(),u}function Ce(e,t,n){return(n?``:` `)+e}function P(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function we(e,t,n,r){let i=P(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\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?` `:`
8
+ `,...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()),o(),l}function Te(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function F(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function I(e,t,n){let i=r(e),a=r(t);return i===void 0?a===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}L.peek=Ee;function L(e,t,n,r){let i=Te(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=I(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=F(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=I(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+F(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ee(e,t,n){return n.options.emphasis||`*`}function R(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),c(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}function De(e,t){let r=!1;return R(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return r=!0,s}),!!((!e.depth||e.depth<3)&&n(e)&&(t.options.setext||r))}function Oe(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(De(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
9
9
  `,after:`
10
10
  `});return r(),t(),o+`
11
11
  `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
12
12
  `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
13
- `,...a.current()});return/^[\t ]/.test(l)&&(l=F(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}z.peek=Ae;function z(e){return e.value||``}function Ae(){return`<`}B.peek=je;function B(e,t,n,r){let i=P(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 je(){return`!`}V.peek=Me;function V(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 Me(){return`!`}H.peek=Ne;function H(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 Ne(){return"`"}function U(e,t){let n=r(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))}W.peek=Pe;function W(e,t,n,r){let i=P(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(U(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 Pe(e,t,n){return U(e,n)?`<`:`[`}G.peek=Fe;function G(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 Fe(){return`[`}function K(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 Ie(e){let t=K(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 Le(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function q(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 Re(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Le(n):K(n),s=e.ordered?o===`.`?`)`:`.`:Ie(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),q(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 ze(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 Be(e,t,n,r){let i=ze(n),a=n.bulletCurrent||K(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 Ve(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}const He=s([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Ue(e,t,n,r){return(e.children.some(function(e){return He(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function We(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}J.peek=Ge;function J(e,t,n,r){let i=We(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=I(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=F(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=I(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+F(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ge(e,t,n){return n.options.strong||`*`}function Ke(e,t,n,r){return n.safe(e.value,r)}function qe(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 Je(e,t,n){let r=(q(n)+(n.options.ruleSpaces?` `:``)).repeat(qe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Y={blockquote:k,break:N,code:Ce,definition:Te,emphasis:L,hardBreak:N,heading:ke,html:z,image:B,imageReference:V,inlineCode:H,link:W,linkReference:G,list:Re,listItem:Be,paragraph:Ve,root:Ue,strong:J,text:Ke,thematicBreak:Je};function Ye(){return{enter:{table:Xe,tableData:Z,tableHeader:Z,tableRow:Qe},exit:{codeText:Q,table:Ze,tableData:X,tableHeader:X,tableRow:X}}}function Xe(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 Ze(e){this.exit(e),this.data.inTable=void 0}function Qe(e){this.enter({type:`tableRow`,children:[]},e)}function X(e){this.exit(e)}function Z(e){this.enter({type:`tableCell`,children:[]},e)}function Q(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,$e));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function $e(e,t){return t===`|`?t:e}function et(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
14
- `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:p,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([f(e,n,r)]);return i.slice(0,i.indexOf(`
15
- `))}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 d(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]=f(r[i],t,n);return o(),a}function f(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 p(e,t,n){let r=Y.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function tt(){return{exit:{taskListCheckValueChecked:$,taskListCheckValueUnchecked:$,paragraph:rt}}}function nt(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:it}}}function $(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function rt(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 it(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=Y.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 at(){return[ee(),ve(),C(),Ye(),tt()]}function ot(e){return{extensions:[te(),ye(e),w(),et(e),nt()]}}export{ot as n,R as r,at as t};
13
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=F(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}z.peek=ke;function z(e){return e.value||``}function ke(){return`<`}B.peek=Ae;function B(e,t,n,r){let i=P(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 Ae(){return`!`}V.peek=je;function V(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 je(){return`!`}H.peek=Me;function H(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 Me(){return"`"}function U(e,t){let r=n(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(r===e.url||`mailto:`+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}W.peek=Ne;function W(e,t,n,r){let i=P(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(U(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 Ne(e,t,n){return U(e,n)?`<`:`[`}G.peek=Pe;function G(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 Pe(){return`[`}function K(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 Fe(e){let t=K(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 Ie(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function q(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 Le(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Ie(n):K(n),s=e.ordered?o===`.`?`)`:`.`:Fe(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),q(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 Re(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 ze(e,t,n,r){let i=Re(n),a=n.bulletCurrent||K(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 Be(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}const Ve=o([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function He(e,t,n,r){return(e.children.some(function(e){return Ve(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ue(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}J.peek=We;function J(e,t,n,r){let i=Ue(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=I(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=F(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=I(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+F(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function We(e,t,n){return n.options.strong||`*`}function Ge(e,t,n,r){return n.safe(e.value,r)}function Ke(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 qe(e,t,n){let r=(q(n)+(n.options.ruleSpaces?` `:``)).repeat(Ke(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Y={blockquote:O,break:M,code:Se,definition:we,emphasis:L,hardBreak:M,heading:Oe,html:z,image:B,imageReference:V,inlineCode:H,link:W,linkReference:G,list:Le,listItem:ze,paragraph:Be,root:He,strong:J,text:Ge,thematicBreak:qe};function Je(){return{enter:{table:Ye,tableData:Z,tableHeader:Z,tableRow:Ze},exit:{codeText:Qe,table:Xe,tableData:X,tableHeader:X,tableRow:X}}}function Ye(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 Xe(e){this.exit(e),this.data.inTable=void 0}function Ze(e){this.enter({type:`tableRow`,children:[]},e)}function X(e){this.exit(e)}function Z(e){this.enter({type:`tableCell`,children:[]},e)}function Qe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Q));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Q(e,t){return t===`|`?t:e}function $e(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
14
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:p,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(d(e,n,r),e.align)}function s(e,t,n,r){let i=l([f(e,n,r)]);return i.slice(0,i.indexOf(`
15
+ `))}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 u(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=f(r[i],t,n);return o(),a}function f(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 p(e,t,n){let r=Y.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function et(){return{exit:{taskListCheckValueChecked:$,taskListCheckValueUnchecked:$,paragraph:nt}}}function tt(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:rt}}}function $(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function nt(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 rt(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=Y.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 it(){return[ee(),ve(),S(),Je(),et()]}function at(e){return{extensions:[te(),ye(e),C(),$e(e),tt()]}}export{at as n,R as r,it as t};
@@ -1,11 +1,11 @@
1
- import{t as e}from"./@ungap/structured-clone.mjs";import{a as t,i as n,r}from"./hast-util-sanitize.mjs";import{t as i}from"./devlop.mjs";import{f as a}from"./mdast-util-from-markdown.mjs";import{r as o}from"./mdast-util-gfm.mjs";function s(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let o=e.charCodeAt(n),s=``;if(o===37&&a(e.charCodeAt(n+1))&&a(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){let t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(s=String.fromCharCode(o,t),i=1):s=`�`}else s=String.fromCharCode(o);s&&=(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function c(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function l(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
2
- `}]}function u(e,t){let n=t.value?t.value+`
3
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function d(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function f(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function p(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=s(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,c+=1,e.footnoteCounts.set(r,c);let l={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(c>1?`-`+c:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,l);let u={type:`element`,tagName:`sup`,properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function m(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function h(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function g(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function _(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return g(e,t);let i={src:s(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function v(e,t){let n={src:s(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function y(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function b(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return g(e,t);let i={href:s(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function x(e,t){let n={href:s(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function S(e,t,n){let r=e.all(t),i=n?C(n):w(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
1
+ import{t as e}from"./@ungap/structured-clone.mjs";import{a as t,i as n,r}from"./hast-util-sanitize.mjs";import"./devlop.mjs";import{o as i}from"./mdast-util-from-markdown.mjs";import{r as a}from"./mdast-util-gfm.mjs";function o(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function s(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
2
+ `}]}function c(e,t){let n=t.value?t.value+`
3
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function l(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),a=i(r.toLowerCase()),o=e.footnoteOrder.indexOf(r),s,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,c+=1,e.footnoteCounts.set(r,c);let l={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+a,id:n+`fnref-`+a+(c>1?`-`+c:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(s)}]};e.patch(t,l);let u={type:`element`,tagName:`sup`,properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function f(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function p(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function m(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function h(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return m(e,t);let a={src:i(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);let o={type:`element`,tagName:`img`,properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)}function g(e,t){let n={src:i(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function _(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function v(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return m(e,t);let a={href:i(r.url||``)};r.title!==null&&r.title!==void 0&&(a.title=r.title);let o={type:`element`,tagName:`a`,properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function y(e,t){let n={href:i(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function b(e,t,n){let r=e.all(t),i=n?x(n):S(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
4
4
  `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
5
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function C(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=w(n[r])}return t}function w(e){return e.spread??e.children.length>1}function T(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function E(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function O(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k(e,t){let i=e.all(t),a=i.shift(),o=[];if(a){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],n),o.push(n)}if(i.length>0){let a={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(i,!0)},s=n(t.children[1]),c=r(t.children[t.children.length-1]);s&&c&&(a.position={start:s,end:c}),o.push(a)}let s={type:`element`,tagName:`table`,properties:{},children:e.wrap(o,!0)};return e.patch(t,s),e.applyData(t,s)}function A(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function j(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function M(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(N(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(N(t.slice(i),i>0,!1)),a.join(``)}function N(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function P(e,t){let n={type:`text`,value:M(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function F(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const I={blockquote:c,break:l,code:u,delete:d,emphasis:f,footnoteReference:p,heading:m,html:h,imageReference:_,image:v,inlineCode:y,linkReference:b,link:x,listItem:S,list:T,paragraph:E,root:D,strong:O,table:k,tableCell:j,tableRow:A,text:P,thematicBreak:F,toml:L,yaml:L,definition:L,footnoteDefinition:L};function L(){}function R(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function z(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function B(t){let n=typeof t.options.clobberPrefix==`string`?t.options.clobberPrefix:`user-content-`,r=t.options.footnoteBackContent||R,i=t.options.footnoteBackLabel||z,a=t.options.footnoteLabel||`Footnotes`,o=t.options.footnoteLabelTagName||`h2`,c=t.options.footnoteLabelProperties||{className:[`sr-only`]},l=[],u=-1;for(;++u<t.footnoteOrder.length;){let e=t.footnoteById.get(t.footnoteOrder[u]);if(!e)continue;let a=t.all(e),o=String(e.identifier).toUpperCase(),c=s(o.toLowerCase()),d=0,f=[],p=t.footnoteCounts.get(o);for(;p!==void 0&&++d<=p;){f.length>0&&f.push({type:`text`,value:` `});let e=typeof r==`string`?r:r(u,d);typeof e==`string`&&(e={type:`text`,value:e}),f.push({type:`element`,tagName:`a`,properties:{href:`#`+n+`fnref-`+c+(d>1?`-`+d:``),dataFootnoteBackref:``,ariaLabel:typeof i==`string`?i:i(u,d),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let m=a[a.length-1];if(m&&m.type===`element`&&m.tagName===`p`){let e=m.children[m.children.length-1];e&&e.type===`text`?e.value+=` `:m.children.push({type:`text`,value:` `}),m.children.push(...f)}else a.push(...f);let h={type:`element`,tagName:`li`,properties:{id:n+`fn-`+c},children:t.wrap(a,!0)};t.patch(e,h),l.push(h)}if(l.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:o,properties:{...e(c),id:`footnote-label`},children:[{type:`text`,value:a}]},{type:`text`,value:`
5
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function x(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=S(n[r])}return t}function S(e){return e.spread??e.children.length>1}function C(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function w(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function E(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D(e,t){let i=e.all(t),a=i.shift(),o=[];if(a){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],n),o.push(n)}if(i.length>0){let a={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(i,!0)},s=n(t.children[1]),c=r(t.children[t.children.length-1]);s&&c&&(a.position={start:s,end:c}),o.push(a)}let s={type:`element`,tagName:`table`,properties:{},children:e.wrap(o,!0)};return e.patch(t,s),e.applyData(t,s)}function O(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function k(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(j(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(j(t.slice(i),i>0,!1)),a.join(``)}function j(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function M(e,t){let n={type:`text`,value:A(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function N(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const P={blockquote:o,break:s,code:c,delete:l,emphasis:u,footnoteReference:d,heading:f,html:p,imageReference:h,image:g,inlineCode:_,linkReference:v,link:y,listItem:b,list:C,paragraph:w,root:T,strong:E,table:D,tableCell:k,tableRow:O,text:M,thematicBreak:N,toml:F,yaml:F,definition:F,footnoteDefinition:F};function F(){}function I(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function L(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function R(t){let n=typeof t.options.clobberPrefix==`string`?t.options.clobberPrefix:`user-content-`,r=t.options.footnoteBackContent||I,a=t.options.footnoteBackLabel||L,o=t.options.footnoteLabel||`Footnotes`,s=t.options.footnoteLabelTagName||`h2`,c=t.options.footnoteLabelProperties||{className:[`sr-only`]},l=[],u=-1;for(;++u<t.footnoteOrder.length;){let e=t.footnoteById.get(t.footnoteOrder[u]);if(!e)continue;let o=t.all(e),s=String(e.identifier).toUpperCase(),c=i(s.toLowerCase()),d=0,f=[],p=t.footnoteCounts.get(s);for(;p!==void 0&&++d<=p;){f.length>0&&f.push({type:`text`,value:` `});let e=typeof r==`string`?r:r(u,d);typeof e==`string`&&(e={type:`text`,value:e}),f.push({type:`element`,tagName:`a`,properties:{href:`#`+n+`fnref-`+c+(d>1?`-`+d:``),dataFootnoteBackref:``,ariaLabel:typeof a==`string`?a:a(u,d),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let m=o[o.length-1];if(m&&m.type===`element`&&m.tagName===`p`){let e=m.children[m.children.length-1];e&&e.type===`text`?e.value+=` `:m.children.push({type:`text`,value:` `}),m.children.push(...f)}else o.push(...f);let h={type:`element`,tagName:`li`,properties:{id:n+`fn-`+c},children:t.wrap(o,!0)};t.patch(e,h),l.push(h)}if(l.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:s,properties:{...e(c),id:`footnote-label`},children:[{type:`text`,value:o}]},{type:`text`,value:`
6
6
  `},{type:`element`,tagName:`ol`,properties:{},children:t.wrap(l,!0)},{type:`text`,value:`
7
- `}]}}const V={}.hasOwnProperty,H={};function U(t,n){let r=n||H,i=new Map,a=new Map,s={all:l,applyData:G,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],handlers:{...I,...r.handlers},one:c,options:r,patch:W,wrap:q};return o(t,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s;function c(t,n){let r=t.type,i=s.handlers[r];if(V.call(s.handlers,r)&&i)return i(s,t,n);if(s.options.passThrough&&s.options.passThrough.includes(r)){if(`children`in t){let{children:n,...r}=t,i=e(r);return i.children=s.all(t),i}return e(t)}return(s.options.unknownHandler||K)(s,t,n)}function l(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=s.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=J(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=J(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function W(e,n){e.position&&(n.position=t(e))}function G(t,n){let r=n;if(t&&t.data){let n=t.data.hName,i=t.data.hChildren,a=t.data.hProperties;typeof n==`string`&&(r.type===`element`?r.tagName=n:r={type:`element`,tagName:n,properties:{},children:`children`in r?r.children:[r]}),r.type===`element`&&a&&Object.assign(r.properties,e(a)),`children`in r&&r.children&&i!=null&&(r.children=i)}return r}function K(e,t){let n=t.data||{},r=`value`in t&&!(V.call(n,`hProperties`)||V.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function q(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
7
+ `}]}}const z={}.hasOwnProperty,B={};function V(t,n){let r=n||B,i=new Map,o=new Map,s={all:l,applyData:U,definitionById:i,footnoteById:o,footnoteCounts:new Map,footnoteOrder:[],handlers:{...P,...r.handlers},one:c,options:r,patch:H,wrap:G};return a(t,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s;function c(t,n){let r=t.type,i=s.handlers[r];if(z.call(s.handlers,r)&&i)return i(s,t,n);if(s.options.passThrough&&s.options.passThrough.includes(r)){if(`children`in t){let{children:n,...r}=t,i=e(r);return i.children=s.all(t),i}return e(t)}return(s.options.unknownHandler||W)(s,t,n)}function l(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=s.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=K(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=K(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function H(e,n){e.position&&(n.position=t(e))}function U(t,n){let r=n;if(t&&t.data){let n=t.data.hName,i=t.data.hChildren,a=t.data.hProperties;typeof n==`string`&&(r.type===`element`?r.tagName=n:r={type:`element`,tagName:n,properties:{},children:`children`in r?r.children:[r]}),r.type===`element`&&a&&Object.assign(r.properties,e(a)),`children`in r&&r.children&&i!=null&&(r.children=i)}return r}function W(e,t){let n=t.data||{},r=`value`in t&&!(z.call(n,`hProperties`)||z.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function G(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
8
8
  `});++r<e.length;)r&&n.push({type:`text`,value:`
9
9
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
10
- `}),n}function J(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Y(e,t){let n=U(e,t),r=n.one(e,void 0),i=B(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
11
- `},i)),a}export{Y as t};
10
+ `}),n}function K(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function q(e,t){let n=V(e,t),r=n.one(e,void 0),i=R(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
11
+ `},i)),a}export{q as t};
@@ -1,2 +1,2 @@
1
- import{t as e}from"./is-error-instance.mjs";import{t}from"./is-plain-obj.mjs";const n=e=>{r.forEach(t=>{i(e,t)})},r=[`name`,`message`,`stack`,`cause`,`errors`],i=(e,t)=>{let n=a(e,t);if(n!==void 0){if(o(n)){c(e,t,e[t]);return}s(n)&&l(e,t,n)}},a=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n;let r=Object.getPrototypeOf(e);return r===null?void 0:a(r,t)},o=({get:e,set:t})=>e!==void 0&&t===void 0,s=({enumerable:e,writable:t})=>e||!t,c=(e,t,n)=>{l(e,t,{value:n})},l=(e,t,n)=>{Object.defineProperty(e,t,{...n,...`get`in n||`set`in n?{}:{writable:!0},enumerable:!1,configurable:!0})},ee=(e,t)=>{Array.isArray(e.errors)?c(e,`errors`,e.errors.filter(te).map(t).filter(Boolean)):ne(e)?c(e,`errors`,[]):e.errors!==void 0&&re(e)},te=e=>e!==void 0,ne=e=>`AggregateError`in globalThis&&(e.name===`AggregateError`||e instanceof AggregateError),re=e=>{delete e.errors,e.errors!==void 0&&c(e,`errors`,[])},u=(e,t)=>{if(!(`cause`in e))return;let n=e.cause===void 0?e.cause:t(e.cause);n===void 0?delete e.cause:c(e,`cause`,n)},d=e=>!Object.isExtensible(e)||r.some(t=>f(e,t)||p(e,t)),f=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t);return n!==void 0&&!n.configurable},p=(e,t)=>{try{return e[t],!1}catch{return!0}},m=e=>{c(e,`stack`,ie(e.message,e.name))},ie=(e=``,t=`Error`)=>{let{stack:n}=new(ae(t))(e);return typeof n==`string`&&n!==``?n:`${t}: ${e}`},ae=e=>{let t={value:e,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},`name`,t);return Object.defineProperty(n.prototype,`name`,t),n},oe=e=>{let t={};for(let n of se(e))try{let r=e[n],{enumerable:i,configurable:o,writable:s=!0}=a(e,n);Object.defineProperty(t,n,{value:r,enumerable:i,configurable:o,writable:s})}catch{}return t},se=e=>{let t=ce(e);for(let n of r)le(e,n)&&t.push(n);return t},ce=e=>{try{return Reflect.ownKeys(e)}catch{return[]}},le=(e,t)=>{try{return t in e&&!Object.hasOwn(e,t)}catch{return!1}},h=e=>{let{name:t,message:n,stack:r,cause:i,errors:a,...o}=oe(e),s=ue(n,o),c=me(t,s);return n===s&&he(c,o),Object.entries({name:t,stack:r,cause:i,errors:a}).forEach(([e,t])=>{ge(c,e,t)}),r===void 0&&m(c),c},ue=(e,t)=>typeof e==`string`&&e!==``?e:pe(de(t)),de=e=>{try{return JSON.stringify(e)}catch{return fe(e)}},fe=e=>{try{return String(e)}catch{return`Invalid error`}},pe=e=>e.length<g?e:`${e.slice(0,g)}...`,g=1e3,me=(e,t)=>e===`AggregateError`&&`AggregateError`in globalThis?AggregateError([],t):e in _?new _[e](t):Error(t),_={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},he=(e,t)=>{for(let n in t)n in e||(e[n]=t[n])},ge=(e,t,n)=>{n!==void 0&&c(e,t,n)},_e=e=>{try{let t=Error(String(e));return m(t),t}catch(e){return e}},{toString:ve}=Object.prototype,ye=t=>be(t)?h(t):e(t)?v(t)?h(t):t:_e(t),be=e=>{try{return t(e)}catch{return!1}},v=e=>y(e)||d(e)||b(e),y=e=>{try{return ve.call(e)===`[object Object]`}catch{return!0}},b=e=>typeof e.constructor!=`function`||typeof e.constructor.name!=`string`||e.constructor.name===``||e.constructor.prototype!==Object.getPrototypeOf(e);var x=(e,{shallow:t=!1}={})=>S(e,[],t);const S=(e,t,n)=>{if(t.includes(e))return;let r=n?C:r=>S(r,[...t,e],n),i=ye(e);return w(i,r),i},C=e=>e,w=(e,t)=>{T(e),E(e),D(e),u(e,t),ee(e,t),n(e)},T=e=>{if(O(e.name))return;let t=Object.getPrototypeOf(e).name;c(e,`name`,O(t)?t:e.constructor.name)},E=e=>{O(e.message)||c(e,`message`,``)},D=e=>{O(e.stack)||m(e)},O=e=>typeof e==`string`&&e!==``,k=(e,t,n=e.name)=>{if(A(t),typeof n!=`string`)throw TypeError(`currentName must be a string: ${n}`);return n},A=e=>{if(!j(e))throw TypeError(`ErrorClass must be a class: ${e}`);if(!M(e.prototype))throw TypeError(`ErrorClass must inherit from Error: ${e}`);if(!N(e))throw TypeError(`ErrorClass must be have a valid constructor: ${e}`)},j=e=>typeof e==`function`&&typeof e.prototype==`object`&&e.prototype!==null,M=e=>e!==null&&(e.name===`Error`||M(Object.getPrototypeOf(e))),N=e=>typeof e.prototype.constructor==`function`,P=(e,t,n)=>{Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})},xe=(e,t)=>{Object.getPrototypeOf(e)!==t.prototype&&(Se(e,t),L(e,`constructor`),Ce(e,t))},Se=(e,t)=>{Object.setPrototypeOf(e,t.prototype)},Ce=(e,t)=>{L(e,`name`);let n=F(t.prototype);e.name!==n&&P(e,`name`,n)},F=e=>we(e)??Te(e)??F(Object.getPrototypeOf(e)),we=e=>Object.hasOwn(e,`name`)&&I(e.name)?e.name:void 0,Te=e=>typeof e.constructor==`function`&&I(e.constructor.name)?e.constructor.name:void 0,I=e=>typeof e==`string`&&e!==``,L=(e,t)=>{Object.hasOwn(e,t)&&delete e[t]},Ee=(e,t)=>{De(e,t)&&P(e,`stack`,ke(e,t))},De=(e,t)=>t!==e.name&&t!==``&&e.stack.includes(t)&&Oe(),Oe=()=>{class e extends Error{}let t={value:R,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(e,`name`,t),Object.defineProperty(e.prototype,`name`,t);let{stack:n}=new e(``);return typeof n==`string`&&n.includes(R)},R=`SetErrorClassError`,ke=({name:e,stack:t},n)=>{if(t.startsWith(`${n}: `))return t.replace(n,e);let[r,i]=Ae(n,e).find(([e])=>t.includes(e));return t.replace(r,i)},Ae=(e,t)=>[[`\n${e}: `,`\n${t}: `],[`${e}: `,`${t}: `],[`${e} `,`${t} `],[e,t]];var je=(e,t,n)=>{let r=x(e),i=k(r,t,n);return xe(r,t),Ee(r,i),r};const Me=(e,t)=>t.configurable===!1?Ne(e,t):Ie(e,t),Ne=(e,t)=>({...t,...Pe(e,t),...Fe(e,t)}),Pe=(e,t)=>t.writable===!0&&e.writable===!1?{writable:!1}:{},Fe=(e,t)=>e.hasValue&&`value`in t&&t.writable===!0?{value:e.value}:{},Ie=(e,t)=>{let n=B(e.enumerable,t.enumerable,!0),r=B(e.writable,t.writable,!0),i=B(e.configurable,t.configurable,!0);return{...Le(e,t,r),enumerable:n,configurable:i}},Le=(e,t,n)=>e.hasValue?{value:e.value,writable:n}:!z(e)&&!z(t)?{value:t.value,writable:n}:{get:B(e.get,t.get),set:B(e.set,t.set)},z=({get:e,set:t})=>e!==void 0||t!==void 0,B=(e,t,n)=>e??t??n,Re=(e,t,n)=>{if(!ze(e))throw TypeError(`Argument must be an object: ${e}`);if(!Be(t))throw TypeError(`Property key must be a string, a symbol or an integer: ${t}`);return Ve(n)},ze=e=>typeof e==`object`&&!!e,Be=e=>{let t=typeof e;return t===`string`||t===`symbol`||t===`number`},Ve=e=>{if(!t(e))throw TypeError(`Descriptor must be a plain object: ${e}`);let{enumerable:n,writable:r,configurable:i,value:a,get:o,set:s,...c}=e,l=`value`in e;return He({enumerable:n,writable:r,configurable:i,get:o,set:s,unknownProps:c,hasValue:l}),{enumerable:n,writable:r,configurable:i,value:a,get:o,set:s,hasValue:l}},He=({enumerable:e,writable:t,configurable:n,get:r,set:i,unknownProps:a,hasValue:o})=>{V(o,r,`get`),V(o,i,`set`),H(e,`enumerable`),H(t,`writable`),H(n,`configurable`),We(a)},V=(e,t,n)=>{if(Ue(t,n),e&&t!==void 0)throw TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${t}`)},Ue=(e,t)=>{if(e!==void 0&&typeof e!=`function`)throw TypeError(`Descriptor property "${t}" must be a function: ${e}`)},H=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`Descriptor property "${t}" must be a boolean: ${e}`)},We=e=>{let[t]=Object.keys(e);if(t!==void 0)throw TypeError(`Unknown descriptor property "${t}": ${e[t]}`)};var Ge=(e,t,n)=>(Ke(e,t,Me(Re(e,t,n),U(e,t))),e);const U=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n;let r=Object.getPrototypeOf(e);return r===null?{}:U(r,t)},Ke=(e,t,n)=>{try{Object.defineProperty(e,t,n)}catch{}},qe=(e,t,n)=>{if(n!==void 0)return W(e,t,n);try{delete e[t]}catch{}if(e[t]!==void 0)return W(e,t)},W=(e,t,n)=>{Ge(e,t,{value:n,...Je(t)})},Je=e=>typeof e==`string`&&e.startsWith(`_`)?{enumerable:!1}:{},Ye=(e,n,r={})=>{if(G(e,`First argument`),G(n,`Second argument`),!t(r))throw TypeError(`Options must be a plain object: ${r}`);let{soft:i=!1}=r;if(typeof i!=`boolean`)throw TypeError(`Option "soft" must be a boolean: ${i}`);return{soft:i}},G=(e,t)=>{if(e===void 0)throw TypeError(`${t} is required.`);if(!Xe(e))throw TypeError(`${t} must be a plain object or an error: ${e}`)},Xe=n=>t(n)||e(n),Ze=({error:e,props:t,propName:n,soft:r})=>Qe(n)||!tt.call(t,n)||r&&e[n]!==void 0,Qe=e=>e in $e||et.has(e),$e=Error(`check`),et=new Set([`prototype`,`errors`,`cause`]),{propertyIsEnumerable:tt}=Object.prototype;var nt=(e,t,n)=>{let{soft:r}=Ye(e,t,n);for(let n of Reflect.ownKeys(t))rt({error:e,props:t,propName:n,soft:r});return e};const rt=({error:e,props:t,propName:n,soft:r})=>{Ze({error:e,props:t,propName:n,soft:r})||qe(e,n,t[n])},K=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})},it=(e,t)=>{e.errors!==void 0&&K(e,`errors`,e.errors.map(e=>t(e).error).filter(Boolean))},at=({target:e,source:t,parent:n,child:r})=>{if(!q(e)){ot(e,t);return}q(t)&&K(e,`errors`,[...r.errors,...n.errors])},ot=(e,t)=>{t.errors!==void 0&&K(e,`errors`,t.errors)},q=e=>e.errors!==void 0&&e.errors.length!==0,st=(e,t,n=e.message)=>{if(typeof t!=`string`)throw TypeError(`newMessage must be a string: ${t}`);if(typeof n!=`string`)throw TypeError(`currentMessage must be a string: ${n}`);return n},ct=({name:e,stack:t},n,r)=>r!==``&&t.includes(r)?lt({name:e,stack:t,newMessage:n,currentMessage:r}):dt(e,t,n),lt=({name:e,stack:t,newMessage:n,currentMessage:r})=>{let[i,a]=ut(e,n,r).find(([e])=>t.includes(e));return t.replace(i,a)},ut=(e,t,n)=>[[`${e}: ${n}`,`${e}: ${t}`],[`: ${n}`,`: ${t}`],[`\n${n}`,`\n${t}`],[` ${n}`,` ${t}`],[n,t]],dt=(e,t,n)=>{let r=`${e}: `,i=n.trimEnd();return t===e||t.startsWith(`${e}\n`)?t.replace(e,`${r}${i}`):t.startsWith(r)?t.replace(r,`${r}${i}\n`):`${r}${i}\n${t}`};var ft=(e,t,n)=>{let r=x(e),i=st(r,t,n);return Y(r,`message`,t),pt(r,t,i),r};const pt=(e,t,n)=>{t===n||!mt()||Y(e,`stack`,ct(e,t,n))},mt=()=>{let{stack:e}=Error(J);return typeof e==`string`&&e.includes(J)},J=`set-error-message test message`,Y=(e,t,n)=>{Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})};var X=(e,t,n)=>{if(typeof t!=`string`)throw TypeError(`Second argument must be a message string: ${t}`);let r=x(e);return ft(r,Z(t,r.message),n)};const Z=(e,t)=>{let n=e.trim(),r=t.trim();return n===``?r:r===``?n:ht(n,r,e)},ht=(e,t,n)=>e.endsWith(gt)?n.endsWith(_t)?`${e}\n${t}`:`${e} ${t}`:`${t}\n${e}`,gt=`:`,_t=`
2
- `,vt=({parent:e,child:t,target:n,stackError:r})=>{let i=e.message,a=r.message;return n.message=t.message,X(n,i,a)},yt=(e,t)=>Q(e)===t,Q=e=>typeof e==`object`&&e?e.stack:void 0,bt=({wrap:e,target:t,source:n,childHasStack:r})=>e===r?t:(K(t,`stack`,n.stack),n),xt=e=>{let{wrap:t,name:n}=e;return typeof t==`boolean`?(Object.hasOwn(e,`wrap`)&&delete e.wrap,t):n===`Error`};var St=e=>$(e,[]).error;const $=(e,t)=>{if(t.includes(e))return{};let n=n=>$(n,[...t,e]),r=Q(e),i=x(e,{shallow:!0}),a=yt(i,r);it(i,n);let{parent:o,childHasStack:s}=Ct(i,n);return{error:o,errorHasStack:a||s}},Ct=(e,t)=>{let n=xt(e);if(e.cause===void 0)return{parent:e,childHasStack:!1};let{error:r,errorHasStack:i}=t(e.cause);return delete e.cause,{parent:wt({parent:e,child:r,childHasStack:i,wrap:n}),childHasStack:i}},wt=({parent:e,child:t,childHasStack:n,wrap:r})=>{if(t===void 0)return e;let[i,a]=r?[t,e]:[e,t],o=bt({wrap:r,target:i,source:a,childHasStack:n}),s=vt({parent:e,child:t,target:je(i,i.constructor,o.name),stackError:o});return at({target:s,source:a,parent:e,child:t}),nt(s,a,{soft:!r})};export{X as n,St as t};
1
+ import{t as e}from"./is-error-instance.mjs";import{t}from"./is-plain-obj.mjs";const n=e=>{r.forEach(t=>{i(e,t)})},r=[`name`,`message`,`stack`,`cause`,`errors`],i=(e,t)=>{let n=a(e,t);if(n!==void 0){if(o(n)){c(e,t,e[t]);return}s(n)&&l(e,t,n)}},a=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n;let r=Object.getPrototypeOf(e);return r===null?void 0:a(r,t)},o=({get:e,set:t})=>e!==void 0&&t===void 0,s=({enumerable:e,writable:t})=>e||!t,c=(e,t,n)=>{l(e,t,{value:n})},l=(e,t,n)=>{Object.defineProperty(e,t,{...n,...`get`in n||`set`in n?{}:{writable:!0},enumerable:!1,configurable:!0})},ee=(e,t)=>{Array.isArray(e.errors)?c(e,`errors`,e.errors.filter(te).map(t).filter(Boolean)):ne(e)?c(e,`errors`,[]):e.errors!==void 0&&re(e)},te=e=>e!==void 0,ne=e=>`AggregateError`in globalThis&&(e.name===`AggregateError`||e instanceof AggregateError),re=e=>{delete e.errors,e.errors!==void 0&&c(e,`errors`,[])},u=(e,t)=>{if(!(`cause`in e))return;let n=e.cause===void 0?e.cause:t(e.cause);n===void 0?delete e.cause:c(e,`cause`,n)},d=e=>!Object.isExtensible(e)||r.some(t=>f(e,t)||p(e,t)),f=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t);return n!==void 0&&!n.configurable},p=(e,t)=>{try{return e[t],!1}catch{return!0}},m=e=>{c(e,`stack`,ie(e.message,e.name))},ie=(e=``,t=`Error`)=>{let{stack:n}=new(ae(t))(e);return typeof n==`string`&&n!==``?n:`${t}: ${e}`},ae=e=>{let t={value:e,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},`name`,t);return Object.defineProperty(n.prototype,`name`,t),n},oe=e=>{let t={};for(let n of se(e))try{let r=e[n],{enumerable:i,configurable:o,writable:s=!0}=a(e,n);Object.defineProperty(t,n,{value:r,enumerable:i,configurable:o,writable:s})}catch{}return t},se=e=>{let t=ce(e);for(let n of r)le(e,n)&&t.push(n);return t},ce=e=>{try{return Reflect.ownKeys(e)}catch{return[]}},le=(e,t)=>{try{return t in e&&!Object.hasOwn(e,t)}catch{return!1}},h=e=>{let{name:t,message:n,stack:r,cause:i,errors:a,...o}=oe(e),s=ue(n,o),c=me(t,s);return n===s&&he(c,o),Object.entries({name:t,stack:r,cause:i,errors:a}).forEach(([e,t])=>{ge(c,e,t)}),r===void 0&&m(c),c},ue=(e,t)=>typeof e==`string`&&e!==``?e:pe(de(t)),de=e=>{try{return JSON.stringify(e)}catch{return fe(e)}},fe=e=>{try{return String(e)}catch{return`Invalid error`}},pe=e=>e.length<g?e:`${e.slice(0,g)}...`,g=1e3,me=(e,t)=>e===`AggregateError`&&`AggregateError`in globalThis?AggregateError([],t):e in _?new _[e](t):Error(t),_={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},he=(e,t)=>{for(let n in t)n in e||(e[n]=t[n])},ge=(e,t,n)=>{n!==void 0&&c(e,t,n)},_e=e=>{try{let t=Error(String(e));return m(t),t}catch(e){return e}},{toString:ve}=Object.prototype,ye=t=>be(t)?h(t):e(t)?v(t)?h(t):t:_e(t),be=e=>{try{return t(e)}catch{return!1}},v=e=>y(e)||d(e)||b(e),y=e=>{try{return ve.call(e)===`[object Object]`}catch{return!0}},b=e=>typeof e.constructor!=`function`||typeof e.constructor.name!=`string`||e.constructor.name===``||e.constructor.prototype!==Object.getPrototypeOf(e),x=(e,{shallow:t=!1}={})=>S(e,[],t),S=(e,t,n)=>{if(t.includes(e))return;let r=n?C:r=>S(r,[...t,e],n),i=ye(e);return w(i,r),i},C=e=>e,w=(e,t)=>{T(e),E(e),D(e),u(e,t),ee(e,t),n(e)},T=e=>{if(O(e.name))return;let t=Object.getPrototypeOf(e).name;c(e,`name`,O(t)?t:e.constructor.name)},E=e=>{O(e.message)||c(e,`message`,``)},D=e=>{O(e.stack)||m(e)},O=e=>typeof e==`string`&&e!==``,k=(e,t,n=e.name)=>{if(A(t),typeof n!=`string`)throw TypeError(`currentName must be a string: ${n}`);return n},A=e=>{if(!j(e))throw TypeError(`ErrorClass must be a class: ${e}`);if(!M(e.prototype))throw TypeError(`ErrorClass must inherit from Error: ${e}`);if(!N(e))throw TypeError(`ErrorClass must be have a valid constructor: ${e}`)},j=e=>typeof e==`function`&&typeof e.prototype==`object`&&e.prototype!==null,M=e=>e!==null&&(e.name===`Error`||M(Object.getPrototypeOf(e))),N=e=>typeof e.prototype.constructor==`function`,P=(e,t,n)=>{Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})},xe=(e,t)=>{Object.getPrototypeOf(e)!==t.prototype&&(Se(e,t),L(e,`constructor`),Ce(e,t))},Se=(e,t)=>{Object.setPrototypeOf(e,t.prototype)},Ce=(e,t)=>{L(e,`name`);let n=F(t.prototype);e.name!==n&&P(e,`name`,n)},F=e=>we(e)??Te(e)??F(Object.getPrototypeOf(e)),we=e=>Object.hasOwn(e,`name`)&&I(e.name)?e.name:void 0,Te=e=>typeof e.constructor==`function`&&I(e.constructor.name)?e.constructor.name:void 0,I=e=>typeof e==`string`&&e!==``,L=(e,t)=>{Object.hasOwn(e,t)&&delete e[t]},Ee=(e,t)=>{De(e,t)&&P(e,`stack`,ke(e,t))},De=(e,t)=>t!==e.name&&t!==``&&e.stack.includes(t)&&Oe(),Oe=()=>{class e extends Error{}let t={value:R,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(e,`name`,t),Object.defineProperty(e.prototype,`name`,t);let{stack:n}=new e(``);return typeof n==`string`&&n.includes(R)},R=`SetErrorClassError`,ke=({name:e,stack:t},n)=>{if(t.startsWith(`${n}: `))return t.replace(n,e);let[r,i]=Ae(n,e).find(([e])=>t.includes(e));return t.replace(r,i)},Ae=(e,t)=>[[`\n${e}: `,`\n${t}: `],[`${e}: `,`${t}: `],[`${e} `,`${t} `],[e,t]],je=(e,t,n)=>{let r=x(e),i=k(r,t,n);return xe(r,t),Ee(r,i),r},Me=(e,t)=>t.configurable===!1?Ne(e,t):Ie(e,t),Ne=(e,t)=>({...t,...Pe(e,t),...Fe(e,t)}),Pe=(e,t)=>t.writable===!0&&e.writable===!1?{writable:!1}:{},Fe=(e,t)=>e.hasValue&&`value`in t&&t.writable===!0?{value:e.value}:{},Ie=(e,t)=>{let n=B(e.enumerable,t.enumerable,!0),r=B(e.writable,t.writable,!0),i=B(e.configurable,t.configurable,!0);return{...Le(e,t,r),enumerable:n,configurable:i}},Le=(e,t,n)=>e.hasValue?{value:e.value,writable:n}:!z(e)&&!z(t)?{value:t.value,writable:n}:{get:B(e.get,t.get),set:B(e.set,t.set)},z=({get:e,set:t})=>e!==void 0||t!==void 0,B=(e,t,n)=>e??t??n,Re=(e,t,n)=>{if(!ze(e))throw TypeError(`Argument must be an object: ${e}`);if(!Be(t))throw TypeError(`Property key must be a string, a symbol or an integer: ${t}`);return Ve(n)},ze=e=>typeof e==`object`&&!!e,Be=e=>{let t=typeof e;return t===`string`||t===`symbol`||t===`number`},Ve=e=>{if(!t(e))throw TypeError(`Descriptor must be a plain object: ${e}`);let{enumerable:n,writable:r,configurable:i,value:a,get:o,set:s,...c}=e,l=`value`in e;return He({enumerable:n,writable:r,configurable:i,get:o,set:s,unknownProps:c,hasValue:l}),{enumerable:n,writable:r,configurable:i,value:a,get:o,set:s,hasValue:l}},He=({enumerable:e,writable:t,configurable:n,get:r,set:i,unknownProps:a,hasValue:o})=>{V(o,r,`get`),V(o,i,`set`),H(e,`enumerable`),H(t,`writable`),H(n,`configurable`),We(a)},V=(e,t,n)=>{if(Ue(t,n),e&&t!==void 0)throw TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${t}`)},Ue=(e,t)=>{if(e!==void 0&&typeof e!=`function`)throw TypeError(`Descriptor property "${t}" must be a function: ${e}`)},H=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`Descriptor property "${t}" must be a boolean: ${e}`)},We=e=>{let[t]=Object.keys(e);if(t!==void 0)throw TypeError(`Unknown descriptor property "${t}": ${e[t]}`)},Ge=(e,t,n)=>(Ke(e,t,Me(Re(e,t,n),U(e,t))),e),U=(e,t)=>{let n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n;let r=Object.getPrototypeOf(e);return r===null?{}:U(r,t)},Ke=(e,t,n)=>{try{Object.defineProperty(e,t,n)}catch{}},qe=(e,t,n)=>{if(n!==void 0)return W(e,t,n);try{delete e[t]}catch{}if(e[t]!==void 0)return W(e,t)},W=(e,t,n)=>{Ge(e,t,{value:n,...Je(t)})},Je=e=>typeof e==`string`&&e.startsWith(`_`)?{enumerable:!1}:{},Ye=(e,n,r={})=>{if(G(e,`First argument`),G(n,`Second argument`),!t(r))throw TypeError(`Options must be a plain object: ${r}`);let{soft:i=!1}=r;if(typeof i!=`boolean`)throw TypeError(`Option "soft" must be a boolean: ${i}`);return{soft:i}},G=(e,t)=>{if(e===void 0)throw TypeError(`${t} is required.`);if(!Xe(e))throw TypeError(`${t} must be a plain object or an error: ${e}`)},Xe=n=>t(n)||e(n),Ze=({error:e,props:t,propName:n,soft:r})=>Qe(n)||!tt.call(t,n)||r&&e[n]!==void 0,Qe=e=>e in $e||et.has(e),$e=Error(`check`),et=new Set([`prototype`,`errors`,`cause`]),{propertyIsEnumerable:tt}=Object.prototype,nt=(e,t,n)=>{let{soft:r}=Ye(e,t,n);for(let n of Reflect.ownKeys(t))rt({error:e,props:t,propName:n,soft:r});return e},rt=({error:e,props:t,propName:n,soft:r})=>{Ze({error:e,props:t,propName:n,soft:r})||qe(e,n,t[n])},K=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})},it=(e,t)=>{e.errors!==void 0&&K(e,`errors`,e.errors.map(e=>t(e).error).filter(Boolean))},at=({target:e,source:t,parent:n,child:r})=>{if(!q(e)){ot(e,t);return}q(t)&&K(e,`errors`,[...r.errors,...n.errors])},ot=(e,t)=>{t.errors!==void 0&&K(e,`errors`,t.errors)},q=e=>e.errors!==void 0&&e.errors.length!==0,st=(e,t,n=e.message)=>{if(typeof t!=`string`)throw TypeError(`newMessage must be a string: ${t}`);if(typeof n!=`string`)throw TypeError(`currentMessage must be a string: ${n}`);return n},ct=({name:e,stack:t},n,r)=>r!==``&&t.includes(r)?lt({name:e,stack:t,newMessage:n,currentMessage:r}):dt(e,t,n),lt=({name:e,stack:t,newMessage:n,currentMessage:r})=>{let[i,a]=ut(e,n,r).find(([e])=>t.includes(e));return t.replace(i,a)},ut=(e,t,n)=>[[`${e}: ${n}`,`${e}: ${t}`],[`: ${n}`,`: ${t}`],[`\n${n}`,`\n${t}`],[` ${n}`,` ${t}`],[n,t]],dt=(e,t,n)=>{let r=`${e}: `,i=n.trimEnd();return t===e||t.startsWith(`${e}\n`)?t.replace(e,`${r}${i}`):t.startsWith(r)?t.replace(r,`${r}${i}\n`):`${r}${i}\n${t}`},ft=(e,t,n)=>{let r=x(e),i=st(r,t,n);return Y(r,`message`,t),pt(r,t,i),r},pt=(e,t,n)=>{t===n||!mt()||Y(e,`stack`,ct(e,t,n))},mt=()=>{let{stack:e}=Error(J);return typeof e==`string`&&e.includes(J)},J=`set-error-message test message`,Y=(e,t,n)=>{Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})},X=(e,t,n)=>{if(typeof t!=`string`)throw TypeError(`Second argument must be a message string: ${t}`);let r=x(e);return ft(r,Z(t,r.message),n)},Z=(e,t)=>{let n=e.trim(),r=t.trim();return n===``?r:r===``?n:ht(n,r,e)},ht=(e,t,n)=>e.endsWith(gt)?n.endsWith(_t)?`${e}\n${t}`:`${e} ${t}`:`${t}\n${e}`,gt=`:`,_t=`
2
+ `,vt=({parent:e,child:t,target:n,stackError:r})=>{let i=e.message,a=r.message;return n.message=t.message,X(n,i,a)},yt=(e,t)=>Q(e)===t,Q=e=>typeof e==`object`&&e?e.stack:void 0,bt=({wrap:e,target:t,source:n,childHasStack:r})=>e===r?t:(K(t,`stack`,n.stack),n),xt=e=>{let{wrap:t,name:n}=e;return typeof t==`boolean`?(Object.hasOwn(e,`wrap`)&&delete e.wrap,t):n===`Error`},St=e=>$(e,[]).error,$=(e,t)=>{if(t.includes(e))return{};let n=n=>$(n,[...t,e]),r=Q(e),i=x(e,{shallow:!0}),a=yt(i,r);it(i,n);let{parent:o,childHasStack:s}=Ct(i,n);return{error:o,errorHasStack:a||s}},Ct=(e,t)=>{let n=xt(e);if(e.cause===void 0)return{parent:e,childHasStack:!1};let{error:r,errorHasStack:i}=t(e.cause);return delete e.cause,{parent:wt({parent:e,child:r,childHasStack:i,wrap:n}),childHasStack:i}},wt=({parent:e,child:t,childHasStack:n,wrap:r})=>{if(t===void 0)return e;let[i,a]=r?[t,e]:[e,t],o=bt({wrap:r,target:i,source:a,childHasStack:n}),s=vt({parent:e,child:t,target:je(i,i.constructor,o.name),stackError:o});return at({target:s,source:a,parent:e,child:t}),nt(s,a,{soft:!r})};export{X as n,St as t};