t.indent&&(e.length=0);break;default:e.length=0}}e.length>=2&&(s=n.sep.splice(e[1]))}switch(this.type){case"anchor":case"tag":return void(r||n.value?(s.push(this.sourceToken),t.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken));case"explicit-key-ind":return n.sep||n.explicitKey?r||n.value?(s.push(this.sourceToken),t.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(n.start.push(this.sourceToken),n.explicitKey=!0),void(this.onKeyLine=!0);case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Su(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Tu(n.key)&&!Su(n.sep,"newline")){const t=Iu(n.start),e=n.key,r=n.sep;r.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:e,sep:r}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(Su(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const t=Iu(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?t.items.push({start:s,key:null,sep:[this.sourceToken]}):Su(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const e=this.flowScalar(this.type);return void(r||n.value?(t.items.push({start:s,key:e,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(e):(Object.assign(n,{key:e,sep:[]}),this.onKeyLine=!0))}default:{const r=this.startBlockValue(t);if(r){if("block-seq"===r.type){if(!n.explicitKey&&n.sep&&!Su(n.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else e&&t.items.push({start:s});return void this.stack.push(r)}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var e;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const e="end"in n.value?n.value.end:void 0,r=Array.isArray(e)?e[e.length-1]:void 0;"comment"===(null==r?void 0:r.type)?null==e||e.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],s=null==(e=null==r?void 0:r.value)?void 0:e.end;if(Array.isArray(s))return Fu(s,n.start),s.push(this.sourceToken),void t.items.pop()}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;return void n.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==t.indent)break;return void(n.value||Su(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken))}if(this.indent>t.indent){const e=this.startBlockValue(t);if(e)return void this.stack.push(e)}yield*this.pop(),yield*this.step()}*flowCollection(t){const e=t.items[t.items.length-1];if("flow-error-end"===this.type){let t;do{yield*this.pop(),t=this.peek(1)}while("flow-collection"===(null==t?void 0:t.type))}else if(0===t.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!e||e.sep?t.items.push({start:[this.sourceToken]}):e.start.push(this.sourceToken));case"map-value-ind":return void(!e||e.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):Object.assign(e,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!e||e.value?t.items.push({start:[this.sourceToken]}):e.sep?e.sep.push(this.sourceToken):e.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!e||e.value?t.items.push({start:[],key:n,sep:[]}):e.sep?this.stack.push(n):Object.assign(e,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void t.end.push(this.sourceToken)}const n=this.startBlockValue(t);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const e=this.peek(2);if("block-map"===e.type&&("map-value-ind"===this.type&&e.indent===t.indent||"newline"===this.type&&!e.items[e.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==e.type){const n=Iu(Nu(e));Lu(t);const r=t.end.splice(1,t.end.length);r.push(this.sourceToken);const s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let t=this.source.indexOf("\n")+1;for(;0!==t;)this.onNewLine(this.offset+t),t=this.source.indexOf("\n",t)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const e=Iu(Nu(t));return e.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const e=Iu(Nu(t));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,e){return"comment"===this.type&&(!(this.indent<=e)&&t.every(t=>"newline"===t.type||"space"===t.type))}*documentEnd(t){"doc-mode"!==this.type&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}function Ou(t,e={}){const{lineCounter:n,prettyErrors:r}=function(t){const e=!1!==t.prettyErrors;return{lineCounter:t.lineCounter||e&&new Cu||null,prettyErrors:e}}(e),s=new qu(null==n?void 0:n.addNewLine),i=new bu(e);let o=null;for(const e of i.compose(s.parse(t),!0,t.length))if(o){if("silent"!==o.options.logLevel){o.errors.push(new Gl(e.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else o=e;return r&&n&&(o.errors.forEach(Zl(t,n)),o.warnings.forEach(Zl(t,n))),o}const Bu={name:"frontmatter",transform:t=>(t.beforeParse.tap((t,e)=>{var n;const{content:r}=e;if(!/^---\r?\n/.test(r))return;const s=/\n---\r?\n/.exec(r);if(!s)return;const i=r.slice(4,s.index).trimEnd();let o;try{o=function(t,e,n){let r;const s=Ou(t,n);if(!s)return null;if(s.warnings.forEach(t=>Tc(s.options.logLevel,t)),s.errors.length>0){if("silent"!==s.options.logLevel)throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}(i.replace(/\r?\n|\r/g,"\n")),(null==o?void 0:o.markmap)&&(o.markmap=function(t){if(!t)return;return["color","extraJs","extraCss"].forEach(e=>{null!=t[e]&&(t[e]=function(t){let e;"string"==typeof t?e=[t]:Array.isArray(t)&&(e=t.filter(t=>t&&"string"==typeof t));return(null==e?void 0:e.length)?e:void 0}(t[e]))}),["duration","maxWidth","initialExpandLevel"].forEach(e=>{null!=t[e]&&(t[e]=function(t){if(isNaN(+t))return;return+t}(t[e]))}),t}(o.markmap))}catch{return}e.frontmatter=o,e.parserOptions={...e.parserOptions,...null==(n=null==o?void 0:o.markmap)?void 0:n.htmlParser},e.frontmatterInfo={lines:r.slice(0,s.index).split("\n").length+1,offset:s.index+s[0].length}}),{})};function Mu(t,e){return"script"===e.type&&e.data.src?{...e,data:{...e.data,src:t.getFullUrl(e.data.src)}}:e}function $u(t,e){return"stylesheet"===e.type&&e.data.href?{...e,data:{...e.data,href:t.getFullUrl(e.data.href)}}:e}const Pu="hljs",ju=["@highlightjs/cdn-assets@11.11.1/highlight.min.js"].map(t=>_(t)),Ru=["@highlightjs/cdn-assets@11.11.1/styles/default.min.css"].map(t=>E(t)),zu={name:Pu,config:{versions:{hljs:"11.11.1"},preloadScripts:ju,styles:Ru},transform(t){var e,n,r;let s;const o=(null==(n=null==(e=zu.config)?void 0:e.preloadScripts)?void 0:n.map(e=>Mu(t.transformer.urlBuilder,e)))||[];let a=i;return t.parser.tap(e=>{e.set({highlight:(e,n)=>{a();const{hljs:r}=window;return r?r.highlightAuto(e,n?[n]:void 0).value:((s||(s=A(o)),s).then(()=>{t.retransform.call()}),e)}})}),t.beforeParse.tap((t,e)=>{a=()=>{e.features[Pu]=!0}}),{styles:null==(r=zu.config)?void 0:r.styles}}};const Uu="katex",Vu=["katex@0.16.47/dist/katex.min.js"].map(t=>_(t)),Ku=_("webfontloader@1.6.28/webfontloader.js");Ku.data.defer=!0;const Hu={versions:{katex:"0.16.47",webfontloader:"1.6.28"},preloadScripts:Vu,scripts:[{type:"iife",data:{fn:t=>{window.WebFontConfig={custom:{families:["KaTeX_AMS","KaTeX_Caligraphic:n4,n7","KaTeX_Fraktur:n4,n7","KaTeX_Main:n4,n7,i4,i7","KaTeX_Math:i4,i7","KaTeX_Script","KaTeX_SansSerif:n4,n7,i4","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4","KaTeX_Typewriter"]},active:()=>{t().refreshHook.call()}}},getParams:({getMarkmap:t})=>[t]}},Ku],styles:["katex@0.16.47/dist/katex.min.css"].map(t=>E(t)),resources:["katex@0.16.47/dist/fonts/KaTeX_AMS-Regular.woff2","katex@0.16.47/dist/fonts/KaTeX_Caligraphic-Bold.woff2","katex@0.16.47/dist/fonts/KaTeX_Caligraphic-Regular.woff2","katex@0.16.47/dist/fonts/KaTeX_Fraktur-Bold.woff2","katex@0.16.47/dist/fonts/KaTeX_Fraktur-Regular.woff2","katex@0.16.47/dist/fonts/KaTeX_Main-Bold.woff2","katex@0.16.47/dist/fonts/KaTeX_Main-BoldItalic.woff2","katex@0.16.47/dist/fonts/KaTeX_Main-Italic.woff2","katex@0.16.47/dist/fonts/KaTeX_Main-Regular.woff2","katex@0.16.47/dist/fonts/KaTeX_Math-BoldItalic.woff2","katex@0.16.47/dist/fonts/KaTeX_Math-Italic.woff2","katex@0.16.47/dist/fonts/KaTeX_SansSerif-Bold.woff2","katex@0.16.47/dist/fonts/KaTeX_SansSerif-Italic.woff2","katex@0.16.47/dist/fonts/KaTeX_SansSerif-Regular.woff2","katex@0.16.47/dist/fonts/KaTeX_Script-Regular.woff2","katex@0.16.47/dist/fonts/KaTeX_Size1-Regular.woff2","katex@0.16.47/dist/fonts/KaTeX_Size2-Regular.woff2","katex@0.16.47/dist/fonts/KaTeX_Size3-Regular.woff2","katex@0.16.47/dist/fonts/KaTeX_Size4-Regular.woff2","katex@0.16.47/dist/fonts/KaTeX_Typewriter-Regular.woff2"]};function Gu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Wu,Zu;var Ju=function(){if(Zu)return Wu;Zu=1;var t=e;function n(t,e){var n,r,s=t.posMax,i=!0,o=!0;return n=e>0?t.src.charCodeAt(e-1):-1,r=e+1<=s?t.src.charCodeAt(e+1):-1,(32===n||9===n||r>=48&&r<=57)&&(o=!1),32!==r&&9!==r||(i=!1),{can_open:i,can_close:o}}function r(t,e){var r,s,i,o;if("$"!==t.src[t.pos])return!1;if(!n(t,t.pos).can_open)return e||(t.pending+="$"),t.pos+=1,!0;for(s=r=t.pos+1;-1!==(s=t.src.indexOf("$",s));){for(o=s-1;"\\"===t.src[o];)o-=1;if((s-o)%2==1)break;s+=1}return-1===s?(e||(t.pending+="$"),t.pos=r,!0):s-r===0?(e||(t.pending+="$$"),t.pos=r+1,!0):n(t,s).can_close?(e||((i=t.push("math_inline","math",0)).markup="$",i.content=t.src.slice(r,s)),t.pos=s+1,!0):(e||(t.pending+="$"),t.pos=r,!0)}function s(t,e,n,r){var s,i,o,a,c,l=!1,u=t.bMarks[e]+t.tShift[e],h=t.eMarks[e];if(u+2>h)return!1;if("$$"!==t.src.slice(u,u+2))return!1;if(u+=2,s=t.src.slice(u,h),r)return!0;for("$$"===s.trim().slice(-2)&&(s=s.trim().slice(0,-2),l=!0),o=e;!l&&!(++o>=n)&&!((u=t.bMarks[o]+t.tShift[o])<(h=t.eMarks[o])&&t.tShift[o]/g,">").replace(/"/g,""").replace(/'/g,"'")}return Wu=function(e,n){n=n||{};e.inline.ruler.after("escape","math_inline",r),e.block.ruler.after("blockquote","math_block",s,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.math_inline=function(e,r){return function(e){n.displayMode=!1;try{return t.renderToString(e,n)}catch(t){return n.throwOnError&&console.log(t),`${i(e)}`}}(e[r].content)},e.renderer.rules.math_block=function(e,r){return function(e){n.displayMode=!0;try{return""+t.renderToString(e,n)+"
"}catch(t){return n.throwOnError&&console.log(t),`${i(e)}
`}}(e[r].content)+"\n"}}}();const Xu=(Qu=Gu(Ju)).default||Qu;var Qu;const Yu={name:Uu,config:Hu,transform(t){var e,n,r,s;let o;const a=(null==(n=null==(e=Yu.config)?void 0:e.preloadScripts)?void 0:n.map(e=>Mu(t.transformer.urlBuilder,e)))||[],c=(e,n)=>{const{katex:r}=window;return r?r.renderToString(e,{displayMode:n,throwOnError:!1}):((o||(o=A(a)),o).then(()=>{t.retransform.call()}),e)};let l=i;return t.parser.tap(t=>{t.use(Xu),["math_block","math_inline"].forEach(e=>{t.renderer.rules[e]=(t,e)=>{l();return c(t[e].content,!!t[e].block)}})}),t.beforeParse.tap((t,e)=>{l=()=>{e.features[Uu]=!0}}),t.afterParse.tap((t,e)=>{var n;const r=null==(n=e.frontmatter)?void 0:n.markmap;r&&["extraJs","extraCss"].forEach(t=>{var e,n;const s=r[t];var i,o,a;s&&(r[t]=(i=s,o=Uu,a=(null==(n=null==(e=Yu.config)?void 0:e.versions)?void 0:n.katex)||"",i.map(t=>{if("string"==typeof t&&!t.includes("://")){t.startsWith("npm:")||(t=`npm:${t}`);const e=4+o.length;t.startsWith(`npm:${o}/`)&&(t=`${t.slice(0,e)}@${a}${t.slice(e)}`)}return t})))})}),{styles:null==(r=Yu.config)?void 0:r.styles,scripts:null==(s=Yu.config)?void 0:s.scripts}}},th=[Bu,Yu,zu,{name:"npmUrl",transform:t=>(t.afterParse.tap((e,n)=>{const{frontmatter:r}=n,s=null==r?void 0:r.markmap;s&&["extraJs","extraCss"].forEach(e=>{const n=s[e];n&&(s[e]=n.map(e=>e.startsWith("npm:")?t.transformer.urlBuilder.getFullUrl(e.slice(4)):e))})}),{})},Ca,{name:"sourceLines",transform(t){let e=0;return t.beforeParse.tap((t,n)=>{var r;e=(null==(r=n.frontmatterInfo)?void 0:r.lines)||0}),t.parser.tap(t=>{t.renderer.renderAttrs=o(t.renderer.renderAttrs,(t,n)=>{if(n.block&&n.map){const t=n.map.map(t=>t+e);n.attrSet("data-lines",t.join(","))}return t(n)}),t.renderer.rules.fence&&(t.renderer.rules.fence=o(t.renderer.rules.fence,(t,n,r,...s)=>{let i=t(n,r,...s);const o=n[r];if(i.startsWith("")&&o.map){const t=o.map.map(t=>t+e);i=i.slice(0,4)+` data-lines="${t.join(",")}"`+i.slice(4)}return i}))}),{}}}];function eh(t){for(;!t.content&&1===t.children.length;)t=t.children[0];for(;1===t.children.length&&!t.children[0].content;)t={...t,children:t.children[0].children};return{...t,children:t.children.map(eh)}}t.Transformer=class{constructor(t=th){this.assetsMap={},this.urlBuilder=new r,this.hooks={transformer:this,parser:new s,beforeParse:new s,afterParse:new s,retransform:new s},this.plugins=t.map(t=>"function"==typeof t?t():t);const e={};for(const{name:t,transform:n}of this.plugins)e[t]=n(this.hooks);this.assetsMap=e;const n=function(){const t=ga({html:!0,breaks:!0});t.use(ya).use(ba).use(wa).use(Ea);const e=t.renderer.rules.link_open||((t,e,n,r,s)=>s.renderToken(t,e,n));return t.renderer.rules.link_open=(t,n,r,s,i)=>(t[n].attrSet("target","_blank"),t[n].attrSet("rel","noopener noreferrer"),e(t,n,r,s,i)),t}();this.md=n,this.hooks.parser.call(n)}transform(t,e){var n;const r={content:t,features:{},parserOptions:e};this.hooks.beforeParse.call(this.md,r);let{content:s}=r;r.frontmatterInfo&&(s=s.slice(r.frontmatterInfo.offset));const i=this.md.render(s,{});this.hooks.afterParse.call(this.md,r);const{root:o,relations:a}=As(i,r.parserOptions),c=eh(o);return c.content||(c.content=`${(null==(n=r.frontmatter)?void 0:n.title)||""}`),{...r,root:c,relations:a}}resolveJS(t){return Mu(this.urlBuilder,t)}resolveCSS(t){return $u(this.urlBuilder,t)}getAssets(t){const e=[],n=[];t??(t=this.plugins.map(t=>t.name));for(const r of t.map(t=>this.assetsMap[t]))r&&(r.styles&&e.push(...r.styles),r.scripts&&n.push(...r.scripts));return{styles:e.map(t=>this.resolveCSS(t)),scripts:n.map(t=>this.resolveJS(t))}}getUsedAssets(t){const e=this.plugins.map(t=>t.name).filter(e=>t[e]);return this.getAssets(e)}},t.builtInPlugins=th,t.patchCSSItem=$u,t.patchJSItem=Mu,t.transformerVersions={"markmap-lib":"0.18.12"},Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}(this.markmap=this.markmap||{},window.katex);