markdown add todo-list feature

This commit is contained in:
lealife committed 2015-12-25 11:50:34 +08:00
1 parent 315a7bbe62
commit 08ae37cae0
2 files changed
+452 -3

No files matched your search

+449
View File
@@ -12842,6 +12842,21 @@ define('extensions/emailConverter',[
return emailConverter; return emailConverter;
}); });
define('extensions/todoList',[
"classes/Extension",
], function(Extension) {
var todoList = new Extension("todoList", "Markdown todoList", true);
todoList.onPagedownConfigure = function(editor) {
editor.getConverter().hooks.chain("postConversion", function(text) {
return text.replace(/<li>(<p>)?\[([ xX]?)\] /g, function(matched, p, b) {
p || (p = '');
return !(b == 'x' || b == 'X') ? '<li class="m-todo-item m-todo-empty">' + p + '<input type="checkbox" /> ' : '<li class="m-todo-item m-todo-done">' + p + '<input type="checkbox" checked /> '
});
});
};
return todoList;
});
/** /**
scrollLink原理 scrollLink原理
@@ -13230,6 +13245,438 @@ define('extensions/scrollLink',[
return scrollLink; return scrollLink;
}); });
define('extensions/htmlSanitizer',[
// "jquery",
"underscore",
"utils",
"classes/Extension",
// "ext!html/htmlSanitizerSettingsBlock.html"
], function(_, utils, Extension) {
var htmlSanitizer = new Extension("htmlSanitizer", "HTML Sanitizer", true);
// htmlSanitizer.settingsBlock = htmlSanitizerSettingsBlockHTML;
var buf;
htmlSanitizer.onPagedownConfigure = function(editor) {
var converter = editor.getConverter();
converter.hooks.chain("postConversion", function(html) {
buf = [];
html.split('<div class="se-preview-section-delimiter"></div>').forEach(function(sectionHtml) {
htmlParser(sectionHtml, htmlSanitizeWriter(buf
/*, function(uri, isImage) {
return !/^unsafe/.test(sanitizeUri(uri, isImage));
}*/));
buf.push('<div class="se-preview-section-delimiter"></div>');
});
return buf.slice(0, -1).join('');
});
};
/**
* @license AngularJS v1.2.16
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
// var aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file):/,
// imgSrcSanitizationWhitelist = /^\s*(https?|ftp|file|leanote):|data:image\//;
/*
var urlResolve = (function() {
var urlParsingNode = document.createElement("a");
return function urlResolve(url) {
var href = url;
if (utils.msie) {
// Normalize before parse. Refer Implementation Notes on why this is
// done in two steps on IE.
urlParsingNode.setAttribute("href", href);
href = urlParsingNode.href;
}
urlParsingNode.setAttribute('href', href);
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
return {
href: urlParsingNode.href,
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
host: urlParsingNode.host,
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
hostname: urlParsingNode.hostname,
port: urlParsingNode.port,
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
urlParsingNode.pathname : '/' + urlParsingNode.pathname
};
};
})();
function sanitizeUri(uri, isImage) {
var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist;
var normalizedVal;
normalizedVal = urlResolve(uri).href;
if(normalizedVal !== '' && !normalizedVal.match(regex)) {
return 'unsafe:' + normalizedVal;
}
}
*/
// Regular Expressions for parsing tags and attributes
var START_TAG_REGEXP =
/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,
END_TAG_REGEXP = /^<\s*\/\s*([\w:-]+)[^>]*>/,
ATTR_REGEXP = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,
BEGIN_TAG_REGEXP = /^</,
BEGING_END_TAGE_REGEXP = /^<\s*\//,
COMMENT_REGEXP = /<!--(.*?)-->/g,
DOCTYPE_REGEXP = /<!DOCTYPE([^>]*?)>/i,
CDATA_REGEXP = /<!\[CDATA\[(.*?)]]>/g,
// Match everything outside of normal chars and " (quote character)
NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g;
function makeMap(str) {
var obj = {}, items = str.split(','), i;
for(i = 0; i < items.length; i++) {
obj[items[i]] = true;
}
return obj;
}
// Good source of info about elements and attributes
// http://dev.w3.org/html5/spec/Overview.html#semantics
// http://simon.html5.org/html-elements
// Safe Void Elements - HTML5
// http://dev.w3.org/html5/spec/Overview.html#void-elements
var voidElements = makeMap("area,br,col,hr,img,wbr");
// Elements that you can, intentionally, leave open (and which close themselves)
// http://dev.w3.org/html5/spec/Overview.html#optional-tags
var optionalEndTagBlockElements = makeMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),
optionalEndTagInlineElements = makeMap("rp,rt"),
optionalEndTagElements = _.extend({},
optionalEndTagInlineElements,
optionalEndTagBlockElements);
// 允许的elements
// Safe Block Elements - HTML5
var blockElements = _.extend({}, optionalEndTagBlockElements, makeMap("address,article," +
"aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5," +
"h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul,embed,iframe"));
// Inline Elements - HTML5
var inlineElements = _.extend({}, optionalEndTagInlineElements, makeMap("a,abbr,acronym,b," +
"bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s," +
"samp,small,span,strike,strong,sub,sup,time,tt,u,var,input"));
// Special Elements (can contain anything)
var specialElements = makeMap("script,style");
// benweet: Add iframe
// blockElements.iframe = true;
var validElements = _.extend({},
voidElements,
blockElements,
inlineElements,
optionalEndTagElements);
//Attributes that have href and hence need to be sanitized
var uriAttrs = makeMap("background,cite,href,longdesc,src,usemap");
var validAttrs = _.extend({}, uriAttrs, makeMap(
'abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +
'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +
'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +
'scope,scrolling,shape,size,span,start,summary,target,title,type,' +
'valign,value,vspace,width,checked'));
// benweet: Add id and allowfullscreen (YouTube iframe)
validAttrs.id = true;
validAttrs.allowfullscreen = true;
/*
* HTML Parser By Misko Hevery (misko@hevery.com)
* based on: HTML Parser By John Resig (ejohn.org)
* Original code by Erik Arvidsson, Mozilla Public License
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
*
* // Use like so:
* htmlParser(htmlString, {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* });
*
*/
/* jshint -W083 */
function htmlParser(html, handler) {
var index, chars, match, stack = [], last = html;
stack.last = function() {
return stack[ stack.length - 1 ];
};
function parseStartTag(tag, tagName, rest, unary) {
tagName = tagName && tagName.toLowerCase();
if(blockElements[ tagName ]) {
while(stack.last() && inlineElements[ stack.last() ]) {
parseEndTag("", stack.last());
}
}
if(optionalEndTagElements[ tagName ] && stack.last() == tagName) {
parseEndTag("", tagName);
}
unary = voidElements[ tagName ] || !!unary;
if(!unary) {
stack.push(tagName);
}
var attrs = {};
rest.replace(ATTR_REGEXP,
function(match, name, doubleQuotedValue, singleQuotedValue, unquotedValue) {
var value = doubleQuotedValue ||
singleQuotedValue ||
unquotedValue ||
'';
attrs[name] = decodeEntities(value);
});
if(handler.start) {
handler.start(tagName, attrs, unary);
}
}
function parseEndTag(tag, tagName) {
var pos = 0, i;
tagName = tagName && tagName.toLowerCase();
if(tagName) {
// Find the closest opened tag of the same type
for(pos = stack.length - 1; pos >= 0; pos--) {
if(stack[ pos ] == tagName) {
break;
}
}
}
if(pos >= 0) {
// Close all the open elements, up the stack
for(i = stack.length - 1; i >= pos; i--) {
if(handler.end) {
handler.end(stack[ i ]);
}
}
// Remove the open elements from the stack
stack.length = pos;
}
}
while(html) {
chars = true;
// Make sure we're not in a script or style element
if(!stack.last() || !specialElements[ stack.last() ]) {
// Comment
if(html.indexOf("<!--") === 0) {
// comments containing -- are not allowed unless they terminate the comment
index = html.indexOf("--", 4);
if(index >= 0 && html.lastIndexOf("-->", index) === index) {
if(handler.comment) {
handler.comment(html.substring(4, index));
}
html = html.substring(index + 3);
chars = false;
}
// DOCTYPE
} else if(DOCTYPE_REGEXP.test(html)) {
match = html.match(DOCTYPE_REGEXP);
if(match) {
html = html.replace(match[0], '');
chars = false;
}
// end tag
} else if(BEGING_END_TAGE_REGEXP.test(html)) {
match = html.match(END_TAG_REGEXP);
if(match) {
html = html.substring(match[0].length);
match[0].replace(END_TAG_REGEXP, parseEndTag);
chars = false;
}
// start tag
} else if(BEGIN_TAG_REGEXP.test(html)) {
match = html.match(START_TAG_REGEXP);
if(match) {
html = html.substring(match[0].length);
match[0].replace(START_TAG_REGEXP, parseStartTag);
chars = false;
}
}
if(chars) {
index = html.indexOf("<");
var text = index < 0 ? html : html.substring(0, index);
html = index < 0 ? "" : html.substring(index);
if(handler.chars) {
handler.chars(decodeEntities(text));
}
}
} else {
html = html.replace(new RegExp("(.*)<\\s*\\/\\s*" + stack.last() + "[^>]*>", 'i'),
function(all, text) {
text = text.replace(COMMENT_REGEXP, "$1").replace(CDATA_REGEXP, "$1");
if(handler.chars) {
handler.chars(decodeEntities(text));
}
return "";
});
parseEndTag("", stack.last());
}
if(html == last) {
//throw new Error("The sanitizer was unable to parse the following block of html: " + html);
stack.reverse();
return stack.forEach(function(tag) {
buf.push('</');
buf.push(tag);
buf.push('>');
});
}
last = html;
}
// Clean up any remaining tags
parseEndTag();
}
var hiddenPre = document.createElement("pre");
var spaceRe = /^(\s*)([\s\S]*?)(\s*)$/;
/**
* decodes all entities into regular string
* @param value
* @returns {string} A string with decoded entities.
*/
function decodeEntities(value) {
if(!value) {
return '';
}
// Note: IE8 does not preserve spaces at the start/end of innerHTML
// so we must capture them and reattach them afterward
var parts = spaceRe.exec(value);
var spaceBefore = parts[1];
var spaceAfter = parts[3];
var content = parts[2];
if(content) {
hiddenPre.innerHTML = content.replace(/</g, "&lt;");
// innerText depends on styling as it doesn't display hidden elements.
// Therefore, it's better to use textContent not to cause unnecessary
// reflows. However, IE<9 don't support textContent so the innerText
// fallback is necessary.
content = 'textContent' in hiddenPre ?
hiddenPre.textContent : hiddenPre.innerText;
}
return spaceBefore + content + spaceAfter;
}
/**
* Escapes all potentially dangerous characters, so that the
* resulting string can be safely inserted into attribute or
* element text.
* @param value
* @returns {string} escaped text
*/
function encodeEntities(value) {
return value.
replace(/&/g, '&amp;').
replace(NON_ALPHANUMERIC_REGEXP, function(value) {
return '&#' + value.charCodeAt(0) + ';';
}).
replace(/</g, '&lt;').
replace(/>/g, '&gt;');
}
/**
* create an HTML/XML writer which writes to buffer
* @param {Array} buf use buf.jain('') to get out sanitized html string
* @returns {object} in the form of {
* start: function(tag, attrs, unary) {},
* end: function(tag) {},
* chars: function(text) {},
* comment: function(text) {}
* }
*/
function htmlSanitizeWriter(buf /* , uriValidator */ ) {
var ignore = false;
var out = _.bind(buf.push, buf);
return {
start: function(tag, attrs, unary) {
tag = tag && tag.toLowerCase();
if(!ignore && specialElements[tag]) {
ignore = tag;
}
if(!ignore && validElements[tag] === true) {
out('<');
out(tag);
_.forEach(attrs, function(value, key) {
var lkey = key && key.toLowerCase();
// var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background');
if(validAttrs[lkey] === true &&
(uriAttrs[lkey] !== true || true/* || uriValidator(value, isImage) */)) {
out(' ');
out(key);
out('="');
out(encodeEntities(value));
out('"');
}
});
out(unary ? '/>' : '>');
}
},
end: function(tag) {
tag = tag && tag.toLowerCase();
if(!ignore && validElements[tag] === true) {
out('</');
out(tag);
out('>');
}
if(tag == ignore) {
ignore = false;
}
},
chars: function(chars) {
if(!ignore) {
out(encodeEntities(chars));
}
},
comment: function(comment) {
if(!ignore) {
out('<!--');
out(encodeEntities(comment));
out('-->');
}
}
};
}
return htmlSanitizer;
});
/* /*
* waitForImages 1.4.2 * waitForImages 1.4.2
* ------------------- * -------------------
@@ -13405,7 +13852,9 @@ define('eventMgr',[
"extensions/toc", "extensions/toc",
"extensions/mathJax", "extensions/mathJax",
"extensions/emailConverter", "extensions/emailConverter",
"extensions/todoList",
"extensions/scrollLink", "extensions/scrollLink",
"extensions/htmlSanitizer",
// "extensions/buttonFocusMode", // "extensions/buttonFocusMode",
// "extensions/buttonSync", // "extensions/buttonSync",
// "extensions/buttonPublish", // "extensions/buttonPublish",
+3 -3
View File
@@ -1,6 +1,6 @@
(function(){var e=this,n=e._,t={},r=Array.prototype,a=Object.prototype,i=Function.prototype,o=r.push,s=r.slice,l=r.concat,c=a.toString,u=a.hasOwnProperty,d=r.forEach,p=r.map,f=r.reduce,m=r.reduceRight,g=r.filter,h=r.every,v=r.some,b=r.indexOf,w=r.lastIndexOf,x=Array.isArray,y=Object.keys,C=i.bind,k=function(e){return e instanceof k?e:this instanceof k?void(this._wrapped=e):new k(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports._=k):e._=k,k.VERSION="1.5.1";var S=k.each=k.forEach=function(e,n,r){if(null!=e)if(d&&e.forEach===d)e.forEach(n,r);else if(e.length===+e.length){for(var a=0,i=e.length;i>a;a++)if(n.call(r,e[a],a,e)===t)return}else for(var o in e)if(k.has(e,o)&&n.call(r,e[o],o,e)===t)return};k.map=k.collect=function(e,n,t){var r=[];return null==e?r:p&&e.map===p?e.map(n,t):(S(e,function(e,a,i){r.push(n.call(t,e,a,i))}),r)};var _="Reduce of empty array with no initial value";k.reduce=k.foldl=k.inject=function(e,n,t,r){var a=arguments.length>2;if(null==e&&(e=[]),f&&e.reduce===f)return r&&(n=k.bind(n,r)),a?e.reduce(n,t):e.reduce(n);if(S(e,function(e,i,o){a?t=n.call(r,t,e,i,o):(t=e,a=!0)}),!a)throw new TypeError(_);return t},k.reduceRight=k.foldr=function(e,n,t,r){var a=arguments.length>2;if(null==e&&(e=[]),m&&e.reduceRight===m)return r&&(n=k.bind(n,r)),a?e.reduceRight(n,t):e.reduceRight(n);var i=e.length;if(i!==+i){var o=k.keys(e);i=o.length}if(S(e,function(s,l,c){l=o?o[--i]:--i,a?t=n.call(r,t,e[l],l,c):(t=e[l],a=!0)}),!a)throw new TypeError(_);return t},k.find=k.detect=function(e,n,t){var r;return E(e,function(e,a,i){return n.call(t,e,a,i)?(r=e,!0):void 0}),r},k.filter=k.select=function(e,n,t){var r=[];return null==e?r:g&&e.filter===g?e.filter(n,t):(S(e,function(e,a,i){n.call(t,e,a,i)&&r.push(e)}),r)},k.reject=function(e,n,t){return k.filter(e,function(e,r,a){return!n.call(t,e,r,a)},t)},k.every=k.all=function(e,n,r){n||(n=k.identity);var a=!0;return null==e?a:h&&e.every===h?e.every(n,r):(S(e,function(e,i,o){return(a=a&&n.call(r,e,i,o))?void 0:t}),!!a)};var E=k.some=k.any=function(e,n,r){n||(n=k.identity);var a=!1;return null==e?a:v&&e.some===v?e.some(n,r):(S(e,function(e,i,o){return a||(a=n.call(r,e,i,o))?t:void 0}),!!a)};k.contains=k.include=function(e,n){return null==e?!1:b&&e.indexOf===b?-1!=e.indexOf(n):E(e,function(e){return e===n})},k.invoke=function(e,n){var t=s.call(arguments,2),r=k.isFunction(n);return k.map(e,function(e){return(r?n:e[n]).apply(e,t)})},k.pluck=function(e,n){return k.map(e,function(e){return e[n]})},k.where=function(e,n,t){return k.isEmpty(n)?t?void 0:[]:k[t?"find":"filter"](e,function(e){for(var t in n)if(n[t]!==e[t])return!1;return!0})},k.findWhere=function(e,n){return k.where(e,n,!0)},k.max=function(e,n,t){if(!n&&k.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!n&&k.isEmpty(e))return-1/0;var r={computed:-1/0,value:-1/0};return S(e,function(e,a,i){var o=n?n.call(t,e,a,i):e;o>r.computed&&(r={value:e,computed:o})}),r.value},k.min=function(e,n,t){if(!n&&k.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!n&&k.isEmpty(e))return 1/0;var r={computed:1/0,value:1/0};return S(e,function(e,a,i){var o=n?n.call(t,e,a,i):e;o<r.computed&&(r={value:e,computed:o})}),r.value},k.shuffle=function(e){var n,t=0,r=[];return S(e,function(e){n=k.random(t++),r[t-1]=r[n],r[n]=e}),r};var T=function(e){return k.isFunction(e)?e:function(n){return n[e]}};k.sortBy=function(e,n,t){var r=T(n);return k.pluck(k.map(e,function(e,n,a){return{value:e,index:n,criteria:r.call(t,e,n,a)}}).sort(function(e,n){var t=e.criteria,r=n.criteria;if(t!==r){if(t>r||void 0===t)return 1;if(r>t||void 0===r)return-1}return e.index<n.index?-1:1}),"value")};var I=function(e,n,t,r){var a={},i=T(null==n?k.identity:n);return S(e,function(n,o){var s=i.call(t,n,o,e);r(a,s,n)}),a};k.groupBy=function(e,n,t){return I(e,n,t,function(e,n,t){(k.has(e,n)?e[n]:e[n]=[]).push(t)})},k.countBy=function(e,n,t){return I(e,n,t,function(e,n){k.has(e,n)||(e[n]=0),e[n]++})},k.sortedIndex=function(e,n,t,r){t=null==t?k.identity:T(t);for(var a=t.call(r,n),i=0,o=e.length;o>i;){var s=i+o>>>1;t.call(r,e[s])<a?i=s+1:o=s}return i},k.toArray=function(e){return e?k.isArray(e)?s.call(e):e.length===+e.length?k.map(e,k.identity):k.values(e):[]},k.size=function(e){return null==e?0:e.length===+e.length?e.length:k.keys(e).length},k.first=k.head=k.take=function(e,n,t){return null==e?void 0:null==n||t?e[0]:s.call(e,0,n)},k.initial=function(e,n,t){return s.call(e,0,e.length-(null==n||t?1:n))},k.last=function(e,n,t){return null==e?void 0:null==n||t?e[e.length-1]:s.call(e,Math.max(e.length-n,0))},k.rest=k.tail=k.drop=function(e,n,t){return s.call(e,null==n||t?1:n)},k.compact=function(e){return k.filter(e,k.identity)};var M=function(e,n,t){return n&&k.every(e,k.isArray)?l.apply(t,e):(S(e,function(e){k.isArray(e)||k.isArguments(e)?n?o.apply(t,e):M(e,n,t):t.push(e)}),t)};k.flatten=function(e,n){return M(e,n,[])},k.without=function(e){return k.difference(e,s.call(argumLine truncated (function(){var e=this,n=e._,t={},r=Array.prototype,a=Object.prototype,i=Function.prototype,o=r.push,s=r.slice,l=r.concat,c=a.toString,u=a.hasOwnProperty,d=r.forEach,p=r.map,f=r.reduce,m=r.reduceRight,g=r.filter,h=r.every,v=r.some,b=r.indexOf,w=r.lastIndexOf,x=Array.isArray,y=Object.keys,C=i.bind,k=function(e){return e instanceof k?e:this instanceof k?void(this._wrapped=e):new k(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports._=k):e._=k,k.VERSION="1.5.1";var S=k.each=k.forEach=function(e,n,r){if(null!=e)if(d&&e.forEach===d)e.forEach(n,r);else if(e.length===+e.length){for(var a=0,i=e.length;i>a;a++)if(n.call(r,e[a],a,e)===t)return}else for(var o in e)if(k.has(e,o)&&n.call(r,e[o],o,e)===t)return};k.map=k.collect=function(e,n,t){var r=[];return null==e?r:p&&e.map===p?e.map(n,t):(S(e,function(e,a,i){r.push(n.call(t,e,a,i))}),r)};var _="Reduce of empty array with no initial value";k.reduce=k.foldl=k.inject=function(e,n,t,r){var a=arguments.length>2;if(null==e&&(e=[]),f&&e.reduce===f)return r&&(n=k.bind(n,r)),a?e.reduce(n,t):e.reduce(n);if(S(e,function(e,i,o){a?t=n.call(r,t,e,i,o):(t=e,a=!0)}),!a)throw new TypeError(_);return t},k.reduceRight=k.foldr=function(e,n,t,r){var a=arguments.length>2;if(null==e&&(e=[]),m&&e.reduceRight===m)return r&&(n=k.bind(n,r)),a?e.reduceRight(n,t):e.reduceRight(n);var i=e.length;if(i!==+i){var o=k.keys(e);i=o.length}if(S(e,function(s,l,c){l=o?o[--i]:--i,a?t=n.call(r,t,e[l],l,c):(t=e[l],a=!0)}),!a)throw new TypeError(_);return t},k.find=k.detect=function(e,n,t){var r;return E(e,function(e,a,i){return n.call(t,e,a,i)?(r=e,!0):void 0}),r},k.filter=k.select=function(e,n,t){var r=[];return null==e?r:g&&e.filter===g?e.filter(n,t):(S(e,function(e,a,i){n.call(t,e,a,i)&&r.push(e)}),r)},k.reject=function(e,n,t){return k.filter(e,function(e,r,a){return!n.call(t,e,r,a)},t)},k.every=k.all=function(e,n,r){n||(n=k.identity);var a=!0;return null==e?a:h&&e.every===h?e.every(n,r):(S(e,function(e,i,o){return(a=a&&n.call(r,e,i,o))?void 0:t}),!!a)};var E=k.some=k.any=function(e,n,r){n||(n=k.identity);var a=!1;return null==e?a:v&&e.some===v?e.some(n,r):(S(e,function(e,i,o){return a||(a=n.call(r,e,i,o))?t:void 0}),!!a)};k.contains=k.include=function(e,n){return null==e?!1:b&&e.indexOf===b?-1!=e.indexOf(n):E(e,function(e){return e===n})},k.invoke=function(e,n){var t=s.call(arguments,2),r=k.isFunction(n);return k.map(e,function(e){return(r?n:e[n]).apply(e,t)})},k.pluck=function(e,n){return k.map(e,function(e){return e[n]})},k.where=function(e,n,t){return k.isEmpty(n)?t?void 0:[]:k[t?"find":"filter"](e,function(e){for(var t in n)if(n[t]!==e[t])return!1;return!0})},k.findWhere=function(e,n){return k.where(e,n,!0)},k.max=function(e,n,t){if(!n&&k.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!n&&k.isEmpty(e))return-1/0;var r={computed:-1/0,value:-1/0};return S(e,function(e,a,i){var o=n?n.call(t,e,a,i):e;o>r.computed&&(r={value:e,computed:o})}),r.value},k.min=function(e,n,t){if(!n&&k.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!n&&k.isEmpty(e))return 1/0;var r={computed:1/0,value:1/0};return S(e,function(e,a,i){var o=n?n.call(t,e,a,i):e;o<r.computed&&(r={value:e,computed:o})}),r.value},k.shuffle=function(e){var n,t=0,r=[];return S(e,function(e){n=k.random(t++),r[t-1]=r[n],r[n]=e}),r};var T=function(e){return k.isFunction(e)?e:function(n){return n[e]}};k.sortBy=function(e,n,t){var r=T(n);return k.pluck(k.map(e,function(e,n,a){return{value:e,index:n,criteria:r.call(t,e,n,a)}}).sort(function(e,n){var t=e.criteria,r=n.criteria;if(t!==r){if(t>r||void 0===t)return 1;if(r>t||void 0===r)return-1}return e.index<n.index?-1:1}),"value")};var I=function(e,n,t,r){var a={},i=T(null==n?k.identity:n);return S(e,function(n,o){var s=i.call(t,n,o,e);r(a,s,n)}),a};k.groupBy=function(e,n,t){return I(e,n,t,function(e,n,t){(k.has(e,n)?e[n]:e[n]=[]).push(t)})},k.countBy=function(e,n,t){return I(e,n,t,function(e,n){k.has(e,n)||(e[n]=0),e[n]++})},k.sortedIndex=function(e,n,t,r){t=null==t?k.identity:T(t);for(var a=t.call(r,n),i=0,o=e.length;o>i;){var s=i+o>>>1;t.call(r,e[s])<a?i=s+1:o=s}return i},k.toArray=function(e){return e?k.isArray(e)?s.call(e):e.length===+e.length?k.map(e,k.identity):k.values(e):[]},k.size=function(e){return null==e?0:e.length===+e.length?e.length:k.keys(e).length},k.first=k.head=k.take=function(e,n,t){return null==e?void 0:null==n||t?e[0]:s.call(e,0,n)},k.initial=function(e,n,t){return s.call(e,0,e.length-(null==n||t?1:n))},k.last=function(e,n,t){return null==e?void 0:null==n||t?e[e.length-1]:s.call(e,Math.max(e.length-n,0))},k.rest=k.tail=k.drop=function(e,n,t){return s.call(e,null==n||t?1:n)},k.compact=function(e){return k.filter(e,k.identity)};var M=function(e,n,t){return n&&k.every(e,k.isArray)?l.apply(t,e):(S(e,function(e){k.isArray(e)||k.isArguments(e)?n?o.apply(t,e):M(e,n,t):t.push(e)}),t)};k.flatten=function(e,n){return M(e,n,[])},k.without=function(e){return k.difference(e,s.call(argumLine truncated
}(e),function(e){if(!e.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Categories");e.addUnicodeData([{name:"C",alias:"Other",isBmpLast:!0,bmp:"\x00--Ÿ­͸͹Ϳ-΃΋΍΢Ԩ-԰՗՘ՠֈ֋-֎֐׈-׏׫-ׯ׵-؅؜؝۝܎܏݋݌޲-޿߻-߿࠮࠯࠿࡜࡝࡟-࢟ࢡࢭ-ࣣࣿॸঀ঄঍঎঑঒঩঱঳-঵঺঻৅৆৉৊৏-৖৘-৛৞৤৥ৼ-਀਄਋-਎਑਒਩਱਴਷਺਻਽੃-੆੉੊੎-੐੒-੘੝੟-੥੶-઀઄઎઒઩઱઴઺઻૆૊૎૏૑-૟૤૥૲-଀଄଍଎଑଒଩଱଴଺଻୅୆୉୊୎-୕୘-୛୞୤୥୸-஁஄஋-஍஑஖-஘஛஝஠-஢஥-஧஫-஭஺-஽௃-௅௉௎௏௑-௖௘-௥௻-ఀఄ఍఑఩ఴ఺-఼౅౉౎-౔౗ౚ-౟౤౥౰-౷ಀಁ಄಍಑಩಴಺಻೅೉೎-೔೗-ೝ೟೤೥೰ೳ-ഁഄ഍഑഻഼൅൉൏-ൖ൘-ൟ൤൥൶-൸඀ඁ඄඗-඙඲඼඾඿෇-෉෋-෎෕෗෠-෱෵-฀฻-฾๜-຀຃຅ຆຉ຋ຌຎ-ຓຘຠ຤຦ຨຩຬ຺຾຿໅໇໎໏໚໛໠-໿཈཭-཰྘྽࿍࿛-࿿჆჈-჌჎჏቉቎቏቗቙቞቟኉኎኏኱኶኷኿዁዆዇዗጑጖጗፛፜፽-፿᎚-᎟Ᏽ-᏿᚝-᚟ᛱ-᛿ᜍ᜕-ᜟ᜷-᜿᝔-᝟᝭᝱᝴-᝿៞៟៪-៯៺-៿᠏᠚-᠟ᡸ-᡿᢫-᢯᣶-᣿ᤝ-᤟᤬-᤯᤼-᤿᥁-᥃᥮᥯᥵-᥿᦬-᦯᧊-᧏᧛-᧝᨜᨝᩟᩽᩾᪊-᪏᪚-᪟᪮-᫿ᭌ-᭏᭽-᭿᯴-᯻᰸-᰺᱊-᱌ᲀ-Ჿ᳈-᳏᳷-᳿ᷧ-᷻἖἗἞἟὆὇὎὏὘὚὜὞὾὿᾵῅῔῕῜῰῱῵῿​-‏‪-‮⁠-⁲⁳₏₝-₟₻-⃏⃱-⃿↊-↏⏴-⏿␧-␿⑋-⑟✀⭍-⭏⭚-⯿Ⱟⱟ⳴-⳸⴦⴨-⴬⴮⴯⵨-⵮⵱-⵾⶗-⶟⶧⶯⶷⶿⷇⷏⷗⷟⸼-⹿⺚⻴-⻿⿖-⿯⿼-⿿぀゗゘㄀-㄄ㄮ-㄰㆏ㆻ-ㆿ㇤-㇯㈟㋿䶶-䶿鿍-鿿꒍-꒏꓇-꓏꘬-꘿Ꚙ-ꚞ꛸-꛿ꞏꞔ-ꞟꞫ-ꟷ꠬-꠯꠺-꠿꡸-꡿ꣅ-꣍꣚-꣟꣼-ꣿ꥔-꥞꥽-꥿꧎꧚-꧝ꧠ-꧿꨷-꨿꩎꩏꩚꩛ꩼ-ꩿ꫃-꫚꫷-꬀꬇꬈꬏꬐꬗-꬟꬧꬯-ꮿ꯮꯯꯺-꯿힤-힯퟇-퟊퟼-﩮﩯﫚-﫿﬇-﬒﬘-﬜﬷﬽﬿﭂﭅﯂-﯒﵀-﵏﶐﶑﷈-﷯﷾﷿︚-︟︧-︯﹓﹧﹬-﹯﹵﻽-＀﾿-￁￈￉￐￑￘￙￝-￟￧￯-￾￿",astral:"�[�-�]|�[�-��-�]|�[�-��-���-��-��-���-��-��-�]|�[�����-�����-��-��-��-��-��-���-����-��-��-��-��-��-����-��-�]|�[�-�]|�[�-��-��-��-�]|�[�-�]|�[�������-��-��-��-��-��-��-��-��-���-��-���-��-�]|�[�-�]|�[�-�����������-��-�����������������������-����-��-�]|�[�-�]|�[�-��-�]|�[�-��-�]|�[�-�]|[�����-��-��-��-����-��-��-�][�-�]|�[����-����-��-��-��-��-��-�]|�[�-��-�������-��-���-��-��-��-��-��-��-���-��-���-��-�]|�[���������������������-������]|�[�-�]|�[�-����-��-��-��-��-�]|�[���-�]|�[�-��-��-�]|�[�-�]"},{name:"Cc",alias:"Control",bmp:"\x00--Ÿ"},{name:"Cf",alias:"Format",bmp:"­؀-؄۝܏​-‏‪-‮⁠-⁤--",astral:"�[��-�]|�[�-�]|𑂽"},{name:"Cn",alias:"Unassigned",bmp:"͸͹Ϳ-΃΋΍΢Ԩ-԰՗՘ՠֈ֋-֎֐׈-׏׫-ׯ׵-׿؅؜؝܎݋݌޲-޿߻-߿࠮࠯࠿࡜࡝࡟-࢟ࢡࢭ-ࣣࣿॸঀ঄঍঎঑঒঩঱঳-঵঺঻৅৆৉৊৏-৖৘-৛৞৤৥ৼ-਀਄਋-਎਑਒਩਱਴਷਺਻਽੃-੆੉੊੎-੐੒-੘੝੟-੥੶-઀઄઎઒઩઱઴઺઻૆૊૎૏૑-૟૤૥૲-଀଄଍଎଑଒଩଱଴଺଻୅୆୉୊୎-୕୘-୛୞୤୥୸-஁஄஋-஍஑஖-஘஛஝஠-஢஥-஧஫-஭஺-஽௃-௅௉௎௏௑-௖௘-௥௻-ఀఄ఍఑఩ఴ఺-఼౅౉౎-౔౗ౚ-౟౤౥౰-౷ಀಁ಄಍಑಩಴಺಻೅೉೎-೔೗-ೝ೟೤೥೰ೳ-ഁഄ഍഑഻഼൅൉൏-ൖ൘-ൟ൤൥൶-൸඀ඁ඄඗-඙඲඼඾඿෇-෉෋-෎෕෗෠-෱෵-฀฻-฾๜-຀຃຅ຆຉ຋ຌຎ-ຓຘຠ຤຦ຨຩຬ຺຾຿໅໇໎໏໚໛໠-໿཈཭-཰྘྽࿍࿛-࿿჆჈-჌჎჏቉቎቏቗቙቞቟኉኎኏኱኶኷኿዁዆዇዗጑጖጗፛፜፽-፿᎚-᎟Ᏽ-᏿᚝-᚟ᛱ-᛿ᜍ᜕-ᜟ᜷-᜿᝔-᝟᝭᝱᝴-᝿៞៟៪-៯៺-៿᠏᠚-᠟ᡸ-᡿᢫-᢯᣶-᣿ᤝ-᤟᤬-᤯᤼-᤿᥁-᥃᥮᥯᥵-᥿᦬-᦯᧊-᧏᧛-᧝᨜᨝᩟᩽᩾᪊-᪏᪚-᪟᪮-᫿ᭌ-᭏᭽-᭿᯴-᯻᰸-᰺᱊-᱌ᲀ-Ჿ᳈-᳏᳷-᳿ᷧ-᷻἖἗἞἟὆὇὎὏὘὚὜὞὾὿᾵῅῔῕῜῰῱῵῿⁥-⁩⁲⁳₏₝-₟₻-⃏⃱-⃿↊-↏⏴-⏿␧-␿⑋-⑟✀⭍-⭏⭚-⯿Ⱟⱟ⳴-⳸⴦⴨-⴬⴮⴯⵨-⵮⵱-⵾⶗-⶟⶧⶯⶷⶿⷇⷏⷗⷟⸼-⹿⺚⻴-⻿⿖-⿯⿼-⿿぀゗゘㄀-㄄ㄮ-㄰㆏ㆻ-Line truncated }(e),function(e){if(!e.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Categories");e.addUnicodeData([{name:"C",alias:"Other",isBmpLast:!0,bmp:"\x00--Ÿ­͸͹Ϳ-΃΋΍΢Ԩ-԰՗՘ՠֈ֋-֎֐׈-׏׫-ׯ׵-؅؜؝۝܎܏݋݌޲-޿߻-߿࠮࠯࠿࡜࡝࡟-࢟ࢡࢭ-ࣣࣿॸঀ঄঍঎঑঒঩঱঳-঵঺঻৅৆৉৊৏-৖৘-৛৞৤৥ৼ-਀਄਋-਎਑਒਩਱਴਷਺਻਽੃-੆੉੊੎-੐੒-੘੝੟-੥੶-઀઄઎઒઩઱઴઺઻૆૊૎૏૑-૟૤૥૲-଀଄଍଎଑଒଩଱଴଺଻୅୆୉୊୎-୕୘-୛୞୤୥୸-஁஄஋-஍஑஖-஘஛஝஠-஢஥-஧஫-஭஺-஽௃-௅௉௎௏௑-௖௘-௥௻-ఀఄ఍఑఩ఴ఺-఼౅౉౎-౔౗ౚ-౟౤౥౰-౷ಀಁ಄಍಑಩಴಺಻೅೉೎-೔೗-ೝ೟೤೥೰ೳ-ഁഄ഍഑഻഼൅൉൏-ൖ൘-ൟ൤൥൶-൸඀ඁ඄඗-඙඲඼඾඿෇-෉෋-෎෕෗෠-෱෵-฀฻-฾๜-຀຃຅ຆຉ຋ຌຎ-ຓຘຠ຤຦ຨຩຬ຺຾຿໅໇໎໏໚໛໠-໿཈཭-཰྘྽࿍࿛-࿿჆჈-჌჎჏቉቎቏቗቙቞቟኉኎኏኱኶኷኿዁዆዇዗጑጖጗፛፜፽-፿᎚-᎟Ᏽ-᏿᚝-᚟ᛱ-᛿ᜍ᜕-ᜟ᜷-᜿᝔-᝟᝭᝱᝴-᝿៞៟៪-៯៺-៿᠏᠚-᠟ᡸ-᡿᢫-᢯᣶-᣿ᤝ-᤟᤬-᤯᤼-᤿᥁-᥃᥮᥯᥵-᥿᦬-᦯᧊-᧏᧛-᧝᨜᨝᩟᩽᩾᪊-᪏᪚-᪟᪮-᫿ᭌ-᭏᭽-᭿᯴-᯻᰸-᰺᱊-᱌ᲀ-Ჿ᳈-᳏᳷-᳿ᷧ-᷻἖἗἞἟὆὇὎὏὘὚὜὞὾὿᾵῅῔῕῜῰῱῵῿​-‏‪-‮⁠-⁲⁳₏₝-₟₻-⃏⃱-⃿↊-↏⏴-⏿␧-␿⑋-⑟✀⭍-⭏⭚-⯿Ⱟⱟ⳴-⳸⴦⴨-⴬⴮⴯⵨-⵮⵱-⵾⶗-⶟⶧⶯⶷⶿⷇⷏⷗⷟⸼-⹿⺚⻴-⻿⿖-⿯⿼-⿿぀゗゘㄀-㄄ㄮ-㄰㆏ㆻ-ㆿ㇤-㇯㈟㋿䶶-䶿鿍-鿿꒍-꒏꓇-꓏꘬-꘿Ꚙ-ꚞ꛸-꛿ꞏꞔ-ꞟꞫ-ꟷ꠬-꠯꠺-꠿꡸-꡿ꣅ-꣍꣚-꣟꣼-ꣿ꥔-꥞꥽-꥿꧎꧚-꧝ꧠ-꧿꨷-꨿꩎꩏꩚꩛ꩼ-ꩿ꫃-꫚꫷-꬀꬇꬈꬏꬐꬗-꬟꬧꬯-ꮿ꯮꯯꯺-꯿힤-힯퟇-퟊퟼-﩮﩯﫚-﫿﬇-﬒﬘-﬜﬷﬽﬿﭂﭅﯂-﯒﵀-﵏﶐﶑﷈-﷯﷾﷿︚-︟︧-︯﹓﹧﹬-﹯﹵﻽-＀﾿-￁￈￉￐￑￘￙￝-￟￧￯-￾￿",astral:"�[�-�]|�[�-��-�]|�[�-��-���-��-��-���-��-��-�]|�[�����-�����-��-��-��-��-��-���-����-��-��-��-��-��-����-��-�]|�[�-�]|�[�-��-��-��-�]|�[�-�]|�[�������-��-��-��-��-��-��-��-��-���-��-���-��-�]|�[�-�]|�[�-�����������-��-�����������������������-����-��-�]|�[�-�]|�[�-��-�]|�[�-��-�]|�[�-�]|[�����-��-��-��-����-��-��-�][�-�]|�[����-����-��-��-��-��-��-�]|�[�-��-�������-��-���-��-��-��-��-��-��-���-��-���-��-�]|�[���������������������-������]|�[�-�]|�[�-����-��-��-��-��-�]|�[���-�]|�[�-��-��-�]|�[�-�]"},{name:"Cc",alias:"Control",bmp:"\x00--Ÿ"},{name:"Cf",alias:"Format",bmp:"­؀-؄۝܏​-‏‪-‮⁠-⁤--",astral:"�[��-�]|�[�-�]|𑂽"},{name:"Cn",alias:"Unassigned",bmp:"͸͹Ϳ-΃΋΍΢Ԩ-԰՗՘ՠֈ֋-֎֐׈-׏׫-ׯ׵-׿؅؜؝܎݋݌޲-޿߻-߿࠮࠯࠿࡜࡝࡟-࢟ࢡࢭ-ࣣࣿॸঀ঄঍঎঑঒঩঱঳-঵঺঻৅৆৉৊৏-৖৘-৛৞৤৥ৼ-਀਄਋-਎਑਒਩਱਴਷਺਻਽੃-੆੉੊੎-੐੒-੘੝੟-੥੶-઀઄઎઒઩઱઴઺઻૆૊૎૏૑-૟૤૥૲-଀଄଍଎଑଒଩଱଴଺଻୅୆୉୊୎-୕୘-୛୞୤୥୸-஁஄஋-஍஑஖-஘஛஝஠-஢஥-஧஫-஭஺-஽௃-௅௉௎௏௑-௖௘-௥௻-ఀఄ఍఑఩ఴ఺-఼౅౉౎-౔౗ౚ-౟౤౥౰-౷ಀಁ಄಍಑಩಴಺಻೅೉೎-೔೗-ೝ೟೤೥೰ೳ-ഁഄ഍഑഻഼൅൉൏-ൖ൘-ൟ൤൥൶-൸඀ඁ඄඗-඙඲඼඾඿෇-෉෋-෎෕෗෠-෱෵-฀฻-฾๜-຀຃຅ຆຉ຋ຌຎ-ຓຘຠ຤຦ຨຩຬ຺຾຿໅໇໎໏໚໛໠-໿཈཭-཰྘྽࿍࿛-࿿჆჈-჌჎჏቉቎቏቗቙቞቟኉኎኏኱኶኷኿዁዆዇዗጑጖጗፛፜፽-፿᎚-᎟Ᏽ-᏿᚝-᚟ᛱ-᛿ᜍ᜕-ᜟ᜷-᜿᝔-᝟᝭᝱᝴-᝿៞៟៪-៯៺-៿᠏᠚-᠟ᡸ-᡿᢫-᢯᣶-᣿ᤝ-᤟᤬-᤯᤼-᤿᥁-᥃᥮᥯᥵-᥿᦬-᦯᧊-᧏᧛-᧝᨜᨝᩟᩽᩾᪊-᪏᪚-᪟᪮-᫿ᭌ-᭏᭽-᭿᯴-᯻᰸-᰺᱊-᱌ᲀ-Ჿ᳈-᳏᳷-᳿ᷧ-᷻἖἗἞἟὆὇὎὏὘὚὜὞὾὿᾵῅῔῕῜῰῱῵῿⁥-⁩⁲⁳₏₝-₟₻-⃏⃱-⃿↊-↏⏴-⏿␧-␿⑋-⑟✀⭍-⭏⭚-⯿Ⱟⱟ⳴-⳸⴦⴨-⴬⴮⴯⵨-⵮⵱-⵾⶗-⶟⶧⶯⶷⶿⷇⷏⷗⷟⸼-⹿⺚⻴-⻿⿖-⿯⿼-⿿぀゗゘㄀-㄄ㄮ-㄰㆏ㆻ-Line truncated
var M;!I&&(M=r(t))&&C.test(M.tagName)&&(I=M.className.match(b)),I&&(I=I[1])}var $;if(y.test(t.tagName))$=1;else{var L=t.currentStyle,A=s.defaultView,R=L?L.whiteSpace:A&&A.getComputedStyle?A.getComputedStyle(t,null).getPropertyValue("white-space"):0;$=R&&"pre"===R.substring(0,3)}var N=i.linenums;(N="true"===N||+N)||(N=m.match(/\blinenums\b(?::(\d+))?/),N=N?N[1]&&N[1].length?+N[1]:!0:!1),N&&o(t,N,$),h={langExtension:I,sourceNode:t,numberLines:N,pre:$},u(h)}}}v<c.length?setTimeout(a,250):"function"==typeof e&&e()}for(var i=n||document.body,s=i.ownerDocument||document,l=[t("pre"),t("code"),t("xmp")],c=[],d=0;d<l.length;++d)for(var p=0,m=l[d].length;m>p;++p)c.push(l[d][p]);l=null;var g=Date;g.now||(g={now:function(){return+new Date}});var h,v=0,b=/\blang(?:uage)?-([\w.]+)(?!\S)/,w=/\bprettyprint\b/,x=/\bprettyprinted\b/,y=/pre|xmp/i,C=/^code$/i,k=/^(?:pre|code|xmp)$/i,S={};a()}var f=window,m=["break,continue,do,else,for,if,return,while"],g=[m,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],h=[g,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],v=[h,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],b=[h,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],w=[b,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],x="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[h,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],C="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",k=[m,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],S=[m,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],_=[m,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],E=[m,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[v,w,y,C,k,S,E],I=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,M="str",$="kwd",L="com",A="typ",R="lit",N="pun",P="pln",B="tag",D="dec",O="src",H="atn",F="atv",j="nocode",q="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*",U=/\S/,K=i({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),z={};l(K,["default-code"]),l(a([],[[P,/^[^<?]+/],[D,/^<!\w[^>]*(?:>|$)/],[L,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[N,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),l(a([[P,/^[\s]+/,null," \r\n"],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[B,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[H,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[N,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),l(a([],[[F,/^[\s\S]+/]]),["uq.val"]),l(i({keywords:v,hashComments:!0,cStyleComments:!0,types:I}),["c","cc","cpp","cxx","cyc","m"]),l(i({keywords:"null,true,false"}),["json"]),l(i({keywords:w,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:I}),["cs"]),l(i({keywords:b,cStyleComments:!0}),["java"]),l(i({keywords:E,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),l(i({keywords:k,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),l(i({keywords:C,hashComments:!0,multiLineStrings:!0,Line truncated var M;!I&&(M=r(t))&&C.test(M.tagName)&&(I=M.className.match(b)),I&&(I=I[1])}var $;if(y.test(t.tagName))$=1;else{var L=t.currentStyle,A=s.defaultView,R=L?L.whiteSpace:A&&A.getComputedStyle?A.getComputedStyle(t,null).getPropertyValue("white-space"):0;$=R&&"pre"===R.substring(0,3)}var N=i.linenums;(N="true"===N||+N)||(N=m.match(/\blinenums\b(?::(\d+))?/),N=N?N[1]&&N[1].length?+N[1]:!0:!1),N&&o(t,N,$),h={langExtension:I,sourceNode:t,numberLines:N,pre:$},u(h)}}}v<c.length?setTimeout(a,250):"function"==typeof e&&e()}for(var i=n||document.body,s=i.ownerDocument||document,l=[t("pre"),t("code"),t("xmp")],c=[],d=0;d<l.length;++d)for(var p=0,m=l[d].length;m>p;++p)c.push(l[d][p]);l=null;var g=Date;g.now||(g={now:function(){return+new Date}});var h,v=0,b=/\blang(?:uage)?-([\w.]+)(?!\S)/,w=/\bprettyprint\b/,x=/\bprettyprinted\b/,y=/pre|xmp/i,C=/^code$/i,k=/^(?:pre|code|xmp)$/i,S={};a()}var f=window,m=["break,continue,do,else,for,if,return,while"],g=[m,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],h=[g,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],v=[h,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],b=[h,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],w=[b,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],x="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[h,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],C="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",k=[m,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],S=[m,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],_=[m,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],E=[m,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[v,w,y,C,k,S,E],I=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,M="str",$="kwd",L="com",A="typ",R="lit",N="pun",P="pln",B="tag",D="dec",O="src",H="atn",F="atv",j="nocode",q="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*",U=/\S/,K=i({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),z={};l(K,["default-code"]),l(a([],[[P,/^[^<?]+/],[D,/^<!\w[^>]*(?:>|$)/],[L,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[N,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),l(a([[P,/^[\s]+/,null," \r\n"],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[B,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[H,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[N,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),l(a([],[[F,/^[\s\S]+/]]),["uq.val"]),l(i({keywords:v,hashComments:!0,cStyleComments:!0,types:I}),["c","cc","cpp","cxx","cyc","m"]),l(i({keywords:"null,true,false"}),["json"]),l(i({keywords:w,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:I}),["cs"]),l(i({keywords:b,cStyleComments:!0}),["java"]),l(i({keywords:E,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),l(i({keywords:k,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),l(i({keywords:C,hashComments:!0,multiLineStrings:!0,Line truncated
},w.insertLink=function(e,n,t,r,a){e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/);var i;if(!(e.endTag.length>1&&e.startTag.length>0)){if(e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="",/\n\n/.test(e.selection))return void this.addLinkDef(e,null);var s=function(t){i.parentNode.removeChild(i),null!==t&&(e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1),e.startTag=a?"![":"[",e.endTag="]("+o(t)+")",e.selection=r),n()};return i=c.createBackground(),s(t),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},w.doLinkOrImage=function(e,n,t){e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\(.*?\))?/);var r;if(!(e.endTag.length>1&&e.startTag.length>0)){if(e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="",/\n\n/.test(e.selection))return void this.addLinkDef(e,null);var a=this,i=function(i,s){if(r.parentNode.removeChild(r),null!==i&&(e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1),e.startTag=t?"![":"[",e.endTag="]("+o(i)+")",!e.selection)){var l="";l=s?s:a.getString(t?"imagedescription":"linkdescription"),e.selection=l}n()};return r=c.createBackground(),t?this.hooks.insertImageDialog(i)||c.prompt(this.getString("imagedialog"),v,i):this.hooks.insertLinkDialog(i)||c.prompt(this.getString("linkdialog"),b,i),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},w.doAutoindent=function(e){var n=this,t=!1;e.before=e.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ \t]+\n$/,"\n\n"),e.selection||/^[ \t]*(?:\n|$)/.test(e.after)||(e.after=e.after.replace(/^[^\n]*/,function(n){return e.selection=n,""}),t=!0),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before)&&n.doList&&n.doList(e),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before)&&n.doBlockquote&&n.doBlockquote(e),/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&n.doCode&&n.doCode(e),t&&(e.after=e.selection+e.after,e.selection="")},w.doBlockquote=function(e){e.selection=e.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(n,t,r,a){return e.before+=t,e.after=a+e.after,r}),e.before=e.before.replace(/(>[ \t]*)$/,function(n,t){return e.selection=t+e.selection,""}),e.selection=e.selection.replace(/^(\s|>)+$/,""),e.selection=e.selection||this.getString("quoteexample");var n,t="",r="";if(e.before){for(var a=e.before.replace(/\n$/,"").split("\n"),i=!1,o=0;o<a.length;o++){var s=!1;n=a[o],i=i&&n.length>0,/^>/.test(n)?(s=!0,!i&&n.length>1&&(i=!0)):s=/^[ \t]*$/.test(n)?!0:i,s?t+=n+"\n":(r+=t+n,t="\n")}/(^|\n)>/.test(t)||(r+=t,t="")}e.startTag=t,e.before=r;var l=function(n){var t=n?"> ":"";e.startTag&&(e.startTag=e.startTag.replace(/\n((>|\s)*)\n$/,function(e,n){return"\n"+n.replace(/^[ ]{0,3}>?[ \t]*$/gm,t)+"\n"})),e.endTag&&(e.endTag=e.endTag.replace(/^\n((>|\s)*)\n/,function(e,n){return"\n"+n.replace(/^[ ]{0,3}>?[ \t]*$/gm,t)+"\n"}))};/^(?![ ]{0,3}>)/m.test(e.selection)?(this.wrap(e,f.lineLength-2),e.selection=e.selection.replace(/^/gm,"> "),l(!0),e.skipLines()):(e.selection=e.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(e),l(!1),!/^(\n|^)[ ]{0,3}>/.test(e.selection)&&e.startTag&&(e.startTag=e.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(e.selection)&&e.endTag&&(e.endTag=e.endTag.replace(/^\n{0,2}/,"\n\n"))),e.selection=this.hooks.postBlockquoteCreation(e.selection),/\n/.test(e.selection)||(e.selection=e.selection.replace(/^(> *)/,function(n,t){return e.startTag+=t,""}))},w.doCode=function(e){var n=/\S[ ]*$/.test(e.before),t=/^[ ]*\S/.test(e.after);if(!t&&!n||/\n/.test(e.selection)){e.before=e.before.replace(/[ ]{4}$/,function(n){return e.selection=n+e.selection,""});var r=1,a=1;/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&(r=0),/^\n(\t|[ ]{4,})/.test(e.after)&&(a=0),e.skipLines(r,a),e.selection?/^[ ]{0,3}\S/m.test(e.selection)?/\n/.test(e.selection)?e.selection=e.selection.replace(/^/gm," "):e.before+=" ":e.selection=e.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,""):(e.startTag=" ",e.selection=this.getString("codeexample"))}else e.trimWhitespace(),e.findTags(/`/,/`/),e.startTag||e.endTag?e.endTag&&!e.startTag?(e.before+=e.endTag,e.endTag=""):e.startTag=e.endTag="":(e.startTag=e.endTag="`",e.selection||(e.selection=this.getString("codeexample")))},w.doList=function(e,n,t){var r=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,a=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,i="-",o=1,s=function(){var e;return t?(e=" "+o+". ",o++):e=" "+i+" ",e},l=function(e){return void 0===t&&(t=/^\s*\d/.test(e)),e=e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(){return s()})};if(e.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),!e.before||/\n$/.test(e.before)||/^\n/.test(e.startTag)||(e.before+=e.startTag,e.startTag=""),e.startTag){var c=/\d+[.]/.test(e.startTag);if(e.stLine truncated },w.insertLink=function(e,n,t,r,a){e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/);var i;if(!(e.endTag.length>1&&e.startTag.length>0)){if(e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="",/\n\n/.test(e.selection))return void this.addLinkDef(e,null);var s=function(t){i.parentNode.removeChild(i),null!==t&&(e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1),e.startTag=a?"![":"[",e.endTag="]("+o(t)+")",e.selection=r),n()};return i=c.createBackground(),s(t),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},w.doLinkOrImage=function(e,n,t){e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\(.*?\))?/);var r;if(!(e.endTag.length>1&&e.startTag.length>0)){if(e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="",/\n\n/.test(e.selection))return void this.addLinkDef(e,null);var a=this,i=function(i,s){if(r.parentNode.removeChild(r),null!==i&&(e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1),e.startTag=t?"![":"[",e.endTag="]("+o(i)+")",!e.selection)){var l="";l=s?s:a.getString(t?"imagedescription":"linkdescription"),e.selection=l}n()};return r=c.createBackground(),t?this.hooks.insertImageDialog(i)||c.prompt(this.getString("imagedialog"),v,i):this.hooks.insertLinkDialog(i)||c.prompt(this.getString("linkdialog"),b,i),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},w.doAutoindent=function(e){var n=this,t=!1;e.before=e.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ \t]+\n$/,"\n\n"),e.selection||/^[ \t]*(?:\n|$)/.test(e.after)||(e.after=e.after.replace(/^[^\n]*/,function(n){return e.selection=n,""}),t=!0),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before)&&n.doList&&n.doList(e),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before)&&n.doBlockquote&&n.doBlockquote(e),/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&n.doCode&&n.doCode(e),t&&(e.after=e.selection+e.after,e.selection="")},w.doBlockquote=function(e){e.selection=e.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(n,t,r,a){return e.before+=t,e.after=a+e.after,r}),e.before=e.before.replace(/(>[ \t]*)$/,function(n,t){return e.selection=t+e.selection,""}),e.selection=e.selection.replace(/^(\s|>)+$/,""),e.selection=e.selection||this.getString("quoteexample");var n,t="",r="";if(e.before){for(var a=e.before.replace(/\n$/,"").split("\n"),i=!1,o=0;o<a.length;o++){var s=!1;n=a[o],i=i&&n.length>0,/^>/.test(n)?(s=!0,!i&&n.length>1&&(i=!0)):s=/^[ \t]*$/.test(n)?!0:i,s?t+=n+"\n":(r+=t+n,t="\n")}/(^|\n)>/.test(t)||(r+=t,t="")}e.startTag=t,e.before=r;var l=function(n){var t=n?"> ":"";e.startTag&&(e.startTag=e.startTag.replace(/\n((>|\s)*)\n$/,function(e,n){return"\n"+n.replace(/^[ ]{0,3}>?[ \t]*$/gm,t)+"\n"})),e.endTag&&(e.endTag=e.endTag.replace(/^\n((>|\s)*)\n/,function(e,n){return"\n"+n.replace(/^[ ]{0,3}>?[ \t]*$/gm,t)+"\n"}))};/^(?![ ]{0,3}>)/m.test(e.selection)?(this.wrap(e,f.lineLength-2),e.selection=e.selection.replace(/^/gm,"> "),l(!0),e.skipLines()):(e.selection=e.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(e),l(!1),!/^(\n|^)[ ]{0,3}>/.test(e.selection)&&e.startTag&&(e.startTag=e.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(e.selection)&&e.endTag&&(e.endTag=e.endTag.replace(/^\n{0,2}/,"\n\n"))),e.selection=this.hooks.postBlockquoteCreation(e.selection),/\n/.test(e.selection)||(e.selection=e.selection.replace(/^(> *)/,function(n,t){return e.startTag+=t,""}))},w.doCode=function(e){var n=/\S[ ]*$/.test(e.before),t=/^[ ]*\S/.test(e.after);if(!t&&!n||/\n/.test(e.selection)){e.before=e.before.replace(/[ ]{4}$/,function(n){return e.selection=n+e.selection,""});var r=1,a=1;/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&(r=0),/^\n(\t|[ ]{4,})/.test(e.after)&&(a=0),e.skipLines(r,a),e.selection?/^[ ]{0,3}\S/m.test(e.selection)?/\n/.test(e.selection)?e.selection=e.selection.replace(/^/gm," "):e.before+=" ":e.selection=e.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,""):(e.startTag=" ",e.selection=this.getString("codeexample"))}else e.trimWhitespace(),e.findTags(/`/,/`/),e.startTag||e.endTag?e.endTag&&!e.startTag?(e.before+=e.endTag,e.endTag=""):e.startTag=e.endTag="":(e.startTag=e.endTag="`",e.selection||(e.selection=this.getString("codeexample")))},w.doList=function(e,n,t){var r=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,a=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,i="-",o=1,s=function(){var e;return t?(e=" "+o+". ",o++):e=" "+i+" ",e},l=function(e){return void 0===t&&(t=/^\s*\d/.test(e)),e=e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(){return s()})};if(e.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),!e.before||/\n$/.test(e.before)||/^\n/.test(e.startTag)||(e.before+=e.startTag,e.startTag=""),e.startTag){var c=/\d+[.]/.test(e.startTag);if(e.stLine truncated
t!==i.length-1?0===r.length&&(r=void 0):/\n$/.test(r)&&(r+="\n"),n(r)});var h=e.last(p).endOffset,v=s[0].scrollHeight,b=v/h;p=e.map(p,function(e){return{startOffset:e.startOffset*b,endOffset:e.endOffset*b,height:e.height*b}})}else e.each(i,function(e){t+=e.text.length+m,m=0;var n=r.session.doc.indexToPosition(t),i=r.session.documentToScreenPosition(n.row,n.column),o=i.row*r.renderer.lineHeight,s=o-a;p.push({startOffset:a,endOffset:o,height:s}),a=o});f=[];var w,y=c.scrollTop();c.find(".preview-content > .se-section-delimiter").each(function(){if(void 0===w)return void(w=0);var e=$(this),n=e.position().top+y;f.push({startOffset:w,endOffset:n,height:n-w}),w=n});var C=c.prop("scrollHeight");f.push({startOffset:w,endOffset:C,height:C-w}),u=-10,d=-10,x()},500),g=!1,h=!1,v=!1,b=!1,w=$("<div>"),x=e.throttle(function(){if(0===p.length||p.length!==f.length)return void x();var n=window.lightMode?s.scrollTop():r.renderer.getScrollTop();0>n&&(n=0);var a,i=c.scrollTop();if(g===!0){if(Math.abs(n-u)<=9)return;if(g=!1,u=n,a=t(n,p,f),a=e.min([a,c.prop("scrollHeight")-c.outerHeight()]),Math.abs(a-i)<=9)return void(d=i);w.stop("scrollLinkFx",!0).css("value",0).animate({value:a-i},{easing:"linear",duration:200,queue:"scrollLinkFx",step:function(e){b=!0,d=i+e,c.scrollTop(d)},done:function(){e.defer(function(){b=!1})}}).dequeue("scrollLinkFx")}else if(h===!0){if(Math.abs(i-d)<=9)return;if(h=!1,d=i,a=t(i,f,p),window.lightMode?a=e.min([a,s.prop("scrollHeight")-s.outerHeight()]):(a=e.min([a,r.session.getScreenLength()*r.renderer.lineHeight+r.renderer.scrollMargin.bottom-r.renderer.$size.scrollerHeight]),0>a&&(a=0)),Math.abs(a-n)<=9)return void(u=n);w.stop("scrollLinkFx",!0).css("value",0).animate({value:a-n},{easing:"linear",duration:200,queue:"scrollLinkFx",step:function(e){v=!0,u=n+e,window.lightMode||r.session.setScrollTop(u),window.lightMode&&s.scrollTop(u)},done:function(){e.defer(function(){v=!1})}}).dequeue("scrollLinkFx")}},100);a.onLayoutResize=function(){g=!0,m()},a.onFileClosed=function(){p=[]};var y=function(e){c=$(".preview-container"),s=$("#wmd-input"),l=$(".textarea-helper"),c.scroll(function(){b===!1&&C===!1&&(h=!0,g=!1,x()),C=!1});var n=function(){v===!1&&(g=!0,h=!1,x())},t=e?500:0;setTimeout(function(){window.lightMode?s.scroll(n):r.session.on("changeScrollTop",n)},t)};a.onToggleMode=function(){c=$(".preview-container"),s=$("#wmd-input"),l=$(".textarea-helper"),m(),y(!0)};var C=!1;a.onReady=function(){c=$(".preview-container"),s=$("#wmd-input"),l=$(".textarea-helper"),y(),$(".extension-preview-buttons .table-of-contents, #preview-contents").on("click","a",function(e){var n=this.hash;if(n){e.preventDefault();var a=$("#preview-contents "+n);if(a.length){var i=a[0].getBoundingClientRect().top-c.get(0).getBoundingClientRect().top+c.scrollTop(),o=t(i,f,p);c.scrollTop(i),window.lightMode||r.session.setScrollTop(o),window.lightMode&&s.scrollTop(o)}}})};var k;return a.onPagedownConfigure=function(e){k=$("#preview-contents"),e.getConverter().hooks.chain("postConversion",function(e){return k.height(k.height()),e})},a.onPreviewFinished=function(){var e=k.height();k.height("auto");var n=k.height();g=!0,e>n&&(C=!0),m()},a}),function(e){var n="waitForImages";e.waitForImages={hasImageProperties:["backgroundImage","listStyleImage","borderImage","borderCornerImage"]},e.expr[":"].uncached=function(n){if(!e(n).is('img[src!=""]'))return!1;var t=new Image;return t.src=n.src,!t.complete},e.fn.waitForImages=function(t,r,a){var i=0,o=0;if(e.isPlainObject(arguments[0])&&(a=arguments[0].waitForAll,r=arguments[0].each,t=arguments[0].finished),t=t||e.noop,r=r||e.noop,a=!!a,!e.isFunction(t)||!e.isFunction(r))throw new TypeError("An invalid callback was supplied.");return this.each(function(){var s=e(this),l=[],c=e.waitForImages.hasImageProperties||[],u=/url\(\s*(['"]?)(.*?)\1\s*\)/g;a?s.find("*").andSelf().each(function(){var n=e(this);n.is("img:uncached")&&l.push({src:n.attr("src"),element:n[0]}),e.each(c,function(e,t){var r,a=n.css(t);if(!a)return!0;for(;r=u.exec(a);)l.push({src:r[2],element:n[0]})})}):s.find("img:uncached").each(function(){l.push({src:this.src,element:this})}),i=l.length,o=0,0===i&&t.call(s[0]),e.each(l,function(a,l){var c=new Image;e(c).bind("load."+n+" error."+n,function(e){return o++,r.call(l.element,o,i,"load"==e.type),o==i?(t.call(s[0]),!1):void 0}),c.src=l.src})})}}(jQuery),define("jquery-waitforimages",function(){}),define("eventMgr",["underscore","crel","utils","classes/Extension","settings","extensions/markdownSectionParser","extensions/partialRendering","extensions/umlDiagrams","extensions/markdownExtra","extensions/toc","extensions/mathJax","extensions/emailConverter","extensions/scrollLink","jquery-waitforimages"],function(e,n,t,r,a){function i(n){return e.chain(c).map(function(e){return e.enabled&&e[n]}).compact().value()}function o(n){return d[n]=i(n),function(){var t=arguments;e.each(d[n],function(n){try{n.apply(null,t)}catch(r){console.error(e.isObject(r)?r.stack:r)}})}}function s(e){l[e]=o(e)}var l={},c=e.Line truncated }}var r,a=new n("scrollLink","Scroll Link",!0,!0);a.onAceCreated=function(e){r=e};var i;a.onSectionsCreated=function(e){i=e};var o=0;a.onMarkdownTrim=function(e){o=e};var s,l,c,u,d,p=[],f=[],m=e.debounce(function(){function n(e){var n=g;if(void 0!==e){var t=document.createTextNode(e);l.empty().append(t),n+=l.prop("scrollHeight")}var r=a+n;p.push({startOffset:a,endOffset:r,height:n}),a=r}p=[];var t=0,a=0,m=o,g=0;if(window.lightMode){l.innerWidth(s.innerWidth()),e.each(i,function(e,t){var r=e.text;t!==i.length-1?0===r.length&&(r=void 0):/\n$/.test(r)&&(r+="\n"),n(r)});var h=e.last(p).endOffset,v=s[0].scrollHeight,b=v/h;p=e.map(p,function(e){return{startOffset:e.startOffset*b,endOffset:e.endOffset*b,height:e.height*b}})}else e.each(i,function(e){t+=e.text.length+m,m=0;var n=r.session.doc.indexToPosition(t),i=r.session.documentToScreenPosition(n.row,n.column),o=i.row*r.renderer.lineHeight,s=o-a;p.push({startOffset:a,endOffset:o,height:s}),a=o});f=[];var w,y=c.scrollTop();c.find(".preview-content > .se-section-delimiter").each(function(){if(void 0===w)return void(w=0);var e=$(this),n=e.position().top+y;f.push({startOffset:w,endOffset:n,height:n-w}),w=n});var C=c.prop("scrollHeight");f.push({startOffset:w,endOffset:C,height:C-w}),u=-10,d=-10,x()},500),g=!1,h=!1,v=!1,b=!1,w=$("<div>"),x=e.throttle(function(){if(0===p.length||p.length!==f.length)return void x();var n=window.lightMode?s.scrollTop():r.renderer.getScrollTop();0>n&&(n=0);var a,i=c.scrollTop();if(g===!0){if(Math.abs(n-u)<=9)return;if(g=!1,u=n,a=t(n,p,f),a=e.min([a,c.prop("scrollHeight")-c.outerHeight()]),Math.abs(a-i)<=9)return void(d=i);w.stop("scrollLinkFx",!0).css("value",0).animate({value:a-i},{easing:"linear",duration:200,queue:"scrollLinkFx",step:function(e){b=!0,d=i+e,c.scrollTop(d)},done:function(){e.defer(function(){b=!1})}}).dequeue("scrollLinkFx")}else if(h===!0){if(Math.abs(i-d)<=9)return;if(h=!1,d=i,a=t(i,f,p),window.lightMode?a=e.min([a,s.prop("scrollHeight")-s.outerHeight()]):(a=e.min([a,r.session.getScreenLength()*r.renderer.lineHeight+r.renderer.scrollMargin.bottom-r.renderer.$size.scrollerHeight]),0>a&&(a=0)),Math.abs(a-n)<=9)return void(u=n);w.stop("scrollLinkFx",!0).css("value",0).animate({value:a-n},{easing:"linear",duration:200,queue:"scrollLinkFx",step:function(e){v=!0,u=n+e,window.lightMode||r.session.setScrollTop(u),window.lightMode&&s.scrollTop(u)},done:function(){e.defer(function(){v=!1})}}).dequeue("scrollLinkFx")}},100);a.onLayoutResize=function(){g=!0,m()},a.onFileClosed=function(){p=[]};var y=function(e){c=$(".preview-container"),s=$("#wmd-input"),l=$(".textarea-helper"),c.scroll(function(){b===!1&&C===!1&&(h=!0,g=!1,x()),C=!1});var n=function(){v===!1&&(g=!0,h=!1,x())},t=e?500:0;setTimeout(function(){window.lightMode?s.scroll(n):r.session.on("changeScrollTop",n)},t)};a.onToggleMode=function(){c=$(".preview-container"),s=$("#wmd-input"),l=$(".textarea-helper"),m(),y(!0)};var C=!1;a.onReady=function(){c=$(".preview-container"),s=$("#wmd-input"),l=$(".textarea-helper"),y(),$(".extension-preview-buttons .table-of-contents, #preview-contents").on("click","a",function(e){var n=this.hash;if(n){e.preventDefault();var a=$("#preview-contents "+n);if(a.length){var i=a[0].getBoundingClientRect().top-c.get(0).getBoundingClientRect().top+c.scrollTop(),o=t(i,f,p);c.scrollTop(i),window.lightMode||r.session.setScrollTop(o),window.lightMode&&s.scrollTop(o)}}})};var k;return a.onPagedownConfigure=function(e){k=$("#preview-contents"),e.getConverter().hooks.chain("postConversion",function(e){return k.height(k.height()),e})},a.onPreviewFinished=function(){var e=k.height();k.height("auto");var n=k.height();g=!0,e>n&&(C=!0),m()},a}),define("extensions/htmlSanitizer",["underscore","utils","classes/Extension"],function(e,n,t){function r(e){var n,t={},r=e.split(",");for(n=0;n<r.length;n++)t[r[n]]=!0;return t}function a(e,n){function t(e,t,a,o){if(t=t&&t.toLowerCase(),k[t])for(;c.last()&&S[c.last()];)r("",c.last());C[t]&&c.last()==t&&r("",t),o=w[t]||!!o,o||c.push(t);var s={};a.replace(p,function(e,n,t,r,a){var o=t||r||a||"";s[n]=i(o)}),n.start&&n.start(t,s,o)}function r(e,t){var r,a=0;if(t=t&&t.toLowerCase())for(a=c.length-1;a>=0&&c[a]!=t;a--);if(a>=0){for(r=c.length-1;r>=a;r--)n.end&&n.end(c[r]);c.length=a}}var a,o,s,c=[],b=e;for(c.last=function(){return c[c.length-1]};e;){if(o=!0,c.last()&&_[c.last()])e=e.replace(new RegExp("(.*)<\\s*\\/\\s*"+c.last()+"[^>]*>","i"),function(e,t){return t=t.replace(g,"$1").replace(v,"$1"),n.chars&&n.chars(i(t)),""}),r("",c.last());else if(0===e.indexOf("<!--")?(a=e.indexOf("--",4),a>=0&&e.lastIndexOf("-->",a)===a&&(n.comment&&n.comment(e.substring(4,a)),e=e.substring(a+3),o=!1)):h.test(e)?(s=e.match(h),s&&(e=e.replace(s[0],""),o=!1)):m.test(e)?(s=e.match(d),s&&(e=e.substring(s[0].length),s[0].replace(d,r),o=!1)):f.test(e)&&(s=e.match(u),s&&(e=e.substring(s[0].length),s[0].replace(u,t),o=!1)),o){a=e.indexOf("<");var x=0>a?e:e.substring(0,a);e=0>a?"":e.substring(a),n.chars&&n.chars(i(x))}if(e==b)return c.reverse(),cLine truncated
e.before=e.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ \t]+\n$/,"\n\n"),e.selection||/^[ \t]*(?:\n|$)/.test(e.after)||(e.after=e.after.replace(/^[^\n]*/,function(n){return e.selection=n,""}),t=!0),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before)&&n.doList&&n.doList(e),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before)&&n.doBlockquote&&n.doBlockquote(e),/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&n.doCode&&n.doCode(e),t&&(e.after=e.selection+e.after,e.selection="")},w.doBlockquote=function(e){e.selection=e.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(n,t,r,a){return e.before+=t,e.after=a+e.after,r}),e.before=e.before.replace(/(>[ \t]*)$/,function(n,t){return e.selection=t+e.selection,""}),e.selection=e.selection.replace(/^(\s|>)+$/,""),e.selection=e.selection||this.getString("quoteexample");var n,t="",r="";if(e.before){for(var a=e.before.replace(/\n$/,"").split("\n"),i=!1,o=0;o<a.length;o++){var s=!1;n=a[o],i=i&&n.length>0,/^>/.test(n)?(s=!0,!i&&n.length>1&&(i=!0)):s=/^[ \t]*$/.test(n)?!0:i,s?t+=n+"\n":(r+=t+n,t="\n")}/(^|\n)>/.test(t)||(r+=t,t="")}e.startTag=t,e.before=r,e.after&&(e.after=e.after.replace(/^\n?/,"\n")),e.after=e.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(n){return e.endTag=n,""});var l=function(n){var t=n?"> ":"";e.startTag&&(e.startTag=e.startTag.replace(/\n((>|\s)*)\n$/,function(e,n){return"\n"+n.replace(/^[ ]{0,3}>?[ \t]*$/gm,t)+"\n"})),e.endTag&&(e.endTag=e.endTag.replace(/^\n((>|\s)*)\n/,function(e,n){return"\n"+n.replace(/^[ ]{0,3}>?[ \t]*$/gm,t)+"\n"}))};/^(?![ ]{0,3}>)/m.test(e.selection)?(this.wrap(e,m.lineLength-2),e.selection=e.selection.replace(/^/gm,"> "),l(!0),e.skipLines()):(e.selection=e.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(e),l(!1),!/^(\n|^)[ ]{0,3}>/.test(e.selection)&&e.startTag&&(e.startTag=e.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(e.selection)&&e.endTag&&(e.endTag=e.endTag.replace(/^\n{0,2}/,"\n\n"))),e.selection=this.hooks.postBlockquoteCreation(e.selection),/\n/.test(e.selection)||(e.selection=e.selection.replace(/^(> *)/,function(n,t){return e.startTag+=t,""}))},w.doCode=function(e){var n=/\S[ ]*$/.test(e.before),t=/^[ ]*\S/.test(e.after);if(!t&&!n||/\n/.test(e.selection)){e.before=e.before.replace(/[ ]{4}$/,function(n){return e.selection=n+e.selection,""});var r=1,a=1;/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&(r=0),/^\n(\t|[ ]{4,})/.test(e.after)&&(a=0),e.skipLines(r,a),e.selection?/^[ ]{0,3}\S/m.test(e.selection)?/\n/.test(e.selection)?e.selection=e.selection.replace(/^/gm," "):e.before+=" ":e.selection=e.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,""):(e.startTag=" ",e.selection=this.getString("codeexample"))}else e.trimWhitespace(),e.findTags(/`/,/`/),e.startTag||e.endTag?e.endTag&&!e.startTag?(e.before+=e.endTag,e.endTag=""):e.startTag=e.endTag="":(e.startTag=e.endTag="`",e.selection||(e.selection=this.getString("codeexample")))},w.doList=function(e,n,t){var r=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,a=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,i="-",o=1,s=function(){var e;return t?(e=" "+o+". ",o++):e=" "+i+" ",e},l=function(e){return void 0===t&&(t=/^\s*\d/.test(e)),e=e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(){return s()})};if(e.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),!e.before||/\n$/.test(e.before)||/^\n/.test(e.startTag)||(e.before+=e.startTag,e.startTag=""),e.startTag){var c=/\d+[.]/.test(e.startTag);if(e.startTag="",e.selection=e.selection.replace(/\n[ ]{4}/g,"\n"),this.unwrap(e),e.skipLines(),c&&(e.after=e.after.replace(a,l)),t==c)return}var u=1;e.before=e.before.replace(r,function(e){return/^\s*([*+-])/.test(e)&&(i=p.$1),u=/[^\n]\n\n[^\n]/.test(e)?1:0,l(e)}),e.selection||(e.selection=this.getString("litem"));var d=s(),f=1;e.after=e.after.replace(a,function(e){return f=/[^\n]\n\n[^\n]/.test(e)?1:0,l(e)}),e.trimWhitespace(!0),e.skipLines(u,f,!0),e.startTag=d;var g=d.replace(/./g," ");this.wrap(e,m.lineLength-g.length),e.selection=e.selection.replace(/\n/g,"\n"+g)},w.doHeading=function(e){if(e.selection=e.selection.replace(/\s+/g," "),e.selection=e.selection.replace(/(^\s+|\s+$)/g,""),!e.selection)return e.before&&"\n"!=e.before[e.before.length-1]&&e.skipLines(1,1),e.startTag="# ",e.selection=this.getString("headingexample"),void(e.endTag="");e.findTags(/#+[ ]*/,/[ ]*#+/),e.before&&"\n"!=e.before[e.before.length-1]&&e.skipLines(1,1);var n=0,t=e.startTag;/^#+[ ]*$/.test(t)&&(t=t.replace(/ /g,""),n=t.length);var r=0;if(n>=0&&3>=n&&(r=n+1),n>=4&&(r=0,e.startTag=""),r>0){for(var a="";r--;)a+="#";a+=" ",e.startTag=a}},w.doHorizontalRule=function(e){e.startTag="----------\n",e.selection="",e.skipLines(1,1,!0)}}(),define("pagedown-light",function(){}),define("core",["underscore","crel","constants","utils","eventMgr","shortcutMgr","pagedown-Line truncated },p.value="OK",u=p.style,u.margin="10px",u.display="inline",u.width="7em";var f=d.createElement("input");f.type="button",f.onclick=function(){return o(!0)},f.value="Cancel",u=f.style,u.margin="10px",u.display="inline",u.width="7em",s.appendChild(p),s.appendChild(f),l.addEvent(d.body,"keydown",i),r.style.top="50%",r.style.left="50%",r.style.display="block",g.isIE_5or6&&(r.style.position="absolute",r.style.top=d.documentElement.scrollTop+200+"px",r.style.left="50%"),d.body.appendChild(r),r.style.marginTop=-(c.getHeight(r)/2)+"px",r.style.marginLeft=-(c.getWidth(r)/2)+"px"};setTimeout(function(){s();var e=n.length;if(void 0!==a.selectionStart)a.selectionStart=0,a.selectionEnd=e;else if(a.createTextRange){var t=a.createTextRange();t.collapse(!1),t.moveStart("character",-e),t.moveEnd("character",e),t.select()}a.focus()},0)};var w=o.prototype;w.prefixes="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)",w.unwrap=function(e){var n=new p("([^\\n])\\n(?!(\\n|"+this.prefixes+"))","g");e.selection=e.selection.replace(n,"$1 $2")},w.wrap=function(e,n){this.unwrap(e);var t=new p("(.{1,"+n+"})( +|$\\n?)","gm"),r=this;e.selection=e.selection.replace(t,function(e,n){return new p("^"+r.prefixes,"").test(e)?e:n+"\n"}),e.selection=e.selection.replace(/\s+$/,"")},w.doBold=function(e,n){return this.doBorI(e,n,2,this.getString("boldexample"))},w.doItalic=function(e,n){return this.doBorI(e,n,1,this.getString("italicexample"))},w.doBorI=function(e,n,t,r){e.trimWhitespace(),e.selection=e.selection.replace(/\n{2,}/g,"\n");var a=/(\**$)/.exec(e.before)[0],i=/(^\**)/.exec(e.after)[0],o=Math.min(a.length,i.length);if(o>=t&&(2!=o||1!=t))e.before=e.before.replace(p("[*]{"+t+"}$",""),""),e.after=e.after.replace(p("^[*]{"+t+"}",""),"");else if(!e.selection&&i){e.after=e.after.replace(/^([*_]*)/,""),e.before=e.before.replace(/(\s?)$/,"");var s=p.$1;e.before=e.before+i+s}else{e.selection||i||(e.selection=r);var l=1>=t?"*":"**";e.before=e.before+l,e.after=l+e.after}},w.stripLinkDefs=function(e,n){return e=e.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm,function(e,t,r,a,i){return n[t]=e.replace(/\s*$/,""),a?(n[t]=e.replace(/["(](.+?)[")]$/,""),a+i):""})},w.addLinkDef=function(e,n){var t=0,r={};e.before=this.stripLinkDefs(e.before,r),e.selection=this.stripLinkDefs(e.selection,r),e.after=this.stripLinkDefs(e.after,r);var a="",i=/(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g,o=function(e){t++,e=e.replace(/^[ ]{0,3}\[(\d+)\]:/," ["+t+"]:"),a+="\n"+e},s=function(e,n,a,l,c,u){return a=a.replace(i,s),r[c]?(o(r[c]),n+a+l+t+u):e};e.before=e.before.replace(i,s),n?o(n):e.selection=e.selection.replace(i,s);var l=t;return e.after=e.after.replace(i,s),e.after&&(e.after=e.after.replace(/\n*$/,"")),e.after||(e.selection=e.selection.replace(/\n*$/,"")),e.after+="\n\n"+a,l},w.insertLink=function(e,n,t,r,a){e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/);var i;if(!(e.endTag.length>1&&e.startTag.length>0)){if(e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="",/\n\n/.test(e.selection))return void this.addLinkDef(e,null);var o=function(t){i.parentNode.removeChild(i),null!==t&&(e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1),e.startTag=a?"![":"[",e.endTag="]("+s(t)+")",e.selection=r),n()};return i=u.createBackground(),o(t),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},w.doLinkOrImage=function(e,n,t){e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\(.*?\))?/);var r;if(!(e.endTag.length>1&&e.startTag.length>0)){if(e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="",/\n\n/.test(e.selection))return void this.addLinkDef(e,null);var a=this,i=function(i,o){if(r.parentNode.removeChild(r),null!==i&&(e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1),e.startTag=t?"![":"[",e.endTag="]("+s(i)+")",!e.selection)){var l="";l=o?o:a.getString(t?"imagedescription":"linkdescription"),e.selection=l}n()};return r=u.createBackground(),t?this.hooks.insertImageDialog(i)||u.prompt(this.getString("imagedialog"),v,i):this.hooks.insertLinkDialog(i)||u.prompt(this.getString("linkdialog"),b,i),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},w.doAutoindent=function(e){var n=this,t=!1;e.before=e.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ \t]+\n$/,"\n\n"),e.selection||/^[ \t]*(?:\n|$)/.test(e.after)||(e.after=e.after.replace(/^[^\n]*/,function(n){return e.selection=n,""}),t=!0),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before)&&n.doList&&n.doList(e),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before)&&n.doBlockquote&&n.doBlockquote(e),/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&n.doCode&&n.doCode(e),t&&(e.after=e.selection+e.after,e.selection="")},w.doBlockquote=function(e){e.selectLine truncated