UNPKG

antd-form-data

Version:

```shell npm install --save antd-form-data ```

1 lines 1.01 MB
import React,{useState,forwardRef,useEffect,createContext}from"react";import{Input,Row,Col,Checkbox,Form,Upload,TreeSelect,Rate,Slider,ColorPicker,TimePicker,DatePicker,Cascader,Select,Radio,Switch,AutoComplete,InputNumber,Space,Button}from"antd";function _iterableToArrayLimit(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var n,r,i,s,o=[],l=!0,c=!1;try{if(i=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;l=!1}else for(;!(l=(n=i.call(a)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=a.return&&(s=a.return(),Object(s)!==s))return}finally{if(c)throw r}}return o}}function ownKeys(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(a),!0).forEach((function(t){_defineProperty(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}function _defineProperty(e,t,a){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var a,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}function _objectWithoutProperties(e,t){if(null==e)return{};var a,n,r=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _getDefaults(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let _defaults=_getDefaults();function changeDefaults(e){_defaults=e}const escapeTest$1=/[&<>"']/,escapeReplace$1=new RegExp(escapeTest$1.source,"g"),escapeTestNoEncode$1=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode$1=new RegExp(escapeTestNoEncode$1.source,"g"),escapeReplacements$1={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},getEscapeReplacement$1=e=>escapeReplacements$1[e];function escape$1$1(e,t){if(t){if(escapeTest$1.test(e))return e.replace(escapeReplace$1,getEscapeReplacement$1)}else if(escapeTestNoEncode$1.test(e))return e.replace(escapeReplaceNoEncode$1,getEscapeReplacement$1);return e}const unescapeTest=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function unescape(e){return e.replace(unescapeTest,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const caret=/(^|[^\[])\^/g;function edit(e,t){let a="string"==typeof e?e:e.source;t=t||"";const n={replace:(e,t)=>{let r="string"==typeof t?t:t.source;return r=r.replace(caret,"$1"),a=a.replace(e,r),n},getRegex:()=>new RegExp(a,t)};return n}function cleanUrl(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const noopTest={exec:()=>null};function splitCells(e,t){const a=e.replace(/\|/g,((e,t,a)=>{let n=!1,r=t;for(;--r>=0&&"\\"===a[r];)n=!n;return n?"|":" |"})).split(/ \|/);let n=0;if(a[0].trim()||a.shift(),a.length>0&&!a[a.length-1].trim()&&a.pop(),t)if(a.length>t)a.splice(t);else for(;a.length<t;)a.push("");for(;n<a.length;n++)a[n]=a[n].trim().replace(/\\\|/g,"|");return a}function rtrim(e,t,a){const n=e.length;if(0===n)return"";let r=0;for(;r<n;){const i=e.charAt(n-r-1);if(i!==t||a){if(i===t||!a)break;r++}else r++}return e.slice(0,n-r)}function findClosingBracket(e,t){if(-1===e.indexOf(t[1]))return-1;let a=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if(e[n]===t[0])a++;else if(e[n]===t[1]&&(a--,a<0))return n;return-1}function outputLink(e,t,a,n){const r=t.href,i=t.title?escape$1$1(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:a,href:r,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,e}return{type:"image",raw:a,href:r,title:i,text:escape$1$1(s)}}function indentCodeCompensation(e,t){const a=e.match(/^(\s+)(?:```)/);if(null===a)return t;const n=a[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[a]=t;return a.length>=n.length?e.slice(n.length):e})).join("\n")}class _Tokenizer{options;rules;lexer;constructor(e){this.options=e||_defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:rtrim(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],a=indentCodeCompensation(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:a}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=rtrim(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=rtrim(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),a=this.lexer.state.top;this.lexer.state.top=!0;const n=this.lexer.blockTokens(e);return this.lexer.state.top=a,{type:"blockquote",raw:t[0],tokens:n,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let a=t[1].trim();const n=a.length>1,r={type:"list",raw:"",ordered:n,start:n?+a.slice(0,-1):"",loose:!1,items:[]};a=n?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=n?a:"[*+-]");const i=new RegExp(`^( {0,3}${a})((?:[\t ][^\\n]*)?(?:\\n|$))`);let s="",o="",l=!1;for(;e;){let a=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;s=t[0],e=e.substring(s.length);let n=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],_=0;this.options.pedantic?(_=2,o=n.trimStart()):(_=t[2].search(/[^ ]/),_=_>4?1:_,o=n.slice(_),_+=t[1].length);let d=!1;if(!n&&/^ *$/.test(c)&&(s+=c+"\n",e=e.substring(c.length+1),a=!0),!a){const t=new RegExp(`^ {0,${Math.min(3,_-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),a=new RegExp(`^ {0,${Math.min(3,_-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=new RegExp(`^ {0,${Math.min(3,_-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,_-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(c=l,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(c))break;if(i.test(c))break;if(t.test(c))break;if(a.test(e))break;if(c.search(/[^ ]/)>=_||!c.trim())o+="\n"+c.slice(_);else{if(d)break;if(n.search(/[^ ]/)>=4)break;if(r.test(n))break;if(i.test(n))break;if(a.test(n))break;o+="\n"+c}d||c.trim()||(d=!0),s+=l+"\n",e=e.substring(l.length+1),n=c.slice(_)}}r.loose||(l?r.loose=!0:/\n *\n *$/.test(s)&&(l=!0));let u,p=null;this.options.gfm&&(p=/^\[[ xX]\] /.exec(o),p&&(u="[ ] "!==p[0],o=o.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:s,task:!!p,checked:u,loose:!1,text:o,tokens:[]}),r.raw+=s}r.items[r.items.length-1].raw=s.trimEnd(),r.items[r.items.length-1].text=o.trimEnd(),r.raw=r.raw.trimEnd();for(let e=0;e<r.items.length;e++)if(this.lexer.state.top=!1,r.items[e].tokens=this.lexer.blockTokens(r.items[e].text,[]),!r.loose){const t=r.items[e].tokens.filter((e=>"space"===e.type)),a=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));r.loose=a}if(r.loose)for(let e=0;e<r.items.length;e++)r.items[e].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),a=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:a,title:n}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const a=splitCells(t[1]),n=t[2].replace(/^\||\| *$/g,"").split("|"),r=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(a.length===n.length){for(const e of n)/^ *-+: *$/.test(e)?i.align.push("right"):/^ *:-+: *$/.test(e)?i.align.push("center"):/^ *:-+ *$/.test(e)?i.align.push("left"):i.align.push(null);for(const e of a)i.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of r)i.rows.push(splitCells(e,i.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:escape$1$1(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=rtrim(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=findClosingBracket(t[2],"()");if(e>-1){const a=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let a=t[2],n="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);e&&(a=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return a=a.trim(),/^</.test(a)&&(a=this.options.pedantic&&!/>$/.test(e)?a.slice(1):a.slice(1,-1)),outputLink(t,{href:a?a.replace(this.rules.inline.anyPunctuation,"$1"):a,title:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n},t[0],this.lexer)}}reflink(e,t){let a;if((a=this.rules.inline.reflink.exec(e))||(a=this.rules.inline.nolink.exec(e))){const e=t[(a[2]||a[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=a[0].charAt(0);return{type:"text",raw:e,text:e}}return outputLink(a,e,a[0],this.lexer)}}emStrong(e,t,a=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n)return;if(n[3]&&a.match(/[\p{L}\p{N}]/u))return;if(!(n[1]||n[2]||"")||!a||this.rules.inline.punctuation.exec(a)){const a=[...n[0]].length-1;let r,i,s=a,o=0;const l="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+a);null!=(n=l.exec(t));){if(r=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!r)continue;if(i=[...r].length,n[3]||n[4]){s+=i;continue}if((n[5]||n[6])&&a%3&&!((a+i)%3)){o+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+o);const t=[...n[0]][0].length,l=e.slice(0,a+n.index+t+i);if(Math.min(a,i)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const a=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return a&&n&&(e=e.substring(1,e.length-1)),e=escape$1$1(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,a;return"@"===t[2]?(e=escape$1$1(t[1]),a="mailto:"+e):(e=escape$1$1(t[1]),a=e),{type:"link",raw:t[0],text:e,href:a,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,a;if("@"===t[2])e=escape$1$1(t[0]),a="mailto:"+e;else{let n;do{n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(n!==t[0]);e=escape$1$1(t[0]),a="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:a,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:escape$1$1(t[0]),{type:"text",raw:t[0],text:e}}}}const newline=/^(?: *(?:\n|$))+/,blockCode=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bullet=/(?:[*+-]|\d{1,9}[.)])/,lheading=edit(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,bullet).getRegex(),_paragraph=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,blockText=/^[^\n]+/,_blockLabel=/(?!\s*\])(?:\\.|[^\[\]\\])+/,def=edit(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",_blockLabel).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),list=edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bullet).getRegex(),_tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",_comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,html=edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",_comment).replace("tag",_tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),paragraph=edit(_paragraph).replace("hr",hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex(),blockquote=edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",paragraph).getRegex(),blockNormal={blockquote:blockquote,code:blockCode,def:def,fences:fences,heading:heading,hr:hr,html:html,lheading:lheading,list:list,newline:newline,paragraph:paragraph,table:noopTest,text:blockText},gfmTable=edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex(),blockGfm={...blockNormal,table:gfmTable,paragraph:edit(_paragraph).replace("hr",hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gfmTable).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex()},blockPedantic={...blockNormal,html:edit("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",_comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:noopTest,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:edit(_paragraph).replace("hr",hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",lheading).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},escape$2=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,inlineCode=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br=/^( {2,}|\\)\n(?!\s*$)/,inlineText=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_punctuation="\\p{P}$+<=>`^|~",punctuation=edit(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,_punctuation).getRegex(),blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,emStrongLDelim=edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,_punctuation).getRegex(),emStrongRDelimAst=edit("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,_punctuation).getRegex(),emStrongRDelimUnd=edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,_punctuation).getRegex(),anyPunctuation=edit(/\\([punct])/,"gu").replace(/punct/g,_punctuation).getRegex(),autolink=edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),_inlineComment=edit(_comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),tag=edit("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_inlineComment).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_inlineLabel=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,link=edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",_inlineLabel).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),reflink=edit(/^!?\[(label)\]\[(ref)\]/).replace("label",_inlineLabel).replace("ref",_blockLabel).getRegex(),nolink=edit(/^!?\[(ref)\](?:\[\])?/).replace("ref",_blockLabel).getRegex(),reflinkSearch=edit("reflink|nolink(?!\\()","g").replace("reflink",reflink).replace("nolink",nolink).getRegex(),inlineNormal={_backpedal:noopTest,anyPunctuation:anyPunctuation,autolink:autolink,blockSkip:blockSkip,br:br,code:inlineCode,del:noopTest,emStrongLDelim:emStrongLDelim,emStrongRDelimAst:emStrongRDelimAst,emStrongRDelimUnd:emStrongRDelimUnd,escape:escape$2,link:link,nolink:nolink,punctuation:punctuation,reflink:reflink,reflinkSearch:reflinkSearch,tag:tag,text:inlineText,url:noopTest},inlinePedantic={...inlineNormal,link:edit(/^!?\[(label)\]\((.*?)\)/).replace("label",_inlineLabel).getRegex(),reflink:edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_inlineLabel).getRegex()},inlineGfm={...inlineNormal,escape:edit(escape$2).replace("])","~|])").getRegex(),url:edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},inlineBreaks={...inlineGfm,br:edit(br).replace("{2,}","*").getRegex(),text:edit(inlineGfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},block={normal:blockNormal,gfm:blockGfm,pedantic:blockPedantic},inline={normal:inlineNormal,gfm:inlineGfm,breaks:inlineBreaks,pedantic:inlinePedantic};class _Lexer{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_defaults,this.options.tokenizer=this.options.tokenizer||new _Tokenizer,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:block.normal,inline:inline.normal};this.options.pedantic?(t.block=block.pedantic,t.inline=inline.pedantic):this.options.gfm&&(t.block=block.gfm,this.options.breaks?t.inline=inline.breaks:t.inline=inline.gfm),this.tokenizer.rules=t}static get rules(){return{block:block,inline:inline}}static lex(e,t){return new _Lexer(t).lex(e)}static lexInline(e,t){return new _Lexer(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){let a,n,r,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,a)=>t+" ".repeat(a.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((n=>!!(a=n.call({lexer:this},e,t))&&(e=e.substring(a.raw.length),t.push(a),!0)))))if(a=this.tokenizer.space(e))e=e.substring(a.raw.length),1===a.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(a);else if(a=this.tokenizer.code(e))e=e.substring(a.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?t.push(a):(n.raw+="\n"+a.raw,n.text+="\n"+a.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(a=this.tokenizer.fences(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.heading(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.hr(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.blockquote(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.list(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.html(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.def(e))e=e.substring(a.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title}):(n.raw+="\n"+a.raw,n.text+="\n"+a.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(a=this.tokenizer.table(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.lheading(e))e=e.substring(a.raw.length),t.push(a);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const a=e.slice(1);let n;this.options.extensions.startBlock.forEach((e=>{n=e.call({lexer:this},a),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(a=this.tokenizer.paragraph(r)))n=t[t.length-1],i&&"paragraph"===n.type?(n.raw+="\n"+a.raw,n.text+="\n"+a.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(a),i=r.length!==e.length,e=e.substring(a.raw.length);else if(a=this.tokenizer.text(e))e=e.substring(a.raw.length),n=t[t.length-1],n&&"text"===n.type?(n.raw+="\n"+a.raw,n.text+="\n"+a.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(a);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let a,n,r,i,s,o,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,i.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(s||(o=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(a=n.call({lexer:this},e,t))&&(e=e.substring(a.raw.length),t.push(a),!0)))))if(a=this.tokenizer.escape(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.tag(e))e=e.substring(a.raw.length),n=t[t.length-1],n&&"text"===a.type&&"text"===n.type?(n.raw+=a.raw,n.text+=a.text):t.push(a);else if(a=this.tokenizer.link(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(a.raw.length),n=t[t.length-1],n&&"text"===a.type&&"text"===n.type?(n.raw+=a.raw,n.text+=a.text):t.push(a);else if(a=this.tokenizer.emStrong(e,l,o))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.codespan(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.br(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.del(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.autolink(e))e=e.substring(a.raw.length),t.push(a);else if(this.state.inLink||!(a=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const a=e.slice(1);let n;this.options.extensions.startInline.forEach((e=>{n=e.call({lexer:this},a),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(a=this.tokenizer.inlineText(r))e=e.substring(a.raw.length),"_"!==a.raw.slice(-1)&&(o=a.raw.slice(-1)),s=!0,n=t[t.length-1],n&&"text"===n.type?(n.raw+=a.raw,n.text+=a.text):t.push(a);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(a.raw.length),t.push(a);return t}}class _Renderer{options;constructor(e){this.options=e||_defaults}code(e,t,a){const n=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",n?'<pre><code class="language-'+escape$1$1(n)+'">'+(a?e:escape$1$1(e,!0))+"</code></pre>\n":"<pre><code>"+(a?e:escape$1$1(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,a){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,a){const n=t?"ol":"ul";return"<"+n+(t&&1!==a?' start="'+a+'"':"")+">\n"+e+"</"+n+">\n"}listitem(e,t,a){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const a=t.header?"th":"td";return(t.align?`<${a} align="${t.align}">`:`<${a}>`)+e+`</${a}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,a){const n=cleanUrl(e);if(null===n)return a;let r='<a href="'+(e=n)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+a+"</a>",r}image(e,t,a){const n=cleanUrl(e);if(null===n)return a;let r=`<img src="${e=n}" alt="${a}"`;return t&&(r+=` title="${t}"`),r+=">",r}text(e){return e}}class _TextRenderer{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,a){return""+a}image(e,t,a){return""+a}br(){return""}}class _Parser{options;renderer;textRenderer;constructor(e){this.options=e||_defaults,this.options.renderer=this.options.renderer||new _Renderer,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new _TextRenderer}static parse(e,t){return new _Parser(t).parse(e)}static parseInline(e,t){return new _Parser(t).parseInline(e)}parse(e,t=!0){let a="";for(let n=0;n<e.length;n++){const r=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const e=r,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){a+=t||"";continue}}switch(r.type){case"space":continue;case"hr":a+=this.renderer.hr();continue;case"heading":{const e=r;a+=this.renderer.heading(this.parseInline(e.tokens),e.depth,unescape(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=r;a+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=r;let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(n);let i="";for(let t=0;t<e.rows.length;t++){const a=e.rows[t];n="";for(let t=0;t<a.length;t++)n+=this.renderer.tablecell(this.parseInline(a[t].tokens),{header:!1,align:e.align[t]});i+=this.renderer.tablerow(n)}a+=this.renderer.table(t,i);continue}case"blockquote":{const e=r,t=this.parse(e.tokens);a+=this.renderer.blockquote(t);continue}case"list":{const e=r,t=e.ordered,n=e.start,i=e.loose;let s="";for(let t=0;t<e.items.length;t++){const a=e.items[t],n=a.checked,r=a.task;let o="";if(a.task){const e=this.renderer.checkbox(!!n);i?a.tokens.length>0&&"paragraph"===a.tokens[0].type?(a.tokens[0].text=e+" "+a.tokens[0].text,a.tokens[0].tokens&&a.tokens[0].tokens.length>0&&"text"===a.tokens[0].tokens[0].type&&(a.tokens[0].tokens[0].text=e+" "+a.tokens[0].tokens[0].text)):a.tokens.unshift({type:"text",text:e+" "}):o+=e+" "}o+=this.parse(a.tokens,i),s+=this.renderer.listitem(o,r,!!n)}a+=this.renderer.list(s,t,n);continue}case"html":{const e=r;a+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=r;a+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=r,s=i.tokens?this.parseInline(i.tokens):i.text;for(;n+1<e.length&&"text"===e[n+1].type;)i=e[++n],s+="\n"+(i.tokens?this.parseInline(i.tokens):i.text);a+=t?this.renderer.paragraph(s):s;continue}default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return a}parseInline(e,t){t=t||this.renderer;let a="";for(let n=0;n<e.length;n++){const r=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const e=this.options.extensions.renderers[r.type].call({parser:this},r);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){a+=e||"";continue}}switch(r.type){case"escape":{const e=r;a+=t.text(e.text);break}case"html":{const e=r;a+=t.html(e.text);break}case"link":{const e=r;a+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=r;a+=t.image(e.href,e.title,e.text);break}case"strong":{const e=r;a+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=r;a+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=r;a+=t.codespan(e.text);break}case"br":a+=t.br();break;case"del":{const e=r;a+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=r;a+=t.text(e.text);break}default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return a}}class _Hooks{options;constructor(e){this.options=e||_defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}class Marked{defaults=_getDefaults();options=this.setOptions;parse=this.#e(_Lexer.lex,_Parser.parse);parseInline=this.#e(_Lexer.lexInline,_Parser.parseInline);Parser=_Parser;Renderer=_Renderer;TextRenderer=_TextRenderer;Lexer=_Lexer;Tokenizer=_Tokenizer;Hooks=_Hooks;constructor(...e){this.use(...e)}walkTokens(e,t){let a=[];for(const n of e)switch(a=a.concat(t.call(this,n)),n.type){case"table":{const e=n;for(const n of e.header)a=a.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)a=a.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=n;a=a.concat(this.walkTokens(e.items,t));break}default:{const e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((n=>{a=a.concat(this.walkTokens(e[n],t))})):e.tokens&&(a=a.concat(this.walkTokens(e.tokens,t)))}}return a}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const a={...e};if(a.async=this.defaults.async||a.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const a=t.renderers[e.name];t.renderers[e.name]=a?function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=a.apply(this,t)),n}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const a=t[e.level];a?a.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),a.extensions=t),e.renderer){const t=this.defaults.renderer||new _Renderer(this.defaults);for(const a in e.renderer){if(!(a in t))throw new Error(`renderer '${a}' does not exist`);if("options"===a)continue;const n=a,r=e.renderer[n],i=t[n];t[n]=(...e)=>{let a=r.apply(t,e);return!1===a&&(a=i.apply(t,e)),a||""}}a.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new _Tokenizer(this.defaults);for(const a in e.tokenizer){if(!(a in t))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;const n=a,r=e.tokenizer[n],i=t[n];t[n]=(...e)=>{let a=r.apply(t,e);return!1===a&&(a=i.apply(t,e)),a}}a.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new _Hooks;for(const a in e.hooks){if(!(a in t))throw new Error(`hook '${a}' does not exist`);if("options"===a)continue;const n=a,r=e.hooks[n],i=t[n];_Hooks.passThroughHooks.has(a)?t[n]=e=>{if(this.defaults.async)return Promise.resolve(r.call(t,e)).then((e=>i.call(t,e)));const a=r.call(t,e);return i.call(t,a)}:t[n]=(...e)=>{let a=r.apply(t,e);return!1===a&&(a=i.apply(t,e)),a}}a.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,n=e.walkTokens;a.walkTokens=function(e){let a=[];return a.push(n.call(this,e)),t&&(a=a.concat(t.call(this,e))),a}}this.defaults={...this.defaults,...a}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return _Lexer.lex(e,t??this.defaults)}parser(e,t){return _Parser.parse(e,t??this.defaults)}#e(e,t){return(a,n)=>{const r={...n},i={...this.defaults,...r};!0===this.defaults.async&&!1===r.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const s=this.#t(!!i.silent,!!i.async);if(null==a)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof a)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(a)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(a):a).then((t=>e(t,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(s);try{i.hooks&&(a=i.hooks.preprocess(a));let n=e(a,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=t(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return s(e)}}}#t(e,t){return a=>{if(a.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+escape$1$1(a.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(a);throw a}}}const markedInstance=new Marked;function marked(e,t){return markedInstance.parse(e,t)}function markedHighlight(e){if("function"==typeof e&&(e={highlight:e}),!e||"function"!=typeof e.highlight)throw new Error("Must provide highlight function");return"string"!=typeof e.langPrefix&&(e.langPrefix="language-"),{async:!!e.async,walkTokens(t){if("code"!==t.type)return;const a=getLang(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,a,t.lang||"")).then(updateToken(t));const n=e.highlight(t.text,a,t.lang||"");if(n instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");updateToken(t)(n)},renderer:{code(t,a,n){const r=getLang(a),i=r?` class="${e.langPrefix}${escape$1(r)}"`:"";return t=t.replace(/\n$/,""),`<pre><code${i}>${n?t:escape$1(t,!0)}\n</code></pre>`}}}}function getLang(e){return(e||"").match(/\S*/)[0]}function updateToken(e){return t=>{"string"==typeof t&&t!==e.text&&(e.escaped=!0,e.text=t)}}marked.options=marked.setOptions=function(e){return markedInstance.setOptions(e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.getDefaults=_getDefaults,marked.defaults=_defaults,marked.use=function(...e){return markedInstance.use(...e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.walkTokens=function(e,t){return markedInstance.walkTokens(e,t)},marked.parseInline=markedInstance.parseInline,marked.Parser=_Parser,marked.parser=_Parser.parse,marked.Renderer=_Renderer,marked.TextRenderer=_TextRenderer,marked.Lexer=_Lexer,marked.lexer=_Lexer.lex,marked.Tokenizer=_Tokenizer,marked.Hooks=_Hooks,marked.parse=marked,marked.options,marked.setOptions,marked.use,marked.walkTokens,marked.parseInline,_Parser.parse,_Lexer.lex;const escapeTest=/[&<>"']/,escapeReplace=new RegExp(escapeTest.source,"g"),escapeTestNoEncode=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode=new RegExp(escapeTestNoEncode.source,"g"),escapeReplacements={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},getEscapeReplacement=e=>escapeReplacements[e];function escape$1(e,t){if(t){if(escapeTest.test(e))return e.replace(escapeReplace,getEscapeReplacement)}else if(escapeTestNoEncode.test(e))return e.replace(escapeReplaceNoEncode,getEscapeReplacement);return e}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function deepFreeze(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t=>{const a=e[t],n=typeof a;"object"!==n&&"function"!==n||Object.isFrozen(a)||deepFreeze(a)})),e}class Response{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function escapeHTML(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function inherit$1(e,...t){const a=Object.create(null);for(const t in e)a[t]=e[t];return t.forEach((function(e){for(const t in e)a[t]=e[t]})),a}const SPAN_CLOSE="</span>",emitsWrappingTags=e=>!!e.scope,scopeToCSSClass=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const a=e.split(".");return[`${t}${a.shift()}`,...a.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`};class HTMLRenderer{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=escapeHTML(e)}openNode(e){if(!emitsWrappingTags(e))return;const t=scopeToCSSClass(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){emitsWrappingTags(e)&&(this.buffer+=SPAN_CLOSE)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const newNode=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class TokenTree{constructor(){this.rootNode=newNode(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=newNode({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{TokenTree._collapse(e)})))}}class TokenTreeEmitter extends TokenTree{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const a=e.root;t&&(a.scope=`language:${t}`),this.add(a)}toHTML(){return new HTMLRenderer(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function source(e){return e?"string"==typeof e?e:e.source:null}function lookahead(e){return concat("(?=",e,")")}function anyNumberOfTimes(e){return concat("(?:",e,")*")}function optional(e){return concat("(?:",e,")?")}function concat(...e){return e.map((e=>source(e))).join("")}function stripOptionsFromArgs(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function either(...e){return"("+(stripOptionsFromArgs(e).capture?"":"?:")+e.map((e=>source(e))).join("|")+")"}function countMatchGroups(e){return new RegExp(e.toString()+"|").exec("").length-1}function startsWith(e,t){const a=e&&e.exec(t);return a&&0===a.index}const BACKREF_RE=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function _rewriteBackreferences(e,{joinWith:t}){let a=0;return e.map((e=>{a+=1;const t=a;let n=source(e),r="";for(;n.length>0;){const e=BACKREF_RE.exec(n);if(!e){r+=n;break}r+=n.substring(0,e.index),n=n.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+String(Number(e[1])+t):(r+=e[0],"("===e[0]&&a++)}return r})).map((e=>`(${e})`)).join(t)}const MATCH_NOTHING_RE=/\b\B/,IDENT_RE="[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",NUMBER_RE="\\b\\d+(\\.\\d+)?",C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",BINARY_NUMBER_RE="\\b(0b[01]+)",RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=concat(t,/.*\b/,e.binary,/\b.*/)),inherit$1({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE={begin:"\\\\[\\s\\S]",relevance:0},APOS_STRING_MODE={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[BACKSLASH_ESCAPE]},QUOTE_STRING_MODE={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[BACKSLASH_ESCAPE]},PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT=function(e,t,a={}){const n=inherit$1({scope:"comment",begin:e,end:t,contains:[]},a);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=either("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:concat(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},C_LINE_COMMENT_MODE=COMMENT("//","$"),C_BLOCK_COMMENT_MODE=COMMENT("/\\*","\\*/"),HASH_COMMENT_MODE=COMMENT("#","$"),NUMBER_MODE={scope:"number",begin:NUMBER_RE,relevance:0},C_NUMBER_MODE={scope:"number",begin:C_NUMBER_RE,relevance:0},BINARY_NUMBER_MODE={scope:"number",begin:BINARY_NUMBER_RE,relevance:0},REGEXP_MODE={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[BACKSLASH_ESCAPE]}]},TITLE_MODE={scope:"title",begin:IDENT_RE,relevance:0},UNDERSCORE_TITLE_MODE={scope:"title",begin:UNDERSCORE_IDENT_RE,relevance:0},METHOD_GUARD={begin:"\\.\\s*"+UNDERSCORE_IDENT_RE,relevance:0},END_SAME_AS_BEGIN=function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})};var MODES=Object.freeze({__proto__:null,APOS_STRING_MODE:APOS_STRING_MODE,BACKSLASH_ESCAPE:BACKSLASH_ESCAPE,BINARY_NUMBER_MODE:BINARY_NUMBER_MODE,BINARY_NUMBER_RE:BINARY_NUMBER_RE,COMMENT:COMMENT,C_BLOCK_COMMENT_MODE:C_BLOCK_COMMENT_MODE,C_LINE_COMMENT_MODE:C_LINE_COMMENT_MODE,C_NUMBER_MODE:C_NUMBER_MODE,C_NUMBER_RE:C_NUMBER_RE,END_SAME_AS_BEGIN:END_SAME_AS_BEGIN,HASH_COMMENT_MODE:HASH_COMMENT_MODE,IDENT_RE:IDENT_RE,MATCH_NOTHING_RE:MATCH_NOTHING_RE,METHOD_GUARD:METHOD_GUARD,NUMBER_MODE:NUMBER_MODE,NUMBER_RE:NUMBER_RE,PHRASAL_WORDS_MODE:PHRASAL_WORDS_MODE,QUOTE_STRING_MODE:QUOTE_STRING_MODE,REGEXP_MODE:REGEXP_MODE,RE_STARTERS_RE:RE_STARTERS_RE,SHEBANG:SHEBANG,TITLE_MODE:TITLE_MODE,UNDERSCORE_IDENT_RE:UNDERSCORE_IDENT_RE,UNDERSCORE_TITLE_MODE:UNDERSCORE_TITLE_MODE});function skipIfHasPrecedingDot(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function scopeClassName(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function beginKeywords(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=skipIfHasPrecedingDot,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function compileIllegal(e,t){Array.isArray(e.illegal)&&(e.illegal=either(...e.illegal))}function compileMatch(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function compileRelevance(e,t){void 0===e.relevance&&(e.relevance=1)}const beforeMatchExt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const a=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=a.keywords,e.begin=concat(a.beforeMatch,lookahead(a.begin)),e.starts={relevance:0,contains:[Object.assign(a,{end