mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-11-30 11:08:58 +08:00
3 lines
35 KiB
JavaScript
3 lines
35 KiB
JavaScript
var Docsify=function(){"use strict";function e(e,t,n){void 0===t&&(t="GET");var r=new XMLHttpRequest;return r.open(t,e),r.send(),{then:function(e,t){if(void 0===t&&(t=function(){}),n){var a=setInterval(function(e){return n({step:Math.floor(5*Math.random()+1)})},500);r.addEventListener("progress",n),r.addEventListener("loadend",function(e){n(e),clearInterval(a)})}r.addEventListener("error",t),r.addEventListener("load",function(n){var r=n.target;r.status>=400?t(r):e(r.response)})},abort:function(){return 4!==r.readyState&&r.abort()}}}function t(e,t){var n=[],r={};return e.forEach(function(e){var a=e.level||1,i=a-1;a>t||(r[i]?(r[i].children=r[i].children||[],r[i].children.push(e)):n.push(e),r[a]=e)}),n}function n(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}function r(e){return null===e||void 0===e}function a(){var e=window.location;if($===e.hash&&!r(A))return A;var t=e.hash.match(/^#\/([^#]+)/);return t=t&&2===t.length?t[1]:/^#\//.test(e.hash)?"":e.pathname,A=t,$=e.hash,t}function i(){return document.body.clientWidth<=600}function s(e){var t=/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@\[\]^`{|}~]/g,n=!1,r="-";if(s.occurrences=s.occurrences||{},"string"!=typeof e)return"";n||(e=e.toLowerCase());var a=e.trim().replace(/<[^>\d]+>/g,"").replace(t,"").replace(/\s/g,r).replace(/-+/g,r).replace(/^(\d)/,"_$1"),i=s.occurrences[a];return s.occurrences.hasOwnProperty(a)?i++:i=0,s.occurrences[a]=i,i&&(a=a+"-"+i),a}function o(){function e(){for(var e=0,r=t.length;e<r;e+=1){var i=t[e],s=i.getBoundingClientRect();if(s.top<10&&s.bottom>10){var o=n[i.getAttribute("data-id")];if(!o||o===a)return;return a&&a.setAttribute("class",""),o.setAttribute("class","active"),void(a=o)}}}if(!i()){for(var t=document.querySelectorAll(".anchor"),n={},r=document.querySelectorAll(".sidebar li"),a=null,s=0,o=r.length;s<o;s+=1){var l=r[s],u=l.querySelector("a").getAttribute("href");if("/"!==u){var c=u.match("#([^#]+)$");c&&c.length&&(u=c[0].slice(1))}n[decodeURIComponent(u)]=l}window.removeEventListener("scroll",e),window.addEventListener("scroll",e),e()}}function l(){var e=window.location.hash.match(/#[^#\/]+$/g);if(e&&e.length){var t=document.querySelector(decodeURIComponent(e[0]));t&&t.scrollIntoView()}}function u(e,t){var n=window.location.href;if(e="object"==typeof e?e:document.querySelector(e)){var r;return[].slice.call(e.querySelectorAll("a")).sort(function(e,t){return t.href.length-e.href.length}).forEach(function(e){0!==n.indexOf(e.href)||r?t?e.parentNode.removeAttribute("class"):e.removeAttribute("class"):(t?e.parentNode.setAttribute("class","active"):e.setAttribute("class","active"),r=e)}),r}}function c(e){if(e="object"==typeof e?e:document.querySelector(e)){var t=document.body;e.addEventListener("click",function(){return t.classList.toggle("close")}),i()&&document.querySelector("aside").addEventListener("click",function(e){return t.classList.toggle("close")})}}function p(){document.body.scrollTop=0}function d(){var e=document.querySelector("section.cover"),t=e.getBoundingClientRect().height;return function(){window.pageYOffset>=t||e.classList.contains("hidden")?document.body.classList.add("sticky"):document.body.classList.remove("sticky")}()}function g(e,t){return t={exports:{}},e(t,t.exports),t.exports}function h(e){return e?(/\/\//.test(e)||(e="https://github.com/"+e),e=e.replace(/^git\+/,""),'\n <a href="'+e+'" class="github-corner" aria-label="View source on Github">\n <svg viewBox="0 0 250 250" aria-hidden="true">\n <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>\n <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>\n <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>\n </svg>\n </a>'):""}function f(e){var t=e+'<aside class="sidebar"></aside>';return(i()?t+"<main>":"<main>"+t)+'<section class="content">\n <article class="markdown-section"></article>\n </section>\n </main>'}function m(){var e=", 100%, 85%",t="linear-gradient(to left bottom, hsl("+(Math.floor(255*Math.random())+e)+") 0%, hsl("+(Math.floor(255*Math.random())+e)+") 100%)";return'<section class="cover" style="background: '+t+'">\n <div class="cover-main"></div>\n <div class="mask"></div>\n </section>'}function b(){return'<button class="sidebar-toggle">\n <div class="sidebar-toggle-button">\n <span></span><span></span><span></span>\n </div>\n </button>'}function y(e,t){return void 0===t&&(t=""),e&&e.length?(e.forEach(function(e){t+='<li><a class="section-link" href="'+e.slug+'">'+e.title+"</a></li>",e.children&&(t+='<li><ul class="children">'+y(e.children)+"</li></ul>")}),t):""}function v(e){M=e;var t=new O.Renderer;t.heading=function(e,t){var n=s(e),r="";return M.router&&(r="#/"+a()),P.push({level:t,slug:r+"#"+encodeURIComponent(n),title:e}),"<h"+t+' id="'+n+'"><a href="'+r+"#"+n+'" data-id="'+n+'" class="anchor"><span>'+e+"</span></a></h"+t+">"},t.code=function(e,t){void 0===t&&(t="");var n=T.highlight(e,T.languages[t]||T.languages.markup).replace(/{{/g,"<span>{{</span>");return'<pre data-lang="'+t+'"><code class="lang-'+t+'">'+n+"</code></pre>"},t.link=function(e,t,n){return M.router&&!/:/.test(e)&&(e=("#/"+e).replace(/\/\//g,"/")),'<a href="'+e+'" title="'+(t||"")+'">'+n+"</a>"},"function"==typeof M.markdown?(N.setOptions({renderer:t}),N=M.markdown.call(this,N)):N.setOptions(q({renderer:t},M.markdown))}function k(e,t){var n=document.querySelector("nav")||document.createElement("nav");M.repo||n.classList.add("no-badge"),e[t?"outerHTML":"innerHTML"]=h(M.repo)+(M.coverpage?m():"")+f(M.sidebarToggle?b():""),document.body.insertBefore(n,document.body.children[0]),c("button.sidebar-toggle"),M.coverpage?!i()&&window.addEventListener("scroll",d):document.body.classList.add("sticky")}function x(e){if(W("article",e?N(e):"not found"),M.sidebar||M.loadSidebar||S(),e&&"undefined"!=typeof Vue&&"undefined"!=typeof Vuep){var t=new Vue({el:"main"});t.$nextTick(function(e){return o()})}M.auto2top&&p()}function w(e){I.navbar&&I.navbar===e||(I.navbar=e,e&&W("nav",N(e)),u("nav"))}function S(e){var n;n=e?N(e):M.sidebar?y(M.sidebar,"<ul>"):y(t(P,M.maxLevel),"<ul>"),W("aside.sidebar",n);var r=u("aside.sidebar",!0);e&&L(r),P=[],o()}function L(e){M.subMaxLevel&&(e.parentNode.innerHTML+=y(t(P,M.subMaxLevel),"<ul>"))}function _(e){if(_.dom=_.dom||document.querySelector("section.cover"),!e)return void _.dom.classList.remove("show");if(_.dom.classList.add("show"),!_.rendered){var t=N(e),n=t.trim().match('<p><img[^s]+src="(.*?)"[^a]+alt="(.*?)"></p>$');if(n){var r=document.querySelector("section.cover");"color"===n[2]?r.style.background=n[1]:(r.classList.add("has-mask"),r.style.backgroundImage="url("+n[1]+")"),t=t.replace(n[0],"")}W(".cover-main",t),_.rendered=!0,d()}}function C(e){var t,n=e.loaded,r=e.total,a=e.step;if(!I.loading){var i=document.createElement("div");i.classList.add("progress"),document.body.appendChild(i),I.loading=i}a?(t=parseInt(I.loading.style.width,10)+a,t=t>80?80:t):t=Math.floor(n/r*100),I.loading.style.opacity=1,I.loading.style.width=t>=95?"100%":t+"%",t>=95&&(clearTimeout(C.cacheTimeout),C.cacheTimeout=setTimeout(function(e){I.loading.style.opacity=0,I.loading.style.width="0%"},200))}var A=null,$=null;s.clear=function(){s.occurrences={}};var E=Object.prototype.hasOwnProperty,q=Object.assign||function(e){for(var t=arguments,n=1;n<arguments.length;n++){var r=Object(t[n]);for(var a in r)E.call(r,a)&&(e[a]=r[a])}return e},j="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},O=g(function(e,t){(function(){function n(e){this.tokens=[],this.tokens.links={},this.options=e||p.defaults,this.rules=d.normal,this.options.gfm&&(this.options.tables?this.rules=d.tables:this.rules=d.gfm)}function r(e,t){if(this.options=t||p.defaults,this.links=e,this.rules=g.normal,this.renderer=this.options.renderer||new a,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=g.breaks:this.rules=g.gfm:this.options.pedantic&&(this.rules=g.pedantic)}function a(e){this.options=e||{}}function i(e){this.tokens=[],this.token=null,this.options=e||p.defaults,this.options.renderer=this.options.renderer||new a,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function o(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,a){return r?(a=a.source||a,a=a.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,a),n):new RegExp(e,t)}}function u(){}function c(e){for(var t,n,r=arguments,a=1;a<arguments.length;a++){t=r[a];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}function p(e,t,r){if(r||"function"==typeof t){r||(r=t,t=null),t=c({},p.defaults,t||{});var a,o,l=t.highlight,u=0;try{a=n.lex(e,t)}catch(e){return r(e)}o=a.length;var d=function(e){if(e)return t.highlight=l,r(e);var n;try{n=i.parse(a,t)}catch(t){e=t}return t.highlight=l,e?r(e):r(null,n)};if(!l||l.length<3)return d();if(delete t.highlight,!o)return d();for(;u<a.length;u++)!function(e){return"code"!==e.type?--o||d():l(e.text,e.lang,function(t,n){return t?d(t):null==n||n===e.text?--o||d():(e.text=n,e.escaped=!0,void(--o||d()))})}(a[u])}else try{return t&&(t=c({},p.defaults,t)),i.parse(n.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/chjj/marked.",(t||p.defaults).silent)return"<p>An error occured:</p><pre>"+s(e.message+"",!0)+"</pre>";throw e}}var d={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:u,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};d.bullet=/(?:[*+-]|\d+\.)/,d.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,d.item=l(d.item,"gm")(/bull/g,d.bullet)(),d.list=l(d.list)(/bull/g,d.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+d.def.source+")")(),d.blockquote=l(d.blockquote)("def",d.def)(),d._tag="(?!(?: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",d.html=l(d.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,d._tag)(),d.paragraph=l(d.paragraph)("hr",d.hr)("heading",d.heading)("lheading",d.lheading)("blockquote",d.blockquote)("tag","<"+d._tag)("def",d.def)(),d.normal=c({},d),d.gfm=c({},d.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),d.gfm.paragraph=l(d.paragraph)("(?!","(?!"+d.gfm.fences.source.replace("\\1","\\2")+"|"+d.list.source.replace("\\1","\\3")+"|")(),d.tables=c({},d.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=d,n.lex=function(e,t){var r=new n(t);return r.lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,t,n){for(var r,a,i,s,o,l,u,c,p,g=this,e=e.replace(/^ +$/gm,"");e;)if((i=g.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&g.tokens.push({type:"space"})),i=g.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),g.tokens.push({type:"code",text:g.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=g.rules.fences.exec(e))e=e.substring(i[0].length),g.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=g.rules.heading.exec(e))e=e.substring(i[0].length),g.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=g.rules.nptable.exec(e))){for(e=e.substring(i[0].length),l={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},c=0;c<l.align.length;c++)/^ *-+: *$/.test(l.align[c])?l.align[c]="right":/^ *:-+: *$/.test(l.align[c])?l.align[c]="center":/^ *:-+ *$/.test(l.align[c])?l.align[c]="left":l.align[c]=null;for(c=0;c<l.cells.length;c++)l.cells[c]=l.cells[c].split(/ *\| */);g.tokens.push(l)}else if(i=g.rules.lheading.exec(e))e=e.substring(i[0].length),g.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(i=g.rules.hr.exec(e))e=e.substring(i[0].length),g.tokens.push({type:"hr"});else if(i=g.rules.blockquote.exec(e))e=e.substring(i[0].length),g.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),g.token(i,t,!0),g.tokens.push({type:"blockquote_end"});else if(i=g.rules.list.exec(e)){for(e=e.substring(i[0].length),s=i[2],g.tokens.push({type:"list_start",ordered:s.length>1}),i=i[0].match(g.rules.item),r=!1,p=i.length,c=0;c<p;c++)l=i[c],u=l.length,l=l.replace(/^ *([*+-]|\d+\.) +/,""),~l.indexOf("\n ")&&(u-=l.length,l=g.options.pedantic?l.replace(/^ {1,4}/gm,""):l.replace(new RegExp("^ {1,"+u+"}","gm"),"")),g.options.smartLists&&c!==p-1&&(o=d.bullet.exec(i[c+1])[0],s===o||s.length>1&&o.length>1||(e=i.slice(c+1).join("\n")+e,c=p-1)),a=r||/\n\n(?!\s*$)/.test(l),c!==p-1&&(r="\n"===l.charAt(l.length-1),a||(a=r)),g.tokens.push({type:a?"loose_item_start":"list_item_start"}),g.token(l,!1,n),g.tokens.push({type:"list_item_end"});g.tokens.push({type:"list_end"})}else if(i=g.rules.html.exec(e))e=e.substring(i[0].length),g.tokens.push({type:g.options.sanitize?"paragraph":"html",pre:!g.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=g.rules.def.exec(e)))e=e.substring(i[0].length),g.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=g.rules.table.exec(e))){for(e=e.substring(i[0].length),l={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},c=0;c<l.align.length;c++)/^ *-+: *$/.test(l.align[c])?l.align[c]="right":/^ *:-+: *$/.test(l.align[c])?l.align[c]="center":/^ *:-+ *$/.test(l.align[c])?l.align[c]="left":l.align[c]=null;for(c=0;c<l.cells.length;c++)l.cells[c]=l.cells[c].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);g.tokens.push(l)}else if(t&&(i=g.rules.paragraph.exec(e)))e=e.substring(i[0].length),g.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=g.rules.text.exec(e))e=e.substring(i[0].length),g.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var g={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:u,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};g._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,g._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,g.link=l(g.link)("inside",g._inside)("href",g._href)(),g.reflink=l(g.reflink)("inside",g._inside)(),g.normal=c({},g),g.pedantic=c({},g.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),g.gfm=c({},g.normal,{escape:l(g.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(g.text)("]|","~]|")("|","|https?://|")()}),g.breaks=c({},g.gfm,{br:l(g.br)("{2,}","*")(),text:l(g.gfm.text)("{2,}","*")()}),r.rules=g,r.output=function(e,t,n){var a=new r(t,n);return a.output(e)},r.prototype.output=function(e){for(var t,n,r,a,i=this,o="";e;)if(a=i.rules.escape.exec(e))e=e.substring(a[0].length),o+=a[1];else if(a=i.rules.autolink.exec(e))e=e.substring(a[0].length),"@"===a[2]?(n=":"===a[1].charAt(6)?i.mangle(a[1].substring(7)):i.mangle(a[1]),r=i.mangle("mailto:")+n):(n=s(a[1]),r=n),o+=i.renderer.link(r,null,n);else if(i.inLink||!(a=i.rules.url.exec(e))){if(a=i.rules.tag.exec(e))!i.inLink&&/^<a /i.test(a[0])?i.inLink=!0:i.inLink&&/^<\/a>/i.test(a[0])&&(i.inLink=!1),e=e.substring(a[0].length),o+=i.options.sanitize?i.options.sanitizer?i.options.sanitizer(a[0]):s(a[0]):a[0];else if(a=i.rules.link.exec(e))e=e.substring(a[0].length),i.inLink=!0,o+=i.outputLink(a,{href:a[2],title:a[3]}),i.inLink=!1;else if((a=i.rules.reflink.exec(e))||(a=i.rules.nolink.exec(e))){if(e=e.substring(a[0].length),t=(a[2]||a[1]).replace(/\s+/g," "),t=i.links[t.toLowerCase()],!t||!t.href){o+=a[0].charAt(0),e=a[0].substring(1)+e;continue}i.inLink=!0,o+=i.outputLink(a,t),i.inLink=!1}else if(a=i.rules.strong.exec(e))e=e.substring(a[0].length),o+=i.renderer.strong(i.output(a[2]||a[1]));else if(a=i.rules.em.exec(e))e=e.substring(a[0].length),o+=i.renderer.em(i.output(a[2]||a[1]));else if(a=i.rules.code.exec(e))e=e.substring(a[0].length),o+=i.renderer.codespan(s(a[2],!0));else if(a=i.rules.br.exec(e))e=e.substring(a[0].length),o+=i.renderer.br();else if(a=i.rules.del.exec(e))e=e.substring(a[0].length),o+=i.renderer.del(i.output(a[1]));else if(a=i.rules.text.exec(e))e=e.substring(a[0].length),o+=i.renderer.text(s(i.smartypants(a[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(a[0].length),n=s(a[1]),r=n,o+=i.renderer.link(r,null,n);return o},r.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,a=0;a<r;a++)t=e.charCodeAt(a),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},a.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+s(t,!0)+'">'+(n?e:s(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:s(e,!0))+"\n</code></pre>"},a.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},a.prototype.html=function(e){return e},a.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},a.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},a.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},a.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},a.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},a.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},a.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},a.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"</"+n+">\n"},a.prototype.strong=function(e){return"<strong>"+e+"</strong>"},a.prototype.em=function(e){return"<em>"+e+"</em>"},a.prototype.codespan=function(e){return"<code>"+e+"</code>"},a.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},a.prototype.del=function(e){return"<del>"+e+"</del>"},a.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(o(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var a='<a href="'+e+'"';return t&&(a+=' title="'+t+'"'),a+=">"+n+"</a>"},a.prototype.image=function(e,t,n){var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},a.prototype.text=function(e){return e},i.parse=function(e,t,n){var r=new i(t,n);return r.parse(e)},i.prototype.parse=function(e){var t=this;this.inline=new r(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=t.tok();return n},i.prototype.next=function(){return this.token=this.tokens.pop()},i.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},i.prototype.parseText=function(){for(var e=this,t=this.token.text;"text"===this.peek().type;)t+="\n"+e.next().text;return this.inline.output(t)},i.prototype.tok=function(){var e=this;switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var t,n,r,a,i,s="",o="";for(r="",t=0;t<this.token.header.length;t++)a={header:!0,align:e.token.align[t]},r+=e.renderer.tablecell(e.inline.output(e.token.header[t]),{header:!0,align:e.token.align[t]});for(s+=this.renderer.tablerow(r),t=0;t<this.token.cells.length;t++){for(n=e.token.cells[t],r="",i=0;i<n.length;i++)r+=e.renderer.tablecell(e.inline.output(n[i]),{header:!1,align:e.token.align[i]});o+=e.renderer.tablerow(r)}return this.renderer.table(s,o);case"blockquote_start":for(var o="";"blockquote_end"!==this.next().type;)o+=e.tok();return this.renderer.blockquote(o);case"list_start":for(var o="",l=this.token.ordered;"list_end"!==this.next().type;)o+=e.tok();return this.renderer.list(o,l);case"list_item_start":for(var o="";"list_item_end"!==this.next().type;)o+="text"===e.token.type?e.parseText():e.tok();return this.renderer.listitem(o);case"loose_item_start":for(var o="";"list_item_end"!==this.next().type;)o+=e.tok();return this.renderer.listitem(o);case"html":var u=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(u);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},u.exec=u,p.options=p.setOptions=function(e){return c(p.defaults,e),p},p.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new a,xhtml:!1},p.Parser=i,p.parser=i.parse,p.Renderer=a,p.Lexer=n,p.lexer=n.lex,p.InlineLexer=r,p.inlineLexer=r.output,p.parse=p,"undefined"!=typeof e&&"object"==typeof t?e.exports=p:"function"==typeof define&&define.amd?define(function(){return p}):this.marked=p}).call(function(){return this||("undefined"!=typeof window?window:j)}())}),T=g(function(e){var t="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},n=function(){var e=/\blang(?:uage)?-(\w+)\b/i,n=0,r=t.Prism={util:{encode:function(e){return e instanceof a?new a(e.type,r.util.encode(e.content),e.alias):"Array"===r.util.type(e)?e.map(r.util.encode):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function(e){var t=r.util.type(e);switch(t){case"Object":var n={};for(var a in e)e.hasOwnProperty(a)&&(n[a]=r.util.clone(e[a]));return n;case"Array":return e.map&&e.map(function(e){return r.util.clone(e)})}return e}},languages:{extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var a in t)n[a]=t[a];return n},insertBefore:function(e,t,n,a){a=a||r.languages;var i=a[e];if(2==arguments.length){n=arguments[1];for(var s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);return i}var o={};for(var l in i)if(i.hasOwnProperty(l)){if(l==t)for(var s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);o[l]=i[l]}return r.languages.DFS(r.languages,function(t,n){n===a[e]&&t!=e&&(this[t]=o)}),a[e]=o},DFS:function(e,t,n,a){a=a||{};for(var i in e)e.hasOwnProperty(i)&&(t.call(e,i,e[i],n||i),"Object"!==r.util.type(e[i])||a[r.util.objId(e[i])]?"Array"!==r.util.type(e[i])||a[r.util.objId(e[i])]||(a[r.util.objId(e[i])]=!0,r.languages.DFS(e[i],t,i,a)):(a[r.util.objId(e[i])]=!0,r.languages.DFS(e[i],t,null,a)))}},plugins:{},highlightAll:function(e,t){var n={callback:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",n);for(var a,i=n.elements||document.querySelectorAll(n.selector),s=0;a=i[s++];)r.highlightElement(a,e===!0,n.callback)},highlightElement:function(n,a,i){for(var s,o,l=n;l&&!e.test(l.className);)l=l.parentNode;l&&(s=(l.className.match(e)||[,""])[1].toLowerCase(),o=r.languages[s]),n.className=n.className.replace(e,"").replace(/\s+/g," ")+" language-"+s,l=n.parentNode,/pre/i.test(l.nodeName)&&(l.className=l.className.replace(e,"").replace(/\s+/g," ")+" language-"+s);var u=n.textContent,c={element:n,language:s,grammar:o,code:u};if(r.hooks.run("before-sanity-check",c),!c.code||!c.grammar)return void r.hooks.run("complete",c);if(r.hooks.run("before-highlight",c),a&&t.Worker){var p=new Worker(r.filename);p.onmessage=function(e){c.highlightedCode=e.data,r.hooks.run("before-insert",c),c.element.innerHTML=c.highlightedCode,i&&i.call(c.element),r.hooks.run("after-highlight",c),r.hooks.run("complete",c)},p.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else c.highlightedCode=r.highlight(c.code,c.grammar,c.language),r.hooks.run("before-insert",c),c.element.innerHTML=c.highlightedCode,i&&i.call(n),r.hooks.run("after-highlight",c),r.hooks.run("complete",c)},highlight:function(e,t,n){var i=r.tokenize(e,t);return a.stringify(r.util.encode(i),n)},tokenize:function(e,t,n){var a=r.Token,i=[e],s=t.rest;if(s){for(var o in s)t[o]=s[o];delete t.rest}e:for(var o in t)if(t.hasOwnProperty(o)&&t[o]){var l=t[o];l="Array"===r.util.type(l)?l:[l];for(var u=0;u<l.length;++u){var c=l[u],p=c.inside,d=!!c.lookbehind,g=!!c.greedy,h=0,f=c.alias;c=c.pattern||c;for(var m=0;m<i.length;m++){var b=i[m];if(i.length>e.length)break e;if(!(b instanceof a)){c.lastIndex=0;var y=c.exec(b),v=1;if(!y&&g&&m!=i.length-1){var k=i[m+1].matchedStr||i[m+1],x=b+k;if(m<i.length-2&&(x+=i[m+2].matchedStr||i[m+2]),c.lastIndex=0,y=c.exec(x),!y)continue;var w=y.index+(d?y[1].length:0);if(w>=b.length)continue;var S=y.index+y[0].length,L=b.length+k.length;if(v=3,S<=L){if(i[m+1].greedy)continue;v=2,x=x.slice(0,L)}b=x}if(y){d&&(h=y[1].length);var w=y.index+h,y=y[0].slice(h),S=w+y.length,_=b.slice(0,w),C=b.slice(S),A=[m,v];_&&A.push(_);var $=new a(o,p?r.tokenize(y,p):y,f,y,g);A.push($),C&&A.push(C),Array.prototype.splice.apply(i,A)}}}}}return i},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var a,i=0;a=n[i++];)a(t)}}},a=r.Token=function(e,t,n,r,a){this.type=e,this.content=t,this.alias=n,this.matchedStr=r||null,this.greedy=!!a};if(a.stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===r.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var i={type:e.type,content:a.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var s="Array"===r.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,s)}r.hooks.run("wrap",i);var o="";for(var l in i.attributes)o+=(o?" ":"")+l+'="'+(i.attributes[l]||"")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'" '+o+">"+i.content+"</"+i.tag+">"},!t.document)return t.addEventListener?(t.addEventListener("message",function(e){var n=JSON.parse(e.data),a=n.language,i=n.code,s=n.immediateClose;t.postMessage(r.highlight(i,r.languages[a],a)),s&&t.close()},!1),t.Prism):t.Prism;var i=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return i&&(r.filename=i.src,document.addEventListener&&!i.hasAttribute("data-manual")&&("loading"!==document.readyState?requestAnimationFrame(r.highlightAll,0):document.addEventListener("DOMContentLoaded",r.highlightAll))),t.Prism}();"undefined"!=typeof e&&e.exports&&(e.exports=n),"undefined"!=typeof j&&(j.Prism=n),n.languages.markup={comment:/<!--[\w\W]*?-->/,prolog:/<\?[\w\W]+?\?>/,doctype:/<!DOCTYPE[\w\W]+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=.$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},n.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),n.languages.xml=n.languages.markup,n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},n.languages.css.atrule.inside.rest=n.util.clone(n.languages.css),n.languages.markup&&(n.languages.insertBefore("markup","tag",{style:{pattern:/(<style[\w\W]*?>)[\w\W]*?(?=<\/style>)/i,lookbehind:!0,inside:n.languages.css,alias:"language-css"}}),n.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:n.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:n.languages.css}},alias:"language-css"}},n.languages.markup.tag)),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(true|false)\b/,function:/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,
|
||
punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,function:/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),n.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\\\|\\?[^\\])*?`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}}}),n.languages.markup&&n.languages.insertBefore("markup","tag",{script:{pattern:/(<script[\w\W]*?>)[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:n.languages.javascript,alias:"language-javascript"}}),n.languages.js=n.languages.javascript,function(){"undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector&&(self.Prism.fileHighlight=function(){var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"};Array.prototype.forEach&&Array.prototype.slice.call(document.querySelectorAll("pre[data-src]")).forEach(function(t){for(var r,a=t.getAttribute("data-src"),i=t,s=/\blang(?:uage)?-(?!\*)(\w+)\b/i;i&&!s.test(i.className);)i=i.parentNode;if(i&&(r=(t.className.match(s)||[,""])[1]),!r){var o=(a.match(/\.(\w+)$/)||[,""])[1];r=e[o]||o}var l=document.createElement("code");l.className="language-"+r,t.textContent="",l.textContent="Loading…",t.appendChild(l);var u=new XMLHttpRequest;u.open("GET",a,!0),u.onreadystatechange=function(){4==u.readyState&&(u.status<400&&u.responseText?(l.textContent=u.responseText,n.highlightElement(l)):u.status>=400?l.textContent="✖ Error "+u.status+" while fetching file: "+u.statusText:l.textContent="✖ Error: File does not exist or is empty")},u.send(null)})},document.addEventListener("DOMContentLoaded",self.Prism.fileHighlight))}()}),M={},N=O,P=[],I={},W=function(e,t){return e="object"==typeof e?e:document.querySelector(e),e.innerHTML=t,s.clear(),e},F=q({el:"#app",repo:"",maxLevel:6,subMaxLevel:0,sidebar:"",sidebarToggle:!1,loadSidebar:null,loadNavbar:null,router:!1,homepage:"README.md",coverpage:"",basePath:"",auto2top:!1},window.$docsify),z=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();if(z){for(var R in F){var B=z.getAttribute("data-"+n(R));F[R]=r(B)?F[R]:B||!0}F.loadSidebar===!0&&(F.loadSidebar="_sidebar.md"),F.loadNavbar===!0&&(F.loadNavbar="_navbar.md"),F.coverpage===!0&&(F.coverpage="_coverpage.md"),F.sidebar&&(F.sidebar=window[F.sidebar])}v(F);var D=null,H=null,G=function(t){var n=F.basePath+a();if(D===n)return t();var r=D=n;/\//.test(r)?r&&!/\/$/.test(r)&&(r=r.match(/(\S*\/)[^\/]+$/)[1]):r="";var i;i=n?/\/$/.test(n)?n+"README.md":n+".md":F.homepage||"README.md",F.coverpage&&i===F.homepage&&e(F.coverpage).then(_),H&&H.abort&&H.abort(),H=e(i,"GET",C),H.then(function(n){x(n),F.coverpage&&i!==F.homepage&&_(),F.loadSidebar?e(r+F.loadSidebar).then(function(e){S(e),t()}):t()},function(e){return x(null)}),F.loadNavbar&&e(r+F.loadNavbar).then(w)},V=function(){var e=document.querySelector(F.el)||document.body,t=e!==document.body,n=function(){G(function(e){l(),u("nav")})};k(e,t),n(),F.router&&(/^#\//.test(window.location.hash)||(window.location.hash="#/"),window.addEventListener("hashchange",n))},Z=V();return Z}();
|