var e=require("mdast-util-from-markdown"),t=require("micromark-extension-frontmatter"),r=require("mdast-util-frontmatter"),n=require("memoizee"),o=require("yaml"),i=require("toml"),a=require("mustache"),u=require("did-you-mean");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=/*#__PURE__*/l(n),f=/*#__PURE__*/l(o),d=/*#__PURE__*/l(i),p=/*#__PURE__*/l(a),s=/*#__PURE__*/l(u);function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function v(e,t,r){return v=m()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&h(o,r.prototype),o},v.apply(null,arguments)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var b=c.default(function(e){return e.trim().toLowerCase().replace(/[,&\- \\/]+/g,"_").replace(/[`()+={}[\]#@'!"|.?*%$"]+/g,"")}),x=c.default(function(n){var o=e.fromMarkdown(n,{extensions:[t.frontmatter(["yaml","toml"])],mdastExtensions:[r.frontmatterFromMarkdown(["yaml","toml"])]}),i=o.children.find(function(e){return"yaml"===e.type||"toml"===e.type});return{ast:o,info:i=i?"yaml"===i.type?f.default.parse(i.value):d.default.parse(i.value):{}}}),w=c.default(function(e){return x(e).ast.children.reduce(function(e,t,r){if("heading"===t.type&&2===t.depth){var n=b(t.children.find(function(e){return"text"===e.type}).value);return[].concat(e,[n])}return e},[])}),j=c.default(function(e){for(var t=x(e).ast,r={},n=0;n