From 74ce0bf588bad9d08eac65ebb61b8c7d0ef2ea41 Mon Sep 17 00:00:00 2001
From: "qingwei.li"
Date: Sun, 19 Feb 2017 14:40:16 +0800
Subject: [PATCH] bump: 3.0.0 close #78
---
lib/docsify.js | 1939 +++++++++++++++++++++++--------------
lib/docsify.min.js | 4 +-
lib/plugins/ga.js | 17 +-
lib/plugins/ga.min.js | 2 +-
lib/plugins/search.js | 343 +++----
lib/plugins/search.min.js | 2 +-
lib/themes/buble.css | 2 +-
lib/themes/dark.css | 2 +-
lib/themes/pure.css | 2 +-
lib/themes/vue.css | 2 +-
10 files changed, 1358 insertions(+), 957 deletions(-)
diff --git a/lib/docsify.js b/lib/docsify.js
index 518bafb..c6be9cd 100644
--- a/lib/docsify.js
+++ b/lib/docsify.js
@@ -1,165 +1,37 @@
-var D = (function () {
+(function () {
'use strict';
/**
- * Simple ajax
- * @param {String} url
- * @param {String} [method=GET]
- * @param {Function} [loading] handle loading
- * @return {Promise}
+ * Create a cached version of a pure function.
*/
-function load (url, method, loading) {
- if ( method === void 0 ) method = 'GET';
-
- var xhr = new XMLHttpRequest();
-
- xhr.open(method, url);
- xhr.send();
-
- return {
- then: function (success, error) {
- if ( error === void 0 ) error = function () {};
-
- if (loading) {
- var id = setInterval(function (_) { return loading({ step: Math.floor(Math.random() * 5 + 1) }); },
- 500);
- xhr.addEventListener('progress', loading);
- xhr.addEventListener('loadend', function (evt) {
- loading(evt);
- clearInterval(id);
- });
- }
- xhr.addEventListener('error', error);
- xhr.addEventListener('load', function (ref) {
- var target = ref.target;
-
- target.status >= 400 ? error(target) : success(target.response);
- });
- },
- abort: function () { return xhr.readyState !== 4 && xhr.abort(); }
+function cached (fn) {
+ var cache = Object.create(null);
+ return function cachedFn (str) {
+ var hit = cache[str];
+ return hit || (cache[str] = fn(str))
}
}
/**
- * gen toc tree
- * @link https://github.com/killercup/grock/blob/5280ae63e16c5739e9233d9009bc235ed7d79a50/styles/solarized/assets/js/behavior.coffee#L54-L81
- * @param {Array} toc
- * @param {Number} maxLevel
- * @return {Array}
+ * Hyphenate a camelCase string.
*/
-function genTree (toc, maxLevel) {
- var headlines = [];
- var last = {};
-
- toc.forEach(function (headline) {
- var level = headline.level || 1;
- var len = level - 1;
-
- if (level > maxLevel) { return }
- if (last[len]) {
- last[len].children = last[len].children || [];
- last[len].children.push(headline);
- } else {
- headlines.push(headline);
- }
- last[level] = headline;
- });
-
- return headlines
-}
-
-/**
- * camel to kebab
- * @link https://github.com/bokuweb/kebab2camel/blob/master/index.js
- * @param {String} str
- * @return {String}
- */
-function camel2kebab (str) {
+var hyphenate = cached(function (str) {
return str.replace(/([A-Z])/g, function (m) { return '-' + m.toLowerCase(); })
-}
+});
/**
- * is nil
- * @param {Object} object
- * @return {Boolean}
+ * Simple Object.assign polyfill
*/
-function isNil (o) {
- return o === null || o === undefined
-}
-
-var cacheRoute$1 = null;
-var cacheHash = null;
-
-/**
- * hash route
- */
-function getRoute () {
- var loc = window.location;
- if (cacheHash === loc.hash && !isNil(cacheRoute$1)) { return cacheRoute$1 }
-
- var route = loc.hash.replace(/%23/g, '#').match(/^#\/([^#]+)/);
-
- if (route && route.length === 2) {
- route = route[1];
- } else {
- route = /^#\//.test(loc.hash) ? '' : loc.pathname;
- }
- cacheRoute$1 = route;
- cacheHash = loc.hash;
-
- return route
-}
-
-function isMobile () {
- return document.body.clientWidth <= 600
-}
-
-function slugify (string) {
- var re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@\[\]^`{|}~]/g;
- var maintainCase = false;
- var replacement = '-';
-
- slugify.occurrences = slugify.occurrences || {};
-
- if (typeof string !== 'string') { return '' }
- if (!maintainCase) { string = string.toLowerCase(); }
-
- var slug = string.trim()
- .replace(/<[^>\d]+>/g, '')
- .replace(re, '')
- .replace(/\s/g, replacement)
- .replace(/-+/g, replacement)
- .replace(/^(\d)/, '_$1');
- var occurrences = slugify.occurrences[slug];
-
- if (slugify.occurrences.hasOwnProperty(slug)) {
- occurrences++;
- } else {
- occurrences = 0;
- }
-
- slugify.occurrences[slug] = occurrences;
-
- if (occurrences) {
- slug = slug + '-' + occurrences;
- }
-
- return slug
-}
-
-slugify.clear = function () {
- slugify.occurrences = {};
-};
-
-var hasOwnProperty = Object.prototype.hasOwnProperty;
var merge = Object.assign || function (to) {
var arguments$1 = arguments;
+ var hasOwn = Object.prototype.hasOwnProperty;
+
for (var i = 1; i < arguments.length; i++) {
var from = Object(arguments$1[i]);
for (var key in from) {
- if (hasOwnProperty.call(from, key)) {
+ if (hasOwn.call(from, key)) {
to[key] = from[key];
}
}
@@ -168,42 +40,441 @@ var merge = Object.assign || function (to) {
return to
};
-function emojify (text) {
- return text
- .replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g, function (match) { return match.replace(/:/g, '__colon__'); })
- .replace(/:(\w+?):/ig, '
')
- .replace(/__colon__/g, ':')
+/**
+ * Check if value is primitive
+ */
+function isPrimitive (value) {
+ return typeof value === 'string' || typeof value === 'number'
+}
+
+/**
+ * Perform no operation.
+ */
+function noop () {}
+
+/**
+ * Check if value is function
+ */
+function isFn (obj) {
+ return typeof obj === 'function'
+}
+
+var config = merge({
+ el: '#app',
+ repo: '',
+ maxLevel: 6,
+ subMaxLevel: 0,
+ loadSidebar: null,
+ loadNavbar: null,
+ homepage: 'README.md',
+ coverpage: '',
+ basePath: '',
+ auto2top: false,
+ name: '',
+ themeColor: '',
+ nameLink: window.location.pathname,
+ autoHeader: false,
+ executeScript: false,
+ ga: ''
+}, window.$docsify);
+
+var script = document.currentScript ||
+ [].slice.call(document.getElementsByTagName('script'))
+ .filter(function (n) { return /docsify\./.test(n.src); })[0];
+
+if (script) {
+ for (var prop in config) {
+ var val = script.getAttribute('data-' + hyphenate(prop));
+
+ if (isPrimitive(val)) {
+ config[prop] = val === '' ? true : val;
+ }
+ }
+
+ if (config.loadSidebar === true) { config.loadSidebar = '_sidebar.md'; }
+ if (config.loadNavbar === true) { config.loadNavbar = '_navbar.md'; }
+ if (config.coverpage === true) { config.coverpage = '_coverpage.md'; }
+ if (config.repo === true) { config.repo = ''; }
+ if (config.name === true) { config.name = ''; }
+}
+
+window.$docsify = config;
+
+function initLifecycle (vm) {
+ var hooks = [
+ 'init',
+ 'mounted',
+ 'beforeEach',
+ 'afterEach',
+ 'doneEach',
+ 'ready'
+ ];
+
+ vm._hooks = {};
+ vm._lifecycle = {};
+ hooks.forEach(function (hook) {
+ var arr = vm._hooks[hook] = [];
+ vm._lifecycle[hook] = function (fn) { return arr.push(fn); };
+ });
+}
+
+function callHook (vm, hook, data, next) {
+ if ( next === void 0 ) next = noop;
+
+ var newData = data;
+ var queue = vm._hooks[hook];
+
+ var step = function (index) {
+ var hook = queue[index];
+ if (index >= queue.length) {
+ next(newData);
+ } else {
+ if (typeof hook === 'function') {
+ if (hook.length === 2) {
+ hook(data, function (result) {
+ newData = result;
+ step(index + 1);
+ });
+ } else {
+ var result = hook(data);
+ newData = result !== undefined ? result : newData;
+ step(index + 1);
+ }
+ } else {
+ step(index + 1);
+ }
+ }
+ };
+
+ step(0);
+}
+
+var cacheNode = {};
+
+/**
+ * Get Node
+ * @param {String|Element} el
+ * @param {Boolean} noCache
+ * @return {Element}
+ */
+function getNode (el, noCache) {
+ if ( noCache === void 0 ) noCache = false;
+
+ if (typeof el === 'string') {
+ el = noCache ? find(el) : (cacheNode[el] || find(el));
+ }
+
+ return el
+}
+
+var $ = document;
+
+var body = $.body;
+
+var head = $.head;
+
+/**
+ * Find element
+ * @example
+ * find('nav') => document.querySelector('nav')
+ * find(nav, 'a') => nav.querySelector('a')
+ */
+function find (el, node) {
+ return node ? el.querySelector(node) : $.querySelector(el)
+}
+
+/**
+ * Find all elements
+ * @example
+ * findAll('a') => [].slice.call(document.querySelectorAll('a'))
+ * findAll(nav, 'a') => [].slice.call(nav.querySelectorAll('a'))
+ */
+function findAll (el, node) {
+ return [].slice.call(node ? el.querySelectorAll(node) : $.querySelectorAll(el))
+}
+
+function create (node, tpl) {
+ node = $.createElement(node);
+ if (tpl) { node.innerHTML = tpl; }
+ return node
+}
+
+function appendTo (target, el) {
+ return target.appendChild(el)
+}
+
+function before (target, el) {
+ return target.insertBefore(el, target.children[0])
+}
+
+function on (el, type, handler) {
+ isFn(type)
+ ? window.addEventListener(el, type)
+ : el.addEventListener(type, handler);
+}
+
+var off = function on (el, type, handler) {
+ isFn(type)
+ ? window.removeEventListener(el, type)
+ : el.removeEventListener(type, handler);
+};
+
+/**
+ * Toggle class
+ *
+ * @example
+ * toggleClass(el, 'active') => el.classList.toggle('active')
+ * toggleClass(el, 'add', 'active') => el.classList.add('active')
+ */
+function toggleClass (el, type, val) {
+ el && el.classList[val ? type : 'toggle'](val || type);
}
-var utils = Object.freeze({
- load: load,
- genTree: genTree,
- camel2kebab: camel2kebab,
- isNil: isNil,
- getRoute: getRoute,
- isMobile: isMobile,
- slugify: slugify,
- merge: merge,
- emojify: emojify
+var dom = Object.freeze({
+ getNode: getNode,
+ $: $,
+ body: body,
+ head: head,
+ find: find,
+ findAll: findAll,
+ create: create,
+ appendTo: appendTo,
+ before: before,
+ on: on,
+ off: off,
+ toggleClass: toggleClass
});
-/**
- * Active sidebar when scroll
- * @link https://buble.surge.sh/
- */
-function scrollActiveSidebar () {
- if (isMobile()) { return }
+var UA = window.navigator.userAgent.toLowerCase();
- var hoveredOverSidebar = false;
- var anchors = document.querySelectorAll('.anchor');
- var sidebar = document.querySelector('.sidebar');
- var sidebarContainer = sidebar.querySelector('.sidebar-nav');
- var sidebarHeight = sidebar.clientHeight;
+var isIE = UA && /msie|trident/.test(UA);
+
+var isMobile = document.body.clientWidth <= 600;
+
+var decode = decodeURIComponent;
+var encode = encodeURIComponent;
+
+function parseQuery (query) {
+ var res = {};
+
+ query = query.trim().replace(/^(\?|#|&)/, '');
+
+ if (!query) {
+ return res
+ }
+
+ // Simple parse
+ query.split('&').forEach(function (param) {
+ var parts = param.replace(/\+/g, ' ').split('=');
+
+ res[parts[0]] = decode(parts[1]);
+ });
+ return res
+}
+
+function stringifyQuery (obj) {
+ var qs = [];
+
+ for (var key in obj) {
+ qs.push(((encode(key)) + "=" + (encode(obj[key]))).toLowerCase());
+ }
+
+ return qs.length ? ("?" + (qs.join('&'))) : ''
+}
+
+var getBasePath = cached(function (base) {
+ return /^(\/|https?:)/g.test(base)
+ ? base
+ : cleanPath(window.location.pathname + '/' + base)
+});
+
+function getPath () {
+ var args = [], len = arguments.length;
+ while ( len-- ) args[ len ] = arguments[ len ];
+
+ return cleanPath(args.join('/'))
+}
+
+var isAbsolutePath = cached(function (path) {
+ return /(:|(\/{2}))/.test(path)
+});
+
+var getRoot = cached(function (path) {
+ return /\/$/g.test(path) ? path : path.match(/(\S*\/)[^\/]+$/)[1]
+});
+
+var cleanPath = cached(function (path) {
+ return path.replace(/\/+/g, '/')
+});
+
+function replaceHash (path) {
+ var i = window.location.href.indexOf('#');
+ window.location.replace(
+ window.location.href.slice(0, i >= 0 ? i : 0) + '#' + path
+ );
+}
+
+var replaceSlug = cached(function (path) {
+ return path
+ .replace('#', '?id=')
+ .replace(/\?(\w+)=/g, function (_, slug) { return slug === 'id' ? '?id=' : ("&" + slug + "="); })
+});
+/**
+ * Normalize the current url
+ *
+ * @example
+ * domain.com/docs/ => domain.com/docs/#/
+ * domain.com/docs/#/#slug => domain.com/docs/#/?id=slug
+ */
+function normalize () {
+ var path = getHash();
+
+ path = replaceSlug(path);
+
+ if (path.charAt(0) === '/') { return replaceHash(path) }
+ replaceHash('/' + path);
+}
+
+function getHash () {
+ // We can't use window.location.hash here because it's not
+ // consistent across browsers - Firefox will pre-decode it!
+ var href = window.location.href;
+ var index = href.indexOf('#');
+ return index === -1 ? '' : href.slice(index + 1)
+}
+
+/**
+ * Parse the url
+ * @param {string} [path=window.location.herf]
+ * @return {object} { path, query }
+ */
+function parse (path) {
+ if ( path === void 0 ) path = window.location.href;
+
+ var query = '';
+
+ var queryIndex = path.indexOf('?');
+ if (queryIndex >= 0) {
+ query = path.slice(queryIndex + 1);
+ path = path.slice(0, queryIndex);
+ }
+
+ var hashIndex = path.indexOf('#');
+ if (hashIndex) {
+ path = path.slice(hashIndex + 1);
+ }
+
+ return { path: path, query: parseQuery(query) }
+}
+
+/**
+ * to URL
+ * @param {string} path
+ * @param {object} qs query params
+ */
+function toURL (path, params) {
+ var route = parse(replaceSlug(path));
+
+ route.query = merge({}, route.query, params);
+ path = route.path + stringifyQuery(route.query);
+
+ return cleanPath('#/' + path)
+}
+
+
+var route = Object.freeze({
+ normalize: normalize,
+ getHash: getHash,
+ parse: parse,
+ toURL: toURL,
+ parseQuery: parseQuery,
+ stringifyQuery: stringifyQuery,
+ getBasePath: getBasePath,
+ getPath: getPath,
+ isAbsolutePath: isAbsolutePath,
+ getRoot: getRoot,
+ cleanPath: cleanPath
+});
+
+var title = $.title;
+/**
+ * Toggle button
+ */
+function btn (el) {
+ var toggle = function () { return body.classList.toggle('close'); };
+
+ el = getNode(el);
+ on(el, 'click', toggle);
+
+ if (isMobile) {
+ var sidebar = getNode('.sidebar');
+
+ on(sidebar, 'click', function () {
+ toggle();
+ setTimeout(function () { return getAndActive(sidebar, true, true); }, 0);
+ });
+ }
+}
+
+function sticky () {
+ var cover = getNode('section.cover');
+ if (!cover) { return }
+ var coverHeight = cover.getBoundingClientRect().height;
+
+ if (window.pageYOffset >= coverHeight || cover.classList.contains('hidden')) {
+ toggleClass(body, 'add', 'sticky');
+ } else {
+ toggleClass(body, 'remove', 'sticky');
+ }
+}
+
+/**
+ * Get and active link
+ * @param {string|element} el
+ * @param {Boolean} isParent acitve parent
+ * @param {Boolean} autoTitle auto set title
+ * @return {element}
+ */
+function getAndActive (el, isParent, autoTitle) {
+ el = getNode(el);
+
+ var links = findAll(el, 'a');
+ var hash = '#' + getHash();
+ var target;
+
+ links
+ .sort(function (a, b) { return b.href.length - a.href.length; })
+ .forEach(function (a) {
+ var href = a.getAttribute('href');
+ var node = isParent ? a.parentNode : a;
+
+ if (hash.indexOf(href) === 0 && !target) {
+ target = a;
+ toggleClass(node, 'add', 'active');
+ } else {
+ toggleClass(node, 'remove', 'active');
+ }
+ });
+
+ if (autoTitle) {
+ $.title = target ? ((target.innerText) + " - " + title) : title;
+ }
+
+ return target
+}
+
+function scrollActiveSidebar () {
+ if (isMobile) { return }
+
+ var hoverOver = false;
+ var anchors = findAll('.anchor');
+ var sidebar = find('.sidebar');
+ var wrap = find(sidebar, '.sidebar-nav');
var nav = {};
- var lis = sidebar.querySelectorAll('li');
- var active = sidebar.querySelector('li.active');
+ var lis = findAll(sidebar, 'li');
+ var active = find(sidebar, 'li.active');
for (var i = 0, len = lis.length; i < len; i += 1) {
var li = lis[i];
@@ -212,15 +483,14 @@ function scrollActiveSidebar () {
var href = a.getAttribute('href');
if (href !== '/') {
- var match = href.match('#([^#]+)$');
- if (match && match.length) { href = match[0].slice(1); }
+ href = parse(href).query.id;
}
nav[decodeURIComponent(href)] = li;
}
function highlight () {
- var top = document.body.scrollTop;
+ var top = body.scrollTop;
var last;
for (var i = 0, len = anchors.length; i < len; i += 1) {
@@ -237,113 +507,268 @@ function scrollActiveSidebar () {
var li = nav[last.getAttribute('data-id')];
if (!li || li === active) { return }
- if (active) { active.classList.remove('active'); }
+ active && active.classList.remove('active');
li.classList.add('active');
active = li;
// scroll into view
// https://github.com/vuejs/vuejs.org/blob/master/themes/vue/source/js/common.js#L282-L297
- if (!hoveredOverSidebar && !sticky.noSticky) {
- var currentPageOffset = 0;
- var currentActiveOffset = active.offsetTop + active.clientHeight + 40;
- var currentActiveIsInView = (
- active.offsetTop >= sidebarContainer.scrollTop &&
- currentActiveOffset <= sidebarContainer.scrollTop + sidebarHeight
+ if (!hoverOver && body.classList.contains('sticky')) {
+ var height = sidebar.clientHeight;
+ var curOffset = 0;
+ var cur = active.offsetTop + active.clientHeight + 40;
+ var isInView = (
+ active.offsetTop >= wrap.scrollTop &&
+ cur <= wrap.scrollTop + height
);
- var linkNotFurtherThanSidebarHeight = currentActiveOffset - currentPageOffset < sidebarHeight;
- var newScrollTop = currentActiveIsInView
- ? sidebarContainer.scrollTop
- : linkNotFurtherThanSidebarHeight
- ? currentPageOffset
- : currentActiveOffset - sidebarHeight;
+ var notThan = cur - curOffset < height;
+ var top$1 = isInView
+ ? wrap.scrollTop
+ : notThan
+ ? curOffset
+ : cur - height;
- sidebar.scrollTop = newScrollTop;
+ sidebar.scrollTop = top$1;
}
}
- window.removeEventListener('scroll', highlight);
- window.addEventListener('scroll', highlight);
- sidebar.addEventListener('mouseover', function () { hoveredOverSidebar = true; });
- sidebar.addEventListener('mouseleave', function () { hoveredOverSidebar = false; });
+ off('scroll', highlight);
+ on('scroll', highlight);
+ on(sidebar, 'mouseover', function () { hoverOver = true; });
+ on(sidebar, 'mouseleave', function () { hoverOver = false; });
}
-function scrollIntoView () {
- var id = window.location.hash.match(/#[^#\/]+$/g);
- if (!id || !id.length) { return }
- var section = document.querySelector(decodeURIComponent(id[0]));
-
- if (section) { setTimeout(function () { return section.scrollIntoView(); }, 0); }
-
- return section
+function scrollIntoView (id) {
+ var section = find('#' + id);
+ section && section.scrollIntoView();
}
-/**
- * Acitve link
- */
-function activeLink (dom, activeParent) {
- var host = window.location.href;
-
- dom = typeof dom === 'object' ? dom : document.querySelector(dom);
- if (!dom) { return }
- var target;[].slice.call(dom.querySelectorAll('a'))
- .sort(function (a, b) { return b.href.length - a.href.length; })
- .forEach(function (node) {
- if (host.indexOf(node.href) === 0 && !target) {
- activeParent
- ? node.parentNode.classList.add('active')
- : node.classList.add('active');
- target = node;
- } else {
- activeParent
- ? node.parentNode.classList.remove('active')
- : node.classList.remove('active');
- }
- });
-
- return target
-}
-
-/**
- * sidebar toggle
- */
-function bindToggle (dom) {
- dom = typeof dom === 'object' ? dom : document.querySelector(dom);
- if (!dom) { return }
- var body = document.body;
-
- dom.addEventListener('click', function () { return body.classList.toggle('close'); });
-
- if (isMobile()) {
- var sidebar = document.querySelector('.sidebar');
- sidebar.addEventListener('click', function () {
- body.classList.toggle('close');
- setTimeout(function () { return activeLink(sidebar, true); }, 0);
- });
- }
-}
-
-var scrollingElement = document.scrollingElement || document.documentElement;
+var scrollEl = $.scrollingElement || $.documentElement;
function scroll2Top (offset) {
if ( offset === void 0 ) offset = 0;
- scrollingElement.scrollTop = offset === true ? 0 : Number(offset);
+ scrollEl.scrollTop = offset === true ? 0 : Number(offset);
}
-function sticky () {
- sticky.dom = sticky.dom || document.querySelector('section.cover');
- var coverHeight = sticky.dom.getBoundingClientRect().height;
+var barEl;
+var timeId;
- return (function () {
- if (window.pageYOffset >= coverHeight || sticky.dom.classList.contains('hidden')) {
- document.body.classList.add('sticky');
- sticky.noSticky = false;
- } else {
- document.body.classList.remove('sticky');
- sticky.noSticky = true;
+/**
+ * Init progress component
+ */
+function init () {
+ var div = create('div');
+
+ div.classList.add('progress');
+ appendTo(body, div);
+ barEl = div;
+}
+/**
+ * Render progress bar
+ */
+var progressbar = function (ref) {
+ var loaded = ref.loaded;
+ var total = ref.total;
+ var step = ref.step;
+
+ var num;
+
+ !barEl && init();
+
+ if (step) {
+ num = parseInt(barEl.style.width || 0, 10) + step;
+ num = num > 80 ? 80 : num;
+ } else {
+ num = Math.floor(loaded / total * 100);
+ }
+
+ barEl.style.opacity = 1;
+ barEl.style.width = num >= 95 ? '100%' : num + '%';
+
+ if (num >= 95) {
+ clearTimeout(timeId);
+ timeId = setTimeout(function (_) {
+ barEl.style.opacity = 0;
+ barEl.style.width = '0%';
+ }, 200);
+ }
+};
+
+var cache = {};
+var RUN_VERSION = Date.now();
+
+/**
+ * Simple ajax get
+ * @param {string} url
+ * @param {boolean} [hasBar=false] has progress bar
+ * @return { then(resolve, reject), abort }
+ */
+function get (url, hasBar) {
+ if ( hasBar === void 0 ) hasBar = false;
+
+ var xhr = new XMLHttpRequest();
+ var on = function () {
+ xhr.addEventListener.apply(xhr, arguments);
+ };
+
+ url += (/\?(\w+)=/g.test(url) ? '&' : '?') + "v=" + RUN_VERSION;
+
+ if (cache[url]) {
+ return { then: function (cb) { return cb(cache[url]); }, abort: noop }
+ }
+
+ xhr.open('GET', url);
+ xhr.send();
+
+ return {
+ then: function (success, error) {
+ if ( error === void 0 ) error = noop;
+
+ if (hasBar) {
+ var id = setInterval(function (_) { return progressbar({
+ step: Math.floor(Math.random() * 5 + 1)
+ }); }, 500);
+
+ on('progress', progressbar);
+ on('loadend', function (evt) {
+ progressbar(evt);
+ clearInterval(id);
+ });
+ }
+
+ on('error', error);
+ on('load', function (ref) {
+ var target = ref.target;
+
+ if (target.status >= 400) {
+ error(target);
+ } else {
+ cache[url] = target.response;
+ success(target.response);
+ }
+ });
+ },
+ abort: function (_) { return xhr.readyState !== 4 && xhr.abort(); }
+ }
+}
+
+function replaceVar (block, color) {
+ block.innerHTML = block.innerHTML
+ .replace(/var\(\s*--theme-color.*?\)/g, color);
+}
+
+var cssVars = function (color) {
+ // Variable support
+ if (window.CSS &&
+ window.CSS.supports &&
+ window.CSS.supports('(--v:red)')) { return }
+
+ var styleBlocks = findAll('style:not(.inserted),link');[].forEach.call(styleBlocks, function (block) {
+ if (block.nodeName === 'STYLE') {
+ replaceVar(block, color);
+ } else if (block.nodeName === 'LINK') {
+ var href = block.getAttribute('href');
+
+ if (!/\.css$/.test(href)) { return }
+
+ get(href).then(function (res) {
+ var style = create('style', res);
+
+ head.appendChild(style);
+ replaceVar(style, color);
+ });
}
- })()
+ });
+};
+
+/**
+ * Render github corner
+ * @param {Object} data
+ * @return {String}
+ */
+function corner (data) {
+ if (!data) { return '' }
+ if (!/\/\//.test(data)) { data = 'https://github.com/' + data; }
+ data = data.replace(/^git\+/, '');
+
+ return (
+ "" +
+ '' +
+ '`')
+}
+
+/**
+ * Render main content
+ */
+function main (config) {
+ var aside = (
+ '' +
+ '');
+
+ return (isMobile ? (aside + "") : ("" + aside)) +
+ '' +
+ ''
+}
+
+/**
+ * Cover Page
+ */
+function cover () {
+ var SL = ', 100%, 85%';
+ var bgc = 'linear-gradient(to left bottom, ' +
+ "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 0%," +
+ "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 100%)";
+
+ return "'
+}
+
+/**
+ * Render tree
+ * @param {Array} tree
+ * @param {String} tpl
+ * @return {String}
+ */
+function tree (toc, tpl) {
+ if ( tpl === void 0 ) tpl = '';
+
+ if (!toc || !toc.length) { return '' }
+
+ toc.forEach(function (node) {
+ tpl += "" + (node.title) + "";
+ if (node.children) {
+ tpl += "" + (tree(node.children)) + "
";
+ }
+ });
+
+ return tpl
+}
+
+function helper (className, content) {
+ return ("" + (content.slice(5).trim()) + "
")
+}
+
+function theme (color) {
+ return ("")
}
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -2451,565 +2876,577 @@ Prism.languages.js = Prism.languages.javascript;
});
/**
- * Render github corner
- * @param {Object} data
- * @return {String}
+ * gen toc tree
+ * @link https://github.com/killercup/grock/blob/5280ae63e16c5739e9233d9009bc235ed7d79a50/styles/solarized/assets/js/behavior.coffee#L54-L81
+ * @param {Array} toc
+ * @param {Number} maxLevel
+ * @return {Array}
*/
-function corner (data) {
- if (!data) { return '' }
- if (!/\/\//.test(data)) { data = 'https://github.com/' + data; }
- data = data.replace(/^git\+/, '');
+function genTree (toc, maxLevel) {
+ var headlines = [];
+ var last = {};
- return ("\n \n \n ")
-}
+ toc.forEach(function (headline) {
+ var level = headline.level || 1;
+ var len = level - 1;
-/**
- * Render main content
- */
-function main () {
- var aside = (toggle()) + "";
-
- return (isMobile() ? (aside + "") : ("" + aside)) +
- "\n "
-}
-
-/**
- * Cover Page
- */
-function cover () {
- var SL = ', 100%, 85%';
- var bgc = "linear-gradient(to left bottom, hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 0%, hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 100%)";
-
- return ("")
-}
-
-function toggle () {
- return ""
-}
-
-/**
- * Render tree
- * @param {Array} tree
- * @param {String} tpl
- * @return {String}
- */
-function tree (toc, tpl) {
- if ( tpl === void 0 ) tpl = '';
-
- if (!toc || !toc.length) { return '' }
-
- toc.forEach(function (node) {
- tpl += "" + (node.title) + "";
- if (node.children) {
- tpl += "" + (tree(node.children)) + "
";
+ if (level > maxLevel) { return }
+ if (last[len]) {
+ last[len].children = last[len].children || [];
+ last[len].children.push(headline);
+ } else {
+ headlines.push(headline);
}
+ last[level] = headline;
});
- return tpl
+ return headlines
}
-function helper (className, content) {
- return ("" + (content.slice(5).trim()) + "
")
+var cache$1 = {};
+var re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@\[\]^`{|}~]/g;
+
+function slugify (str) {
+ if (typeof str !== 'string') { return '' }
+
+ var slug = str.toLowerCase().trim()
+ .replace(/<[^>\d]+>/g, '')
+ .replace(re, '')
+ .replace(/\s/g, '-')
+ .replace(/-+/g, '-')
+ .replace(/^(\d)/, '_$1');
+ var count = cache$1[slug];
+
+ count = cache$1.hasOwnProperty(slug) ? (count + 1) : 0;
+ cache$1[slug] = count;
+
+ if (count) {
+ slug = slug + '-' + count;
+ }
+
+ return slug
}
-function theme (color) {
- return ("")
+function clearSlugCache () {
+ cache$1 = {};
}
-function replaceVar (block) {
- block.innerHTML = block.innerHTML.replace(/var\(\s*--theme-color.*?\)/g, $docsify.themeColor);
+function emojify (text) {
+ return text
+ .replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g, function (m) { return m.replace(/:/g, '__colon__'); })
+ .replace(/:(\w+?):/ig, '
')
+ .replace(/__colon__/g, ':')
}
-function cssVars () {
- // variable support
- if (window.CSS && window.CSS.supports && window.CSS.supports('(--foo: red)')) { return }
-
- var styleBlocks = document.querySelectorAll('style:not(.inserted),link');[].forEach.call(styleBlocks, function (block) {
- if (block.nodeName === 'STYLE') {
- replaceVar(block);
- } else if (block.nodeName === 'LINK') {
- var href = block.getAttribute('href');
-
- if (!/\.css$/.test(href)) { return }
-
- load(href).then(function (res) {
- var style = document.createElement('style');
-
- style.innerHTML = res;
- document.head.appendChild(style);
- replaceVar(style);
- });
- }
- });
-}
-
-var markdown = marked;
+var markdownCompiler = marked;
+var contentBase = '';
+var currentPath = '';
+var renderer = new marked.Renderer();
+var TOC = {};
var toc = [];
-var CACHE = {};
-var originTitle = document.title;
-var renderTo = function (dom, content) {
- dom = typeof dom === 'object' ? dom : document.querySelector(dom);
- dom.innerHTML = content;
- slugify.clear();
+/**
+ * Compile markdown content
+ */
+var markdown = cached(function (text) {
+ var html = '';
- return dom
+ if (!text) { return text }
+
+ html = markdownCompiler(text);
+ html = emojify(html);
+ clearSlugCache();
+
+ return html
+});
+
+markdown.renderer = renderer;
+
+markdown.init = function (config, base) {
+ if ( config === void 0 ) config = {};
+ if ( base === void 0 ) base = window.location.pathname;
+
+ contentBase = getBasePath(base);
+ currentPath = parse().path;
+
+ if (isFn(config)) {
+ markdownCompiler = config(marked, renderer);
+ } else {
+ renderer = merge(renderer, config.renderer);
+ marked.setOptions(merge(config, { renderer: renderer }));
+ }
+};
+
+markdown.update = function () {
+ currentPath = parse().path;
};
/**
- * init render
+ * render anchor tag
+ * @link https://github.com/chjj/marked#overriding-renderer-methods
*/
-function init () {
- var renderer = new marked.Renderer();
- /**
- * render anchor tag
- * @link https://github.com/chjj/marked#overriding-renderer-methods
- */
- renderer.heading = function (text, level) {
- var slug = slugify(text);
- var route = '';
+renderer.heading = function (text, level) {
+ var slug = slugify(text);
+ var url = toURL(currentPath, { id: slug });
- route = "#/" + (getRoute());
- toc.push({ level: level, slug: (route + "#" + (encodeURIComponent(slug))), title: text });
+ toc.push({ level: level, slug: url, title: text });
- return ("" + text + "")
- };
- // highlight code
- renderer.code = function (code, lang) {
- if ( lang === void 0 ) lang = '';
+ return ("" + text + "")
+};
+// highlight code
+renderer.code = function (code, lang) {
+ if ( lang === void 0 ) lang = '';
- var hl = prism.highlight(code, prism.languages[lang] || prism.languages.markup);
+ var hl = prism.highlight(code, prism.languages[lang] || prism.languages.markup);
- return ("" + hl + "
")
- };
- renderer.link = function (href, title, text) {
- if (!/:|(\/{2})/.test(href)) {
- href = ("#/" + href).replace(/\/+/g, '/');
- }
- return ("" + text + "")
- };
- renderer.paragraph = function (text) {
- if (/^!>/.test(text)) {
- return helper('tip', text)
- } else if (/^\?>/.test(text)) {
- return helper('warn', text)
- }
- return ("" + text + "
")
- };
- renderer.image = function (href, title, text) {
- var url = /:|(\/{2})/.test(href) ? href : ($docsify.basePath + href).replace(/\/+/g, '/');
- var titleHTML = title ? (" title=\"" + title + "\"") : '';
-
- return ("
")
- };
-
- if (typeof $docsify.markdown === 'function') {
- markdown = $docsify.markdown.call(this, markdown, renderer);
+ return ("" + hl + "
")
+};
+renderer.link = function (href, title, text) {
+ var blank = '';
+ if (!/:|(\/{2})/.test(href)) {
+ href = toURL(href);
} else {
- if ($docsify.markdown && $docsify.markdown.renderer) {
- $docsify.markdown.renderer = merge(renderer, $docsify.markdown.renderer);
- }
- markdown.setOptions(merge({ renderer: renderer }, $docsify.markdown));
+ blank = ' target="_blank"';
+ }
+ return ("" + text + "")
+};
+renderer.paragraph = function (text) {
+ if (/^!>/.test(text)) {
+ return helper('tip', text)
+ } else if (/^\?>/.test(text)) {
+ return helper('warn', text)
+ }
+ return ("" + text + "
")
+};
+renderer.image = function (href, title, text) {
+ var url = href;
+ var titleHTML = title ? (" title=\"" + title + "\"") : '';
+
+ if (!isAbsolutePath(href)) {
+ url = getPath(contentBase, href);
}
- var md = markdown;
+ return ("
")
+};
- markdown = function (text) { return emojify(md(text)); };
+/**
+ * Compile sidebar
+ */
+function sidebar (text, level) {
+ var html = '';
- window.Docsify.utils.marked = function (text) {
- var result = markdown(text);
- toc = [];
- return result
- };
+ if (text) {
+ html = markdown(text);
+ html = html.match(/]*>([\s\S]+)<\/ul>/g)[0];
+ } else {
+ var tree$$1 = genTree(toc, level);
+ html = tree(tree$$1, '');
+ }
+
+ return html
}
/**
- * App
+ * Compile sub sidebar
*/
-function renderApp (dom, replace) {
- var nav = document.querySelector('nav') || document.createElement('nav');
- var body = document.body;
- var head = document.head;
+function subSidebar (el, level) {
+ if (el) {
+ toc[0] && toc[0].level === 1 && toc.shift();
+ var tree$$1 = genTree(TOC[currentPath] || toc, level);
+ el.parentNode.innerHTML += tree(tree$$1, '
'+n+"
"},e.link=function(e,t,n){return/:|(\/{2})/.test(e)||(e=("#/"+e).replace(/\/+/g,"/")),''+n+""},e.paragraph=function(e){return/^!>/.test(e)?k("tip",e):/^\?>/.test(e)?k("warn",e):""+e+"
"},e.image=function(e,t,n){var r=/:|(\/{2})/.test(e)?e:($docsify.basePath+e).replace(/\/+/g,"/"),i=t?' title="'+t+'"':"";return'
"},"function"==typeof $docsify.markdown?z=$docsify.markdown.call(this,z,e):($docsify.markdown&&$docsify.markdown.renderer&&($docsify.markdown.renderer=O(e,$docsify.markdown.renderer)),z.setOptions(O({renderer:e},$docsify.markdown)));var t=z;z=function(e){return s(t(e))},window.Docsify.utils.marked=function(e){var t=z(e);return D=[],t}}function $(e,t){var n=document.querySelector("nav")||document.createElement("nav"),r=document.body,i=document.head;if($docsify.repo||n.classList.add("no-badge"),e[t?"outerHTML":"innerHTML"]=f($docsify.repo)+($docsify.coverpage?y():"")+m(),r.insertBefore(n,r.children[0]),$docsify.themeColor&&(i.innerHTML+=w($docsify.themeColor),L()),$docsify.name){var a=document.querySelector(".sidebar");a.innerHTML='"+a.innerHTML}d("button.sidebar-toggle"),$docsify.coverpage?!o()&&window.addEventListener("scroll",h):r.classList.add("sticky")}function _(e){var t=window.Docsify.hook,n=function(e){if(G("article",e),$docsify.loadSidebar||E(),e&&"undefined"!=typeof Vue){R.vm&&R.vm.$destroy();var t=[].slice.call(document.body.querySelectorAll("article>script")).filter(function(e){return!/template/.test(e.type)})[0],n=t?t.innerText.trim():null;t&&t.remove(),R.vm=n?new Function("return "+n)():new Vue({el:"main"}),R.vm&&R.vm.$nextTick(function(e){return l()})}$docsify.auto2top&&setTimeout(function(){return p($docsify.auto2top)},0)};t.emit("before",e,function(e){var r=e?z(e):"";t.emit("after",r,function(e){return n(e||"not found")})})}function C(e){R.navbar&&R.navbar===e||(R.navbar=e,e&&G("nav",z(e)),u("nav"))}function E(e){var n;e?(n=z(e),n=n.match(/]*>([\s\S]+)<\/ul>/g)[0]):n=v(t(D,$docsify.maxLevel),""),G(".sidebar-nav",n),D[0]&&1===D[0].level&&(document.title=""+D[0].title+(B?" - "+B:""));var r=u(".sidebar-nav",!0);r&&A(r),D=[],l()}function A(e){$docsify.subMaxLevel&&(D[0]&&1===D[0].level&&D.shift(),e.parentNode.innerHTML+=v(t(D,$docsify.subMaxLevel),""))}function T(e){if(T.dom=T.dom||document.querySelector("section.cover"),!e)return void T.dom.classList.remove("show");if(T.dom.classList.add("show"),T.rendered)return h();var t=D.slice(),n=z(e),r=n.trim().match('
([^<]*?)
$');if(D=t.slice(),r){var i=document.querySelector("section.cover");"color"===r[2]?i.style.background=r[1]+(r[3]||""):(i.classList.add("has-mask"),i.style.backgroundImage="url("+r[1]+")"),n=n.replace(r[0],"")}G(".cover-main",n),T.rendered=!0,h()}function q(e){var t,n=e.loaded,r=e.total,i=e.step;if(!R.loading){var o=document.createElement("div");o.classList.add("progress"),document.body.appendChild(o),R.loading=o}i?(t=parseInt(R.loading.style.width,10)+i,t=t>80?80:t):t=Math.floor(n/r*100),R.loading.style.opacity=1,R.loading.style.width=t>=95?"100%":t+"%",t>=95&&(clearTimeout(q.cacheTimeout),q.cacheTimeout=setTimeout(function(e){R.loading.style.opacity=0,R.loading.style.width="0%"},200))}var j=null,M=null;a.clear=function(){a.occurrences={}};var N=Object.prototype.hasOwnProperty,O=Object.assign||function(e){for(var t=arguments,n=1;n/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(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 s(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function l(){}function c(e){for(var t,n,r=arguments,i=1;iAn error occured:
"+o(e.message+"",!0)+"
";throw e}}var d={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:l,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:l,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:l,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};d.bullet=/(?:[*+-]|\d+\.)/,d.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,d.item=s(d.item,"gm")(/bull/g,d.bullet)(),d.list=s(d.list)(/bull/g,d.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+d.def.source+")")(),d.blockquote=s(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=s(d.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,d._tag)(),d.paragraph=s(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=s(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*/}),t.rules=d,t.lex=function(e,n){var r=new t(n);return r.lex(e)},t.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)},t.prototype.token=function(e,t,n){for(var r,i,o,a,s,l,c,u,p,h=this,e=e.replace(/^ +$/gm,"");e;)if((o=h.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&h.tokens.push({type:"space"})),o=h.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),h.tokens.push({type:"code",text:h.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=h.rules.fences.exec(e))e=e.substring(o[0].length),h.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=h.rules.heading.exec(e))e=e.substring(o[0].length),h.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(t&&(o=h.rules.nptable.exec(e))){for(e=e.substring(o[0].length),l={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},u=0;u ?/gm,""),h.token(o,t,!0),h.tokens.push({type:"blockquote_end"});else if(o=h.rules.list.exec(e)){for(e=e.substring(o[0].length),a=o[2],h.tokens.push({type:"list_start",ordered:a.length>1}),o=o[0].match(h.rules.item),r=!1,p=o.length,u=0;u1&&s.length>1||(e=o.slice(u+1).join("\n")+e,u=p-1)),i=r||/\n\n(?!\s*$)/.test(l),u!==p-1&&(r="\n"===l.charAt(l.length-1),i||(i=r)),h.tokens.push({type:i?"loose_item_start":"list_item_start"}),h.token(l,!1,n),h.tokens.push({type:"list_item_end"});h.tokens.push({type:"list_end"})}else if(o=h.rules.html.exec(e))e=e.substring(o[0].length),h.tokens.push({type:h.options.sanitize?"paragraph":"html",pre:!h.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(!n&&t&&(o=h.rules.def.exec(e)))e=e.substring(o[0].length),h.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]};else if(t&&(o=h.rules.table.exec(e))){for(e=e.substring(o[0].length),l={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:l,tag:/^|^<\/?\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:l,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,p.link=s(p.link)("inside",p._inside)("href",p._href)(),p.reflink=s(p.reflink)("inside",p._inside)(),p.normal=c({},p),p.pedantic=c({},p.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),p.gfm=c({},p.normal,{escape:s(p.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(p.text)("]|","~]|")("|","|https?://|")()}),p.breaks=c({},p.gfm,{br:s(p.br)("{2,}","*")(),text:s(p.gfm.text)("{2,}","*")()}),n.rules=p,n.output=function(e,t,r){var i=new n(t,r);return i.output(e)},n.prototype.output=function(e){for(var t,n,r,i,a=this,s="";e;)if(i=a.rules.escape.exec(e))e=e.substring(i[0].length),s+=i[1];else if(i=a.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?a.mangle(i[1].substring(7)):a.mangle(i[1]),r=a.mangle("mailto:")+n):(n=o(i[1]),r=n),s+=a.renderer.link(r,null,n);else if(a.inLink||!(i=a.rules.url.exec(e))){if(i=a.rules.tag.exec(e))!a.inLink&&/^/i.test(i[0])&&(a.inLink=!1),e=e.substring(i[0].length),s+=a.options.sanitize?a.options.sanitizer?a.options.sanitizer(i[0]):o(i[0]):i[0];else if(i=a.rules.link.exec(e))e=e.substring(i[0].length),a.inLink=!0,s+=a.outputLink(i,{href:i[2],title:i[3]}),a.inLink=!1;else if((i=a.rules.reflink.exec(e))||(i=a.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=a.links[t.toLowerCase()],!t||!t.href){s+=i[0].charAt(0),e=i[0].substring(1)+e;continue}a.inLink=!0,s+=a.outputLink(i,t),a.inLink=!1}else if(i=a.rules.strong.exec(e))e=e.substring(i[0].length),s+=a.renderer.strong(a.output(i[2]||i[1]));else if(i=a.rules.em.exec(e))e=e.substring(i[0].length),s+=a.renderer.em(a.output(i[2]||i[1]));else if(i=a.rules.code.exec(e))e=e.substring(i[0].length),s+=a.renderer.codespan(o(i[2],!0));else if(i=a.rules.br.exec(e))e=e.substring(i[0].length),s+=a.renderer.br();else if(i=a.rules.del.exec(e))e=e.substring(i[0].length),s+=a.renderer.del(a.output(i[1]));else if(i=a.rules.text.exec(e))e=e.substring(i[0].length),s+=a.renderer.text(o(a.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=o(i[1]),r=n,s+=a.renderer.link(r,null,n);return s},n.prototype.outputLink=function(e,t){var n=o(t.href),r=t.title?o(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,o(e[1]))},n.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},n.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i.5&&(t="x"+t.toString(16)),n+=""+t+";";return n},r.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?''+(n?e:o(e,!0))+"\n
\n":""+(n?e:o(e,!0))+"\n
"},r.prototype.blockquote=function(e){return"\n"+e+"
\n"},r.prototype.html=function(e){return e},r.prototype.heading=function(e,t,n){return"\n"},r.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},r.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+""+n+">\n"},r.prototype.listitem=function(e){return""+e+"\n"},r.prototype.paragraph=function(e){return""+e+"
\n"},r.prototype.table=function(e,t){return"\n"},r.prototype.tablerow=function(e){return"\n"+e+"
\n"},r.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"},r.prototype.strong=function(e){return""+e+""},r.prototype.em=function(e){return""+e+""},r.prototype.codespan=function(e){return""+e+""},r.prototype.br=function(){return this.options.xhtml?"
":"
"},r.prototype.del=function(e){return""+e+""},r.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(a(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var i='"+n+""},r.prototype.image=function(e,t,n){var r='
":">"},r.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 n(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var r="";this.next();)r+=t.tok();return r},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,i,o,a="",s="";for(r="",t=0;te.length)break e;if(!(v instanceof i)){u.lastIndex=0;var k=u.exec(v),w=1;if(!k&&h&&y!=o.length-1){if(u.lastIndex=b,k=u.exec(e),!k)break;for(var x=k.index+(p?k[1].length:0),L=k.index+k[0].length,S=y,$=b,_=o.length;S<_&&$=$&&(++y,b=$);if(o[y]instanceof i||o[S-1].greedy)continue;w=S-y,v=e.slice(b,$),k.index-=b}if(k){p&&(g=k[1].length);var x=k.index+g,k=k[0].slice(g),L=x+k.length,C=v.slice(0,x),E=v.slice(L),A=[y,w];C&&A.push(C);var T=new i(s,d?r.tokenize(k,d):k,f,k,h);A.push(T),E&&A.push(E),Array.prototype.splice.apply(o,A)}}}}}return o},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 i,o=0;i=n[o++];)i(t)}}},i=r.Token=function(e,t,n,r,i){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!i};if(i.stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===r.util.type(e))return e.map(function(n){return i.stringify(n,t,e)}).join("");var o={type:e.type,content:i.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if("comment"==o.type&&(o.attributes.spellcheck="true"),e.alias){var a="Array"===r.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(o.classes,a)}r.hooks.run("wrap",o);var s=Object.keys(o.attributes).map(function(e){return e+'="'+(o.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+o.tag+' class="'+o.classes.join(" ")+'"'+(s?" "+s:"")+">"+o.content+""+o.tag+">"},!t.document)return t.addEventListener?(t.addEventListener("message",function(e){var n=JSON.parse(e.data),i=n.language,o=n.code,a=n.immediateClose;
-t.postMessage(r.highlight(o,r.languages[i],i)),a&&t.close()},!1),t.Prism):t.Prism;var o=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return o&&(r.filename=o.src,document.addEventListener&&!o.hasAttribute("data-manual")&&("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(r.highlightAll):window.setTimeout(r.highlightAll,16):document.addEventListener("DOMContentLoaded",r.highlightAll))),t.Prism}();e.exports&&(e.exports=n),"undefined"!=typeof I&&(I.Prism=n),n.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://i,cdata://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:{pattern:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,greedy:!0},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:/("}function F(e,t){return t={exports:{}},e(t,t.exports),t.exports}function I(e,t){var n=[],r={};return e.forEach(function(e){var i=e.level||1,a=i-1;i>t||(r[a]?(r[a].children=r[a].children||[],r[a].children.push(e)):n.push(e),r[i]=e)}),n}function H(e){if("string"!=typeof e)return"";var t=e.toLowerCase().trim().replace(/<[^>\d]+>/g,"").replace(Re,"").replace(/\s/g,"-").replace(/-+/g,"-").replace(/^(\d)/,"_$1"),n=ze[t];return n=ze.hasOwnProperty(t)?n+1:0,ze[t]=n,n&&(t=t+"-"+n),t}function z(){ze={}}function R(e){return e.replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g,function(e){return e.replace(/:/g,"__colon__")}).replace(/:(\w+?):/gi,'
').replace(/__colon__/g,":")}function W(e,t){var n="";if(e)n=Ve(e),n=n.match(/]*>([\s\S]+)<\/ul>/g)[0];else{var r=I(Ze,t);n=q(r,"")}return n}function B(e,t){if(e){Ze[0]&&1===Ze[0].level&&Ze.shift();var n=I(Ge[De]||Ze,t);e.parentNode.innerHTML+=q(n,'
"+a(e.message+"",!0)+"
";throw e}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:l,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:l,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:l,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=s(p.item,"gm")(/bull/g,p.bullet)(),p.list=s(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=s(p.blockquote)("def",p.def)(),p._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",p.html=s(p.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,p._tag)(),p.paragraph=s(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=u({},p),p.gfm=u({},p.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),p.gfm.paragraph=s(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=u({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=p,t.lex=function(e,n){var r=new t(n);return r.lex(e)},t.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)},t.prototype.token=function(e,t,n){for(var r,i,a,o,s,l,u,c,h,g=this,e=e.replace(/^ +$/gm,"");e;)if((a=g.rules.newline.exec(e))&&(e=e.substring(a[0].length),a[0].length>1&&g.tokens.push({type:"space"})),a=g.rules.code.exec(e))e=e.substring(a[0].length),a=a[0].replace(/^ {4}/gm,""),g.tokens.push({type:"code",text:g.options.pedantic?a:a.replace(/\n+$/,"")});else if(a=g.rules.fences.exec(e))e=e.substring(a[0].length),g.tokens.push({type:"code",lang:a[2],text:a[3]||""});else if(a=g.rules.heading.exec(e))e=e.substring(a[0].length),g.tokens.push({type:"heading",depth:a[1].length,text:a[2]});else if(t&&(a=g.rules.nptable.exec(e))){for(e=e.substring(a[0].length),l={type:"table",header:a[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:a[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:a[3].replace(/\n$/,"").split("\n")},c=0;c ?/gm,""),g.token(a,t,!0),g.tokens.push({type:"blockquote_end"});else if(a=g.rules.list.exec(e)){for(e=e.substring(a[0].length),o=a[2],g.tokens.push({type:"list_start",ordered:o.length>1}),a=a[0].match(g.rules.item),r=!1,h=a.length,c=0;c1&&s.length>1||(e=a.slice(c+1).join("\n")+e,c=h-1)),i=r||/\n\n(?!\s*$)/.test(l),c!==h-1&&(r="\n"===l.charAt(l.length-1),i||(i=r)),g.tokens.push({type:i?"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(a=g.rules.html.exec(e))e=e.substring(a[0].length),g.tokens.push({type:g.options.sanitize?"paragraph":"html",pre:!g.options.sanitizer&&("pre"===a[1]||"script"===a[1]||"style"===a[1]),text:a[0]});else if(!n&&t&&(a=g.rules.def.exec(e)))e=e.substring(a[0].length),g.tokens.links[a[1].toLowerCase()]={href:a[2],title:a[3]};else if(t&&(a=g.rules.table.exec(e))){for(e=e.substring(a[0].length),l={type:"table",header:a[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:a[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:a[3].replace(/(?: *\| *)?\n$/,"").split("\n")},c=0;c])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:l,tag:/^|^<\/?\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:l,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,h.link=s(h.link)("inside",h._inside)("href",h._href)(),h.reflink=s(h.reflink)("inside",h._inside)(),h.normal=u({},h),h.pedantic=u({},h.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),h.gfm=u({},h.normal,{escape:s(h.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(h.text)("]|","~]|")("|","|https?://|")()}),h.breaks=u({},h.gfm,{br:s(h.br)("{2,}","*")(),text:s(h.gfm.text)("{2,}","*")()}),n.rules=h,n.output=function(e,t,r){var i=new n(t,r);return i.output(e)},n.prototype.output=function(e){for(var t,n,r,i,o=this,s="";e;)if(i=o.rules.escape.exec(e))e=e.substring(i[0].length),s+=i[1];else if(i=o.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?o.mangle(i[1].substring(7)):o.mangle(i[1]),r=o.mangle("mailto:")+n):(n=a(i[1]),r=n),s+=o.renderer.link(r,null,n);else if(o.inLink||!(i=o.rules.url.exec(e))){if(i=o.rules.tag.exec(e))!o.inLink&&/^/i.test(i[0])&&(o.inLink=!1),e=e.substring(i[0].length),s+=o.options.sanitize?o.options.sanitizer?o.options.sanitizer(i[0]):a(i[0]):i[0];else if(i=o.rules.link.exec(e))e=e.substring(i[0].length),o.inLink=!0,s+=o.outputLink(i,{href:i[2],title:i[3]}),o.inLink=!1;else if((i=o.rules.reflink.exec(e))||(i=o.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=o.links[t.toLowerCase()],!t||!t.href){s+=i[0].charAt(0),e=i[0].substring(1)+e;continue}o.inLink=!0,s+=o.outputLink(i,t),o.inLink=!1}else if(i=o.rules.strong.exec(e))e=e.substring(i[0].length),s+=o.renderer.strong(o.output(i[2]||i[1]));else if(i=o.rules.em.exec(e))e=e.substring(i[0].length),s+=o.renderer.em(o.output(i[2]||i[1]));else if(i=o.rules.code.exec(e))e=e.substring(i[0].length),s+=o.renderer.codespan(a(i[2],!0));else if(i=o.rules.br.exec(e))e=e.substring(i[0].length),s+=o.renderer.br();else if(i=o.rules.del.exec(e))e=e.substring(i[0].length),s+=o.renderer.del(o.output(i[1]));else if(i=o.rules.text.exec(e))e=e.substring(i[0].length),s+=o.renderer.text(a(o.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=a(i[1]),r=n,s+=o.renderer.link(r,null,n);return s},n.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},n.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},n.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i.5&&(t="x"+t.toString(16)),n+=""+t+";";return n},r.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?''+(n?e:a(e,!0))+"\n
\n":""+(n?e:a(e,!0))+"\n
"},r.prototype.blockquote=function(e){return"\n"+e+"
\n"},r.prototype.html=function(e){return e},r.prototype.heading=function(e,t,n){return"\n"},r.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},r.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+""+n+">\n"},r.prototype.listitem=function(e){return""+e+"\n"},r.prototype.paragraph=function(e){return""+e+"
\n"},r.prototype.table=function(e,t){return"\n"},r.prototype.tablerow=function(e){return"\n"+e+"
\n"},r.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"},r.prototype.strong=function(e){return""+e+""},r.prototype.em=function(e){return""+e+""},r.prototype.codespan=function(e){return""+e+""},r.prototype.br=function(){return this.options.xhtml?"
":"
"},r.prototype.del=function(e){return""+e+""},r.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 i='"+n+""},r.prototype.image=function(e,t,n){var r='
":">"},r.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 n(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var r="";this.next();)r+=t.tok();return r},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,i,a,o="",s="";for(r="",t=0;te.length)break e;if(!(y instanceof i)){c.lastIndex=0;var k=c.exec(y),w=1;if(!k&&g&&v!=a.length-1){if(c.lastIndex=b,k=c.exec(e),!k)break;for(var x=k.index+(h?k[1].length:0),_=k.index+k[0].length,L=v,S=b,C=a.length;L=S&&(++v,b=S);if(a[v]instanceof i||a[L-1].greedy)continue;w=L-v,y=e.slice(b,S),k.index-=b}if(k){h&&(d=k[1].length);var x=k.index+d,k=k[0].slice(d),_=x+k.length,$=y.slice(0,x),E=y.slice(_),T=[v,w];$&&T.push($);var A=new i(s,p?r.tokenize(k,p):k,f,k,g);T.push(A),E&&T.push(E),Array.prototype.splice.apply(a,T)}}}}}return a},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 i,a=0;i=n[a++];)i(t)}}},i=r.Token=function(e,t,n,r,i){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!i};if(i.stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===r.util.type(e))return e.map(function(n){return i.stringify(n,t,e)}).join("");var a={type:e.type,content:i.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if("comment"==a.type&&(a.attributes.spellcheck="true"),e.alias){var o="Array"===r.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(a.classes,o)}r.hooks.run("wrap",a);var s=Object.keys(a.attributes).map(function(e){return e+'="'+(a.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+a.tag+' class="'+a.classes.join(" ")+'"'+(s?" "+s:"")+">"+a.content+""+a.tag+">"},!t.document)return t.addEventListener?(t.addEventListener("message",function(e){var n=JSON.parse(e.data),i=n.language,a=n.code,o=n.immediateClose;t.postMessage(r.highlight(a,r.languages[i],i)),o&&t.close()},!1),t.Prism):t.Prism;var a=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return a&&(r.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(r.highlightAll):window.setTimeout(r.highlightAll,16):document.addEventListener("DOMContentLoaded",r.highlightAll))),t.Prism}();e.exports&&(e.exports=n),"undefined"!=typeof Fe&&(Fe.Prism=n),n.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://i,cdata://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:{pattern:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,greedy:!0},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:/(