var w=!1,u={false:"push",true:"unshift",after:"push",before:"unshift"},m={isPermalinkSymbol:!0};function g(t,e,s,n){var a;if(!w){var r="Using deprecated markdown-it-anchor permalink option, see https://github.com/valeriangalliat/markdown-it-anchor#todo-anchor-or-file";typeof process=="object"&&process&&process.emitWarning?process.emitWarning(r):console.warn(r),w=!0}var o=[Object.assign(new s.Token("link_open","a",1),{attrs:[].concat(e.permalinkClass?[["class",e.permalinkClass]]:[],[["href",e.permalinkHref(t,s)]],Object.entries(e.permalinkAttrs(t,s)))}),Object.assign(new s.Token("html_block","",0),{content:e.permalinkSymbol,meta:m}),new s.Token("link_close","a",-1)];e.permalinkSpace&&s.tokens[n+1].children[u[e.permalinkBefore]](Object.assign(new s.Token("text","",0),{content:" "})),(a=s.tokens[n+1].children)[u[e.permalinkBefore]].apply(a,o)}function T(t){return"#"+t}function j(t){return{}}var x={class:"header-anchor",symbol:"#",renderHref:T,renderAttrs:j};function k(t){function e(s){return s=Object.assign({},e.defaults,s),function(n,a,r,o){return t(n,s,a,r,o)}}return e.defaults=Object.assign({},x),e.renderPermalinkImpl=t,e}var h=k(function(t,e,s,n,a){var r,o=[Object.assign(new n.Token("link_open","a",1),{attrs:[].concat(e.class?[["class",e.class]]:[],[["href",e.renderHref(t,n)]],e.ariaHidden?[["aria-hidden","true"]]:[],Object.entries(e.renderAttrs(t,n)))}),Object.assign(new n.Token("html_inline","",0),{content:e.symbol,meta:m}),new n.Token("link_close","a",-1)];if(e.space){var l=typeof e.space=="string"?e.space:" ";n.tokens[a+1].children[u[e.placement]](Object.assign(new n.Token(typeof e.space=="string"?"html_inline":"text","",0),{content:l}))}(r=n.tokens[a+1].children)[u[e.placement]].apply(r,o)});Object.assign(h.defaults,{space:!0,placement:"after",ariaHidden:!1});var d=k(h.renderPermalinkImpl);d.defaults=Object.assign({},h.defaults,{ariaHidden:!0});var _=k(function(t,e,s,n,a){var r=[Object.assign(new n.Token("link_open","a",1),{attrs:[].concat(e.class?[["class",e.class]]:[],[["href",e.renderHref(t,n)]],Object.entries(e.renderAttrs(t,n)))})].concat(e.safariReaderFix?[new n.Token("span_open","span",1)]:[],n.tokens[a+1].children,e.safariReaderFix?[new n.Token("span_close","span",-1)]:[],[new n.Token("link_close","a",-1)]);n.tokens[a+1]=Object.assign(new n.Token("inline","",0),{children:r})});Object.assign(_.defaults,{safariReaderFix:!1});var v=k(function(t,e,s,n,a){var r;if(!["visually-hidden","aria-label","aria-describedby","aria-labelledby"].includes(e.style))throw new Error("`permalink.linkAfterHeader` called with unknown style option `"+e.style+"`");if(!["aria-describedby","aria-labelledby"].includes(e.style)&&!e.assistiveText)throw new Error("`permalink.linkAfterHeader` called without the `assistiveText` option in `"+e.style+"` style");if(e.style==="visually-hidden"&&!e.visuallyHiddenClass)throw new Error("`permalink.linkAfterHeader` called without the `visuallyHiddenClass` option in `visually-hidden` style");var o=n.tokens[a+1].children.filter(function(p){return p.type==="text"||p.type==="code_inline"}).reduce(function(p,y){return p+y.content},""),l=[],i=[];if(e.class&&i.push(["class",e.class]),i.push(["href",e.renderHref(t,n)]),i.push.apply(i,Object.entries(e.renderAttrs(t,n))),e.style==="visually-hidden"){if(l.push(Object.assign(new n.Token("span_open","span",1),{attrs:[["class",e.visuallyHiddenClass]]}),Object.assign(new n.Token("text","",0),{content:e.assistiveText(o)}),new n.Token("span_close","span",-1)),e.space){var b=typeof e.space=="string"?e.space:" ";l[u[e.placement]](Object.assign(new n.Token(typeof e.space=="string"?"html_inline":"text","",0),{content:b}))}l[u[e.placement]](Object.assign(new n.Token("span_open","span",1),{attrs:[["aria-hidden","true"]]}),Object.assign(new n.Token("html_inline","",0),{content:e.symbol,meta:m}),new n.Token("span_close","span",-1))}else l.push(Object.assign(new n.Token("html_inline","",0),{content:e.symbol,meta:m}));e.style==="aria-label"?i.push(["aria-label",e.assistiveText(o)]):["aria-describedby","aria-labelledby"].includes(e.style)&&i.push([e.style,t]);var c=[Object.assign(new n.Token("link_open","a",1),{attrs:i})].concat(l,[new n.Token("link_close","a",-1)]);(r=n.tokens).splice.apply(r,[a+3,0].concat(c)),e.wrapper&&(n.tokens.splice(a,0,Object.assign(new n.Token("html_block","",0),{content:e.wrapper[0]+`
`})),n.tokens.splice(a+3+c.length+1,0,Object.assign(new n.Token("html_block","",0),{content:e.wrapper[1]+`
`})))});function O(t,e,s,n){var a=t,r=n;if(s&&Object.prototype.hasOwnProperty.call(e,a))throw new Error("User defined `id` attribute `"+t+"` is not unique. Please fix it in your Markdown to continue.");for(;Object.prototype.hasOwnProperty.call(e,a);)a=t+"-"+r,r+=1;return e[a]=!0,a}function f(t,e){e=Object.assign({},f.defaults,e),t.core.ruler.push("anchor",function(s){for(var n,a={},r=s.tokens,o=Array.isArray(e.level)?(n=e.level,function(p){return n.includes(p)}):function(p){return function(y){return y>=p}}(e.level),l=0;l<r.length;l++){var i=r[l];if(i.type==="heading_open"&&o(Number(i.tag.substr(1)))){var b=e.getTokensText(r[l+1].children),c=i.attrGet("id");c=c==null?O(e.slugify(b),a,!1,e.uniqueSlugStartIndex):O(c,a,!0,e.uniqueSlugStartIndex),i.attrSet("id",c),e.tabIndex!==!1&&i.attrSet("tabindex",""+e.tabIndex),typeof e.permalink=="function"?e.permalink(c,e,s,l):(e.permalink||e.renderPermalink&&e.renderPermalink!==g)&&e.renderPermalink(c,e,s,l),l=r.indexOf(i),e.callback&&e.callback(i,{slug:c,title:b})}}})}Object.assign(v.defaults,{style:"visually-hidden",space:!0,placement:"after",wrapper:null}),f.permalink={__proto__:null,legacy:g,renderHref:T,renderAttrs:j,makePermalink:k,linkInsideHeader:h,ariaHidden:d,headerLink:_,linkAfterHeader:v},f.defaults={level:1,slugify:function(t){return encodeURIComponent(String(t).trim().toLowerCase().replace(/\s+/g,"-"))},uniqueSlugStartIndex:1,tabIndex:"-1",getTokensText:function(t){return t.filter(function(e){return["text","code_inline"].includes(e.type)}).map(function(e){return e.content}).join("")},permalink:!1,renderPermalink:g,permalinkClass:d.defaults.class,permalinkSpace:d.defaults.space,permalinkSymbol:"\xB6",permalinkBefore:d.defaults.placement==="before",permalinkHref:d.defaults.renderHref,permalinkAttrs:d.defaults.renderAttrs},f.default=f;export{f as b};
