From cfe7be206a44ef1598f5b7976fb87498276366fe Mon Sep 17 00:00:00 2001 From: kj-sh604 Date: Wed, 9 Apr 2025 21:46:16 -0400 Subject: refactor: locally host js --- src/index.php | 2 +- src/js/simplemde.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 src/js/simplemde.js (limited to 'src') diff --git a/src/index.php b/src/index.php index 22c84b3..0f4616c 100644 --- a/src/index.php +++ b/src/index.php @@ -29,7 +29,7 @@ session_start(); ?> generatingIndicator.style.display = 'block'; } - + >18&63]+u[r>>12&63]+u[r>>6&63]+u[63&r]);return i.join("")}n.toByteArray=function(e){var t,n,r,i,o=e.length;if(0>16&255,i[l++]=n>>8&255,i[l++]=255&n;return 2==r?(n=a[e.charCodeAt(s)]<<2|a[e.charCodeAt(s+1)]>>4,i[l++]=255&n):1==r&&(n=a[e.charCodeAt(s)]<<10|a[e.charCodeAt(s+1)]<<4|a[e.charCodeAt(s+2)]>>2,i[l++]=n>>8&255,i[l++]=255&n),i},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i="",o=[],l=16383,s=0,a=n-r;s>2],i+=u[t<<4&63],i+="=="):2==r&&(t=(e[n-2]<<8)+e[n-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),o.push(i),o.join("")};var u=[],a=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array;!function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function c(e,t){if(h.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":case void 0:return S(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return C(e).length;default:if(r)return S(e).length;t=(""+t).toLowerCase(),r=!0}}function t(e,t,n){var r,i,o,l=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||r>8,r=r%256,i.push(r),i.push(n);return i}(t,e.length-n),e,n,r)}function m(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i>>10&1023|55296),u=56320|1023&u),r.push(u),i+=h}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);for(var n="",r=0;re.length)throw new RangeError("Index out of range")}function y(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function x(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function b(e,t,n,r){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function w(e,t,n,r,i){return i||b(e,0,n,4),M.write(e,t,n,r,23,4),n+4}function k(e,t,n,r,i){return i||b(e,0,n,8),M.write(e,t,n,r,52,8),n+8}function S(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],l=0;l>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function C(e){return T.toByteArray(function(e){if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(E,"")).length<2)return"";for(var t;e.length%4!=0;)e+="=";return e}(e))}function L(e,t,n,r){for(var i=0;i=t.length||i>=e.length);i++)t[i+n]=e[i];return i}var T=O("base64-js"),M=O("ieee754"),N=O("isarray");I.Buffer=h,I.SlowBuffer=function(e){return+e!=e&&(e=0),h.alloc(+e)},I.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),I.kMaxLength=n(),h.poolSize=8192,h._augment=function(e){return e.__proto__=h.prototype,e},h.from=function(e,t,n){return r(null,e,t,n)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(e,t,n){return r=null,t=t,n=n,o(e=e),!(e<=0)&&void 0!==t?"string"==typeof n?i(r,e).fill(t,n):i(r,e).fill(t):i(r,e);var r},h.allocUnsafe=function(e){return l(null,e)},h.allocUnsafeSlow=function(e){return l(null,e)},h.isBuffer=function(e){return!(null==e||!e._isBuffer)},h.compare=function(e,t){if(!h.isBuffer(e)||!h.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);it&&(e+=" ... ")),""},h.prototype.compare=function(e,t,n,r,i){if(!h.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(i<=r&&n<=t)return 0;if(i<=r)return-1;if(n<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),l=(n>>>=0)-(t>>>=0),s=Math.min(o,l),a=this.slice(r,i),c=e.slice(t,n),u=0;u>=0,0===this.length)return-1;if(t>=this.length)return-1;if(t<0&&(t=Math.max(this.length+t,0)),"string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:d(this,e,t,n);if("number"==typeof e)return h.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):d(this,[e],t,n);throw new TypeError("val must be string, number or Buffer")},h.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},h.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||ithis.length)throw new RangeError("Attempt to write outside buffer bounds");r=r||"utf8";for(var o,l,s,a=!1;;)switch(r){case"hex":return function(e,t,n,r){n=Number(n)||0;var i=e.length-n;if(r?i<(r=Number(r))&&(r=i):r=i,(i=t.length)%2!=0)throw new Error("Invalid hex string");i/2>>8):y(this,e,t,!0),t+2},h.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):y(this,e,t,!1),t+2},h.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):x(this,e,t,!0),t+4},h.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},h.prototype.writeIntLE=function(e,t,n,r){e=+e,t|=0,r||v(this,e,t,n,(r=Math.pow(2,8*n-1))-1,-r);var i=0,o=1,l=0;for(this[t]=255&e;++i>0)-l&255;return t+n},h.prototype.writeIntBE=function(e,t,n,r){e=+e,t|=0,r||v(this,e,t,n,(r=Math.pow(2,8*n-1))-1,-r);var i=n-1,o=1,l=0;for(this[t+i]=255&e;0<=--i&&(o*=256);)e<0&&0===l&&0!==this[t+i+1]&&(l=1),this[t+i]=(e/o>>0)-l&255;return t+n},h.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,1,127,-128),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},h.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):y(this,e,t,!0),t+2},h.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):y(this,e,t,!1),t+2},h.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):x(this,e,t,!0),t+4},h.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},h.prototype.writeFloatLE=function(e,t,n){return w(this,e,t,!0,n)},h.prototype.writeFloatBE=function(e,t,n){return w(this,e,t,!1,n)},h.prototype.writeDoubleLE=function(e,t,n){return k(this,e,t,!0,n)},h.prototype.writeDoubleBE=function(e,t,n){return k(this,e,t,!1,n)},h.prototype.copy=function(e,t,n,r){if(n=n||0,r||0===r||(r=this.length),t>=e.length&&(t=e.length),t=t||0,0=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(e=e||0))for(s=t;s[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,h=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,d=/[*+-]\s/;c.commands.newlineAndIndentContinueMarkdownList=function(e){if(e.getOption("disableInput"))return c.Pass;for(var t=e.listSelections(),n=[],r=0;r")?o[2]:parseInt(o[3],10)+1+o[4],n[r]="\n"+a+o+i)}e.replaceSelections(n)}})("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],8:[function(e,t,n){(function(t){"use strict";t.overlayMode=function(n,r,i){return{startState:function(){return{base:t.startState(n),overlay:t.startState(r),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(e){return{base:t.copyState(n,e.base),overlay:t.copyState(r,e.overlay),basePos:e.basePos,baseCur:null,overlayPos:e.overlayPos,overlayCur:null}},token:function(e,t){return(e!=t.streamSeen||Math.min(t.basePos,t.overlayPos)=n.line,u=c?n:d(a,0),u=e.markText(s,u,{className:o});if(null==r?i.push(u):i.splice(r++,0,u),c)break;l=a}}function s(e){for(var t=e.state.markedSelection,n=0;nn.maxLineLength&&(n.maxLineLength=t,n.maxLine=e)})}function h(e){var t=Sr(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):-1=r&&(o=Zn(t,Jn(Yn(t,n))-e.wrapper.clientHeight),r=n)),{from:o,to:Math.max(r,o+1)}}function x(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=S(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mt(e))return!1;w(e)&&(dt(e),t.dims=O(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroml&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),pi&&(o=kn(e.doc,o),l=Sn(e.doc,l));var s=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;r=o,i=l,0==(l=(o=e).display).view.length||r>=l.viewTo||i<=l.viewFrom?(l.view=ct(o,r,i),l.viewFrom=r):(l.viewFrom>r?l.view=ct(o,r,l.viewFrom).concat(l.view):l.viewFromi&&(l.view=l.view.slice(0,ft(o,i)))),l.viewTo=i,n.viewOffset=Jn(Yn(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";l=mt(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;i=Dr();return 4=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&L(e,t);r=!1){A(e);var i=d(e);Se(e),v(e,i),N(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function M(e,t){var n=new C(e,t);L(e,n)&&(A(e),T(e,n),t=d(e),Se(e),v(e,t),N(e,t),n.finish())}function N(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Re(e)+"px"}function A(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;rn?mi(n,Yn(e,n).text.length):(e=Yn(e,(n=t).line).text.length,null==(t=n.ch)||e=e.first&&t=t.ch:s.to>t.ch))){if(i&&(uo(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(a.atomic){if(n){var c,u=a.find(r<0?1:-1);if((r<0?a.inclusiveRight:a.inclusiveLeft)&&(u=ke(e,u,-r,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=gi(u,n))&&(r<0?c<0:0e.first?le(e,mi(t.line-1)):null:0=e.display.viewTo||n.to().linet||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}(Qn(r),s||0,null==a?d:a,function(e,t,n){var r,i,o,l=c(e,"left");e==t?r=i=(o=l).left:(o=c(t-1,"right"),"rtl"==n&&(n=l,l=o,o=n),r=l.left,i=o.right),null==s&&0==e&&(r=p),3h.bottom||o.bottom==h.bottom&&o.right>h.right)&&(h=o),r=s.display.viewTo||(a=+new Date+s.options.workTime,c=_i(h.mode,Ae(s,h.frontier)),u=[],h.iter(h.frontier,Math.min(h.first+h.size,s.display.viewTo+500),function(e){if(h.frontier>=s.display.viewFrom){var t=e.styles,n=e.text.length>s.options.maxHighlightLength,r=In(s,e,n?_i(h.mode,c):c,!0);e.styles=r.styles;var i=e.styleClasses,r=r.classes;r?e.styleClasses=r:i&&(e.styleClasses=null);for(var o=!t||t.length!=e.styles.length||i!=r&&(!i||!r||i.bgClass!=r.bgClass||i.textClass!=r.textClass),l=0;!o&&la?(Me(s,s.options.workDelay),!0):void 0}),u.length&&it(s,function(){for(var e=0;ei.first&&Yn(i,l-1).stateAfter)?_i(i.mode,s):Fi(i.mode);return i.iter(l,r,function(e){Pn(n,e.text,s);var t=l==r-1||l%5==0||l>=o.viewFrom&&ln)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function We(e,t,n,r){return Fe(e,_e(e,t),n,r)}function Be(e,t){if(t>=e.display.viewFrom&&t=e.lineN&&tt)&&(i=(o=c-a)-1,c<=t&&(l="right")),null!=i){if(r=e[s+2],a==c&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)r=e[2+(s-=3)],l="left";if("right"==n&&i==c-a)for(;sn.from?s(e-1):s(e,r)}i=i||Yn(n.doc,e.line),o=o||_e(n,i);var a=Qn(i),c=e.ch;if(!a)return s(c);e=t(c,Gr(a,c));return null!=Bo&&(e.other=t(c,Bo)),e}function Ze(e,t){var n=0,t=le(e.doc,t);e.options.lineWrapping||(n=tt(e.display)*t.ch);t=Yn(e.doc,t.line),e=Jn(t)+Ee(e.display);return{left:n,right:n,top:e,bottom:e+t.height}}function Je(e,t,n,r){t=mi(e,t);return t.xRel=r,n&&(t.outside=!0),t}function Qe(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Je(r.first,0,!0,-1);var i=Zn(r,n),o=r.first+r.size-1;if(oe.bottom?e.left-a:lc.from.ch||s.ch==c.from.ch&&0=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new C(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}(e[t]);for(t=0;t(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null==i||li||(t=Ir("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-Ee(e.display))+"px; height: "+(t.bottom-t.top+Re(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;"),e.display.lineSpace.appendChild(t),t.scrollIntoView(i),e.display.lineSpace.removeChild(t)))}(n,t));var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var s=0;st)&&(l.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=l.viewTo?pi&&kn(e.doc,t)l.viewFrom?dt(e):(l.viewFrom+=r,l.viewTo+=r):t<=l.viewFrom&&n>=l.viewTo?dt(e):t<=l.viewFrom?(o=pt(e,n,n+r,1))?(l.view=l.view.slice(o.index),l.viewFrom=o.lineN,l.viewTo+=r):dt(e):n>=l.viewTo?(o=pt(e,t,t,-1))?(l.view=l.view.slice(0,o.index),l.viewTo=o.lineN):dt(e):(i=pt(e,t,t,-1),o=pt(e,n,n+r,1),i&&o?(l.view=l.view.slice(0,i.index).concat(ct(e,i.lineN,o.lineN)).concat(l.view.slice(o.index)),l.viewTo+=r):dt(e));e=l.externalMeasured;e&&(n=o.lineN&&t=i.viewTo||null==(r=i.view[ft(e,t)]).node||-1==Sr(r=r.changes||(r.changes=[]),n)&&r.push(n)}function dt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ft(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;ri-400&&0==gi(bi.pos,n)?r="triple":xi&&xi.time>i-400&&0==gi(xi.pos,n)?(r="double",bi={time:i,pos:n}):(r="single",xi={time:i,pos:n});var o,l=e.doc.sel,i=ci?t.metaKey:t.ctrlKey;e.options.dragDrop&&Io&&!e.isReadOnly()&&"single"==r&&-1<(o=l.contains(n))&&(gi((o=l.ranges[o]).from(),n)<0||0u&&t.push(new ne(mi(s,u),mi(s,xo(c,l,n))))}t.length||t.push(new ne(f,f)),me(m,re(y.ranges.slice(0,v).concat(t),v),{origin:"*mouse",scroll:!1}),d.scrollIntoView(e)}else{var h=g,r=h.anchor,i=e;"single"!=p&&(e="double"==p?d.findWordAt(e):new ne(mi(e.line,0),le(m,mi(e.line+1,0))),r=0=t.to||i.lines.bottom?20:0)&&setTimeout(ot(d,function(){a==r&&(l.scroller.scrollTop+=n,o(e))}),50))}function n(e){d.state.selectingText=!1,a=1/0,io(e),l.input.focus(),co(document,"mousemove",c),co(document,"mouseup",u),m.history.lastSelOrigin=null}var l=d.display,m=d.doc;io(e);var g,v,r,y=m.sel,i=y.ranges;t&&!e.shiftKey?(v=m.sel.contains(f),g=-1=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&io(t);var l=e.display,r=l.lineDiv.getBoundingClientRect();if(o>r.bottom||!yr(e,n))return ur(t);o-=r.top-l.viewOffset;for(var s=0;s=i){var c=Zn(e.doc,o),a=e.options.gutters[s];return uo(e,n,e,c,a,t),ur(t)}}}function wt(e,t){return bt(e,t,"gutterClick",!0)}function kt(e){var r=this;if(St(r),!gr(r,e)&&!vt(r.display,e)){io(e),ei&&(Ci=+new Date);var t,i=yt(r,e,!0),n=e.dataTransfer.files;if(i&&!r.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var o=n.length,l=Array(o),s=0,a=0;al.clientWidth,a=l.scrollHeight>l.clientHeight;if(r&&s||i&&a){if(i&&ci&&ni)e:for(var c=t.target,u=o.view;c!=l;c=c.parentNode)for(var h=0;he.lastLine()||(t.from.lined&&(t={from:t.from,to:mi(d,Yn(e,d).text.length),text:[t.text[0]],origin:t.origin}),t.removed=$n(e,t.from,t.to),n=n||Wt(e,t),e.cm?(i=e.cm,o=t,l=r,s=i.doc,a=i.display,c=o.from,u=o.to,h=!1,d=c.line,i.options.lineWrapping||(d=Xn(wn(Yn(s,c.line))),s.iter(d,u.line+1,function(e){return e==a.maxLine?h=!0:void 0})),-1a.maxLineLength&&(a.maxLine=e,a.maxLineLength=t,a.maxLineChanged=!0,h=!1)}),h&&(i.curOp.updateMaxLine=!0)),s.frontier=Math.min(s.frontier,c.line),Me(i,400),d=o.text.length-(u.line-c.line)-1,o.full?ut(i):c.line!=u.line||1!=o.text.length||Fn(i.doc,o)?ut(i,c.line,u.line+1,d):ht(i,c.line,"text"),s=yr(i,"changes"),((d=yr(i,"change"))||s)&&(o={from:c,to:u,text:o.text,removed:o.removed,origin:o.origin},d&&pr(i,"change",i,o),s&&(i.curOp.changeObjs||(i.curOp.changeObjs=[])).push(o)),i.display.selForContextMenu=null):zn(e,t,r),ge(e,n,mo))}function Gt(e,t,n,r,i){var o;gi(r=r||n,n)<0&&(o=r,r=n,n=o),"string"==typeof t&&(t=e.splitLines(t)),Ft(e,{from:n,to:r,text:t,origin:i})}function Yt(e,t,n,r,i){var o=e.display,l=et(e.display);n<0&&(n=0);var s=(e.curOp&&null!=e.curOp.scrollTop?e.curOp:o.scroller).scrollTop,a=De(e),c={};ao.first?yo(Yn(o,t-1).text,null,l):0:"add"==n?c=a+e.options.indentUnit:"subtract"==n?c=a-e.options.indentUnit:"number"==typeof n&&(c=a+n),c=Math.max(0,c);var h="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/l);f;--f)d+=l,h+="\t";if(d=n.first+n.size||!(c=Yn(n,l=e))))return;s=i?(r<0?jr:zr)(c):r<0?c.text.length:0}else s=t;return 1}var l=e.line,s=e.ch,a=r,c=Yn(n,l);if("char"==t)o();else if("column"==t)o(!0);else if("word"==t||"group"==t)for(var u=null,h="group"==t,d=n.cm&&n.cm.getHelper(e,"wordChars"),f=!0;!(r<0)||o(!f);f=!1){var p=c.text.charAt(s)||"\n",p=Ar(p,d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||p||(p="s"),u&&u!=p){r<0&&(r=1,o());break}if(p&&(u=p),0=l.height){a.hitSide=!0;break}o+=5*n}return a}function tn(e,t,r,n){a.defaults[e]=t,r&&(Ii[e]=n?function(e,t,n){n!=Ri&&r(e,t,n)}:r)}function nn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],l=0;l=t:l.to>t),(r=r||[]).push(new sn(s,l.from,o?null:l.to)))}return r}(n,l,e),c=function(e,t,n){if(e)for(var r,i=0;i=t:l.to>t))&&(l.from!=t||"bookmark"!=s.type||n&&!l.marker.insertLeft)||(o=null==l.from||(s.inclusiveLeft?l.from<=t:l.frome.lastLine())return t;var n,r=Yn(e,t);if(!Cn(e,r))return t;for(;n=xn(r);)r=n.find(1,!0).line;return Xn(r)+1}function Cn(e,t){var n=pi&&t.markedSpans;if(n)for(var r,i=0;it.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function En(e,t,n,r){function i(e){return{start:h.start,end:h.pos,string:h.current(),type:o||null,state:e?_i(l.mode,u):u}}var o,l=e.doc,s=l.mode;t=le(l,t);var a,c=Yn(l,t.line),u=Ae(e,t.line,n),h=new Yi(c.text,e.options.tabSize);for(r&&(a=[]);(r||h.pose.options.maxHighlightLength?(s=!1,l&&Pn(e,t,r,u.pos),u.pos=t.length,null):Mn(An(n,u,r,h),o);if(h&&(d=h[0].name)&&(f="m-"+(f?d+" "+f:d)),!s||c!=f){for(;ae.options.maxHighlightLength?_i(e.doc.mode,r):r),t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++),t.styles}function Pn(e,t,n,r){var i=e.doc.mode,o=new Yi(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Nn(i,n);!o.eol();)An(i,o,n),o.start=o.pos}function Dn(e,t){if(!e||/^\s*$/.test(e))return null;t=t.addModeClass?Qi:Ji;return t[e]||(t[e]=e.replace(/\S+/g,"cm-$&"))}function Hn(e,t){var n=Ir("span",null,null,ni?"padding-right: .1px":null),r={pre:Ir("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(ei||ni)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,l=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=Wn,function(e){if(null!=No)return No;var t=Pr(e,document.createTextNode("AخA")),e=Lo(t,0,1).getBoundingClientRect();if(!e||e.left==e.right)return!1;t=Lo(t,1,2).getBoundingClientRect();return No=t.right-e.right<3}(e.display.measure)&&(o=Qn(l))&&(r.addToken=function(h,d){return function(e,t,n,r,i,o,l){n=n?n+" cm-force-border":"cm-force-border";for(var s=e.pos,a=s+t.length;;){for(var c=0;cs&&u.from<=s)break}if(u.to>=a)return h(e,t,n,r,i,o,l);h(e,t.slice(0,u.to-s),n,r,null,o,l),r=null,t=t.slice(u.to-s),s=u.to}}}(r.addToken,o)),r.map=[],function(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var l,s,a,c,u,h,d,f=i.length,p=0,m=1,g="",v=0;;){if(v==p){a=c=u=h=s="",d=null,v=1/0;for(var y,x=[],b=0;bp||k.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(a+=" "+k.className),k.css&&(s=(s?s+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(y=y||[]).push(k.endStyle,w.to),k.title&&!h&&(h=k.title),k.collapsed&&(!d||gn(d.marker,k)<0)&&(d=w)):w.from>p&&v>w.from&&(v=w.from)}if(y)for(b=0;b=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(tl-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=(a=i).lastOp==r?(nr(a.done),kr(a.done)):a.done.length&&!kr(a.done).ranges?kr(a.done):1i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||uo(e,"historyAdded")}function ir(e,t){var n=kr(t);n&&n.ranges&&n.equals(e)||t.push(e)}function or(t,n,e,r){var i=n["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,r),function(e){e.markedSpans&&((i=i||(n["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function lr(e,t,n){for(var r=0,i=[];rt)return l;if(s.from==t||s.to==t){if(null!=n)return r=e,i=s.level,o=e[n].level,r=r[0].level,i==r||o!=r&&il.from&&se.text.length?null:i}var Kr=navigator.userAgent,Xr=navigator.platform,Zr=/gecko\/\d/i.test(Kr),Jr=/MSIE \d/.test(Kr),Qr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Kr),ei=Jr||Qr,ti=ei&&(Jr?document.documentMode||6:Qr[1]),ni=/WebKit\//.test(Kr),Jr=ni&&/Qt\/\d+\.\d+/.test(Kr),Qr=/Chrome\//.test(Kr),ri=/Opera\//.test(Kr),ii=/Apple Computer/.test(navigator.vendor),oi=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Kr),li=/PhantomJS/.test(Kr),si=/AppleWebKit/.test(Kr)&&/Mobile\/\w+/.test(Kr),ai=si||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Kr),ci=si||/Mac/.test(Xr),ui=/\bCrOS\b/.test(Kr),Xr=/win/i.test(Xr),Kr=ri&&Kr.match(/Version\/(\d*\.\d*)/);(Kr=Kr&&Number(Kr[1]))&&15<=Kr&&(ni=!(ri=!1));var hi=ci&&(Jr||ri&&(null==Kr||Kr<12.11)),di=Zr||ei&&9<=ti,fi=!1,pi=!1;e.prototype=Mr({update:function(e){var t,n=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;return r?(this.vert.style.display="block",this.vert.style.bottom=n?i+"px":"0",t=e.viewHeight-(n?i:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),n?(this.horiz.style.display="block",this.horiz.style.right=r?i+"px":"0",this.horiz.style.left=e.barLeft+"px",t=e.viewWidth-e.barLeft-(r?i:0),this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+t+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0n.viewTo-1)return!1;g=i.line==n.viewFrom||0==(g=ft(t,i.line))?(e=Xn(n.view[0].line),n.view[0].node):(e=Xn(n.view[g].line),n.view[g-1].node.nextSibling);var o,r=ft(t,r.line);r=r==n.view.length-1?(o=n.viewTo-1,n.lineDiv.lastChild):(o=Xn(n.view[r+1].line)-1,n.view[r+1].node.previousSibling);for(var l=t.doc.splitLines(ee(t,g,r,e,o)),s=$n(t.doc,mi(e,0),mi(o,Yn(t.doc,o).text.length));1n&&(Xt(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Vt(this));else{for(var o=i.from(),l=i.to(),i=Math.max(n,o.line),n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1,s=i;s>1;if((l?n[2*l-1]:0)>=o)i=l;else{if(!(n[2*l+1]o)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=o&&(a=e.bottom),c+t.offsetWidth>l&&(c=l-t.offsetWidth)),t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(c=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(i=this,s=a,c=(n=c)+t.offsetWidth,t=a+t.offsetHeight,null!=(t=Yt(i,n,s,c,t)).scrollTop&&Ct(i,t.scrollTop),null!=t.scrollLeft&&Lt(i,t.scrollLeft))},triggerOnKeyDown:lt(Et),triggerOnKeyPress:lt(It),triggerOnKeyUp:Ot,execCommand:function(e){return zi.hasOwnProperty(e)?zi[e].call(null,this):void 0},triggerElectric:lt(function(e){G(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=0,l=le(this.doc,e);ol.doc.first&&((r=Yn(l.doc,i.line-1).text)&&l.replaceRange(o.charAt(0)+l.doc.lineSeparator()+r.charAt(r.length-1),mi(i.line-1,r.length-1),mi(i.line,1),"+transpose"))),t.push(new ne(i,i))}l.setSelections(t)})},newlineAndIndent:function(r){it(r,function(){for(var e=r.listSelections().length,t=0;t=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){e=this.string.indexOf(e,this.pos);return-1t.display.maxLineLength&&(t.display.maxLine=a,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&ut(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ye(t.doc)),t&&pr(t,"markerCleared",t,this),n&&rt(t),this.parent&&this.parent.clear()}},Vi.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(i,o,l){i=le(this,i),o=le(this,o);var s=[],a=i.line;return this.iter(i.line,o.line+1,function(e){var t=e.markedSpans;if(t)for(var n=0;n=r.to||null==r.from&&a!=i.line||null!=r.from&&a==o.line&&r.from>=o.ch||l&&!l(r.marker)||s.push(r.marker.parent||r.marker)}++a}),s},getAllMarks:function(){var r=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var n=0;nt&&(t=e.from),null!=e.to&&e.to]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;l.defineMode("gfm",function(e,r){var t,i=0,n={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,t){if(t.combineTokens=null,t.codeBlock)return e.match(/^```+/)?t.codeBlock=!1:e.skipToEnd(),null;if(e.sol()&&(t.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),t.codeBlock=!0,null;if("`"===e.peek()){e.next();var n=e.pos;e.eatWhile("`");n=1+e.pos-n;return t.code?n===i&&(t.code=!1):(i=n,t.code=!0),null}if(t.code)return e.next(),null;if(e.eatSpace())return t.ateSpace=!0,null;if((e.sol()||t.ateSpace)&&(t.ateSpace=!1)!==r.gitHubSpice){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return t.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return t.combineTokens=!0,"link"}return e.match(s)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(t.combineTokens=!0,"link"):(e.next(),null)},blankLine:function(e){return e.code=!1,null}},o={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(t in r)o[t]=r[t];return o.name="markdown",l.overlayMode(l.getMode(e,o),n)},"markdown"),l.defineMIME("text/x-gfm","gfm")},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror"),e("../markdown/markdown"),e("../../addon/mode/overlay")):r(CodeMirror)},{"../../addon/mode/overlay":8,"../../lib/codemirror":10,"../markdown/markdown":12}],12:[function(e,t,n){var r;r=function(O){"use strict";O.defineMode("markdown",function(s,u){function a(e,t,n){return(t.f=t.inline=n)(e,t)}function c(e){return!e||!/\S/.test(e.string)}function r(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,x&&e.f==h&&(e.f=o,e.block=i),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null}function i(e,t){var n=e.sol(),r=!1!==t.list,i=t.indentedCode;t.indentedCode=!1,r&&(0<=t.indentationDiff?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):0"))return t.quote=n?1:t.quote+1,u.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),f(t);if("["===e.peek())return a(e,t,g);if(e.match(w,!0))return t.hr=!0,b.hr;if(!c(t.prevLine)&&!r||!e.match(k,!1)&&!e.match(S,!1))return u.fencedCodeBlocks&&(o=e.match(N,!0))?(t.fencedChars=o[1],t.localMode=(l=o[2],!O.findModeByName||(o=O.findModeByName(l))&&(l=o.mime||o.mimes[0]),"null"==(l=O.getMode(s,l)).name?null:l),t.localMode&&(t.localState=O.startState(t.localMode)),t.f=t.block=d,u.highlightFormatting&&(t.formatting="code-block"),t.code=-1,f(t)):a(e,t,t.inline);var l=null,l=e.match(k,!0)?"ul":(e.match(S,!0),"ol");for(t.indentation=e.column()+e.current().length,t.list=!0;t.listStack&&e.column()"))&&(t.f=o,t.block=i,t.htmlState=null),r}function d(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=n,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),b.code)}function n(e,t){e.match(t.fencedChars),t.block=i,t.f=o,t.fencedChars=null,u.highlightFormatting&&(t.formatting="code-block"),t.code=1;e=f(t);return t.code=0,e}function f(e){var t,n=[];if(e.formatting){n.push(b.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r=e.quote?n.push(b.formatting+"-"+e.formatting[r]+"-"+e.quote):n.push("error"))}return e.taskOpen?n.push("meta"):e.taskClosed?n.push("property"):(e.linkHref?n.push(b.linkHref,"url"):(e.strong&&n.push(b.strong),e.em&&n.push(b.em),e.strikethrough&&n.push(b.strikethrough),e.linkText&&n.push(b.linkText),e.code&&n.push(b.code)),e.header&&n.push(b.header,b.header+"-"+e.header),e.quote&&(n.push(b.quote),!u.maxBlockquoteDepth||u.maxBlockquoteDepth>=e.quote?n.push(b.quote+"-"+e.quote):n.push(b.quote+"-"+u.maxBlockquoteDepth)),!1!==e.list&&((t=(e.listStack.length-1)%3)?1==t?n.push(b.list2):n.push(b.list3):n.push(b.list1)),e.trailingSpaceNewLine?n.push("trailing-space-new-line"):e.trailingSpace&&n.push("trailing-space-"+(e.trailingSpace%2?"a":"b"))),n.length?n.join(" "):null}function e(e,t){return e.match(M,!0)?f(t):void 0}function o(e,t){var n=t.text(e,t);if(void 0!==n)return n;if(t.list)return t.list=null,f(t);if(t.taskList)return"x"!==e.match(C,!0)[1]?t.taskOpen=!0:t.taskClosed=!0,u.highlightFormatting&&(t.formatting="task"),t.taskList=!1,f(t);if(t.taskOpen=!1,t.taskClosed=!1,t.header&&e.match(/^#+$/,!0))return u.highlightFormatting&&(t.formatting="header"),f(t);var r=e.sol(),i=e.next();if(t.linkTitle){t.linkTitle=!1;n="("===i?")":i,n="^\\s*(?:[^"+(n=(n+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+n;if(e.match(new RegExp(n),!0))return b.linkHref}if("`"===i){var o=t.formatting;u.highlightFormatting&&(t.formatting="code"),e.eatWhile("`");var l=e.current().length;if(0==t.code)return t.code=l,f(t);if(l!=t.code)return t.formatting=o,f(t);l=f(t);return t.code=0,l}if(t.code)return f(t);if("\\"===i&&(e.next(),u.highlightFormatting)){var s=f(t),o=b.formatting+"-escape";return s?s+" "+o:o}if("!"===i&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return e.match(/\[[^\]]*\]/),t.inline=t.f=m,b.image;if("["===i&&e.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1))return t.linkText=!0,u.highlightFormatting&&(t.formatting="link"),f(t);if("]"===i&&t.linkText&&e.match(/\(.*?\)| ?\[.*?\]/,!1)){u.highlightFormatting&&(t.formatting="link");var s=f(t);return t.linkText=!1,t.inline=t.f=m,s}if("<"===i&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return t.f=t.inline=p,u.highlightFormatting&&(t.formatting="link"),(s=f(t))?s+=" ":s="",s+b.linkInline;if("<"===i&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return t.f=t.inline=p,u.highlightFormatting&&(t.formatting="link"),(s=f(t))?s+=" ":s="",s+b.linkEmail;if("<"===i&&e.match(/^(!--|\w)/,!1)){s=e.string.indexOf(">",e.pos);return-1!=s&&(a=e.string.substring(e.start,s),/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(a)&&(t.md_inside=!0)),e.backUp(1),t.htmlState=O.startState(y),c=e,s=h,((a=t).f=a.block=s)(c,a)}if("<"===i&&e.match(/^\/\w*?>/))return t.md_inside=!1,"tag";var a,c=!1;if(u.underscoresBreakWords||"_"!==i||"_"===e.peek()||!e.match(/(\w)/,!1)||0<=(a=e.pos-2)&&("_"!==(a=e.string.charAt(a))&&a.match(/(\w)/,!1)&&(c=!0)),"*"===i||"_"===i&&!c){if(!r||" "!==e.peek()){if(t.strong===i&&e.eat(i)){u.highlightFormatting&&(t.formatting="strong");l=f(t);return t.strong=!1,l}if(!t.strong&&e.eat(i))return t.strong=i,u.highlightFormatting&&(t.formatting="strong"),f(t);if(t.em===i){u.highlightFormatting&&(t.formatting="em");l=f(t);return t.em=!1,l}if(!t.em)return t.em=i,u.highlightFormatting&&(t.formatting="em"),f(t)}}else if(" "===i&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return f(t);e.backUp(1)}if(u.strikethrough)if("~"===i&&e.eatWhile(i)){if(t.strikethrough){u.highlightFormatting&&(t.formatting="strikethrough");l=f(t);return t.strikethrough=!1,l}if(e.match(/^[^\s]/,!1))return t.strikethrough=!0,u.highlightFormatting&&(t.formatting="strikethrough"),f(t)}else if(" "===i&&e.match(/^~~/,!0)){if(" "===e.peek())return f(t);e.backUp(2)}return" "===i&&(e.match(/ +$/,!1)?t.trailingSpace++:t.trailingSpace&&(t.trailingSpaceNewLine=!0)),f(t)}function p(e,t){if(">"!==e.next())return e.match(/^[^>]+/,!0),b.linkInline;t.f=t.inline=o,u.highlightFormatting&&(t.formatting="link");t=f(t);return t?t+=" ":t="",t+b.linkInline}function m(e,t){if(e.eatSpace())return null;var n,e=e.next();return"("===e||"["===e?(t.f=t.inline=(n="("===e?")":"]",function(e,t){if(e.next()!==n)return e.match(A[n]),t.linkHref=!0,f(t);t.f=t.inline=o,u.highlightFormatting&&(t.formatting="link-string");e=f(t);return t.linkHref=!1,e}),u.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,f(t)):"error"}function g(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=l,e.next(),u.highlightFormatting&&(t.formatting="link"),t.linkText=!0,f(t)):a(e,t,o)}function l(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=v,u.highlightFormatting&&(t.formatting="link");var n=f(t);return t.linkText=!1,n}return e.match(/^([^\]\\]|\\.)+/,!0),b.linkText}function v(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=o,b.linkHref+" url")}var y=O.getMode(s,"text/html"),x="null"==y.name;void 0===u.highlightFormatting&&(u.highlightFormatting=!1),void 0===u.maxBlockquoteDepth&&(u.maxBlockquoteDepth=0),void 0===u.underscoresBreakWords&&(u.underscoresBreakWords=!0),void 0===u.taskLists&&(u.taskLists=!1),void 0===u.strikethrough&&(u.strikethrough=!1),void 0===u.tokenTypeOverrides&&(u.tokenTypeOverrides={});var t,b={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"tag",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(t in b)b.hasOwnProperty(t)&&u.tokenTypeOverrides[t]&&(b[t]=u.tokenTypeOverrides[t]);var w=/^([*\-_])(?:\s*\1){2,}\s*$/,k=/^[*\-+]\s+/,S=/^[0-9]+([.)])\s+/,C=/^\[(x| )\](?=\s)/,L=u.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,T=/^ *(?:\={1,}|-{1,})\s*$/,M=/^[^#!\[\]*_\\<>` "'(~]+/,N=new RegExp("^("+(!0===u.fencedCodeBlocks?"~~~+|```+":u.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),A={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/},E={startState:function(){return{f:i,prevLine:null,thisLine:null,block:i,htmlState:null,indentation:0,inline:o,text:e,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&O.copyState(y,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?O.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkTitle:e.linkTitle,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,header:e.header,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedChars:e.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(r(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentationDiff=Math.min(n-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,0")):null:t.match("--")?e(i("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function r(i){return function(e,t){for(var n;null!=(n=e.next());){if("<"==n)return t.tokenize=r(i+1),t.tokenize(e,t);if(">"==n){if(1!=i)return t.tokenize=r(i-1),t.tokenize(e,t);t.tokenize=l;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),n.tokenize=i("meta","?>"),"meta"):(y=t.eat("/")?"closeTag":"openTag",n.tokenize=s,"tag bracket"):"&"!=r?(t.eatWhile(/[^&<]/),null):(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error"}function s(e,t){var n,r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=l,y=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return y="equals",null;if("<"!=r)return/[\'\"]/.test(r)?(t.tokenize=(n=r,i.isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word");t.tokenize=l,t.state=c,t.tagName=t.tagStart=null;t=t.tokenize(e,t);return t?t+" tag error":"tag error";function i(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=s;break}return"string"}}function i(n,r){return function(e,t){for(;!e.eol();){if(e.match(r)){t.tokenize=l;break}e.next()}return n}}function o(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(w.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function r(e){e.context&&(e.context=e.context.prev)}function a(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!w.contextGrabbers.hasOwnProperty(n)||!w.contextGrabbers[n].hasOwnProperty(t))return;r(e)}}function c(e,t,n){return"openTag"==e?(n.tagStart=t.column(),u):"closeTag"==e?h:c}function u(e,t,n){return"word"==e?(n.tagName=t.current(),x="tag",p):(x="error",u)}function h(e,t,n){if("word"!=e)return x="error",f;t=t.current();return n.context&&n.context.tagName!=t&&w.implicitlyClosed.hasOwnProperty(n.context.tagName)&&r(n),n.context&&n.context.tagName==t||!1===w.matchClosing?(x="tag",d):(x="tag error",f)}function d(e,t,n){return"endTag"!=e?(x="error",d):(r(n),c)}function f(e,t,n){return x="error",d(e,0,n)}function p(e,t,n){if("word"==e)return x="attribute",m;if("endTag"!=e&&"selfcloseTag"!=e)return x="error",p;var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||w.autoSelfClosers.hasOwnProperty(r)?a(n,r):(a(n,r),n.context=new o(n,r,i==n.indented)),c}function m(e,t,n){return"equals"==e?g:(w.allowMissing||(x="error"),p(e,0,n))}function g(e,t,n){return"string"==e?v:"word"==e&&w.allowUnquoted?(x="string",p):(x="error",p(e,0,n))}function v(e,t,n){return"string"==e?v:p(e,0,n)}var n,y,x,b=e.indentUnit,w={},k=t.htmlMode?C:L;for(n in k)w[n]=k[n];for(n in t)w[n]=t[n];return l.isInText=!0,{startState:function(e){var t={tokenize:l,state:c,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;y=null;var n=t.tokenize(e,t);return(n||y)&&"comment"!=n&&(x=null,t.state=t.state(y||n,e,t),x&&(n="error"==x?n+" error":x)),n},indent:function(e,t,n){var r=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+b;if(r&&r.noIndent)return S.Pass;if(e.tokenize!=s&&e.tokenize!=l)return n?n.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==w.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+b*(w.multilineTagIndentFactor||1);if(w.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:w.htmlMode?"html":"xml",helperType:w.htmlMode?"html":"xml",skipAttribute:function(e){e.state==g&&(e.state=p)}}}),S.defineMIME("text/xml","xml"),S.defineMIME("application/xml","xml"),S.mimeModes.hasOwnProperty("text/html")||S.defineMIME("text/html",{name:"xml",htmlMode:!0})})("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],15:[function(e,t,n){n.read=function(e,t,n,r,i){var o,l,s=8*i-r-1,a=(1<>1,u=-7,h=n?i-1:0,d=n?-1:1,n=e[t+h];for(h+=d,o=n&(1<<-u)-1,n>>=-u,u+=s;0>=-u,u+=r;0>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,f=r?1:-1,o=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,l=c):(l=Math.floor(Math.log(t)/Math.LN2),t*(r=Math.pow(2,-l))<1&&(l--,r*=2),2<=(t+=1<=l+u?h/r:h*Math.pow(2,1-u))*r&&(l++,r/=2),c<=l+u?(s=0,l=c):1<=l+u?(s=(t*r-1)*Math.pow(2,i),l+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),l=0));8<=i;e[n+d]=255&s,d+=f,s/=256,i-=8);for(l=l</g,">").replace(/"/g,""").replace(/'/g,"'")}function e(r,i){return r=r.source,i=i||"",function e(t,n){return t?(n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),r=r.replace(t,n),e):new RegExp(r,i)}}function t(){}function h(e){for(var t,n,r=1;rAn error occured:

"+u(e.message+"",!0)+"
";throw e}}var f={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:t,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:t,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:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:t,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/,bullet:/(?:[*+-]|\d+\.)/,item:/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/};f.item=e(f.item,"gm")(/bull/g,f.bullet)(),f.list=e(f.list)(/bull/g,f.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+f.def.source+")")(),f.blockquote=e(f.blockquote)("def",f.def)(),f._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",f.html=e(f.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,f._tag)(),f.paragraph=e(f.paragraph)("hr",f.hr)("heading",f.heading)("lheading",f.lheading)("blockquote",f.blockquote)("tag","<"+f._tag)("def",f.def)(),f.normal=h({},f),f.gfm=h({},f.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),f.gfm.paragraph=e(f.paragraph)("(?!","(?!"+f.gfm.fences.source.replace("\\1","\\2")+"|"+f.list.source.replace("\\1","\\3")+"|")(),f.tables=h({},f.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),a.rules=f,a.lex=function(e,t){return new a(t).lex(e)},a.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)},a.prototype.token=function(e,t,n){for(var r,i,o,l,s,a,c,u,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),1 ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),o=i[2],this.tokens.push({type:"list_start",ordered:1])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:t,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:t,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/};i.link=e(i.link)("inside",i._inside)("href",i._href)(),i.reflink=e(i.reflink)("inside",i._inside)(),i.normal=h({},i),i.pedantic=h({},i.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),i.gfm=h({},i.normal,{escape:e(i.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:e(i.text)("]|","~]|")("|","|https?://|")()}),i.breaks=h({},i.gfm,{br:e(i.br)("{2,}","*")(),text:e(i.gfm.text)("{2,}","*")()}),r.rules=i,r.output=function(e,t,n){return new r(t,n).output(e)},r.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),r="@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),this.mangle("mailto:")+n):n=u(i[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):u(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(u(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(u(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),r=n=u(i[1]),o+=this.renderer.link(r,null,n);return o},r.prototype.outputLink=function(e,t){var n=u(t.href),t=t.title?u(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,t,this.output(e[1])):this.renderer.image(n,t,u(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i'+(n?e:u(e,!0))+"\n\n":"
"+(n?e:u(e,!0))+"\n
"},n.prototype.blockquote=function(e){return"
\n"+e+"
\n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},n.prototype.list=function(e,t){t=t?"ol":"ul";return"<"+t+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},n.prototype.paragraph=function(e){return"

    "+e+"

    \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(e.replace(/&([#\w]+);/g,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var i='
    "+n+""},n.prototype.image=function(e,t,n){n=''+n+'":">")},n.prototype.text=function(e){return e},c.parse=function(e,t,n){return new c(t).parse(e)},c.prototype.parse=function(e){this.inline=new r(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},c.prototype.next=function(){return this.token=this.tokens.pop()},c.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},c.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},c.prototype.tok=function(){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":for(var e,t,n="",r="",i="",o=0;o=this.flags.COMPOUNDMIN)for(var n=0,r=this.compoundRules.length;n ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:i,ch:0},{line:i,ch:99999999999999})}(e.codemirror)}function b(e){var t=e.codemirror,n=d(t),r=e.options,e="http://";return!(r.promptURLs&&!(e=prompt(r.promptTexts.link)))&&void E(t,n.link,r.insertTexts.link,e)}function w(e){var t=e.codemirror,n=d(t),r=e.options,e="http://";return!(r.promptURLs&&!(e=prompt(r.promptTexts.image)))&&void E(t,n.image,r.insertTexts.image,e)}function k(e){var t=e.codemirror,n=d(t),e=e.options;E(t,n.table,e.insertTexts.table)}function S(e){var t=e.codemirror,n=d(t),e=e.options;E(t,n.image,e.insertTexts.horizontalRule)}function C(e){e=e.codemirror;e.undo(),e.focus()}function L(e){e=e.codemirror;e.redo(),e.focus()}function T(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.nextSibling,i=e.toolbarElements["side-by-side"],o=!1;/editor-preview-active-side/.test(r.className)?(r.className=r.className.replace(/\s*editor-preview-active-side\s*/g,""),i.className=i.className.replace(/\s*active\s*/g,""),n.className=n.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout(function(){t.getOption("fullScreen")||u(e),r.className+=" editor-preview-active-side"},1),i.className+=" active",n.className+=" CodeMirror-sided",o=!0);i=n.lastChild;/editor-preview-active/.test(i.className)&&(i.className=i.className.replace(/\s*editor-preview-active\s*/g,""),i=e.toolbarElements.preview,n=n.previousSibling,i.className=i.className.replace(/\s*active\s*/g,""),n.className=n.className.replace(/\s*disabled-for-preview*/g,""));t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=function(){r.innerHTML=e.options.previewRender(e.value(),r)}),o?(r.innerHTML=e.options.previewRender(e.value(),r),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction),t.refresh()}function M(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.previousSibling,i=!!e.options.toolbar&&e.toolbarElements.preview,o=n.lastChild;o&&/editor-preview/.test(o.className)||((o=document.createElement("div")).className="editor-preview",n.appendChild(o)),/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),i&&(i.className=i.className.replace(/\s*active\s*/g,""),r.className=r.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout(function(){o.className+=" editor-preview-active"},1),i&&(i.className+=" active",r.className+=" disabled-for-preview")),o.innerHTML=e.options.previewRender(e.value(),o);t=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(t.className)&&T(e)}function E(e,t,n,r){var i,o,l,s;/editor-preview-active/.test(e.getWrapperElement().lastChild.className)||(o=n[0],l=n[1],s=e.getCursor("start"),n=e.getCursor("end"),r&&(l=l.replace("#url#",r)),t?(o=(i=e.getLine(s.line)).slice(0,s.ch),l=i.slice(s.ch),e.replaceRange(o+l,{line:s.line,ch:0})):(i=e.getSelection(),e.replaceSelection(o+i+l),s.ch+=o.length,s!==n&&(n.ch+=o.length)),e.setSelection(s,n),e.focus())}function N(e,t,n){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var r=e.getCursor("start"),i=e.getCursor("end"),o=r.line;o<=i.line;o++)l=o,a=s=void 0,s=(a=e.getLine(l)).search(/[^#]/),a=void 0!==t?s<=0?"bigger"==t?"###### "+a:"# "+a:6==s&&"smaller"==t?a.substr(7):1==s&&"bigger"==t?a.substr(2):"bigger"==t?a.substr(1):"#"+a:1==n?s<=0?"# "+a:s==n?a.substr(s+1):"# "+a.substr(s+1):2==n?s<=0?"## "+a:s==n?a.substr(s+1):"## "+a.substr(s+1):s<=0?"### "+a:s==n?a.substr(s+1):"### "+a.substr(s+1),e.replaceRange(a,{line:l,ch:0},{line:l,ch:99999999999999});e.focus()}var l,s,a}function A(e,t){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var n=d(e),r=e.getCursor("start"),i=e.getCursor("end"),o={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},l={quote:"> ","unordered-list":"* ","ordered-list":"1. "},s=r.line;s<=i.line;s++)a=s,c=c=void 0,c=e.getLine(a),c=n[t]?c.replace(o[t],"$1"):l[t]+c,e.replaceRange(c,{line:a,ch:0},{line:a,ch:99999999999999});e.focus()}var a,c}function O(e,t,n,r){var i,o,l,s,a;/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)||(r=void 0===r?n:r,l=d(o=e.codemirror),s=n,a=r,e=o.getCursor("start"),r=o.getCursor("end"),l[t]?(s=(i=o.getLine(e.line)).slice(0,e.ch),a=i.slice(e.ch),"bold"==t?(s=s.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),a=a.replace(/(\*\*|__)/,"")):"italic"==t?(s=s.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),a=a.replace(/(\*|_)/,"")):"strikethrough"==t&&(s=s.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),a=a.replace(/(\*\*|~~)/,"")),o.replaceRange(s+a,{line:e.line,ch:0},{line:e.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(e.ch-=2,e!==r&&(r.ch-=2)):"italic"==t&&(--e.ch,e!==r&&--r.ch)):(i=o.getSelection(),"bold"==t?i=(i=i.split("**").join("")).split("__").join(""):"italic"==t?i=(i=i.split("*").join("")).split("_").join(""):"strikethrough"==t&&(i=i.split("~~").join("")),o.replaceSelection(s+i+a),e.ch+=n.length,r.ch=e.ch+i.length),o.setSelection(e,r),o.focus())}function I(e){for(var t=1;t