UNPKG

kompendium

Version:

Documentation generator for Stencil components

1 lines 550 kB
import{r as e,h as t,a as n}from"./p-9UrzenzW.js";import{g as i}from"./p-BFTU3MAI.js";import{g as r}from"./p-Ajsawr_9.js";import{a as o}from"./p-BAGXN2n6.js";function s(e){if(e){throw e}}var l;var a;function u(){if(a)return l;a=1;var e=Object.prototype.hasOwnProperty;var t=Object.prototype.toString;var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var r=function e(n){if(typeof Array.isArray==="function"){return Array.isArray(n)}return t.call(n)==="[object Array]"};var o=function n(i){if(!i||t.call(i)!=="[object Object]"){return false}var r=e.call(i,"constructor");var o=i.constructor&&i.constructor.prototype&&e.call(i.constructor.prototype,"isPrototypeOf");if(i.constructor&&!r&&!o){return false}var s;for(s in i){}return typeof s==="undefined"||e.call(i,s)};var s=function e(t,i){if(n&&i.name==="__proto__"){n(t,i.name,{enumerable:true,configurable:true,value:i.newValue,writable:true})}else{t[i.name]=i.newValue}};var u=function t(n,r){if(r==="__proto__"){if(!e.call(n,r)){return void 0}else if(i){return i(n,r).value}}return n[r]};l=function e(){var t,n,i,l,a,c;var f=arguments[0];var h=1;var d=arguments.length;var p=false;if(typeof f==="boolean"){p=f;f=arguments[1]||{};h=2}if(f==null||typeof f!=="object"&&typeof f!=="function"){f={}}for(;h<d;++h){t=arguments[h];if(t!=null){for(n in t){i=u(f,n);l=u(t,n);if(f!==l){if(p&&l&&(o(l)||(a=r(l)))){if(a){a=false;c=i&&r(i)?i:[]}else{c=i&&o(i)?i:{}}s(f,{name:n,newValue:e(p,c,l)})}else if(typeof l!=="undefined"){s(f,{name:n,newValue:l})}}}}}return f};return l}var c=u();var f=i(c);function h(e){if(typeof e!=="object"||e===null){return false}const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function d(){const e=[];const t={run:n,use:i};return t;function n(...t){let n=-1;const i=t.pop();if(typeof i!=="function"){throw new TypeError("Expected function as last argument, not "+i)}r(null,...t);function r(o,...s){const l=e[++n];let a=-1;if(o){i(o);return}while(++a<t.length){if(s[a]===null||s[a]===undefined){s[a]=t[a]}}t=s;if(l){p(l,r)(...s)}else{i(null,...s)}}}function i(n){if(typeof n!=="function"){throw new TypeError("Expected `middelware` to be a function, not "+n)}e.push(n);return t}}function p(e,t){let n;return i;function i(...t){const i=e.length>t.length;let s;if(i){t.push(r)}try{s=e.apply(this,t)}catch(e){const t=e;if(i&&n){throw t}return r(t)}if(!i){if(s&&s.then&&typeof s.then==="function"){s.then(o,r)}else if(s instanceof Error){r(s)}else{o(s)}}}function r(e,...i){if(!n){n=true;t(e,...i)}}function o(e){r(null,e)}}function m(e){if(!e||typeof e!=="object"){return""}if("position"in e||"type"in e){return b(e.position)}if("start"in e||"end"in e){return b(e)}if("line"in e||"column"in e){return g(e)}return""}function g(e){return k(e&&e.line)+":"+k(e&&e.column)}function b(e){return g(e&&e.start)+"-"+g(e&&e.end)}function k(e){return e&&typeof e==="number"?e:1}class y extends Error{constructor(e,t,n){super();if(typeof t==="string"){n=t;t=undefined}let i="";let r={};let o=false;if(t){if("line"in t&&"column"in t){r={place:t}}else if("start"in t&&"end"in t){r={place:t}}else if("type"in t){r={ancestors:[t],place:t.position}}else{r={...t}}}if(typeof e==="string"){i=e}else if(!r.cause&&e){o=true;i=e.message;r.cause=e}if(!r.ruleId&&!r.source&&typeof n==="string"){const e=n.indexOf(":");if(e===-1){r.ruleId=n}else{r.source=n.slice(0,e);r.ruleId=n.slice(e+1)}}if(!r.place&&r.ancestors&&r.ancestors){const e=r.ancestors[r.ancestors.length-1];if(e){r.place=e.position}}const s=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||undefined;this.cause=r.cause||undefined;this.column=s?s.column:undefined;this.fatal=undefined;this.file="";this.message=i;this.line=s?s.line:undefined;this.name=m(r.place)||"1:1";this.place=r.place||undefined;this.reason=this.message;this.ruleId=r.ruleId||undefined;this.source=r.source||undefined;this.stack=o&&r.cause&&typeof r.cause.stack==="string"?r.cause.stack:"";this.actual=undefined;this.expected=undefined;this.note=undefined;this.url=undefined}}y.prototype.file="";y.prototype.name="";y.prototype.reason="";y.prototype.message="";y.prototype.stack="";y.prototype.column=undefined;y.prototype.line=undefined;y.prototype.ancestors=undefined;y.prototype.cause=undefined;y.prototype.fatal=undefined;y.prototype.place=undefined;y.prototype.ruleId=undefined;y.prototype.source=undefined;const D={basename:w,dirname:E,extname:v,join:A,sep:"/"};function w(e,t){if(t!==undefined&&typeof t!=="string"){throw new TypeError('"ext" argument must be a string')}S(e);let n=0;let i=-1;let r=e.length;let o;if(t===undefined||t.length===0||t.length>e.length){while(r--){if(e.codePointAt(r)===47){if(o){n=r+1;break}}else if(i<0){o=true;i=r+1}}return i<0?"":e.slice(n,i)}if(t===e){return""}let s=-1;let l=t.length-1;while(r--){if(e.codePointAt(r)===47){if(o){n=r+1;break}}else{if(s<0){o=true;s=r+1}if(l>-1){if(e.codePointAt(r)===t.codePointAt(l--)){if(l<0){i=r}}else{l=-1;i=s}}}}if(n===i){i=s}else if(i<0){i=e.length}return e.slice(n,i)}function E(e){S(e);if(e.length===0){return"."}let t=-1;let n=e.length;let i;while(--n){if(e.codePointAt(n)===47){if(i){t=n;break}}else if(!i){i=true}}return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function v(e){S(e);let t=e.length;let n=-1;let i=0;let r=-1;let o=0;let s;while(t--){const l=e.codePointAt(t);if(l===47){if(s){i=t+1;break}continue}if(n<0){s=true;n=t+1}if(l===46){if(r<0){r=t}else if(o!==1){o=1}}else if(r>-1){o=-1}}if(r<0||n<0||o===0||o===1&&r===n-1&&r===i+1){return""}return e.slice(r,n)}function A(...e){let t=-1;let n;while(++t<e.length){S(e[t]);if(e[t]){n=n===undefined?e[t]:n+"/"+e[t]}}return n===undefined?".":C(n)}function C(e){S(e);const t=e.codePointAt(0)===47;let n=F(e,!t);if(n.length===0&&!t){n="."}if(n.length>0&&e.codePointAt(e.length-1)===47){n+="/"}return t?"/"+n:n}function F(e,t){let n="";let i=0;let r=-1;let o=0;let s=-1;let l;let a;while(++s<=e.length){if(s<e.length){l=e.codePointAt(s)}else if(l===47){break}else{l=47}if(l===47){if(r===s-1||o===1);else if(r!==s-1&&o===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){a=n.lastIndexOf("/");if(a!==n.length-1){if(a<0){n="";i=0}else{n=n.slice(0,a);i=n.length-1-n.lastIndexOf("/")}r=s;o=0;continue}}else if(n.length>0){n="";i=0;r=s;o=0;continue}}if(t){n=n.length>0?n+"/..":"..";i=2}}else{if(n.length>0){n+="/"+e.slice(r+1,s)}else{n=e.slice(r+1,s)}i=s-r-1}r=s;o=0}else if(l===46&&o>-1){o++}else{o=-1}}return n}function S(e){if(typeof e!=="string"){throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}}const x={cwd:T};function T(){return"/"}function O(e){return Boolean(e!==null&&typeof e==="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===undefined)}function N(e){if(typeof e==="string"){e=new URL(e)}else if(!O(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");t.code="ERR_INVALID_ARG_TYPE";throw t}if(e.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");e.code="ERR_INVALID_URL_SCHEME";throw e}return L(e)}function L(e){if(e.hostname!==""){const e=new TypeError('File URL host must be "localhost" or empty on darwin');e.code="ERR_INVALID_FILE_URL_HOST";throw e}const t=e.pathname;let n=-1;while(++n<t.length){if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const e=t.codePointAt(n+2);if(e===70||e===102){const e=new TypeError("File URL path must not include encoded / characters");e.code="ERR_INVALID_FILE_URL_PATH";throw e}}}return decodeURIComponent(t)}const I=["history","path","basename","stem","extname","dirname"];class _{constructor(e){let t;if(!e){t={}}else if(O(e)){t={path:e}}else if(typeof e==="string"||P(e)){t={value:e}}else{t=e}this.cwd="cwd"in t?"":x.cwd();this.data={};this.history=[];this.messages=[];let n=-1;while(++n<I.length){const e=I[n];if(e in t&&t[e]!==undefined&&t[e]!==null){this[e]=e==="history"?[...t[e]]:t[e]}}let i;for(i in t){if(!I.includes(i)){this[i]=t[i]}}}get basename(){return typeof this.path==="string"?D.basename(this.path):undefined}set basename(e){B(e,"basename");M(e,"basename");this.path=D.join(this.dirname||"",e)}get dirname(){return typeof this.path==="string"?D.dirname(this.path):undefined}set dirname(e){R(this.basename,"dirname");this.path=D.join(e||"",this.basename)}get extname(){return typeof this.path==="string"?D.extname(this.path):undefined}set extname(e){M(e,"extname");R(this.dirname,"extname");if(e){if(e.codePointAt(0)!==46){throw new Error("`extname` must start with `.`")}if(e.includes(".",1)){throw new Error("`extname` cannot contain multiple dots")}}this.path=D.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){if(O(e)){e=N(e)}B(e,"path");if(this.path!==e){this.history.push(e)}}get stem(){return typeof this.path==="string"?D.basename(this.path,this.extname):undefined}set stem(e){B(e,"stem");M(e,"stem");this.path=D.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const i=this.message(e,t,n);i.fatal=true;throw i}info(e,t,n){const i=this.message(e,t,n);i.fatal=undefined;return i}message(e,t,n){const i=new y(e,t,n);if(this.path){i.name=this.path+":"+i.name;i.file=this.path}i.fatal=false;this.messages.push(i);return i}toString(e){if(this.value===undefined){return""}if(typeof this.value==="string"){return this.value}const t=new TextDecoder(e||undefined);return t.decode(this.value)}}function M(e,t){if(e&&e.includes(D.sep)){throw new Error("`"+t+"` cannot be a path: did not expect `"+D.sep+"`")}}function B(e,t){if(!e){throw new Error("`"+t+"` cannot be empty")}}function R(e,t){if(!e){throw new Error("Setting `"+t+"` requires `path` to be set too")}}function P(e){return Boolean(e&&typeof e==="object"&&"byteLength"in e&&"byteOffset"in e)}const q=function(e){const t=this;const n=t.constructor;const i=n.prototype;const r=i[e];const o=function(){return r.apply(o,arguments)};Object.setPrototypeOf(o,i);return o};const U={}.hasOwnProperty;class j extends q{constructor(){super("copy");this.Compiler=undefined;this.Parser=undefined;this.attachers=[];this.compiler=undefined;this.freezeIndex=-1;this.frozen=undefined;this.namespace={};this.parser=undefined;this.transformers=d()}copy(){const e=new j;let t=-1;while(++t<this.attachers.length){const n=this.attachers[t];e.use(...n)}e.data(f(true,{},this.namespace));return e}data(e,t){if(typeof e==="string"){if(arguments.length===2){V("data",this.frozen);this.namespace[e]=t;return this}return U.call(this.namespace,e)&&this.namespace[e]||undefined}if(e){V("data",this.frozen);this.namespace=e;return this}return this.namespace}freeze(){if(this.frozen){return this}const e=this;while(++this.freezeIndex<this.attachers.length){const[t,...n]=this.attachers[this.freezeIndex];if(n[0]===false){continue}if(n[0]===true){n[0]=undefined}const i=t.call(e,...n);if(typeof i==="function"){this.transformers.use(i)}}this.frozen=true;this.freezeIndex=Number.POSITIVE_INFINITY;return this}parse(e){this.freeze();const t=Y(e);const n=this.parser||this.Parser;H("parse",n);return n(String(t),t)}process(e,t){const n=this;this.freeze();H("process",this.parser||this.Parser);$("process",this.compiler||this.Compiler);return t?i(undefined,t):new Promise(i);function i(i,r){const o=Y(e);const s=n.parse(o);n.run(s,o,(function(e,t,i){if(e||!t||!i){return l(e)}const r=t;const o=n.stringify(r,i);if(X(o)){i.value=o}else{i.result=o}l(e,i)}));function l(e,n){if(e||!n){r(e)}else if(i){i(n)}else{t(undefined,n)}}}}processSync(e){let t=false;let n;this.freeze();H("processSync",this.parser||this.Parser);$("processSync",this.compiler||this.Compiler);this.process(e,i);K("processSync","process",t);return n;function i(e,i){t=true;s(e);n=i}}run(e,t,n){G(e);this.freeze();const i=this.transformers;if(!n&&typeof t==="function"){n=t;t=undefined}return n?r(undefined,n):new Promise(r);function r(r,o){const s=Y(t);i.run(e,s,l);function l(t,i,s){const l=i||e;if(t){o(t)}else if(r){r(l)}else{n(undefined,l,s)}}}}runSync(e,t){let n=false;let i;this.run(e,t,r);K("runSync","run",n);return i;function r(e,t){s(e);i=t;n=true}}stringify(e,t){this.freeze();const n=Y(t);const i=this.compiler||this.Compiler;$("stringify",i);G(e);return i(e,n)}use(e,...t){const n=this.attachers;const i=this.namespace;V("use",this.frozen);if(e===null||e===undefined);else if(typeof e==="function"){l(e,t)}else if(typeof e==="object"){if(Array.isArray(e)){s(e)}else{o(e)}}else{throw new TypeError("Expected usable value, not `"+e+"`")}return this;function r(e){if(typeof e==="function"){l(e,[])}else if(typeof e==="object"){if(Array.isArray(e)){const[t,...n]=e;l(t,n)}else{o(e)}}else{throw new TypeError("Expected usable value, not `"+e+"`")}}function o(e){if(!("plugins"in e)&&!("settings"in e)){throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither")}s(e.plugins);if(e.settings){i.settings=f(true,i.settings,e.settings)}}function s(e){let t=-1;if(e===null||e===undefined);else if(Array.isArray(e)){while(++t<e.length){const n=e[t];r(n)}}else{throw new TypeError("Expected a list of plugins, not `"+e+"`")}}function l(e,t){let i=-1;let r=-1;while(++i<n.length){if(n[i][0]===e){r=i;break}}if(r===-1){n.push([e,...t])}else if(t.length>0){let[i,...o]=t;const s=n[r][1];if(h(s)&&h(i)){i=f(true,s,i)}n[r]=[e,i,...o]}}}}const z=(new j).freeze();function H(e,t){if(typeof t!=="function"){throw new TypeError("Cannot `"+e+"` without `parser`")}}function $(e,t){if(typeof t!=="function"){throw new TypeError("Cannot `"+e+"` without `compiler`")}}function V(e,t){if(t){throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}}function G(e){if(!h(e)||typeof e.type!=="string"){throw new TypeError("Expected node, got `"+e+"`")}}function K(e,t,n){if(!n){throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}}function Y(e){return W(e)?e:new _(e)}function W(e){return Boolean(e&&typeof e==="object"&&"message"in e&&"messages"in e)}function X(e){return typeof e==="string"||Q(e)}function Q(e){return Boolean(e&&typeof e==="object"&&"byteLength"in e&&"byteOffset"in e)}const J={};function Z(e,t){const n=J;const i=typeof n.includeImageAlt==="boolean"?n.includeImageAlt:true;const r=typeof n.includeHtml==="boolean"?n.includeHtml:true;return ee(e,i,r)}function ee(e,t,n){if(ne(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 te(e.children,t,n)}}if(Array.isArray(e)){return te(e,t,n)}return""}function te(e,t,n){const i=[];let r=-1;while(++r<e.length){i[r]=ee(e[r],t,n)}return i.join("")}function ne(e){return Boolean(e&&typeof e==="object")}const ie=document.createElement("i");function re(e){const t="&"+e+";";ie.innerHTML=t;const n=ie.textContent;if(n.charCodeAt(n.length-1)===59&&e!=="semi"){return false}return n===t?false:n}function oe(e,t,n,i){const r=e.length;let o=0;let s;if(t<0){t=-t>r?0:r+t}else{t=t>r?r:t}n=n>0?n:0;if(i.length<1e4){s=Array.from(i);s.unshift(t,n);e.splice(...s)}else{if(n)e.splice(t,n);while(o<i.length){s=i.slice(o,o+1e4);s.unshift(t,0);e.splice(...s);o+=1e4;t+=1e4}}}function se(e,t){if(e.length>0){oe(e,e.length,0,t);return e}return t}const le={}.hasOwnProperty;function ae(e){const t={};let n=-1;while(++n<e.length){ue(t,e[n])}return t}function ue(e,t){let n;for(n in t){const i=le.call(e,n)?e[n]:undefined;const r=i||(e[n]={});const o=t[n];let s;if(o){for(s in o){if(!le.call(r,s))r[s]=[];const e=o[s];ce(r[s],Array.isArray(e)?e:e?[e]:[])}}}}function ce(e,t){let n=-1;const i=[];while(++n<t.length){(t[n].add==="after"?e:i).push(t[n])}oe(e,0,0,i)}function fe(e,t){const n=Number.parseInt(e,t);if(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){return"�"}return String.fromCodePoint(n)}function he(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const de=Ce(/[A-Za-z]/);const pe=Ce(/[\dA-Za-z]/);const me=Ce(/[#-'*+\--9=?A-Z^-~]/);function ge(e){return e!==null&&(e<32||e===127)}const be=Ce(/\d/);const ke=Ce(/[\dA-Fa-f]/);const ye=Ce(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function we(e){return e!==null&&(e<0||e===32)}function Ee(e){return e===-2||e===-1||e===32}const ve=Ce(/\p{P}|\p{S}/u);const Ae=Ce(/\s/);function Ce(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Fe(e){const t=[];let n=-1;let i=0;let r=0;while(++n<e.length){const o=e.charCodeAt(n);let s="";if(o===37&&pe(e.charCodeAt(n+1))&&pe(e.charCodeAt(n+2))){r=2}else if(o<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))){s=String.fromCharCode(o)}}else if(o>55295&&o<57344){const t=e.charCodeAt(n+1);if(o<56320&&t>56319&&t<57344){s=String.fromCharCode(o,t);r=1}else{s="�"}}else{s=String.fromCharCode(o)}if(s){t.push(e.slice(i,n),encodeURIComponent(s));i=n+r+1;s=""}if(r){n+=r;r=0}}return t.join("")+e.slice(i)}function Se(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(i){if(Ee(i)){e.enter(n);return l(i)}return t(i)}function l(i){if(Ee(i)&&o++<r){e.consume(i);return l}e.exit(n);return t(i)}}const xe={tokenize:Te};function Te(e){const t=e.attempt(this.parser.constructs.contentInitial,i,r);let n;return t;function i(n){if(n===null){e.consume(n);return}e.enter("lineEnding");e.consume(n);e.exit("lineEnding");return Se(e,t,"linePrefix")}function r(t){e.enter("paragraph");return o(t)}function o(t){const i=e.enter("chunkText",{contentType:"text",previous:n});if(n){n.next=i}n=i;return s(t)}function s(t){if(t===null){e.exit("chunkText");e.exit("paragraph");e.consume(t);return}if(De(t)){e.consume(t);e.exit("chunkText");return o}e.consume(t);return s}}const Oe={tokenize:Le};const Ne={tokenize:Ie};function Le(e){const t=this;const n=[];let i=0;let r;let o;let s;return l;function l(r){if(i<n.length){const o=n[i];t.containerState=o[1];return e.attempt(o[0].continuation,a,u)(r)}return u(r)}function a(e){i++;if(t.containerState._closeFlow){t.containerState._closeFlow=undefined;if(r){k()}const n=t.events.length;let o=n;let s;while(o--){if(t.events[o][0]==="exit"&&t.events[o][1].type==="chunkFlow"){s=t.events[o][1].end;break}}b(i);let l=n;while(l<t.events.length){t.events[l][1].end={...s};l++}oe(t.events,o+1,0,t.events.slice(n));t.events.length=l;return u(e)}return l(e)}function u(o){if(i===n.length){if(!r){return h(o)}if(r.currentConstruct&&r.currentConstruct.concrete){return p(o)}t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}t.containerState={};return e.check(Ne,c,f)(o)}function c(e){if(r)k();b(i);return h(e)}function f(e){t.parser.lazy[t.now().line]=i!==n.length;s=t.now().offset;return p(e)}function h(n){t.containerState={};return e.attempt(Ne,d,p)(n)}function d(e){i++;n.push([t.currentConstruct,t.containerState]);return h(e)}function p(n){if(n===null){if(r)k();b(0);e.consume(n);return}r=r||t.parser.flow(t.now());e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o});return m(n)}function m(n){if(n===null){g(e.exit("chunkFlow"),true);b(0);e.consume(n);return}if(De(n)){e.consume(n);g(e.exit("chunkFlow"));i=0;t.interrupt=undefined;return l}e.consume(n);return m}function g(e,n){const l=t.sliceStream(e);if(n)l.push(null);e.previous=o;if(o)o.next=e;o=e;r.defineSkip(e.start);r.write(l);if(t.parser.lazy[e.start.line]){let e=r.events.length;while(e--){if(r.events[e][1].start.offset<s&&(!r.events[e][1].end||r.events[e][1].end.offset>s)){return}}const n=t.events.length;let o=n;let l;let a;while(o--){if(t.events[o][0]==="exit"&&t.events[o][1].type==="chunkFlow"){if(l){a=t.events[o][1].end;break}l=true}}b(i);e=n;while(e<t.events.length){t.events[e][1].end={...a};e++}oe(t.events,o+1,0,t.events.slice(n));t.events.length=e}}function b(i){let r=n.length;while(r-- >i){const i=n[r];t.containerState=i[1];i[0].exit.call(t,e)}n.length=i}function k(){r.write([null]);o=undefined;r=undefined;t.containerState._closeFlow=undefined}}function Ie(e,t,n){return Se(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?undefined:4)}function _e(e){if(e===null||we(e)||Ae(e)){return 1}if(ve(e)){return 2}}function Me(e,t,n){const i=[];let r=-1;while(++r<e.length){const o=e[r].resolveAll;if(o&&!i.includes(o)){t=o(t,n);i.push(o)}}return t}const Be={name:"attention",resolveAll:Re,tokenize:Pe};function Re(e,t){let n=-1;let i;let r;let o;let s;let l;let a;let u;let c;while(++n<e.length){if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){i=n;while(i--){if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3)){continue}a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[i][1].end};const h={...e[n][1].start};qe(f,-a);qe(h,a);s={type:a>1?"strongSequence":"emphasisSequence",start:f,end:{...e[i][1].end}};l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h};o={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}};r={type:a>1?"strong":"emphasis",start:{...s.start},end:{...l.end}};e[i][1].end={...s.start};e[n][1].start={...l.end};u=[];if(e[i][1].end.offset-e[i][1].start.offset){u=se(u,[["enter",e[i][1],t],["exit",e[i][1],t]])}u=se(u,[["enter",r,t],["enter",s,t],["exit",s,t],["enter",o,t]]);u=se(u,Me(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t));u=se(u,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",r,t]]);if(e[n][1].end.offset-e[n][1].start.offset){c=2;u=se(u,[["enter",e[n][1],t],["exit",e[n][1],t]])}else{c=0}oe(e,i-1,n-i+3,u);n=i+u.length-c-2;break}}}}n=-1;while(++n<e.length){if(e[n][1].type==="attentionSequence"){e[n][1].type="data"}}return e}function Pe(e,t){const n=this.parser.constructs.attentionMarkers.null;const i=this.previous;const r=_e(i);let o;return s;function s(t){o=t;e.enter("attentionSequence");return l(t)}function l(s){if(s===o){e.consume(s);return l}const a=e.exit("attentionSequence");const u=_e(s);const c=!u||u===2&&r||n.includes(s);const f=!r||r===2&&u||n.includes(i);a._open=Boolean(o===42?c:c&&(r||!f));a._close=Boolean(o===42?f:f&&(u||!c));return t(s)}}function qe(e,t){e.column+=t;e.offset+=t;e._bufferIndex+=t}const Ue={name:"autolink",tokenize:je};function je(e,t,n){let i=0;return r;function r(t){e.enter("autolink");e.enter("autolinkMarker");e.consume(t);e.exit("autolinkMarker");e.enter("autolinkProtocol");return o}function o(t){if(de(t)){e.consume(t);return s}if(t===64){return n(t)}return u(t)}function s(e){if(e===43||e===45||e===46||pe(e)){i=1;return l(e)}return u(e)}function l(t){if(t===58){e.consume(t);i=0;return a}if((t===43||t===45||t===46||pe(t))&&i++<32){e.consume(t);return l}i=0;return u(t)}function a(i){if(i===62){e.exit("autolinkProtocol");e.enter("autolinkMarker");e.consume(i);e.exit("autolinkMarker");e.exit("autolink");return t}if(i===null||i===32||i===60||ge(i)){return n(i)}e.consume(i);return a}function u(t){if(t===64){e.consume(t);return c}if(me(t)){e.consume(t);return u}return n(t)}function c(e){return pe(e)?f(e):n(e)}function f(n){if(n===46){e.consume(n);i=0;return c}if(n===62){e.exit("autolinkProtocol").type="autolinkEmail";e.enter("autolinkMarker");e.consume(n);e.exit("autolinkMarker");e.exit("autolink");return t}return h(n)}function h(t){if((t===45||pe(t))&&i++<63){const n=t===45?h:f;e.consume(t);return n}return n(t)}}const ze={partial:true,tokenize:He};function He(e,t,n){return i;function i(t){return Ee(t)?Se(e,r,"linePrefix")(t):r(t)}function r(e){return e===null||De(e)?t(e):n(e)}}const $e={continuation:{tokenize:Ge},exit:Ke,name:"blockQuote",tokenize:Ve};function Ve(e,t,n){const i=this;return r;function r(t){if(t===62){const n=i.containerState;if(!n.open){e.enter("blockQuote",{_container:true});n.open=true}e.enter("blockQuotePrefix");e.enter("blockQuoteMarker");e.consume(t);e.exit("blockQuoteMarker");return o}return n(t)}function o(n){if(Ee(n)){e.enter("blockQuotePrefixWhitespace");e.consume(n);e.exit("blockQuotePrefixWhitespace");e.exit("blockQuotePrefix");return t}e.exit("blockQuotePrefix");return t(n)}}function Ge(e,t,n){const i=this;return r;function r(t){if(Ee(t)){return Se(e,o,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?undefined:4)(t)}return o(t)}function o(i){return e.attempt($e,t,n)(i)}}function Ke(e){e.exit("blockQuote")}const Ye={name:"characterEscape",tokenize:We};function We(e,t,n){return i;function i(t){e.enter("characterEscape");e.enter("escapeMarker");e.consume(t);e.exit("escapeMarker");return r}function r(i){if(ye(i)){e.enter("characterEscapeValue");e.consume(i);e.exit("characterEscapeValue");e.exit("characterEscape");return t}return n(i)}}const Xe={name:"characterReference",tokenize:Qe};function Qe(e,t,n){const i=this;let r=0;let o;let s;return l;function l(t){e.enter("characterReference");e.enter("characterReferenceMarker");e.consume(t);e.exit("characterReferenceMarker");return a}function a(t){if(t===35){e.enter("characterReferenceMarkerNumeric");e.consume(t);e.exit("characterReferenceMarkerNumeric");return u}e.enter("characterReferenceValue");o=31;s=pe;return c(t)}function u(t){if(t===88||t===120){e.enter("characterReferenceMarkerHexadecimal");e.consume(t);e.exit("characterReferenceMarkerHexadecimal");e.enter("characterReferenceValue");o=6;s=ke;return c}e.enter("characterReferenceValue");o=7;s=be;return c(t)}function c(l){if(l===59&&r){const r=e.exit("characterReferenceValue");if(s===pe&&!re(i.sliceSerialize(r))){return n(l)}e.enter("characterReferenceMarker");e.consume(l);e.exit("characterReferenceMarker");e.exit("characterReference");return t}if(s(l)&&r++<o){e.consume(l);return c}return n(l)}}const Je={partial:true,tokenize:tt};const Ze={concrete:true,name:"codeFenced",tokenize:et};function et(e,t,n){const i=this;const r={partial:true,tokenize:w};let o=0;let s=0;let l;return a;function a(e){return u(e)}function u(t){const n=i.events[i.events.length-1];o=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],true).length:0;l=t;e.enter("codeFenced");e.enter("codeFencedFence");e.enter("codeFencedFenceSequence");return c(t)}function c(t){if(t===l){s++;e.consume(t);return c}if(s<3){return n(t)}e.exit("codeFencedFenceSequence");return Ee(t)?Se(e,f,"whitespace")(t):f(t)}function f(n){if(n===null||De(n)){e.exit("codeFencedFence");return i.interrupt?t(n):e.check(Je,m,D)(n)}e.enter("codeFencedFenceInfo");e.enter("chunkString",{contentType:"string"});return h(n)}function h(t){if(t===null||De(t)){e.exit("chunkString");e.exit("codeFencedFenceInfo");return f(t)}if(Ee(t)){e.exit("chunkString");e.exit("codeFencedFenceInfo");return Se(e,d,"whitespace")(t)}if(t===96&&t===l){return n(t)}e.consume(t);return h}function d(t){if(t===null||De(t)){return f(t)}e.enter("codeFencedFenceMeta");e.enter("chunkString",{contentType:"string"});return p(t)}function p(t){if(t===null||De(t)){e.exit("chunkString");e.exit("codeFencedFenceMeta");return f(t)}if(t===96&&t===l){return n(t)}e.consume(t);return p}function m(t){return e.attempt(r,D,g)(t)}function g(t){e.enter("lineEnding");e.consume(t);e.exit("lineEnding");return b}function b(t){return o>0&&Ee(t)?Se(e,k,"linePrefix",o+1)(t):k(t)}function k(t){if(t===null||De(t)){return e.check(Je,m,D)(t)}e.enter("codeFlowValue");return y(t)}function y(t){if(t===null||De(t)){e.exit("codeFlowValue");return k(t)}e.consume(t);return y}function D(n){e.exit("codeFenced");return t(n)}function w(e,t,n){let r=0;return o;function o(t){e.enter("lineEnding");e.consume(t);e.exit("lineEnding");return a}function a(t){e.enter("codeFencedFence");return Ee(t)?Se(e,u,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?undefined:4)(t):u(t)}function u(t){if(t===l){e.enter("codeFencedFenceSequence");return c(t)}return n(t)}function c(t){if(t===l){r++;e.consume(t);return c}if(r>=s){e.exit("codeFencedFenceSequence");return Ee(t)?Se(e,f,"whitespace")(t):f(t)}return n(t)}function f(i){if(i===null||De(i)){e.exit("codeFencedFence");return t(i)}return n(i)}}}function tt(e,t,n){const i=this;return r;function r(t){if(t===null){return n(t)}e.enter("lineEnding");e.consume(t);e.exit("lineEnding");return o}function o(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}const nt={name:"codeIndented",tokenize:rt};const it={partial:true,tokenize:ot};function rt(e,t,n){const i=this;return r;function r(t){e.enter("codeIndented");return Se(e,o,"linePrefix",4+1)(t)}function o(e){const t=i.events[i.events.length-1];return t&&t[1].type==="linePrefix"&&t[2].sliceSerialize(t[1],true).length>=4?s(e):n(e)}function s(t){if(t===null){return a(t)}if(De(t)){return e.attempt(it,s,a)(t)}e.enter("codeFlowValue");return l(t)}function l(t){if(t===null||De(t)){e.exit("codeFlowValue");return s(t)}e.consume(t);return l}function a(n){e.exit("codeIndented");return t(n)}}function ot(e,t,n){const i=this;return r;function r(t){if(i.parser.lazy[i.now().line]){return n(t)}if(De(t)){e.enter("lineEnding");e.consume(t);e.exit("lineEnding");return r}return Se(e,o,"linePrefix",4+1)(t)}function o(e){const o=i.events[i.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],true).length>=4?t(e):De(e)?r(e):n(e)}}const st={name:"codeText",previous:at,resolve:lt,tokenize:ut};function lt(e){let t=e.length-4;let n=3;let i;let r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){i=n;while(++i<t){if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding";e[t][1].type="codeTextPadding";n+=2;t-=2;break}}}i=n-1;t++;while(++i<=t){if(r===undefined){if(i!==t&&e[i][1].type!=="lineEnding"){r=i}}else if(i===t||e[i][1].type==="lineEnding"){e[r][1].type="codeTextData";if(i!==r+2){e[r][1].end=e[i-1][1].end;e.splice(r+2,i-r-2);t-=i-r-2;i=r+2}r=undefined}}return e}function at(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ut(e,t,n){let i=0;let r;let o;return s;function s(t){e.enter("codeText");e.enter("codeTextSequence");return l(t)}function l(t){if(t===96){e.consume(t);i++;return l}e.exit("codeTextSequence");return a(t)}function a(t){if(t===null){return n(t)}if(t===32){e.enter("space");e.consume(t);e.exit("space");return a}if(t===96){o=e.enter("codeTextSequence");r=0;return c(t)}if(De(t)){e.enter("lineEnding");e.consume(t);e.exit("lineEnding");return a}e.enter("codeTextData");return u(t)}function u(t){if(t===null||t===32||t===96||De(t)){e.exit("codeTextData");return a(t)}e.consume(t);return u}function c(n){if(n===96){e.consume(n);r++;return c}if(r===i){e.exit("codeTextSequence");e.exit("codeText");return t(n)}o.type="codeTextData";return u(n)}}class ct{constructor(e){this.left=e?[...e]:[];this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length){throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`")}if(e<this.left.length)return this.left[e];return this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){this.setCursor(0);return this.right.pop()}slice(e,t){const n=t===null||t===undefined?Number.POSITIVE_INFINITY:t;if(n<this.left.length){return this.left.slice(e,n)}if(e>this.left.length){return this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse()}return this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const i=t||0;this.setCursor(Math.trunc(e));const r=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);if(n)ft(this.left,n);return r.reverse()}pop(){this.setCursor(Number.POSITIVE_INFINITY);return this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY);this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY);ft(this.left,e)}unshift(e){this.setCursor(0);this.right.push(e)}unshiftMany(e){this.setCursor(0);ft(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)return;if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);ft(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);ft(this.left,t.reverse())}}}function ft(e,t){let n=0;if(t.length<1e4){e.push(...t)}else{while(n<t.length){e.push(...t.slice(n,n+1e4));n+=1e4}}}function ht(e){const t={};let n=-1;let i;let r;let o;let s;let l;let a;let u;const c=new ct(e);while(++n<c.length){while(n in t){n=t[n]}i=c.get(n);if(n&&i[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"){a=i[1]._tokenizer.events;o=0;if(o<a.length&&a[o][1].type==="lineEndingBlank"){o+=2}if(o<a.length&&a[o][1].type==="content"){while(++o<a.length){if(a[o][1].type==="content"){break}if(a[o][1].type==="chunkText"){a[o][1]._isInFirstContentOfListItem=true;o++}}}}if(i[0]==="enter"){if(i[1].contentType){Object.assign(t,dt(c,n));n=t[n];u=true}}else if(i[1]._container){o=n;r=undefined;while(o--){s=c.get(o);if(s[1].type==="lineEnding"||s[1].type==="lineEndingBlank"){if(s[0]==="enter"){if(r){c.get(r)[1].type="lineEndingBlank"}s[1].type="lineEnding";r=o}}else if(s[1].type==="linePrefix"||s[1].type==="listItemIndent");else{break}}if(r){i[1].end={...c.get(r)[1].start};l=c.slice(r,n);l.unshift(i);c.splice(r,n-r+1,l)}}}oe(e,0,Number.POSITIVE_INFINITY,c.slice(0));return!u}function dt(e,t){const n=e.get(t)[1];const i=e.get(t)[2];let r=t-1;const o=[];let s=n._tokenizer;if(!s){s=i.parser[n.contentType](n.start);if(n._contentTypeTextTrailing){s._contentTypeTextTrailing=true}}const l=s.events;const a=[];const u={};let c;let f;let h=-1;let d=n;let p=0;let m=0;const g=[m];while(d){while(e.get(++r)[1]!==d){}o.push(r);if(!d._tokenizer){c=i.sliceStream(d);if(!d.next){c.push(null)}if(f){s.defineSkip(d.start)}if(d._isInFirstContentOfListItem){s._gfmTasklistFirstContentOfListItem=true}s.write(c);if(d._isInFirstContentOfListItem){s._gfmTasklistFirstContentOfListItem=undefined}}f=d;d=d.next}d=n;while(++h<l.length){if(l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line){m=h+1;g.push(m);d._tokenizer=undefined;d.previous=undefined;d=d.next}}s.events=[];if(d){d._tokenizer=undefined;d.previous=undefined}else{g.pop()}h=g.length;while(h--){const t=l.slice(g[h],g[h+1]);const n=o.pop();a.push([n,n+t.length-1]);e.splice(n,2,t)}a.reverse();h=-1;while(++h<a.length){u[p+a[h][0]]=p+a[h][1];p+=a[h][1]-a[h][0]-1}return u}const pt={resolve:gt,tokenize:bt};const mt={partial:true,tokenize:kt};function gt(e){ht(e);return e}function bt(e,t){let n;return i;function i(t){e.enter("content");n=e.enter("chunkContent",{contentType:"content"});return r(t)}function r(t){if(t===null){return o(t)}if(De(t)){return e.check(mt,s,o)(t)}e.consume(t);return r}function o(n){e.exit("chunkContent");e.exit("content");return t(n)}function s(t){e.consume(t);e.exit("chunkContent");n.next=e.enter("chunkContent",{contentType:"content",previous:n});n=n.next;return r}}function kt(e,t,n){const i=this;return r;function r(t){e.exit("chunkContent");e.enter("lineEnding");e.consume(t);e.exit("lineEnding");return Se(e,o,"linePrefix")}function o(r){if(r===null||De(r)){return n(r)}const o=i.events[i.events.length-1];if(!i.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],true).length>=4){return t(r)}return e.interrupt(i.parser.constructs.flow,n,t)(r)}}function yt(e,t,n,i,r,o,s,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return f;function f(t){if(t===60){e.enter(i);e.enter(r);e.enter(o);e.consume(t);e.exit(o);return h}if(t===null||t===32||t===41||ge(t)){return n(t)}e.enter(i);e.enter(s);e.enter(l);e.enter("chunkString",{contentType:"string"});return m(t)}function h(n){if(n===62){e.enter(o);e.consume(n);e.exit(o);e.exit(r);e.exit(i);return t}e.enter(l);e.enter("chunkString",{contentType:"string"});return d(n)}function d(t){if(t===62){e.exit("chunkString");e.exit(l);return h(t)}if(t===null||t===60||De(t)){return n(t)}e.consume(t);return t===92?p:d}function p(t){if(t===60||t===62||t===92){e.consume(t);return d}return d(t)}function m(r){if(!c&&(r===null||r===41||we(r))){e.exit("chunkString");e.exit(l);e.exit(s);e.exit(i);return t(r)}if(c<u&&r===40){e.consume(r);c++;return m}if(r===41){e.consume(r);c--;return m}if(r===null||r===32||r===40||ge(r)){return n(r)}e.consume(r);return r===92?g:m}function g(t){if(t===40||t===41||t===92){e.consume(t);return m}return m(t)}}function Dt(e,t,n,i,r,o){const s=this;let l=0;let a;return u;function u(t){e.enter(i);e.enter(r);e.consume(t);e.exit(r);e.enter(o);return c}function c(u){if(l>999||u===null||u===91||u===93&&!a||u===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs){return n(u)}if(u===93){e.exit(o);e.enter(r);e.consume(u);e.exit(r);e.exit(i);return t}if(De(u)){e.enter("lineEnding");e.consume(u);e.exit("lineEnding");return c}e.enter("chunkString",{contentType:"string"});return f(u)}function f(t){if(t===null||t===91||t===93||De(t)||l++>999){e.exit("chunkString");return c(t)}e.consume(t);if(!a)a=!Ee(t);return t===92?h:f}function h(t){if(t===91||t===92||t===93){e.consume(t);l++;return f}return f(t)}}function wt(e,t,n,i,r,o){let s;return l;function l(t){if(t===34||t===39||t===40){e.enter(i);e.enter(r);e.consume(t);e.exit(r);s=t===40?41:t;return a}return n(t)}function a(n){if(n===s){e.enter(r);e.consume(n);e.exit(r);e.exit(i);return t}e.enter(o);return u(n)}function u(t){if(t===s){e.exit(o);return a(s)}if(t===null){return n(t)}if(De(t)){e.enter("lineEnding");e.consume(t);e.exit("lineEnding");return Se(e,u,"linePrefix")}e.enter("chunkString",{contentType:"string"});return c(t)}function c(t){if(t===s||t===null||De(t)){e.exit("chunkString");return u(t)}e.consume(t);return t===92?f:c}function f(t){if(t===s||t===92){e.consume(t);return c}return c(t)}}function Et(e,t){let n;return i;function i(r){if(De(r)){e.enter("lineEnding");e.consume(r);e.exit("lineEnding");n=true;return i}if(Ee(r)){return Se(e,i,n?"linePrefix":"lineSuffix")(r)}return t(r)}}const vt={name:"definition",tokenize:Ct};const At={partial:true,tokenize:Ft};function Ct(e,t,n){const i=this;let r;return o;function o(t){e.enter("definition");return s(t)}function s(t){return Dt.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}function l(t){r=he(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1));if(t===58){e.enter("definitionMarker");e.consume(t);e.exit("definitionMarker");return a}return n(t)}function a(t){return we(t)?Et(e,u)(t):u(t)}function u(t){return yt(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function c(t){return e.attempt(At,f,f)(t)}function f(t){return Ee(t)?Se(e,h,"whitespace")(t):h(t)}function h(o){if(o===null||De(o)){e.exit("definition");i.parser.defined.push(r);return t(o)}return n(o)}}function Ft(e,t,n){return i;function i(t){return we(t)?Et(e,r)(t):n(t)}function r(t){return wt(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return Ee(t)?Se(e,s,"whitespace")(t):s(t)}function s(e){return e===null||De(e)?t(e):n(e)}}const St={name:"hardBreakEscape",tokenize:xt};function xt(e,t,n){return i;function i(t){e.enter("hardBreakEscape");e.consume(t);return r}function r(i){if(De(i)){e.exit("hardBreakEscape");return t(i)}return n(i)}}const Tt={name:"headingAtx",resolve:Ot,tokenize:Nt};function Ot(e,t){let n=e.length-2;let i=3;let r;let o;if(e[i][1].type==="whitespace"){i+=2}if(n-2>i&&e[n][1].type==="whitespace"){n-=2}if(e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")){n-=i+1===n?2:4}if(n>i){r={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end};o={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"};oe(e,i,n-i+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])}return e}function Nt(e,t,n){let i=0;return r;function r(t){e.enter("atxHeading");return o(t)}function o(t){e.enter("atxHeadingSequence");return s(t)}function s(t){if(t===35&&i++<6){e.consume(t);return s}if(t===null||we(t)){e.exit("atxHeadingSequence");return l(t)}return n(t)}function l(n){if(n===35){e.enter("atxHeadingSequence");return a(n)}if(n===null||De(n)){e.exit("atxHeading");return t(n)}if(Ee(n)){return Se(e,l,"whitespace")(n)}e.enter("atxHeadingText");return u(n)}function a(t){if(t===35){e.consume(t);return a}e.exit("atxHeadingSequence");return l(t)}function u(t){if(t===null||t===35||we(t)){e.exit("atxHeadingText");return l(t)}e.consume(t);return u}}const Lt=["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"];const It=["pre","script","style","textarea"];const _t={concrete:true,name:"htmlFlow",resolveTo:Rt,tokenize:Pt};const Mt={partial:true,tokenize:Ut};const Bt={partial:true,tokenize:qt};function Rt(e){let t=e.length;while(t--){if(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"){break}}if(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)}return e}function Pt(e,t,n){const i=this;let r;let o;let s;let l;let a;return u;function u(e){return c(e)}function c(t){e.enter("htmlFlow");e.enter("htmlFlowData");e.consume(t);return f}function f(l){if(l===33){e.consume(l);return h}if(l===47){e.consume(l);o=true;return m}if(l===63){e.consume(l);r=3;return i.interrupt?t:B}if(de(l)){e.consume(l);s=String.fromCharCode(l);return g}return n(l)}function h(o){if(o===45){e.consume(o);r=2;return d}if(o===91){e.consume(o);r=5;l=0;return p}if(de(o)){e.consume(o);r=4;return i.interrupt?t:B}return n(o)}function d(r){if(r===45){e.consume(r);return i.interrupt?t:B}return n(r)}function p(r){const o="CDATA[";if(r===o.charCodeAt(l++)){e.consume(r);if(l===o.length){return i.interrupt?t:x}return p}return n(r)}function m(t){if(de(t)){e.consume(t);s=String.fromCharCode(t);return g}return n(t)}function g(l){if(l===null||l===47||l===62||we(l)){const a=l===47;const u=s.toLowerCase();if(!a&&!o&&It.includes(u)){r=1;return i.interrupt?t(l):x(l)}if(Lt.includes(s.toLowerCase())){r=6;if(a){e.consume(l);return b}return i.interrupt?t(l):x(l)}r=7;return i.interrupt&&!i.parser.lazy[i.now().line]?n(l):o?k(l):y(l)}if(l===45||pe(l)){e.consume(l);s+=String.fromCharCode(l);return g}return n(l)}function b(r){if(r===62){e.consume(r);return i.interrupt?t:x}return n(r)}function k(t){if(Ee(t)){e.consume(t);return k}return F(t)}function y(t){if(t===47){e.consume(t);return F}if(t===58||t===95||de(t)){e.consume(t);return D}if(Ee(t)){e.consume(t);return y}return F(t)}function D(t){if(t===45||t===46||t===58||t===95||pe(t)){e.consume(t);return D}return w(t)}function w(t){if(t===61){e.consume(t);return E}if(Ee(t)){e.consume(t);return w}return y(t)}function E(t){if(t===null||t===60||t===61||t===62||t===96){return n(t)}if(t===34||t===39){e.consume(t);a=t;return v}if(Ee(t)){e.consume(t);return E}return A(t)}function v(t){if(t===a){e.consume(t);a=null;return C}if(t===null||De(t)){return n(t)}e.consume(t);return v}function A(t){if(t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||we(t)){return w(t)}e.consume(t);return A}function C(e){if(e===47||e===62||Ee(e)){return y(e)}return n(e)}function F(t){if(t===62){e.consume(t);return S}return n(t)}function S(t){if(t===null||De(t)){return x(t)}if(Ee(t)){e.consume(t);return S}return n(t)}function x(t){if(t===45&&r===2){e.consume(t);return L}if(t===60&&r===1){e.consume(t);return I}if(t===62&&r===4){e.consume(t);return R}if(t===63&&r===3){e.consume(t);return B}if(t===93&&r===5){e.consume(t);return M}if(De(t)&&(r===6||r===7)){e.exit("htmlFlowData");return e.check(Mt,P,T)(t)}if(t===null||De(t)){e.exit("htmlFlowData");return T(t)}e.consume(t);return x}function T(t){return e.check(Bt,O,P)(t)}function O(t){e.enter("lineEnding");e.consume(t);e.exit("lineEnding");return N}function N(t){if(t===null||De(t)){return T(t)}e.enter("htmlFlowData");return x(t)}function L(t){if(t===45){e.consume(t);return B}return x(t)}function I(t){if(t===47){e.consume(t);s="";return _}return x(t)}function _(t){if(t===62){const n=s.toLowerCase();if(It.includes(n)){e.consume(t);return R}return x(t)}if(de(t)&&s.length<8){e.consume(t);s+=String.fromCharCode(t);return _}return x(t)}function M(t){if(t===93){e.consume(t);return B}return x(t)}function B(t){if(t===62){e.consume(t);return R}if(t===45&&r===2){e.consume(t);return B}return x(t)}function R(t){if(t===null||De(t)){e.exit("htmlFlowData");return P(t)}e.consume(t);return R}function P(n){e.exit("htmlFlow");return t(n)}}function qt(e,t,n){const i=this;return r;function r(t){if(De(t)){e.enter("lineEnding");e.consume(t);e.exit("lineEnding");return o}return n(t)}function o(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}function Ut(e,t,n){return i;function i(i){e.enter("lineEnding");e.consume(i);e.exit("lineEnding");return e.attempt(ze,t,n)}}const jt={name:"htmlText",tokenize:zt};function zt(e,t,n){const i=this;let r;let o;let s;return l;function l(t){e.enter("htmlText");e.enter("htmlTextData");e.consume(t);return a}function a(t){if(t===33){e.consume(t);return u}if(t===47){e.consume(t);return w}if(t===63){e.consume(t);return y}if(de(t)){e.consume(t);return A}return n(t)}function u(t){if(t===45){e.consume(t);return c}if(t===91){e.consume(t);o=0;return p}if(de(t)){e.consume(t);return k}return n(t)}function c(t){if(t===45){e.consume(t);return d}return n(t)}function f(t){if(t===null){return n(t)}if(t===45){e.consume(t);return h}if(De(t)){s=f;return I(t)}e.consume(t);return f}function h(t){if(t===45){e.consume(t);return d}return f(t)}function d(e){return e===62?L(e):e===45?h(e):f(e)}function p(t){const i="CDATA[";if(t===i.charCodeAt(o++)){e.consume(t);return o===i.length?m:p}return n(t)}function m(t){if(t===null){return n(t)}if(t===93){e.consume(t);return g}if(De(t)){s=m;return I(t)}e.consume(t);return m}function g(t){if(t===93){e.consume(t);return b}return m(t)}function b(t){if(t===62){return L(t)}if(t===93){e.consume(t);return b}return m(t)}function k(t){if(t===null||t===62){return L(t)}if(De(t)){s=k;return I(t)}e.consume(t);return k}function y(t){if(t===null){return n(t)}if(t===63){e.consume(t);return D}if(De(t)){s=y;return I(t)}e.consume(t);return y}function D(e){return e===62?L(e):y(e)}function w(t){if(de(t)){e.consume(t);return E}return n(t)}function E(t){if(t===45||pe(t)){e.consume(t);return E}return v(t)}function v(t){if(De(t)){s=v;return I(t)}if(Ee(t)){e.consume(t);return v}return L(t)}function A(t){if(t===45||pe(t)){e.consume(t);return A}if(t===47||t===62||we(t)){return C(t)}return n(t)}function C(t){if(t===47){e.consume(t);return L}if(t===58||t===95||de(t)){e.consume(t);return F}if(De(t)){s=C;return I(t)}if(Ee(t)){e.consume(t);return C}return L(t)}function F(t){if(t===45||t===46||t===58||t===95||pe(t)){e.consume(t);return F}return S(t)}function S(t){if(t===61){e.consume(t);return x}if(De(t)){s=S;return I(t)}if(Ee(t)){e.consume(t);return S}return C(t)}function x(t){if(t===null||t===60||t===61||t===62||t===96){return n(t)}if(t===34||t===39){e.consume(t);r=t;return T}if(De(t)){s=x;return I(t)}if(Ee(t)){e.consume(t);return x}e.consume(t);return O}function T(t){if(t===r){e.consume(t);r=undefined;return N}if(t===null){return n(t)}if(De(t)){s=T;return I(t)}e.consume(t);return T}function O(t){if(t===null||t===34||t===39||t===60||t===61||t===96){return n(t)}if(t===47||t===62||we(t)){return C(t)}e.consume(t);return O}function N(e){if(e===47||e===62||we(e)){return C(e)}return n(e)}function L(i){if(i===62){e.consume(i);e.exit("htmlTextData");e.exit("htmlText");return t}return n(i)}function I(t){e.exit("htmlTextData");e.enter("lineEnding");e.consume(t);e.exit("lineEnding");return _}function _(t){return Ee(t)?Se(e,M,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?undefined:4)(t):M(t)}function M(t){e.enter("htmlTextData");return s(t)}}const Ht={name:"labelEnd",resolveAll:Kt,resolveTo:Yt,tokenize:Wt};const $t={tokenize:Xt};const Vt={tokenize:Qt};const Gt={tokenize:Jt};function Kt(e){let t=-1;const n=[];while(++t<e.length){const i=e[t][1];n.push(e[t]);if(i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const e=i.type==="labelImage"?4:2;i.type="data";t+=e}}if(e.length!==n.length){oe(e,0,e.length,n)}return e}function Yt(e,t){let n=e.length;let i=0;let r;let o;let s;let l;while(n--){r=e[n][1];if(o){if(r.type==="link"||r.type==="labelLink"&&r._inactive){break}if(e[n][0]==="enter"&&r.type==="labelLink"){r._inactive=true}}else if(s){if(e[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced){o=n;if(r.type!=="labelLink"){i=2;break}}}else if(r.type==="labelEnd"){s=n}}const a={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};const u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}};const c={type:"labelText",start:{...e[o+i+2][1].end},end:{...e[s-2][1].start}};l=[["enter",a,t],["enter",u,t]];l=se(l,e.slice(o+1,o+i+3));l=se(l,[["enter",c,t]]);l=se(l,Me(t.parser.constructs.insideSpan.null,e.slice(o+i+4,s-3),t));l=se(l,[["exit",c,t],e[s-2],e[s-1],["exit",u,t]]);l=se(l,e.slice(s+1));l=se(l,[["exit",a,t]]);oe(e,o,e.length,l);return e}function Wt(e,t,n){const i=this;let r=i.events.length;let o;let s;while(r--){if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){o=i.events[r][1];break}}return l;function l(t){if(!o){return