1var CodeMirror=function(){function e(r,i){function sn(e){return e>=0&&e<Ct.size}function un(e){return E(Ct,e)}function an(e,t){Wt=!0;var n=t-e.height;for(var r=e;r;r=r.parent)r.height+=n}function fn(e){var t={line:0,ch:0};Ln(t,{line:Ct.size-1,ch:un(Ct.size-1).text.length},lt(e),t,t),Ft=!0}function ln(e){var t=[];return Ct.iter(0,Ct.size,function(e){t.push(e.text)}),t.join(e||"\n")}function cn(e){K.scrollTop&&(bt.scrollTop+=K.scrollTop,K.scrollTop=0);if(Dt!=bt.scrollTop||Pt!=K.scrollLeft)Dt=bt.scrollTop,Pt=K.scrollLeft,tr([]),s.fixedGutter&&(st.style.left=K.scrollLeft+"px"),s.onScroll&&s.onScroll(on)}function hn(e){function d(e){if(i=="single")ur(n,e);else if(i=="double"){var t=yr(e);rt(e,h)?ur(t.from,p):ur(h,t.to)}else i=="triple"&&(rt(e,h)?ur(p,hr({line:e.line,ch:0})):ur(h,hr({line:e.line+1,ch:0})))}function v(e){var t=ei(e,!0);if(t&&!nt(t,u)){Lt||Tn(),u=t,d(t),Ft=!1;var n=er();if(t.line>=n.to||t.line<n.from)a=setTimeout(pi(function(){v(e)}),150)}}function m(e){clearTimeout(a);var t=ei(e);t&&d(t),L(e),Jn(),Ft=!0,g(),l()}or(D(e,"shiftKey"));for(var t=M(e);t!=C;t=t.parentNode)if(t.parentNode==G&&t!=Y)return;for(var t=M(e);t!=C;t=t.parentNode)if(t.parentNode==ot)return s.onGutterClick&&s.onGutterClick(on,at(ot.childNodes,t)+$t,e),L(e);var n=ei(e);switch(_(e)){case 3:j&&ti(e);return;case 2:n&&lr(n.line,n.ch,!0),setTimeout(Jn,20),L(e);return}if(!n){M(e)==K&&L(e);return}Lt||Tn();var r=+(new Date),i="single";if(_t&&_t.time>r-400&&nt(_t.pos,n))i="triple",L(e),setTimeout(Jn,20),br(n.line);else if(Mt&&Mt.time>r-400&&nt(Mt.pos,n)){i="double",_t={time:r,pos:n},L(e);var o=yr(n);ur(o.from,o.to)}else Mt={time:r,pos:n};var u=n,a;if(s.dragDrop&&J&&!s.readOnly&&!nt(At.from,At.to)&&!rt(n,At.from)&&!rt(At.to,n)&&i=="single"){U&&(K.draggable=!0);function f(t){U&&(K.draggable=!1),Ht=!1,l(),c(),Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)<10&&(L(t),lr(n.line,n.ch,!0),Jn())}var l=P(document,"mouseup",pi(f),!0),c=P(K,"drop",pi(f),!0);Ht=!0,K.dragDrop&&K.dragDrop();return}L(e),i=="single"&&lr(n.line,n.ch,!0);var h=At.from,p=At.to,g=P(document,"mousemove",pi(function(e){clearTimeout(a),L(e),!F&&!_(e)?m(e):v(e)}),!0),l=P(document,"mouseup",pi(m),!0)}function pn(e){for(var t=M(e);t!=C;t=t.parentNode)if(t.parentNode==ot)return L(e);L(e)}function dn(e){if(s.onDragEvent&&s.onDragEvent(on,k(e)))return;e.preventDefault();var t=ei(e,!0),n=e.dataTransfer.files;if(!t||s.readOnly)return;if(n&&n.length&&window.FileReader&&window.File){function r(e,n){var r=new FileReader;r.onload=function(){o[n]=r.result,++u==i&&(t=hr(t),pi(function(){var e=jn(o.join(""),t,t);ur(t,e)})())},r.readAsText(e)}var i=n.length,o=Array(i),u=0;for(var a=0;a<i;++a)r(n[a],a)}else{if(Ht&&!rt(t,At.from)&&!rt(At.to,t))return;try{var o=e.dataTransfer.getData("Text");o&&di(function(){var e=At.from,n=At.to;ur(t,t),Ht&&jn("",e,n),Fn(o),Jn()})}catch(e){}}}function vn(e){var t=Rn();e.dataTransfer.setData("Text",t);if(j||z||W){var n=document.createElement("img");n.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=",e.dataTransfer.setDragImage(n,0,0)}}function mn(e,t){if(typeof e=="string"){e=u[e];if(!e)return!1}var n=Ot;try{s.readOnly&&(jt=!0),t&&(Ot=null),e(on)}catch(r){if(r!=B)throw r;return!1}finally{Ot=n,jt=!1}return!0}function gn(e){function u(){o=!0}var t=f(s.keyMap),n=t.auto;clearTimeout(wn),n&&!c(e)&&(wn=setTimeout(function(){f(s.keyMap)==t&&(s.keyMap=n.call?n.call(null,on):n)},50));var r=ht[D(e,"keyCode")],i=!1;if(r==null||e.altGraphKey)return!1;D(e,"altKey")&&(r="Alt-"+r),D(e,"ctrlKey")&&(r="Ctrl-"+r),D(e,"metaKey")&&(r="Cmd-"+r);var o=!1;return D(e,"shiftKey")?i=l("Shift-"+r,s.extraKeys,s.keyMap,function(e){return mn(e,!0)},u)||l(r,s.extraKeys,s.keyMap,function(e){if(typeof e=="string"&&/^go[A-Z]/.test(e))return mn(e)},u):i=l(r,s.extraKeys,s.keyMap,mn,u),o&&(i=!1),i&&(L(e),ni(),F&&(e.oldKeyCode=e.keyCode,e.keyCode=0)),i}function yn(e,t){var n=l("'"+t+"'",s.extraKeys,s.keyMap,function(e){return mn(e,!0)});return n&&(L(e),ni()),n}function En(e){Lt||Tn(),F&&e.keyCode==27&&(e.returnValue=!1),Un&&Vn()&&(Un=!1);if(s.onKeyEvent&&s.onKeyEvent(on,k(e)))return;var t=D(e,"keyCode");or(t==16||D(e,"shiftKey"));var r=gn(e);W&&(bn=r?t:null,!r&&t==88&&D(e,n?"metaKey":"ctrlKey")&&Fn(""))}function Sn(e){Un&&Vn();if(s.onKeyEvent&&s.onKeyEvent(on,k(e)))return;var t=D(e,"keyCode"),n=D(e,"charCode");if(W&&t==bn){bn=null,L(e);return}if((W&&(!e.which||e.which<10)||V)&&gn(e))return;var r=String.fromCharCode(n==null?t:n);s.electricChars&&Nt.electricChars&&s.smartIndent&&!s.readOnly&&Nt.electricChars.indexOf(r)>-1&&setTimeout(pi(function(){Er(At.to.line,"smart")}),75);if(yn(e,r))return;Wn()}function xn(e){if(s.onKeyEvent&&s.onKeyEvent(on,k(e)))return;D(e,"keyCode")==16&&(Ot=null)}function Tn(){if(s.readOnly=="nocursor")return;Lt||(s.onFocus&&s.onFocus(on),Lt=!0,K.className.search(/\bCodeMirror-focused\b/)==-1&&(K.className+=" CodeMirror-focused"),zt||$n(!0)),zn(),ni()}function Nn(){Lt&&(s.onBlur&&s.onBlur(on),Lt=!1,Qt&&pi(function(){Qt&&(Qt(),Qt=null)})(),K.className=K.className.replace(" CodeMirror-focused","")),clearInterval(Tt),setTimeout(function(){Lt||(Ot=null)},150)}function Cn(e){return e>0&&e<1?1:e>-1&&e<0?-1:Math.round(e)}function kn(e){var t=0,n=0;if(e.type=="DOMMouseScroll"){var r=-e.detail*8;e.axis==e.HORIZONTAL_AXIS?t=r:e.axis==e.VERTICAL_AXIS&&(n=r)}else e.wheelDeltaX!==undefined&&e.wheelDeltaY!==undefined?(t=e.wheelDeltaX/3,n=e.wheelDeltaY/3):e.wheelDelta!==undefined&&(n=e.wheelDelta/3);var i=!1;t=Cn(t),n=Cn(n);if(t>0&&K.scrollLeft>0||t<0&&K.scrollLeft+K.clientWidth<K.scrollWidth)K.scrollLeft-=t,i=!0;if(n>0&&bt.scrollTop>0||n<0&&bt.scrollTop+bt.clientHeight<bt.scrollHeight)bt.scrollTop-=n,i=!0;i&&O(e)}function Ln(e,t,n,r,i){if(jt)return;if(tn){var o=[];Ct.iter(e.line,t.line+1,function(e){o.push(e.text)}),tn.addChange(e.line,n.length,o);while(tn.done.length>s.undoDepth)tn.done.shift()}_n(e,t,n,r,i)}function An(e,t){if(!e.length)return;var n=e.pop(),r=[];for(var i=n.length-1;i>=0;i-=1){var s=n[i],o=[],u=s.start+s.added;Ct.iter(s.start,u,function(e){o.push(e.text)}),r.push({start:s.start,added:s.old.length,old:o});var a={line:s.start+s.old.length-1,ch:ut(o[o.length-1],s.old[s.old.length-1])};_n({line:s.start,ch:0},{line:u-1,ch:un(u-1).text.length},s.old,a,a)}Ft=!0,t.push(r)}function On(){An(tn.done,tn.undone)}function Mn(){An(tn.undone,tn.done)}function _n(e,t,n,r,i){function T(e){return e<=Math.min(t.line,t.line+y)?e:e+y}if(jt)return;var o=!1,u=Gt.length;s.lineWrapping||Ct.iter(e.line,t.line+1,function(e){if(!e.hidden&&e.text.length==u)return o=!0,!0});if(e.line!=t.line||n.length>1)Wt=!0;var a=t.line-e.line,f=un(e.line),l=un(t.line);if(e.ch==0&&t.ch==0&&n[n.length-1]==""){var c=[],h=null;e.line?(h=un(e.line-1),h.fixMarkEnds(l)):l.fixMarkStarts();for(var p=0,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],h));a&&Ct.remove(e.line,a,Xt),c.length&&Ct.insert(e.line,c)}else if(f==l)if(n.length==1)f.replace(e.ch,t.ch,n[0]);else{l=f.split(t.ch,n[n.length-1]),f.replace(e.ch,null,n[0]),f.fixMarkEnds(l);var c=[];for(var p=1,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],f));c.push(l),Ct.insert(e.line+1,c)}else if(n.length==1)f.replace(e.ch,null,n[0]),l.replace(null,t.ch,""),f.append(l),Ct.remove(e.line+1,a,Xt);else{var c=[];f.replace(e.ch,null,n[0]),l.replace(null,t.ch,n[n.length-1]),f.fixMarkEnds(l);for(var p=1,d=n.length-1;p<d;++p)c.push(g.inheritMarks(n[p],f));a>1&&Ct.remove(e.line+1,a-1,Xt),Ct.insert(e.line+1,c)}if(s.lineWrapping){var v=Math.max(5,K.clientWidth/Gr()-3);Ct.iter(e.line,e.line+n.length,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/v)||1;t!=e.height&&an(e,t)})}else Ct.iter(e.line,e.line+n.length,function(e){var t=e.text;!e.hidden&&t.length>u&&(Gt=t,u=t.length,Zt=!0,o=!1)}),o&&(Yt=!0);var m=[],y=n.length-a-1;for(var p=0,b=kt.length;p<b;++p){var w=kt[p];w<e.line?m.push(w):w>t.line&&m.push(w+y)}var E=e.line+Math.min(n.length,500);ui(e.line,E),m.push(E),kt=m,fi(100),qt.push({from:e.line,to:t.line+1,diff:y});var S={from:e,to:t,text:n};if(Rt){for(var x=Rt;x.next;x=x.next);x.next=S}else Rt=S;ar(hr(r),hr(i),T(At.from.line),T(At.to.line))}function Dn(){var e=Ct.height*Jr()+2*Yr();return e-1>K.offsetHeight?e:!1}function Pn(e){var t=Dn();bt.style.display=t?"block":"none",t&&(wt.style.height=t+"px",bt.style.height=K.offsetHeight+"px",e!=null&&(bt.scrollTop=e)),Y.style.top=Vt*Jr()-bt.scrollTop+"px"}function Hn(){var e=document.createElement("div"),t=document.createElement("div");e.className="CodeMirror-scrollbar",e.style.cssText="position: absolute; left: -9999px; height: 100px;",t.className="CodeMirror-scrollbar-inner",t.style.height="200px",e.appendChild(t),document.body.appendChild(e);var n=e.offsetWidth<=1;return document.body.removeChild(e),n}function Bn(){var e=0;Gt="",Zt=!0,Ct.iter(0,Ct.size,function(t){var n=t.text;!t.hidden&&n.length>e&&(e=n.length,Gt=n)}),Yt=!1}function jn(e,t,n){function r(r){if(rt(r,t))return r;if(!rt(n,r))return i;var s=r.line+e.length-(n.line-t.line)-1,o=r.ch;return r.line==n.line&&(o+=e[e.length-1].length-(n.ch-(n.line==t.line?t.ch:0))),{line:s,ch:o}}t=hr(t),n?n=hr(n):n=t,e=lt(e);var i;return In(e,t,n,function(e){return i=e,{from:r(At.from),to:r(At.to)}}),i}function Fn(e,t){In(lt(e),At.from,At.to,function(e){return t=="end"?{from:e,to:e}:t=="start"?{from:At.from,to:At.from}:{from:At.from,to:e}})}function In(e,t,n,r){var i=e.length==1?e[0].length+t.ch:e[e.length-1].length,s=r({line:t.line+e.length-1,ch:i});Ln(t,n,e,s.from,s.to)}function qn(e,t,n){var r=e.line,i=t.line;if(r==i)return un(r).text.slice(e.ch,t.ch);var s=[un(r).text.slice(e.ch)];return Ct.iter(r+1,i,function(e){s.push(e.text)}),s.push(un(i).text.slice(0,t.ch)),s.join(n||"\n")}function Rn(e){return qn(At.from,At.to,e)}function zn(){if(Un)return;St.set(s.pollInterval,function(){li(),Vn(),Lt&&zn(),ci()})}function Wn(){function t(){li();var n=Vn();!n&&!e?(e=!0,St.set(60,t)):(Un=!1,zn()),ci()}var e=!1;Un=!0,St.set(20,t)}function Vn(){if(zt||!Lt||ct(X)||s.readOnly)return!1;var e=X.value;if(e==Xn)return!1;Ot=null;var t=0,n=Math.min(Xn.length,e.length);while(t<n&&Xn[t]==e[t])++t;return t<Xn.length?At.from={line:At.from.line,ch:At.from.ch-(Xn.length-t)}:Bt&&nt(At.from,At.to)&&(At.to={line:At.to.line,ch:Math.min(un(At.to.line).text.length,At.to.ch+(e.length-t))}),Fn(e.slice(t),"end"),e.length>1e3?X.value=Xn="":Xn=e,!0}function $n(e){nt(At.from,At.to)?e&&(Xn=X.value=""):(Xn="",X.value=Rn(),tt(X))}function Jn(){s.readOnly!="nocursor"&&X.focus()}function Kn(){var e=vt.getBoundingClientRect();if(F&&e.top==e.bottom)return;var t=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(e.top<0||e.bottom>t)&&Qn()}function Qn(){var e=Gn();return Yn(e.x,e.y,e.x,e.yBot)}function Gn(){var e=Ur(At.inverted?At.from:At.to),t=s.lineWrapping?Math.min(e.x,pt.offsetWidth):e.x;return{x:t,y:e.y,yBot:e.yBot}}function Yn(e,t,n,r){var i=Zn(e,t,n,r),o=!1;i.scrollLeft!=null&&(K.scrollLeft=i.scrollLeft,o=!0),i.scrollTop!=null&&(bt.scrollTop=i.scrollTop,o=!0),o&&s.onScroll&&s.onScroll(on)}function Zn(e,t,n,r){var i=Zr(),o=Yr();t+=o,r+=o,e+=i,n+=i;var u=K.clientHeight,a=bt.scrollTop,f={},l=K.scrollHeight,c=t<o+10,h=r+o>l-10;t<a?f.scrollTop=c?0:Math.max(0,t):r>a+u&&(f.scrollTop=(h?l:r)-u);var p=K.clientWidth,d=K.scrollLeft,v=s.fixedGutter?st.clientWidth:0,m=e<v+i+10;return e<d+v||m?(m&&(e=0),f.scrollLeft=Math.max(0,e-10-v)):n>p+d-3&&(f.scrollLeft=n+10-p),f}function er(e){var t=Jr(),n=(e!=null?e:bt.scrollTop)-Yr(),r=Math.max(0,Math.floor(n/t)),i=Math.ceil((n+K.clientHeight)/t);return{from:x(Ct,r),to:x(Ct,i)}}function tr(e,t,n){function d(){var e=yt.firstChild,t=!1;return Ct.iter($t,Jt,function(n){if(!n.hidden){var r=Math.round(e.offsetHeight/c)||1;n.height!=r&&(an(n,r),Wt=t=!0)}e=e.nextSibling}),t}if(!K.clientWidth){$t=Jt=Vt=0;return}var r=er(n);if(e!==!0&&e.length==0&&r.from>$t&&r.to<Jt){Pn(n);return}var i=Math.max(r.from-100,0),o=Math.min(Ct.size,r.to+100);$t<i&&i-$t<20&&(i=$t),Jt>o&&Jt-o<20&&(o=Math.min(Ct.size,Jt));var u=e===!0?[]:nr([{from:$t,to:Jt,domStart:0}],e),a=0;for(var f=0;f<u.length;++f){var l=u[f];l.from<i&&(l.domStart+=i-l.from,l.from=i),l.to>o&&(l.to=o),l.from>=l.to?u.splice(f--,1):a+=l.to-l.from}if(a==o-i&&i==$t&&o==Jt){Pn(n);return}u.sort(function(e,t){return e.domStart-t.domStart});var c=Jr(),h=st.style.display;yt.style.display="none",rr(i,o,u),yt.style.display=st.style.display="";var p=i!=$t||o!=Jt||Kt!=K.clientHeight+c;p&&(Kt=K.clientHeight+c),$t=i,Jt=o,Vt=T(Ct,i);if(yt.childNodes.length!=Jt-$t)throw new Error("BAD PATCH! "+JSON.stringify(u)+" size="+(Jt-$t)+" nodes="+yt.childNodes.length);if(s.lineWrapping){d();var v=Dn(),m=v?"block":"none";bt.style.display!=m&&(bt.style.display=m,v&&(wt.style.height=v+"px"),d())}return st.style.display=h,(p||Wt)&&ir()&&s.lineWrapping&&d()&&ir(),Pn(n),sr(),!t&&s.onUpdate&&s.onUpdate(on),!0}function nr(e,t){for(var n=0,r=t.length||0;n<r;++n){var i=t[n],s=[],o=i.diff||0;for(var u=0,a=e.length;u<a;++u){var f=e[u];i.to<=f.from&&i.diff?s.push({from:f.from+o,to:f.to+o,domStart:f.domStart}):i.to<=f.from||i.from>=f.to?s.push(f):(i.from>f.from&&s.push({from:f.from,to:i.from,domStart:f.domStart}),i.to<f.to&&s.push({from:i.to+o,to:f.to+o,domStart:f.domStart+(i.to-f.from)}))}e=s}return e}function rr(e,t,n){if(!n.length)yt.innerHTML="";else{function r(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var i=0,s=yt.firstChild,o;for(var u=0;u<n.length;++u){var a=n[u];while(a.domStart>i)s=r(s),i++;for(var f=0,l=a.to-a.from;f<l;++f)s=s.nextSibling,i++}while(s)s=r(s)}var c=n.shift(),s=yt.firstChild,f=e,h=document.createElement("div");Ct.iter(e,t,function(e){c&&c.to==f&&(c=n.shift());if(!c||c.from>f){if(e.hidden)var t=h.innerHTML="<pre></pre>";else{var t="<pre"+(e.className?' class="'+e.className+'"':"")+">"+e.getHTML(Nr)+"</pre>";e.bgClassName&&(t='<div style="position: relative"><pre class="'+e.bgClassName+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2">&#160;</pre>'+t+"</div>")}h.innerHTML=t,yt.insertBefore(h.firstChild,s)}else s=s.nextSibling;++f})}function ir(){if(!s.gutter&&!s.lineNumbers)return;var e=Y.offsetHeight,t=K.clientHeight;st.style.height=(e-t<2?t:e)+"px";var n=[],r=$t,i;Ct.iter($t,Math.max(Jt,$t+1),function(e){if(e.hidden)n.push("<pre></pre>");else{var t=e.gutterMarker,o=s.lineNumbers?s.lineNumberFormatter(r+s.firstLineNumber):null;t&&t.text?o=t.text.replace("%N%",o!=null?o:""):o==null&&(o="\u00a0"),n.push(t&&t.style?'<pre class="'+t.style+'">':"<pre>",o);for(var u=1;u<e.height;++u)n.push("<br/>&#160;");n.push("</pre>"),t||(i=r)}++r}),st.style.display="none",ot.innerHTML=n.join("");if(i!=null&&s.lineNumbers){var o=ot.childNodes[i-$t],u=String(Ct.size).length,a=et(o.firstChild),f="";while(a.length+f.length<u)f+="\u00a0";f&&o.insertBefore(document.createTextNode(f),o.firstChild)}st.style.display="";var l=Math.abs((parseInt(pt.style.marginLeft)||0)-st.offsetWidth)>2;return pt.style.marginLeft=st.offsetWidth+"px",Wt=!1,l}function sr(){var e=nt(At.from,At.to),t=Ur(At.from,!0),n=e?t:Ur(At.to,!0),r=At.inverted?t:n,i=Jr(),o=Z(C),u=Z(yt);A.style.top=Math.max(0,Math.min(K.offsetHeight,r.y+u.top-o.top))+"px",A.style.left=Math.max(0,Math.min(K.offsetWidth,r.x+u.left-o.left))+"px";if(e)vt.style.top=r.y+"px",vt.style.left=(s.lineWrapping?Math.min(r.x,pt.offsetWidth):r.x)+"px",vt.style.display="",gt.style.display="none";else{var a=t.y==n.y,f="",l=pt.clientWidth||pt.offsetWidth,c=pt.clientHeight||pt.offsetHeight;function h(e,t,n,r){var i=R?"width: "+(n?l-n-e:l)+"px":"right: "+n+"px";f+='<div class="CodeMirror-selected" style="position: absolute; left: '+e+"px; top: "+t+"px; "+i+"; height: "+r+'px"></div>'}if(At.from.ch&&t.y>=0){var p=a?l-n.x:0;h(t.x,t.y,p,i)}var d=Math.max(0,t.y+(At.from.ch?i:0)),v=Math.min(n.y,c)-d;v>.2*i&&h(0,d,0,v),(!a||!At.from.ch)&&n.y<c-.5*i&&h(0,n.y,l-n.x,i),gt.innerHTML=f,vt.style.display="none",gt.style.display=""}}function or(e){e?Ot=Ot||(At.inverted?At.to:At.from):Ot=null}function ur(e,t){var n=Ot&&hr(Ot);n&&(rt(n,e)?e=n:rt(t,n)&&(t=n)),ar(e,t),It=!0}function ar(e,t,n,r){mr=null,n==null&&(n=At.from.line,r=At.to.line);if(nt(At.from,e)&&nt(At.to,t))return;if(rt(t,e)){var i=t;t=e,e=i}if(e.line!=n){var o=fr(e,n,At.from.ch);o?e=o:Br(e.line,!1)}t.line!=r&&(t=fr(t,r,At.to.ch)),nt(e,t)?At.inverted=!1:nt(e,At.to)?At.inverted=!1:nt(t,At.from)&&(At.inverted=!0);if(s.autoClearEmptyLines&&nt(At.from,At.to)){var u=At.inverted?e:t;if(u.line!=At.from.line&&At.from.line<Ct.size){var a=un(At.from.line);/^\s+$/.test(a.text)&&setTimeout(pi(function(){if(a.parent&&/^\s+$/.test(a.text)){var e=S(a);jn("",{line:e,ch:0},{line:e,ch:a.text.length})}},10))}}At.from=e,At.to=t,Ut=!0}function fr(e,t,n){function r(t){var r=e.line+t,i=t==1?Ct.size:-1;while(r!=i){var o=un(r);if(!o.hidden){var u=e.ch;if(s||u>n||u>o.text.length)u=o.text.length;return{line:r,ch:u}}r+=t}}var i=un(e.line),s=e.ch==i.text.length&&e.ch!=n;return i.hidden?e.line>=t?r(1)||r(-1):r(-1)||r(1):e}function lr(e,t,n){var r=hr({line:e,ch:t||0});(n?ur:ar)(r,r)}function cr(e){return Math.max(0,Math.min(e,Ct.size-1))}function hr(e){if(e.line<0)return{line:0,ch:0};if(e.line>=Ct.size)return{line:Ct.size-1,ch:un(Ct.size-1).text.length};var t=e.ch,n=un(e.line).text.length;return t==null||t>n?{line:e.line,ch:n}:t<0?{line:e.line,ch:0}:e}function pr(e,t){function o(){for(var t=r+e,n=e<0?-1:Ct.size;t!=n;t+=e){var i=un(t);if(!i.hidden)return r=t,s=i,!0}}function u(t){if(i==(e<0?0:s.text.length)){if(!!t||!o())return!1;i=e<0?s.text.length:0}else i+=e;return!0}var n=At.inverted?At.from:At.to,r=n.line,i=n.ch,s=un(r);if(t=="char")u();else if(t=="column")u(!0);else if(t=="word"){var a=!1;for(;;){if(e<0&&!u())break;if(ft(s.text.charAt(i)))a=!0;else if(a){e<0&&(e=1,u());break}if(e>0&&!u())break}}return{line:r,ch:i}}function dr(e,t){var n=e<0?At.from:At.to;if(Ot||nt(At.from,At.to))n=pr(e,t);lr(n.line,n.ch,!0)}function vr(e,t){nt(At.from,At.to)?e<0?jn("",pr(e,t),At.to):jn("",At.from,pr(e,t)):jn("",At.from,At.to),It=!0}function gr(e,t){var n=0,r=Ur(At.inverted?At.from:At.to,!0);mr!=null&&(r.x=mr),t=="page"?n=Math.min(K.clientHeight,window.innerHeight||document.documentElement.clientHeight):t=="line"&&(n=Jr());var i=zr(r.x,r.y+n*e+2);t=="page"&&(bt.scrollTop+=Ur(i,!0).y-r.y),lr(i.line,i.ch,!0),mr=r.x}function yr(e){var t=un(e.line).text,n=e.ch,r=e.ch,i=ft(t.charAt(n<t.length?n:n-1))?ft:function(e){return!ft(e)};while(n>0&&i(t.charAt(n-1)))--n;while(r<t.length&&i(t.charAt(r)))++r;return{from:{line:e.line,ch:n},to:{line:e.line,ch:r}}}function br(e){ur({line:e,ch:0},hr({line:e+1,ch:0}))}function wr(e){if(nt(At.from,At.to))return Er(At.from.line,e);var t=At.to.line-(At.to.ch?0:1);for(var n=At.from.line;n<=t;++n)Er(n,e)}function Er(e,t){t||(t="add");if(t=="smart")if(!Nt.indent)t="prev";else var n=oi(e);var r=un(e),i=r.indentation(s.tabSize),o=r.text.match(/^\s*/)[0],u;t=="smart"&&(u=Nt.indent(n,r.text.slice(o.length),r.text),u==B&&(t="prev")),t=="prev"?e?u=un(e-1).indentation(s.tabSize):u=0:t=="add"?u=i+s.indentUnit:t=="subtract"&&(u=i-s.indentUnit),u=Math.max(0,u);var a=u-i,f="",l=0;if(s.indentWithTabs)for(var c=Math.floor(u/s.tabSize);c;--c)l+=s.tabSize,f+="	";while(l<u)++l,f+=" ";jn(f,{line:e,ch:0},{line:e,ch:o.length})}function Sr(){Nt=e.getMode(s,s.mode),Ct.iter(0,Ct.size,function(e){e.stateAfter=null}),kt=[0],fi()}function xr(){var e=s.gutter||s.lineNumbers;st.style.display=e?"":"none",e?Wt=!0:yt.parentNode.style.marginLeft=0}function Tr(e,t){if(s.lineWrapping){C.className+=" CodeMirror-wrap";var n=K.clientWidth/Gr()-3;Ct.iter(0,Ct.size,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/n)||1;t!=1&&an(e,t)}),pt.style.width=G.style.width="",mt.style.left=""}else C.className=C.className.replace(" CodeMirror-wrap",""),Gt="",Zt=!0,Ct.iter(0,Ct.size,function(e){e.height!=1&&!e.hidden&&an(e,1),e.text.length>Gt.length&&(Gt=e.text)});qt.push({from:0,to:Ct.size})}function Nr(e){var t=s.tabSize-e%s.tabSize,n=en[t];if(n)return n;for(var r='<span class="cm-tab">',i=0;i<t;++i)r+=" ";return en[t]={html:r+"</span>",width:t}}function Cr(){K.className=K.className.replace(/\s*cm-s-\S+/g,"")+s.theme.replace(/(^|\s)\s*/g," cm-s-")}function kr(){var e=a[s.keyMap].style;C.className=C.className.replace(/\s*cm-keymap-\S+/g,"")+(e?" cm-keymap-"+e:"")}function Lr(){this.set=[]}function Ar(e,t,n){function i(e,t,n,i){un(e).addMark(new v(t,n,i,r))}e=hr(e),t=hr(t);var r=new Lr;if(!rt(e,t))return r;if(e.line==t.line)i(e.line,e.ch,t.ch,n);else{i(e.line,e.ch,null,n);for(var s=e.line+1,o=t.line;s<o;++s)i(s,null,null,n);i(t.line,null,t.ch,n)}return qt.push({from:e.line,to:t.line+1}),r}function Or(e){e=hr(e);var t=new m(e.ch);return un(e.line).addMark(t),t}function Mr(e){e=hr(e);var t=[],n=un(e.line).marked;if(!n)return t;for(var r=0,i=n.length;r<i;++r){var s=n[r];(s.from==null||s.from<=e.ch)&&(s.to==null||s.to>=e.ch)&&t.push(s.marker||s)}return t}function _r(e,t,n){return typeof e=="number"&&(e=un(cr(e))),e.gutterMarker={text:t,style:n},Wt=!0,e}function Dr(e){typeof e=="number"&&(e=un(cr(e))),e.gutterMarker=null,Wt=!0}function Pr(e,t){var n=e,r=e;return typeof e=="number"?r=un(cr(e)):n=S(e),n==null?null:t(r,n)?(qt.push({from:n,to:n+1}),r):null}function Hr(e,t,n){return Pr(e,function(e){if(e.className!=t||e.bgClassName!=n)return e.className=t,e.bgClassName=n,!0})}function Br(e,t){return Pr(e,function(e,n){if(e.hidden!=t){e.hidden=t;if(!s.lineWrapping){var r=e.text;t&&r.length==Gt.length?Yt=!0:!t&&r.length>Gt.length&&(Gt=r,Yt=!1)}an(e,t?0:1);var i=At.from.line,o=At.to.line;if(t&&(i==n||o==n)){var u=i==n?fr({line:i,ch:0},i,0):At.from,a=o==n?fr({line:o,ch:0},o,0):At.to;if(!a)return;ar(u,a)}return Wt=!0}})}function jr(e){if(typeof e=="number"){if(!sn(e))return null;var t=e;e=un(e);if(!e)return null}else{var t=S(e);if(t==null)return null}var n=e.gutterMarker;return{line:t,handle:e,text:e.text,markerText:n&&n.text,markerClass:n&&n.style,lineClass:e.className,bgClass:e.bgClassName}}function Fr(e){return dt.innerHTML="<pre><span>x</span></pre>",dt.firstChild.firstChild.firstChild.nodeValue=e,dt.firstChild.firstChild.offsetWidth||10}function Ir(e,t){function i(e){return Rr(n,e).left}if(t<=0)return 0;var n=un(e),r=n.text,s=0,o=0,u=r.length,a,f=Math.min(u,Math.ceil(t/Gr()));for(;;){var l=i(f);if(!(l<=t&&f<u)){a=l,u=f;break}f=Math.min(u,Math.ceil(f*1.2))}if(t>a)return u;f=Math.floor(u*.8),l=i(f),l<t&&(s=f,o=l);for(;;){if(u-s<=1)return a-t>t-o?s:u;var c=Math.ceil((s+u)/2),h=i(c);h>t?(u=c,a=h):(s=c,o=h)}}function Rr(e,t){if(t==0)return{top:0,left:0};var n=s.lineWrapping&&t<e.text.length&&Q.test(e.text.slice(t-1,t+1));dt.innerHTML="<pre>"+e.getHTML(Nr,t,qr,n)+"</pre>";var r=document.getElementById(qr),i=r.offsetTop,o=r.offsetLeft;if(F&&i==0&&o==0){var u=document.createElement("span");u.innerHTML="x",r.parentNode.insertBefore(u,r.nextSibling),i=u.offsetTop}return{top:i,left:o}}function Ur(e,t){var n,r=Jr(),i=r*(T(Ct,e.line)-(t?Vt:0));if(e.ch==0)n=0;else{var o=Rr(un(e.line),e.ch);n=o.left,s.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function zr(e,t){function c(e){var t=Rr(u,e);if(f){var r=Math.round(t.top/n);return Math.max(0,t.left+(r-l)*K.clientWidth)}return t.left}t<0&&(t=0);var n=Jr(),r=Gr(),i=Vt+Math.floor(t/n),o=x(Ct,i);if(o>=Ct.size)return{line:Ct.size-1,ch:un(Ct.size-1).text.length};var u=un(o),a=u.text,f=s.lineWrapping,l=f?i-T(Ct,o):0;if(e<=0&&l==0)return{line:o,ch:0};var h=0,p=0,d=a.length,v,m=Math.min(d,Math.ceil((e+l*K.clientWidth*.9)/r));for(;;){var g=c(m);if(!(g<=e&&m<d)){v=g,d=m;break}m=Math.min(d,Math.ceil(m*1.2))}if(e>v)return{line:o,ch:d};m=Math.floor(d*.8),g=c(m),g<e&&(h=m,p=g);for(;;){if(d-h<=1)return{line:o,ch:v-e>e-p?h:d};var y=Math.ceil((h+d)/2),b=c(y);b>e?(d=y,v=b):(h=y,p=b)}}function Wr(e){var t=Ur(e,!0),n=Z(pt);return{x:n.left+t.x,y:n.top+t.y,yBot:n.top+t.yBot}}function Jr(){if($r==null){$r="<pre>";for(var e=0;e<49;++e)$r+="x<br/>";$r+="x</pre>"}var t=yt.clientHeight;return t==Vr?Xr:(Vr=t,dt.innerHTML=$r,Xr=dt.firstChild.offsetHeight/50||1,dt.innerHTML="",Xr)}function Gr(){return K.clientWidth==Qr?Kr:(Qr=K.clientWidth,Kr=Fr("x"))}function Yr(){return pt.offsetTop}function Zr(){return pt.offsetLeft}function ei(e,t){var n=Z(K,!0),r,i;try{r=e.clientX,i=e.clientY}catch(e){return null}if(!t&&(r-n.left>K.clientWidth||i-n.top>K.clientHeight))return null;var s=Z(pt,!0);return zr(r-s.left,i-s.top)}function ti(e){function o(){var e=lt(X.value).join("\n");e!=i&&!s.readOnly&&pi(Fn)(e,"end"),A.style.position="relative",X.style.cssText=r,q&&(bt.scrollTop=n),zt=!1,$n(!0),zn()}var t=ei(e),n=bt.scrollTop;if(!t||W)return;(nt(At.from,At.to)||rt(t,At.from)||!rt(t,At.to))&&pi(lr)(t.line,t.ch);var r=X.style.cssText;A.style.position="absolute",X.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",zt=!0;var i=X.value=Rn();Jn(),tt(X);if(j){O(e);var u=P(window,"mouseup",function(){u(),setTimeout(o,20)},!0)}else setTimeout(o,50)}function ni(){clearInterval(Tt);var e=!0;vt.style.visibility="",Tt=setInterval(function(){vt.style.visibility=(e=!e)?"":"hidden"},650)}function ii(e){function v(e,t,n){if(!e.text)return;var r=e.styles,i=o?0:e.text.length-1,s;for(var a=o?0:r.length-2,f=o?r.length:-2;a!=f;a+=2*u){var l=r[a];if(r[a+1]!=h){i+=u*l.length;continue}for(var c=o?0:l.length-1,v=o?l.length:-1;c!=v;c+=u,i+=u)if(i>=t&&i<n&&d.test(s=l.charAt(c))){var m=ri[s];if(m.charAt(1)==">"==o)p.push(s);else{if(p.pop()!=m.charAt(0))return{pos:i,match:!1};if(!p.length)return{pos:i,match:!0}}}}}var t=At.inverted?At.from:At.to,n=un(t.line),r=t.ch-1,i=r>=0&&ri[n.text.charAt(r)]||ri[n.text.charAt(++r)];if(!i)return;var s=i.charAt(0),o=i.charAt(1)==">",u=o?1:-1,a=n.styles;for(var f=r+1,l=0,c=a.length;l<c;l+=2)if((f-=a[l].length)<=0){var h=a[l+1];break}var p=[n.text.charAt(r)],d=/[(){}[\]]/;for(var l=t.line,c=o?Math.min(l+100,Ct.size):Math.max(-1,l-100);l!=c;l+=u){var n=un(l),m=l==t.line,g=v(n,m&&o?r+1:0,m&&!o?r:n.text.length);if(g)break}g||(g={pos:null,match:!1});var h=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",y=Ar({line:t.line,ch:r},{line:t.line,ch:r+1},h),b=g.pos!=null&&Ar({line:l,ch:g.pos},{line:l,ch:g.pos+1},h),w=pi(function(){y.clear(),b&&b.clear()});e?setTimeout(w,800):Qt=w}function si(e){var t,n;for(var r=e,i=e-40;r>i;--r){if(r==0)return 0;var o=un(r-1);if(o.stateAfter)return r;var u=o.indentation(s.tabSize);if(n==null||t>u)n=r-1,t=u}return n}function oi(e){var t=si(e),n=t&&un(t-1).stateAfter;return n?n=h(Nt,n):n=p(Nt),Ct.iter(t,e,function(e){e.highlight(Nt,n,s.tabSize),e.stateAfter=h(Nt,n)}),t<e&&qt.push({from:t,to:e}),e<Ct.size&&!un(e).stateAfter&&kt.push(e),n}function ui(e,t){var n=oi(e);Ct.iter(e,t,function(e){e.highlight(Nt,n,s.tabSize),e.stateAfter=h(Nt,n)})}function ai(){var e=+(new Date)+s.workTime,t=kt.length;while(kt.length){if(!un($t).stateAfter)var n=$t;else var n=kt.pop();if(n>=Ct.size)continue;var r=si(n),i=r&&un(r-1).stateAfter;i?i=h(Nt,i):i=p(Nt);var o=0,u=Nt.compareStates,a=!1,f=r,l=!1;Ct.iter(f,Ct.size,function(t){var r=t.stateAfter;if(+(new Date)>e)return kt.push(f),fi(s.workDelay),a&&qt.push({from:n,to:f+1}),l=!0;var c=t.highlight(Nt,i,s.tabSize);c&&(a=!0),t.stateAfter=h(Nt,i);var p=null;if(u){var d=r&&u(r,i);d!=B&&(p=!!d)}p==null&&(c!==!1||!r?o=0:++o>3&&(!Nt.indent||Nt.indent(r,"")==Nt.indent(i,""))&&(p=!0));if(p)return!0;++f});if(l)return;a&&qt.push({from:n,to:f+1})}t&&s.onHighlightComplete&&s.onHighlightComplete(on)}function fi(e){if(!kt.length)return;xt.set(e,pi(ai))}function li(){Ft=It=Rt=null,qt=[],Ut=!1,Xt=[]}function ci(){Yt&&Bn();if(Zt&&!s.lineWrapping){var e=mt.offsetWidth,t=Fr(Gt);mt.style.left=t+"px",pt.style.minWidth=t+e+"px",Zt=!1}var n,r;if(Ut){var i=Gn();n=Zn(i.x,i.y,i.x,i.yBot)}qt.length?r=tr(qt,!0,n?n.scrollTop:null):(Ut&&sr(),Wt&&ir()),n&&Qn(),Ut&&(Kn(),ni()),Lt&&!zt&&(Ft===!0||Ft!==!1&&Ut)&&$n(It),Ut&&s.matchBrackets&&setTimeout(pi(function(){Qt&&(Qt(),Qt=null),nt(At.from,At.to)&&ii(!1)}),20);var o=Ut,u=Xt;Rt&&s.onChange&&on&&s.onChange(on,Rt),o&&s.onCursorActivity&&s.onCursorActivity(on);for(var a=0;a<u.length;++a)u[a](on);r&&s.onUpdate&&s.onUpdate(on)}function pi(e){return function(){hi++||li();try{var t=e.apply(this,arguments)}finally{--hi||ci()}return t}}function di(e){tn.startCompound();try{return e()}finally{tn.endCompound()}}var s={},d=e.defaults;for(var y in d)d.hasOwnProperty(y)&&(s[y]=(i&&i.hasOwnProperty(y)?i:d)[y]);var C=document.createElement("div");C.className="CodeMirror"+(s.lineWrapping?" CodeMirror-wrap":""),C.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scrollbar"><div class="CodeMirror-scrollbar-inner"></div></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative; z-index: 0"><div style="position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden;"></div><pre class="CodeMirror-cursor">&#160;</pre><pre class="CodeMirror-cursor" style="visibility: hidden">&#160;</pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>',r.appendChild?r.appendChild(C):r(C);var A=C.firstChild,X=A.firstChild,K=C.lastChild,G=K.firstChild,Y=G.firstChild,st=Y.firstChild,ot=st.firstChild,pt=st.nextSibling.firstChild,dt=pt.firstChild,vt=dt.nextSibling,mt=vt.nextSibling,gt=mt.nextSibling,yt=gt.nextSibling,bt=A.nextSibling,wt=bt.firstChild;Cr(),kr(),t&&(X.style.width="0px"),U||(K.draggable=!0),pt.style.outline="none",s.tabindex!=null&&(X.tabIndex=s.tabindex),s.autofocus&&Jn(),!s.gutter&&!s.lineNumbers&&(st.style.display="none"),V&&(A.style.height="1px",A.style.position="absolute"),$?bt.className+=Hn()?" cm-sb-overlap":" cm-sb-nonoverlap":I&&(bt.className+=" cm-sb-ie7");try{Fr("x")}catch(Et){throw Et.message.match(/runtime/i)&&(Et=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),Et}var St=new H,xt=new H,Tt,Nt,Ct=new w([new b([new g("")])]),kt,Lt;Sr();var At={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},Ot,Mt,_t,Dt=0,Pt=0,Ht,Bt=!1,jt=!1,Ft,It,qt,Rt,Ut,zt,Wt,Xt,Vt=0,$t=0,Jt=0,Kt=0,Qt,Gt="",Yt=!1,Zt=!0,en={};pi(function(){fn(s.value||""),Ft=!1})();var tn=new N;P(K,"mousedown",pi(hn)),P(K,"dblclick",pi(pn)),P(pt,"selectstart",L),j||P(K,"contextmenu",ti),P(K,"scroll",cn),P(bt,"scroll",cn),P(bt,"mousedown",function(){Lt&&setTimeout(Jn,0)}),P(K,"mousewheel",kn),P(K,"DOMMouseScroll",kn),P(window,"resize",function(){tr(!0)}),P(X,"keyup",pi(xn)),P(X,"input",Wn),P(X,"keydown",pi(En)),P(X,"keypress",pi(Sn)),P(X,"focus",Tn),P(X,"blur",Nn);if(s.dragDrop){P(K,"dragstart",vn);function nn(e){if(s.onDragEvent&&s.onDragEvent(on,k(e)))return;O(e)}P(K,"dragenter",nn),P(K,"dragover",nn),P(K,"drop",pi(dn))}P(K,"paste",function(){Jn(),Wn()}),P(X,"paste",Wn),P(X,"cut",pi(function(){s.readOnly||Fn("")})),V&&P(G,"mouseup",function(){document.activeElement==X&&X.blur(),Jn()});var rn;try{rn=document.activeElement==X}catch(Et){}rn||s.autofocus?setTimeout(Tn,20):Nn();var on=C.CodeMirror={getValue:ln,setValue:pi(fn),getSelection:Rn,replaceSelection:pi(Fn),focus:function(){window.focus(),Jn(),Tn(),Wn()},setOption:function(e,t){var n=s[e];s[e]=t,e=="mode"||e=="indentUnit"?Sr():e=="readOnly"&&t=="nocursor"?(Nn(),X.blur()):e=="readOnly"&&!t?$n(!0):e=="theme"?Cr():e=="lineWrapping"&&n!=t?pi(Tr)():e=="tabSize"?tr(!0):e=="keyMap"&&kr();if(e=="lineNumbers"||e=="gutter"||e=="firstLineNumber"||e=="theme")xr(),tr(!0)},getOption:function(e){return s[e]},undo:pi(On),redo:pi(Mn),indentLine:pi(function(e,t){typeof t!="string"&&(t==null?t=s.smartIndent?"smart":"prev":t=t?"add":"subtract"),sn(e)&&Er(e,t)}),indentSelection:pi(wr),historySize:function(){return{undo:tn.done.length,redo:tn.undone.length}},clearHistory:function(){tn=new N},setHistory:function(e){tn=new N,tn.done=e.done,tn.undone=e.undone},getHistory:function(){return tn.time=0,{done:tn.done.concat([]),undone:tn.undone.concat([])}},matchBrackets:pi(function(){ii(!0)}),getTokenAt:pi(function(e){return e=hr(e),un(e.line).getTokenAt(Nt,oi(e.line),e.ch)}),getStateAfter:function(e){return e=cr(e==null?Ct.size-1:e),oi(e+1)},cursorCoords:function(e,t){return e==null&&(e=At.inverted),this.charCoords(e?At.from:At.to,t)},charCoords:function(e,t){return e=hr(e),t=="local"?Ur(e,!1):t=="div"?Ur(e,!0):Wr(e)},coordsChar:function(e){var t=Z(pt);return zr(e.x-t.left,e.y-t.top)},markText:pi(Ar),setBookmark:Or,findMarksAt:Mr,setMarker:pi(_r),clearMarker:pi(Dr),setLineClass:pi(Hr),hideLine:pi(function(e){return Br(e,!0)}),showLine:pi(function(e){return Br(e,!1)}),onDeleteLine:function(e,t){if(typeof e=="number"){if(!sn(e))return null;e=un(e)}return(e.handlers||(e.handlers=[])).push(t),e},lineInfo:jr,addWidget:function(e,t,n,r,i){e=Ur(hr(e));var s=e.yBot,o=e.x;t.style.position="absolute",G.appendChild(t);if(r=="over")s=e.y;else if(r=="near"){var u=Math.max(K.offsetHeight,Ct.height*Jr()),a=Math.max(G.clientWidth,pt.clientWidth)-Zr();e.yBot+t.offsetHeight>u&&e.y>t.offsetHeight&&(s=e.y-t.offsetHeight),o+t.offsetWidth>a&&(o=a-t.offsetWidth)}t.style.top=s+Yr()+"px",t.style.left=t.style.right="",i=="right"?(o=G.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?o=0:i=="middle"&&(o=(G.clientWidth-t.offsetWidth)/2),t.style.left=o+Zr()+"px"),n&&Yn(o,s,o+t.offsetWidth,s+t.offsetHeight)},lineCount:function(){return Ct.size},clipPos:hr,getCursor:function(e){return e==null&&(e=At.inverted),it(e?At.from:At.to)},somethingSelected:function(){return!nt(At.from,At.to)},setCursor:pi(function(e,t,n){t==null&&typeof e.line=="number"?lr(e.line,e.ch,n):lr(e,t,n)}),setSelection:pi(function(e,t,n){(n?ur:ar)(hr(e),hr(t||e))}),getLine:function(e){if(sn(e))return un(e).text},getLineHandle:function(e){if(sn(e))return un(e)},setLine:pi(function(e,t){sn(e)&&jn(t,{line:e,ch:0},{line:e,ch:un(e).text.length})}),removeLine:pi(function(e){sn(e)&&jn("",{line:e,ch:0},hr({line:e+1,ch:0}))}),replaceRange:pi(jn),getRange:function(e,t,n){return qn(hr(e),hr(t),n)},triggerOnKeyDown:pi(En),execCommand:function(e){return u[e](on)},moveH:pi(dr),deleteH:pi(vr),moveV:pi(gr),toggleOverwrite:function(){Bt?(Bt=!1,vt.className=vt.className.replace(" CodeMirror-overwrite","")):(Bt=!0,vt.className+=" CodeMirror-overwrite")},posFromIndex:function(e){var t=0,n;return Ct.iter(0,Ct.size,function(r){var i=r.text.length+1;if(i>e)return n=e,!0;e-=i,++t}),hr({line:t,ch:n})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0;var t=e.ch;return Ct.iter(0,e.line,function(e){t+=e.text.length+1}),t},scrollTo:function(e,t){e!=null&&(K.scrollLeft=e),t!=null&&(bt.scrollTop=t),tr([])},getScrollInfo:function(){return{x:K.scrollLeft,y:bt.scrollTop,height:bt.scrollHeight,width:K.scrollWidth}},setSize:function(e,t){function n(e){return e=String(e),/^\d+$/.test(e)?e+"px":e}e!=null&&(C.style.width=n(e)),t!=null&&(K.style.height=n(t))},operation:function(e){return pi(e)()},compoundChange:function(e){return di(e)},refresh:function(){tr(!0,null,Dt),bt.scrollHeight>Dt&&(bt.scrollTop=Dt)},getInputField:function(){return X},getWrapperElement:function(){return C},getScrollerElement:function(){return K},getGutterElement:function(){return st}},bn=null,wn,Un=!1,Xn="",mr=null;Lr.prototype.clear=pi(function(){var e=Infinity,t=-Infinity;for(var n=0,r=this.set.length;n<r;++n){var i=this.set[n],s=i.marked;if(!s||!i.parent)continue;var o=S(i);e=Math.min(e,o),t=Math.max(t,o);for(var u=0;u<s.length;++u)s[u].marker==this&&s.splice(u--,1)}e!=Infinity&&qt.push({from:e,to:t+1})}),Lr.prototype.find=function(){var e,t;for(var n=0,r=this.set.length;n<r;++n){var i=this.set[n],s=i.marked;for(var o=0;o<s.length;++o){var u=s[o];if(u.marker==this)if(u.from!=null||u.to!=null){var a=S(i);a!=null&&(u.from!=null&&(e={line:a,ch:u.from}),u.to!=null&&(t={line:a,ch:u.to}))}}}return{from:e,to:t}};var qr="CodeMirror-temp-"+Math.floor(Math.random()*16777215).toString(16),Xr,Vr,$r,Kr,Qr=0,ri={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},hi=0;for(var vi in o)o.propertyIsEnumerable(vi)&&!on.propertyIsEnumerable(vi)&&(on[vi]=o[vi]);return on}function f(e){return typeof e=="string"?a[e]:e}function l(e,t,n,r,i){function s(t){t=f(t);var n=t[e];if(n!=null&&r(n))return!0;if(t.nofallthrough)return i&&i(),!0;var o=t.fallthrough;if(o==null)return!1;if(Object.prototype.toString.call(o)!="[object Array]")return s(o);for(var u=0,a=o.length;u<a;++u)if(s(o[u]))return!0;return!1}return t&&s(t)?!0:s(n)}function c(e){var t=ht[D(e,"keyCode")];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function h(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function p(e,t,n){return e.startState?e.startState(t,n):!0}function d(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8}function v(e,t,n,r){this.from=e,this.to=t,this.style=n,this.marker=r}function m(e){this.from=e,this.to=e,this.line=null}function g(e,t){this.styles=t||[e,null],this.text=e,this.height=1,this.marked=this.gutterMarker=this.className=this.bgClassName=this.handlers=null,this.stateAfter=this.parent=this.hidden=null}function y(e,t,n,r){for(var i=0,s=0,o=0;s<t;i+=2){var u=n[i],a=s+u.length;o==0?(a>e&&r.push(u.slice(e-s,Math.min(u.length,t-s)),n[i+1]),a>=e&&(o=1)):o==1&&(a>t?r.push(u.slice(0,t-s),n[i+1]):r.push(u,n[i+1])),s=a}}function b(e){this.lines=e,this.parent=null;for(var t=0,n=e.length,r=0;t<n;++t)e[t].parent=this,r+=e[t].height;this.height=r}function w(e){this.children=e;var t=0,n=0;for(var r=0,i=e.length;r<i;++r){var s=e[r];t+=s.chunkSize(),n+=s.height,s.parent=this}this.size=t,this.height=n,this.parent=null}function E(e,t){while(!e.lines)for(var n=0;;++n){var r=e.children[n],i=r.chunkSize();if(t<i){e=r;break}t-=i}return e.lines[t]}function S(e){if(e.parent==null)return null;var t=e.parent,n=at(t.lines,e);for(var r=t.parent;r;t=r,r=r.parent)for(var i=0,s=r.children.length;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n}function x(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.height;if(t<o){e=s;continue e}t-=o,n+=s.chunkSize()}return n}while(!e.lines);for(var r=0,i=e.lines.length;r<i;++r){var u=e.lines[r],a=u.height;if(t<a)break;t-=a}return n+r}function T(e,t){var n=0;e:do{for(var r=0,i=e.children.length;r<i;++r){var s=e.children[r],o=s.chunkSize();if(t<o){e=s;continue e}t-=o,n+=s.height}return n}while(!e.lines);for(var r=0;r<t;++r)n+=e.lines[r].height;return n}function N(){this.time=0,this.done=[],this.undone=[],this.compound=0,this.closed=!1}function C(){O(this)}function k(e){return e.stop||(e.stop=C),e}function L(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function A(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function O(e){L(e),A(e)}function M(e){return e.target||e.srcElement}function _(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),n&&e.ctrlKey&&t==1&&(t=3),t}function D(e,t){var n=e.override&&e.override.hasOwnProperty(t);return n?e.override[t]:e[t]}function P(e,t,n,r){if(typeof e.addEventListener=="function"){e.addEventListener(t,n,!1);if(r)return function(){e.removeEventListener(t,n,!1)}}else{var i=function(e){n(e||window.event)};e.attachEvent("on"+t,i);if(r)return function(){e.detachEvent("on"+t,i)}}}function H(){this.id=null}function G(e,t,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var r=0,i=0;r<t;++r)e.charAt(r)=="	"?i+=n-i%n:++i;return i}function Y(e){return e.currentStyle?e.currentStyle:window.getComputedStyle(e,null)}function Z(e,t){try{var n=e.getBoundingClientRect();n={top:n.top,left:n.left}}catch(r){n={top:0,left:0}}if(!t)if(window.pageYOffset==null){var i=document.documentElement||document.body.parentNode;i.scrollTop==null&&(i=document.body),n.top+=i.scrollTop,n.left+=i.scrollLeft}else n.top+=window.pageYOffset,n.left+=window.pageXOffset;return n}function et(e){return e.textContent||e.innerText||e.nodeValue||""}function tt(e){t?(e.selectionStart=0,e.selectionEnd=e.value.length):e.select()}function nt(e,t){return e.line==t.line&&e.ch==t.ch}function rt(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function it(e){return{line:e.line,ch:e.ch}}function ot(e){return st.textContent=e,st.innerHTML}function ut(e,t){if(!t)return 0;if(!e)return t.length;for(var n=e.length,r=t.length;n>=0&&r>=0;--n,--r)if(e.charAt(n)!=t.charAt(r))break;return r+1}function at(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function ft(e){return/\w/.test(e)||e.toUpperCase()!=e.toLowerCase()}e.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,onDragEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,dragDrop:!0,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null,autofocus:null,lineNumberFormatter:function(e){return e}};var t=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),n=t||/Mac/.test(navigator.platform),r=/Win/.test(navigator.platform),i=e.modes={},s=e.mimeModes={};e.defineMode=function(t,n){!e.defaults.mode&&t!="null"&&(e.defaults.mode=t);if(arguments.length>2){n.dependencies=[];for(var r=2;r<arguments.length;++r)n.dependencies.push(arguments[r])}i[t]=n},e.defineMIME=function(e,t){s[e]=t},e.resolveMode=function(t){if(typeof t=="string"&&s.hasOwnProperty(t))t=s[t];else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=i[n.name];return r?r(t,n):e.getMode(t,"text/plain")},e.listModes=function(){var e=[];for(var t in i)i.propertyIsEnumerable(t)&&e.push(t);return e},e.listMIMEs=function(){var e=[];for(var t in s)s.propertyIsEnumerable(t)&&e.push({mime:t,mode:s[t]});return e};var o=e.extensions={};e.defineExtension=function(e,t){o[e]=t};var u=e.commands={selectAll:function(e){e.setSelection({line:0,ch:0},{line:e.lineCount()-1})},killLine:function(e){var t=e.getCursor(!0),n=e.getCursor(!1),r=!nt(t,n);!r&&e.getLine(t.line).length==t.ch?e.replaceRange("",t,{line:t.line+1,ch:0}):e.replaceRange("",t,r?n:{line:t.line})},deleteLine:function(e){var t=e.getCursor().line;e.replaceRange("",{line:t,ch:0},{line:t})},undo:function(e){e.undo()},redo:function(e){e.redo()},goDocStart:function(e){e.setCursor(0,0,!0)},goDocEnd:function(e){e.setSelection({line:e.lineCount()-1},null,!0)},goLineStart:function(e){e.setCursor(e.getCursor().line,0,!0)},goLineStartSmart:function(e){var t=e.getCursor(),n=e.getLine(t.line),r=Math.max(0,n.search(/\S/));e.setCursor(t.line,t.ch<=r&&t.ch?0:r,!0)},goLineEnd:function(e){e.setSelection({line:e.getCursor().line},null,!0)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goWordRight:function(e){e.moveH(1,"word")},delCharLeft:function(e){e.deleteH(-1,"char")},delCharRight:function(e){e.deleteH(1,"char")},delWordLeft:function(e){e.deleteH(-1,"word")},delWordRight:function(e){e.deleteH(1,"word")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection("	","end")},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.replaceSelection("	","end")},transposeChars:function(e){var t=e.getCursor(),n=e.getLine(t.line);t.ch>0&&t.ch<n.length-1&&e.replaceRange(n.charAt(t.ch)+n.charAt(t.ch-1),{line:t.line,ch:t.ch-1},{line:t.line,ch:t.ch+1})},newlineAndIndent:function(e){e.replaceSelection("\n","end"),e.indentLine(e.getCursor().line)},toggleOverwrite:function(e){e.toggleOverwrite()}},a=e.keyMap={};a.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},a.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","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",fallthrough:"basic"},a.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","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",fallthrough:["basic","emacsy"]},a["default"]=n?a.macDefault:a.pcDefault,a.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":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},e.fromTextArea=function(t,n){function r(){t.value=u.getValue()}n||(n={}),n.value=t.value,!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex),n.autofocus==null&&t.getAttribute("autofocus")!=null&&(n.autofocus=!0);if(t.form){var i=P(t.form,"submit",r,!0);if(typeof t.form.submit=="function"){var s=t.form.submit;function o(){r(),t.form.submit=s,t.form.submit(),t.form.submit=o}t.form.submit=o}}t.style.display="none";var u=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return u.save=r,u.getTextArea=function(){return t},u.toTextArea=function(){r(),t.parentNode.removeChild(u.getWrapperElement()),t.style.display="",t.form&&(i(),typeof t.form.submit=="function"&&(t.form.submit=s))},u},e.copyState=h,e.startState=p,d.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if(typeof e=="string")var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){var t=this.pos;while(this.eat(e));return this.pos>t},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return G(this.string,this.start,this.tabSize)},indentation:function(){return G(this.string,null,this.tabSize)},match:function(e,t,n){if(typeof e!="string"){var i=this.string.slice(this.pos).match(e);return i&&t!==!1&&(this.pos+=i[0].length),i}function r(e){return n?e.toLowerCase():e}if(r(this.string).indexOf(r(e),this.pos)==this.pos)return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},e.StringStream=d,v.prototype={attach:function(e){this.marker.set.push(e)},detach:function(e){var t=at(this.marker.set,e);t>-1&&this.marker.set.splice(t,1)},split:function(e,t){if(this.to<=e&&this.to!=null)return null;var n=this.from<e||this.from==null?null:this.from-e+t,r=this.to==null?null:this.to-e+t;return new v(n,r,this.style,this.marker)},dup:function(){return new v(null,null,this.style,this.marker)},clipTo:function(e,t,n,r,i){e&&r>this.from&&(r<this.to||this.to==null)?this.from=null:this.from!=null&&this.from>=t&&(this.from=Math.max(r,this.from)+i),n&&(t<this.to||this.to==null)&&(t>this.from||this.from==null)?this.to=null:this.to!=null&&this.to>t&&(this.to=r<this.to?this.to+i:t)},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(e){return this.marker==e.marker}},m.prototype={attach:function(e){this.line=e},detach:function(e){this.line==e&&(this.line=null)},split:function(e,t){if(e<this.from)return this.from=this.to=this.from-e+t,this},isDead:function(){return this.from>this.to},clipTo:function(e,t,n,r,i){(e||t<this.from)&&(n||r>this.to)?(this.from=0,this.to=-1):this.from>t&&(this.from=this.to=Math.max(r,this.from)+i)},sameSet:function(e){return!1},find:function(){return!this.line||!this.line.parent?null:{line:S(this.line),ch:this.from}},clear:function(){if(this.line){var e=at(this.line.marked,this);e!=-1&&this.line.marked.splice(e,1),this.line=null}}},g.inheritMarks=function(e,t){var n=new g(e),r=t&&t.marked;if(r)for(var i=0;i<r.length;++i)if(r[i].to==null&&r[i].style){var s=n.marked||(n.marked=[]),o=r[i],u=o.dup();s.push(u),u.attach(n)}return n},g.prototype={replace:function(e,t,n){var r=[],i=this.marked,s=t==null?this.text.length:t;y(0,e,this.styles,r),n&&r.push(n,null),y(s,this.text.length,this.styles,r),this.styles=r,this.text=this.text.slice(0,e)+n+this.text.slice(s),this.stateAfter=null;if(i){var o=n.length-(s-e);for(var u=0;u<i.length;++u){var a=i[u];a.clipTo(e==null,e||0,t==null,s,o),a.isDead()&&(a.detach(this),i.splice(u--,1))}}},split:function(e,t){var n=[t,null],r=this.marked;y(e,this.text.length,this.styles,n);var i=new g(t+this.text.slice(e),n);if(r)for(var s=0;s<r.length;++s){var o=r[s],u=o.split(e,t.length);u&&(i.marked||(i.marked=[]),i.marked.push(u),u.attach(i),u==o&&r.splice(s--,1))}return i},append:function(e){var t=this.text.length,n=e.marked,r=this.marked;this.text+=e.text,y(0,e.text.length,e.styles,this.styles);if(r)for(var i=0;i<r.length;++i)r[i].to==null&&(r[i].to=t);if(n&&n.length){r||(this.marked=r=[]);e:for(var i=0;i<n.length;++i){var s=n[i];if(!s.from)for(var o=0;o<r.length;++o){var u=r[o];if(u.to==t&&u.sameSet(s)){u.to=s.to==null?null:s.to+t,u.isDead()&&(u.detach(this),n.splice(i--,1));continue e}}r.push(s),s.attach(this),s.from+=t,s.to!=null&&(s.to+=t)}}},fixMarkEnds:function(e){var t=this.marked,n=e.marked;if(!t)return;e:for(var r=0;r<t.length;++r){var i=t[r],s=i.to==null;if(s&&n)for(var o=0;o<n.length;++o){var u=n[o];if(!u.sameSet(i)||u.from!=null)continue;if(i.from==this.text.length&&u.to==0){n.splice(o,1),t.splice(r--,1);continue e}s=!1;break}s&&(i.to=this.text.length)}},fixMarkStarts:function(){var e=this.marked;if(!e)return;for(var t=0;t<e.length;++t)e[t].from==null&&(e[t].from=0)},addMark:function(e){e.attach(this),this.marked==null&&(this.marked=[]),this.marked.push(e),this.marked.sort(function(e,t){return(e.from||0)-(t.from||0)})},highlight:function(e,t,n){var r=new d(this.text,n),i=this.styles,s=0,o=!1,u=i[0],a;this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()){var f=e.token(r,t),l=this.text.slice(r.start,r.pos);r.start=r.pos,s&&i[s-1]==f?i[s-2]+=l:l&&(!o&&(i[s+1]!=f||s&&i[s-2]!=a)&&(o=!0),i[s++]=l,i[s++]=f,a=u,u=i[s]);if(r.pos>5e3){i[s++]=this.text.slice(r.pos),i[s++]=null;break}}return i.length!=s&&(i.length=s,o=!0),s&&i[s-2]!=a&&(o=!0),o||(i.length<5&&this.text.length<10?null:!1)},getTokenAt:function(e,t,n){var r=this.text,i=new d(r);while(i.pos<n&&!i.eol()){i.start=i.pos;var s=e.token(i,t)}return{start:i.start,end:i.pos,string:i.current(),className:s||null,state:t}},indentation:function(e){return G(this.text,null,e)},getHTML:function(e,t,n,r){function u(t,n){if(!t)return;s&&F&&t.charAt(0)==" "&&(t="\u00a0"+t.slice(1)),s=!1;if(t.indexOf("	")==-1){o+=t.length;var r=ot(t)}else{var r="";for(var u=0;;){var a=t.indexOf("	",u);if(a==-1){r+=ot(t.slice(u)),o+=t.length-u;break}o+=a-u;var f=e(o);r+=ot(t.slice(u,a))+f.html,o+=f.width,u=a+1}}n?i.push('<span class="',n,'">',r,"</span>"):i.push(r)}function v(e){return e?"cm-"+e.replace(/ +/g," cm-"):null}var i=[],s=!0,o=0,a=u;if(t!=null){var f=0,l='<span id="'+n+'">';a=function(e,n){var s=e.length;if(t>=f&&t<f+s){t>f&&(u(e.slice(0,t-f),n),r&&i.push("<wbr>")),i.push(l);var o=t-f;u(W?e.slice(o,o+1):e.slice(o),n),i.push("</span>"),W&&u(e.slice(o+1),n),t--,f+=s}else f+=s,u(e,n),f==t&&f==d?i.push(l+(j||F&&!I?"&#x200b;":" ")+"</span>"):f>t+10&&/\s/.test(e)&&(a=function(){})}}var c=this.styles,h=this.text,p=this.marked,d=h.length;if(!h&&t==null)a(" ");else if(!p||!p.length)for(var m=0,g=0;g<d;m+=2){var y=c[m],b=c[m+1],w=y.length;g+w>d&&(y=y.slice(0,d-g)),g+=w,a(y,v(b))}else{var E=0,m=0,S="",b,x=0,T=p[0].from||0,N=[],C=0;function k(){var e;while(C<p.length&&((e=p[C]).from==E||e.from==null))e.style!=null&&N.push(e),++C;T=C<p.length?p[C].from:Infinity;for(var t=0;t<N.length;++t){var n=N[t].to;n==null&&(n=Infinity),n==E?N.splice(t--,1):T=Math.min(n,T)}}var L=0;while(E<d){T==E&&k();var A=Math.min(d,T);for(;;){if(S){var O=E+S.length,M=b;for(var _=0;_<N.length;++_)M=(M?M+" ":"")+N[_].style;a(O>A?S.slice(0,A-E):S,M);if(O>=A){S=S.slice(A-E),E=A;break}E=O}S=c[m++],b=v(c[m++])}}}return i.join("")},cleanUp:function(){this.parent=null;if(this.marked)for(var e=0,t=this.marked.length;e<t;++e)this.marked[e].detach(this)}},b.prototype={chunkSize:function(){return this.lines.length},remove:function(e,t,n){for(var r=e,i=e+t;r<i;++r){var s=this.lines[r];this.height-=s.height,s.cleanUp();if(s.handlers)for(var o=0;o<s.handlers.length;++o)n.push(s.handlers[o])}this.lines.splice(e,t)},collapse:function(e){e.splice.apply(e,[e.length,0].concat(this.lines))},insertHeight:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0,i=t.length;r<i;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},w.prototype={chunkSize:function(){return this.size},remove:function(e,t,n){this.size-=t;for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<s){var o=Math.min(t,s-e),u=i.height;i.remove(e,o,n),this.height-=u-i.height,s==o&&(this.children.splice(r--,1),i.parent=null);if((t-=o)==0)break;e=0}else e-=s}if(this.size-t<25){var a=[];this.collapse(a),this.children=[new b(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0,n=this.children.length;t<n;++t)this.children[t].collapse(e)},insert:function(e,t){var n=0;for(var r=0,i=t.length;r<i;++r)n+=t[r].height;this.insertHeight(e,t,n)},insertHeight:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<=o){s.insertHeight(e,t,n);if(s.lines&&s.lines.length>50){while(s.lines.length>50){var u=s.lines.splice(s.lines.length-25,25),a=new b(u);s.height-=a.height,this.children.splice(r+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new w(t);if(!e.parent){var r=new w(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=at(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iter:function(e,t,n){this.iterN(e,t-e,n)},iterN:function(e,t,n){for(var r=0,i=this.children.length;r<i;++r){var s=this.children[r],o=s.chunkSize();if(e<o){var u=Math.min(t,o-e);if(s.iterN(e,u,n))return!0;if((t-=u)==0)break;e=0}else e-=o}}},N.prototype={addChange:function(e,t,n){this.undone.length=0;var r=+(new Date),i=this.done[this.done.length-1],s=i&&i[i.length-1],o=r-this.time;if(this.compound&&i&&!this.closed)i.push({start:e,added:t,old:n});else if(o>400||!s||this.closed||s.start>e+n.length||s.start+s.added<e)this.done.push([{start:e,added:t,old:n}]),this.closed=!1;else{var u=Math.max(0,s.start-e),a=Math.max(0,e+n.length-(s.start+s.added));for(var f=u;f>0;--f)s.old.unshift(n[f-1]);for(var f=a;f>0;--f)s.old.push(n[n.length-f]);u&&(s.start=e),s.added+=t-(n.length-u-a)}this.time=r},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},e.e_stop=O,e.e_preventDefault=L,e.e_stopPropagation=A,e.connect=P,H.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}};var B=e.Pass={toString:function(){return"CodeMirror.Pass"}},j=/gecko\/\d{7}/i.test(navigator.userAgent),F=/MSIE \d/.test(navigator.userAgent),I=/MSIE [1-7]\b/.test(navigator.userAgent),q=/MSIE [1-8]\b/.test(navigator.userAgent),R=F&&document.documentMode==5,U=/WebKit\//.test(navigator.userAgent),z=/Chrome\//.test(navigator.userAgent),W=/Opera\//.test(navigator.userAgent),X=/Apple Computer/.test(navigator.vendor),V=/KHTML\//.test(navigator.userAgent),$=/Mac OS X 10\D([7-9]|\d\d)\D/.test(navigator.userAgent),J=function(){if(q)return!1;var e=document.createElement("div");return"draggable"in e||"dragDrop"in e}(),K=function(){var e=document.createElement("textarea");return e.value="foo\nbar",e.value.indexOf("\r")>-1?"\r\n":"\n"}(),Q=/^$/;j?Q=/$'/:X?Q=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:z&&(Q=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var st=document.createElement("pre");ot("a")=="\na"?ot=function(e){return st.textContent=e,st.innerHTML.slice(1)}:ot("	")!="	"&&(ot=function(e){return st.innerHTML="",st.appendChild(document.createTextNode(e)),st.innerHTML}),e.htmlEscape=ot;var lt="\n\nb".split(/\n/).length!=3?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var s=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=s.indexOf("\r");o!=-1?(n.push(s.slice(0,o)),t+=o+1):(n.push(s),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)};e.splitLines=lt;var ct=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0};e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var ht={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:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return e.keyNames=ht,function(){for(var e=0;e<10;e++)ht[e+48]=String(e);for(var e=65;e<=90;e++)ht[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)ht[e+111]=ht[e+63235]="F"+e}(),e}();CodeMirror.defineMode("clike",function(e,t){function c(e,t){var n=e.next();if(u[n]){var a=u[n](e,t);if(a!==!1)return a}if(n=='"'||n=="'")return t.tokenize=h(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return l=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),"number";if(n=="/"){if(e.eat("*"))return t.tokenize=p,p(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(f.test(n))return e.eatWhile(f),"operator";e.eatWhile(/[\w\$_]/);var c=e.current();return r.propertyIsEnumerable(c)?(s.propertyIsEnumerable(c)&&(l="newstatement"),"keyword"):i.propertyIsEnumerable(c)?(s.propertyIsEnumerable(c)&&(l="newstatement"),"builtin"):o.propertyIsEnumerable(c)?"atom":"variable"}function h(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}if(s||!r&&!a)n.tokenize=null;return"string"}}function p(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=null;break}n=r=="*"}return"comment"}function d(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function v(e,t,n){return e.context=new d(e.indented,t,n,null,e.context)}function m(e){var t=e.context.type;if(t==")"||t=="]"||t=="}")e.indented=e.context.indented;return e.context=e.context.prev}var n=e.indentUnit,r=t.keywords||{},i=t.builtin||{},s=t.blockKeywords||{},o=t.atoms||{},u=t.hooks||{},a=t.multiLineStrings,f=/[+\-*&%=<>!?|\/]/,l;return{startState:function(e){return{tokenize:null,context:new d((e||0)-n,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;e.sol()&&(n.align==null&&(n.align=!1),t.indented=e.indentation(),t.startOfLine=!0);if(e.eatSpace())return null;l=null;var r=(t.tokenize||c)(e,t);if(r=="comment"||r=="meta")return r;n.align==null&&(n.align=!0);if(l!=";"&&l!=":"||n.type!="statement")if(l=="{")v(t,e.column(),"}");else if(l=="[")v(t,e.column(),"]");else if(l=="(")v(t,e.column(),")");else if(l=="}"){while(n.type=="statement")n=m(t);n.type=="}"&&(n=m(t));while(n.type=="statement")n=m(t)}else l==n.type?m(t):(n.type=="}"||n.type=="top"||n.type=="statement"&&l=="newstatement")&&v(t,e.column(),"statement");else m(t);return t.startOfLine=!1,r},indent:function(e,t){if(e.tokenize!=c&&e.tokenize!=null)return 0;var r=e.context,i=t&&t.charAt(0);r.type=="statement"&&i=="}"&&(r=r.prev);var s=i==r.type;return r.type=="statement"?r.indented+(i=="{"?0:n):r.align?r.column+(s?0:1):r.indented+(s?0:n)},electricChars:"{}"}}),function(){function e(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function n(e,t){return t.startOfLine?(e.skipToEnd(),"meta"):!1}function r(e,t){var n;while((n=e.next())!=null)if(n=='"'&&!e.eat('"')){t.tokenize=null;break}return"string"}var t="auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile";CodeMirror.defineMIME("text/x-csrc",{name:"clike",keywords:e(t),blockKeywords:e("case do else for if switch while struct"),atoms:e("null"),hooks:{"#":n}}),CodeMirror.defineMIME("text/x-c++src",{name:"clike",keywords:e(t+" asm dynamic_cast namespace reinterpret_cast try bool explicit new "+"static_cast typeid catch operator template typename class friend private "+"this using const_cast inline public throw virtual delete mutable protected "+"wchar_t"),blockKeywords:e("catch class do else finally for if struct switch try while"),atoms:e("true false null"),hooks:{"#":n}}),CodeMirror.defineMIME("text/x-java",{name:"clike",keywords:e("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:e("catch class do else finally for if switch try while"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eatWhile(/[\w\$_]/),"meta"}}}),CodeMirror.defineMIME("text/x-csharp",{name:"clike",keywords:e("abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),blockKeywords:e("catch class do else finally for foreach if struct switch try while"),builtin:e("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=r,r(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),CodeMirror.defineMIME("text/x-scala",{name:"clike",keywords:e("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),blockKeywords:e("catch class do else finally for forSome if match switch try while"),atoms:e("true false null"),hooks:{"@":function(e,t){return e.eatWhile(/[\w\$_]/),"meta"}}})}(),CodeMirror.defineMode("css",function(e){function r(e,t){return n=t,e}function i(e,t){var n=e.next();if(n=="@")return e.eatWhile(/[\w\\\-]/),r("meta",e.current());if(n=="/"&&e.eat("*"))return t.tokenize=s,s(e,t);if(n=="<"&&e.eat("!"))return t.tokenize=o,o(e,t);if(n!="=")return n!="~"&&n!="|"||!e.eat("=")?n=='"'||n=="'"?(t.tokenize=u(n),t.tokenize(e,t)):n=="#"?(e.eatWhile(/[\w\\\-]/),r("atom","hash")):n=="!"?(e.match(/^\s*\w*/),r("keyword","important")):/\d/.test(n)?(e.eatWhile(/[\w.%]/),r("number","unit")):/[,.+>*\/]/.test(n)?r(null,"select-op"):/[;{}:\[\]]/.test(n)?r(null,n):(e.eatWhile(/[\w\\\-]/),r("variable","variable")):r(null,"compare");r(null,"compare")}function s(e,t){var n=!1,s;while((s=e.next())!=null){if(n&&s=="/"){t.tokenize=i;break}n=s=="*"}return r("comment","comment")}function o(e,t){var n=0,s;while((s=e.next())!=null){if(n>=2&&s==">"){t.tokenize=i;break}n=s=="-"?n+1:0}return r("comment","comment")}function u(e){return function(t,n){var s=!1,o;while((o=t.next())!=null){if(o==e&&!s)break;s=!s&&o=="\\"}return s||(n.tokenize=i),r("string","string")}}var t=e.indentUnit,n;return{startState:function(e){return{tokenize:i,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;var r=t.tokenize(e,t),i=t.stack[t.stack.length-1];if(n=="hash"&&i!="rule")r="string-2";else if(r=="variable")if(i=="rule")r="number";else if(!i||i=="@media{")r="tag";return i=="rule"&&/^[\{\};]$/.test(n)&&t.stack.pop(),n=="{"?i=="@media"?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):n=="}"?t.stack.pop():n=="@media"?t.stack.push("@media"):i=="{"&&n!="comment"&&t.stack.push("rule"),r},indent:function(e,n){var r=e.stack.length;return/^\}/.test(n)&&(r-=e.stack[e.stack.length-1]=="rule"?2:1),e.baseIndent+r*t},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("htmlembedded",function(e,t){function o(e,t){return e.match(n,!1)?(t.token=u,i.token(e,t.scriptState)):s.token(e,t.htmlState)}function u(e,t){return e.match(r,!1)?(t.token=o,s.token(e,t.htmlState)):i.token(e,t.scriptState)}var n=t.scriptStartRegex||/^<%/i,r=t.scriptEndRegex||/^%>/i,i,s;return{startState:function(){return i=i||CodeMirror.getMode(e,t.scriptingModeSpec),s=s||CodeMirror.getMode(e,"htmlmixed"),{token:t.startOpen?u:o,htmlState:s.startState(),scriptState:i.startState()}},token:function(e,t){return t.token(e,t)},indent:function(e,t){return e.token==o?s.indent(e.htmlState,t):i.indent(e.scriptState,t)},copyState:function(e){return{token:e.token,htmlState:CodeMirror.copyState(s,e.htmlState),scriptState:CodeMirror.copyState(i,e.scriptState)}},electricChars:"/{}:"}},"htmlmixed"),CodeMirror.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),CodeMirror.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),CodeMirror.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),CodeMirror.defineMode("htmlmixed",function(e,t){function s(e,t){var s=n.token(e,t.htmlState);return s=="tag"&&e.current()==">"&&t.htmlState.context&&(/^script$/i.test(t.htmlState.context.tagName)?(t.token=u,t.localState=r.startState(n.indent(t.htmlState,"")),t.mode="javascript"):/^style$/i.test(t.htmlState.context.tagName)&&(t.token=a,t.localState=i.startState(n.indent(t.htmlState,"")),t.mode="css")),s}function o(e,t,n){var r=e.current(),i=r.search(t);return i>-1&&e.backUp(r.length-i),n}function u(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=s,t.localState=null,t.mode="html",s(e,t)):o(e,/<\/\s*script\s*>/,r.token(e,t.localState))}function a(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=s,t.localState=null,t.mode="html",s(e,t)):o(e,/<\/\s*style\s*>/,i.token(e,t.localState))}var n=CodeMirror.getMode(e,{name:"xml",htmlMode:!0}),r=CodeMirror.getMode(e,"javascript"),i=CodeMirror.getMode(e,"css");return{startState:function(){var e=n.startState();return{token:s,localState:null,mode:"html",htmlState:e}},copyState:function(e){if(e.localState)var t=CodeMirror.copyState(e.token==a?i:r,e.localState);return{token:e.token,localState:t,mode:e.mode,htmlState:CodeMirror.copyState(n,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t){return e.token==s||/^\s*<\//.test(t)?n.indent(e.htmlState,t):e.token==u?r.indent(e.localState,t):i.indent(e.localState,t)},compareStates:function(e,t){return e.mode!=t.mode?!1:e.localState?CodeMirror.Pass:n.compareStates(e.htmlState,t.htmlState)},electricChars:"/{}:"}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed"),CodeMirror.defineMode("javascript",function(e,t){function o(e,t,n){return t.tokenize=n,n(e,t)}function u(e,t){var n=!1,r;while((r=e.next())!=null){if(r==t&&!n)return!1;n=!n&&r=="\\"}return n}function l(e,t,n){return a=e,f=n,t}function c(e,t){var n=e.next();if(n=='"'||n=="'")return o(e,t,h(n));if(/[\[\]{}\(\),;\:\.]/.test(n))return l(n);if(n=="0"&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),l("number","number");if(/\d/.test(n)||n=="-"&&e.eat(/\d/))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),l("number","number");if(n=="/")return e.eat("*")?o(e,t,p):e.eat("/")?(e.skipToEnd(),l("comment","comment")):t.reAllowed?(u(e,"/"),e.eatWhile(/[gimy]/),l("regexp","string-2")):(e.eatWhile(s),l("operator",null,e.current()));if(n=="#")return e.skipToEnd(),l("error","error");if(s.test(n))return e.eatWhile(s),l("operator",null,e.current());e.eatWhile(/[\w\$_]/);var r=e.current(),a=i.propertyIsEnumerable(r)&&i[r];return a&&t.kwAllowed?l(a.type,a.style,r):l("variable","variable",r)}function h(e){return function(t,n){return u(t,e)||(n.tokenize=c),l("string","string")}}function p(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=c;break}n=r=="*"}return l("comment","comment")}function v(e,t,n,r,i,s){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=s,r!=null&&(this.align=r)}function m(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0}function g(e,t,n,i,s){var o=e.cc;y.state=e,y.stream=s,y.marked=null,y.cc=o,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);for(;;){var u=o.length?o.pop():r?A:L;if(u(n,i)){while(o.length&&o[o.length-1].lex)o.pop()();return y.marked?y.marked:n=="variable"&&m(e,i)?"variable-2":t}}}function b(){for(var e=arguments.length-1;e>=0;e--)y.cc.push(arguments[e])}function w(){return b.apply(null,arguments),!0}function E(e){var t=y.state;if(t.context){y.marked="def";for(var n=t.localVars;n;n=n.next)if(n.name==e)return;t.localVars={name:e,next:t.localVars}}}function x(){y.state.context||(y.state.localVars=S),y.state.context={prev:y.state.context,vars:y.state.localVars}}function T(){y.state.localVars=y.state.context.vars,y.state.context=y.state.context.prev}function N(e,t){var n=function(){var n=y.state;n.lexical=new v(n.indented,y.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function C(){var e=y.state;e.lexical.prev&&(e.lexical.type==")"&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function k(e){return function(n){return n==e?w():e==";"?b():w(arguments.callee)}}function L(e){return e=="var"?w(N("vardef"),j,k(";"),C):e=="keyword a"?w(N("form"),A,L,C):e=="keyword b"?w(N("form"),L,C):e=="{"?w(N("}"),B,C):e==";"?w():e=="function"?w(z):e=="for"?w(N("form"),k("("),N(")"),I,k(")"),C,L,C):e=="variable"?w(N("stat"),_):e=="switch"?w(N("form"),A,N("}","switch"),k("{"),B,C,C):e=="case"?w(A,k(":")):e=="default"?w(k(":")):e=="catch"?w(N("form"),x,k("("),W,k(")"),L,C,T):b(N("stat"),A,k(";"),C)}function A(e){return d.hasOwnProperty(e)?w(M):e=="function"?w(z):e=="keyword c"?w(O):e=="("?w(N(")"),O,k(")"),C,M):e=="operator"?w(A):e=="["?w(N("]"),H(A,"]"),C,M):e=="{"?w(N("}"),H(P,"}"),C,M):w()}function O(e){return e.match(/[;\}\)\],]/)?b():b(A)}function M(e,t){if(e=="operator"&&/\+\+|--/.test(t))return w(M);if(e=="operator"||e==":")return w(A);if(e==";")return;if(e=="(")return w(N(")"),H(A,")"),C,M);if(e==".")return w(D,M);if(e=="[")return w(N("]"),A,k("]"),C,M)}function _(e){return e==":"?w(C,L):b(M,k(";"),C)}function D(e){if(e=="variable")return y.marked="property",w()}function P(e){e=="variable"&&(y.marked="property");if(d.hasOwnProperty(e))return w(k(":"),A)}function H(e,t){function n(r){return r==","?w(e,n):r==t?w():w(k(t))}return function(i){return i==t?w():b(e,n)}}function B(e){return e=="}"?w():b(L,B)}function j(e,t){return e=="variable"?(E(t),w(F)):w()}function F(e,t){if(t=="=")return w(A,F);if(e==",")return w(j)}function I(e){return e=="var"?w(j,R):e==";"?b(R):e=="variable"?w(q):b(R)}function q(e,t){return t=="in"?w(A):w(M,R)}function R(e,t){return e==";"?w(U):t=="in"?w(A):w(A,k(";"),U)}function U(e){e!=")"&&w(A)}function z(e,t){if(e=="variable")return E(t),w(z);if(e=="(")return w(N(")"),x,H(W,")"),C,L,T)}function W(e,t){if(e=="variable")return E(t),w()}var n=e.indentUnit,r=t.json,i=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),s={type:"atom",style:"atom"};return{"if":t,"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":r,"delete":r,"throw":r,"var":e("var"),"const":e("var"),let:e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":s,"false":s,"null":s,"undefined":s,NaN:s,Infinity:s}}(),s=/[+\-*&%=<>!?|]/,a,f,d={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},y={state:null,column:null,marked:null,cc:null},S={name:"this",next:{name:"arguments"}};return C.lex=!0,{startState:function(e){return{tokenize:c,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new v((e||0)-n,0,"block",!1),localVars:t.localVars,context:t.localVars&&{vars:t.localVars},indented:0}},token:function(e,t){e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation());if(e.eatSpace())return null;var n=t.tokenize(e,t);return a=="comment"?n:(t.reAllowed=a=="operator"||a=="keyword c"||!!a.match(/^[\[{}\(,;:]$/),t.kwAllowed=a!=".",g(t,n,a,f,e))},indent:function(e,t){if(e.tokenize!=c)return 0;var r=t&&t.charAt(0),i=e.lexical;i.type=="stat"&&r=="}"&&(i=i.prev);var s=i.type,o=r==s;return s=="vardef"?i.indented+4:s=="form"&&r=="{"?i.indented:s=="stat"||s=="form"?i.indented+n:i.info=="switch"&&!o?i.indented+(/^(?:case|default)\b/.test(t)?n:2*n):i.align?i.column+(o?0:1):i.indented+(o?0:n)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("pascal",function(e){function t(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function s(e,t){var s=e.next();if(s=="#"&&t.startOfLine)return e.skipToEnd(),"meta";if(s=='"'||s=="'")return t.tokenize=o(s),t.tokenize(e,t);if(s=="("&&e.eat("*"))return t.tokenize=u,u(e,t);if(/[\[\]{}\(\),;\:\.]/.test(s))return null;if(/\d/.test(s))return e.eatWhile(/[\w\.]/),"number";if(s=="/"&&e.eat("/"))return e.skipToEnd(),"comment";if(i.test(s))return e.eatWhile(i),"operator";e.eatWhile(/[\w\$_]/);var a=e.current();return n.propertyIsEnumerable(a)?"keyword":r.propertyIsEnumerable(a)?"atom":"variable"}function o(e){return function(t,n){var r=!1,i,s=!1;while((i=t.next())!=null){if(i==e&&!r){s=!0;break}r=!r&&i=="\\"}if(s||!r)n.tokenize=null;return"string"}}function u(e,t){var n=!1,r;while(r=e.next()){if(r==")"&&n){t.tokenize=null;break}n=r=="*"}return"comment"}var n=t("and array begin case const div do downto else end file for forward integer boolean char function goto if in label mod nil not of or packed procedure program record repeat set string then to type until var while with"),r={"null":!0},i=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null}},token:function(e,t){if(e.eatSpace())return null;var n=(t.tokenize||s)(e,t);return n=="comment"||n=="meta"?n:n},electricChars:"{}"}}),CodeMirror.defineMIME("text/x-pascal","pascal"),CodeMirror.defineMode("perl",function(e,t){function s(e,t,n,r,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){var s=!1,o,a=0;while(o=e.next()){if(o===n[a]&&!s)return n[++a]!==undefined?(t.chain=n[a],t.style=r,t.tail=i):i&&e.eatWhile(i),t.tokenize=u,r;s=!s&&o=="\\"}return r},t.tokenize(e,t)}function o(e,t,n){return t.tokenize=function(e,t){return e.string==n&&(t.tokenize=u),e.skipToEnd(),"string"},t.tokenize(e,t)}function u(e,t){if(e.eatSpace())return null;if(t.chain)return s(e,t,t.chain,t.style,t.tail);if(e.match(/^\-?[\d\.]/,!1)&&e.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(e.match(/^<<(?=\w)/))return e.eatWhile(/\w/),o(e,t,e.current().substr(2));if(e.sol()&&e.match(/^\=item(?!\w)/))return o(e,t,"=cut");var u=e.next();if(u=='"'||u=="'"){if(e.prefix(3)=="<<"+u){var a=e.pos;e.eatWhile(/\w/);var f=e.current().substr(1);if(f&&e.eat(u))return o(e,t,f);e.pos=a}return s(e,t,[u],"string")}if(u=="q"){var l=e.look(-2);if(!l||!/\w/.test(l)){l=e.look(0);if(l=="x"){l=e.look(1);if(l=="(")return e.eatSuffix(2),s(e,t,[")"],r,i);if(l=="[")return e.eatSuffix(2),s(e,t,["]"],r,i);if(l=="{")return e.eatSuffix(2),s(e,t,["}"],r,i);if(l=="<")return e.eatSuffix(2),s(e,t,[">"],r,i);if(/[\^'"!~\/]/.test(l))return e.eatSuffix(1),s(e,t,[e.eat(l)],r,i)}else if(l=="q"){l=e.look(1);if(l=="(")return e.eatSuffix(2),s(e,t,[")"],"string");if(l=="[")return e.eatSuffix(2),s(e,t,["]"],"string");if(l=="{")return e.eatSuffix(2),s(e,t,["}"],"string");if(l=="<")return e.eatSuffix(2),s(e,t,[">"],"string");if(/[\^'"!~\/]/.test(l))return e.eatSuffix(1),s(e,t,[e.eat(l)],"string")}else if(l=="w"){l=e.look(1);if(l=="(")return e.eatSuffix(2),s(e,t,[")"],"bracket");if(l=="[")return e.eatSuffix(2),s(e,t,["]"],"bracket");if(l=="{")return e.eatSuffix(2),s(e,t,["}"],"bracket");if(l=="<")return e.eatSuffix(2),s(e,t,[">"],"bracket");if(/[\^'"!~\/]/.test(l))return e.eatSuffix(1),s(e,t,[e.eat(l)],"bracket")}else if(l=="r"){l=e.look(1);if(l=="(")return e.eatSuffix(2),s(e,t,[")"],r,i);if(l=="[")return e.eatSuffix(2),s(e,t,["]"],r,i);if(l=="{")return e.eatSuffix(2),s(e,t,["}"],r,i);if(l=="<")return e.eatSuffix(2),s(e,t,[">"],r,i);if(/[\^'"!~\/]/.test(l))return e.eatSuffix(1),s(e,t,[e.eat(l)],r,i)}else if(/[\^'"!~\/(\[{<]/.test(l)){if(l=="(")return e.eatSuffix(1),s(e,t,[")"],"string");if(l=="[")return e.eatSuffix(1),s(e,t,["]"],"string");if(l=="{")return e.eatSuffix(1),s(e,t,["}"],"string");if(l=="<")return e.eatSuffix(1),s(e,t,[">"],"string");if(/[\^'"!~\/]/.test(l))return s(e,t,[e.eat(l)],"string")}}}if(u=="m"){var l=e.look(-2);if(!l||!/\w/.test(l)){l=e.eat(/[(\[{<\^'"!~\/]/);if(l){if(/[\^'"!~\/]/.test(l))return s(e,t,[l],r,i);if(l=="(")return s(e,t,[")"],r,i);if(l=="[")return s(e,t,["]"],r,i);if(l=="{")return s(e,t,["}"],r,i);if(l=="<")return s(e,t,[">"],r,i)}}}if(u=="s"){var l=/[\/>\]})\w]/.test(e.look(-2));if(!l){l=e.eat(/[(\[{<\^'"!~\/]/);if(l)return l=="["?s(e,t,["]","]"],r,i):l=="{"?s(e,t,["}","}"],r,i):l=="<"?s(e,t,[">",">"],r,i):l=="("?s(e,t,[")",")"],r,i):s(e,t,[l,l],r,i)}}if(u=="y"){var l=/[\/>\]})\w]/.test(e.look(-2));if(!l){l=e.eat(/[(\[{<\^'"!~\/]/);if(l)return l=="["?s(e,t,["]","]"],r,i):l=="{"?s(e,t,["}","}"],r,i):l=="<"?s(e,t,[">",">"],r,i):l=="("?s(e,t,[")",")"],r,i):s(e,t,[l,l],r,i)}}if(u=="t"){var l=/[\/>\]})\w]/.test(e.look(-2));if(!l){l=e.eat("r");if(l){l=e.eat(/[(\[{<\^'"!~\/]/);if(l)return l=="["?s(e,t,["]","]"],r,i):l=="{"?s(e,t,["}","}"],r,i):l=="<"?s(e,t,[">",">"],r,i):l=="("?s(e,t,[")",")"],r,i):s(e,t,[l,l],r,i)}}}if(u=="`")return s(e,t,[u],"variable-2");if(u=="/")return/~\s*$/.test(e.prefix())?s(e,t,[u],r,i):"operator";if(u=="$"){var a=e.pos;if(e.eatWhile(/\d/)||e.eat("{")&&e.eatWhile(/\d/)&&e.eat("}"))return"variable-2";e.pos=a}if(/[$@%]/.test(u)){var a=e.pos;if(e.eat("^")&&e.eat(/[A-Z]/)||!/[@$%&]/.test(e.look(-2))&&e.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var l=e.current();if(n[l])return"variable-2"}e.pos=a}if(/[$@%&]/.test(u))if(e.eatWhile(/[\w$\[\]]/)||e.eat("{")&&e.eatWhile(/[\w$\[\]]/)&&e.eat("}")){var l=e.current();return n[l]?"variable-2":"variable"}if(u=="#"&&e.look(-2)!="$")return e.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(u)){var a=e.pos;e.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/);if(n[e.current()])return"operator";e.pos=a}if(u=="_"&&e.pos==1){if(e.suffix(6)=="_END__")return s(e,t,["\0"],"comment");if(e.suffix(7)=="_DATA__")return s(e,t,["\0"],"variable-2");if(e.suffix(7)=="_C__")return s(e,t,["\0"],"string")}if(/\w/.test(u)){var a=e.pos;if(e.look(-2)=="{"&&(e.look(0)=="}"||e.eatWhile(/\w/)&&e.look(0)=="}"))return"string";e.pos=a}if(/[A-Z]/.test(u)){var c=e.look(-2),a=e.pos;e.eatWhile(/[A-Z_]/);if(!/[\da-z]/.test(e.look(0))){var l=n[e.current()];return l?(l[1]&&(l=l[0]),c!=":"?l==1?"keyword":l==2?"def":l==3?"atom":l==4?"operator":l==5?"variable-2":"meta":"meta"):"meta"}e.pos=a}if(/[a-zA-Z_]/.test(u)){var c=e.look(-2);e.eatWhile(/\w/);var l=n[e.current()];return l?(l[1]&&(l=l[0]),c!=":"?l==1?"keyword":l==2?"def":l==3?"atom":l==4?"operator":l==5?"variable-2":"meta":"meta"):"meta"}return null}var n={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},r="string-2",i=/[goseximacplud]/;return{startState:function(){return{tokenize:u,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||u)(e,t)},electricChars:"{}"}}),CodeMirror.defineMIME("text/x-perl","perl"),CodeMirror.StringStream.prototype.look=function(e){return this.string.charAt(this.pos+(e||0))},CodeMirror.StringStream.prototype.prefix=function(e){if(e){var t=this.pos-e;return this.string.substr(t>=0?t:0,e)}return this.string.substr(0,this.pos-1)},CodeMirror.StringStream.prototype.suffix=function(e){var t=this.string.length,n=t-this.pos+1;return this.string.substr(this.pos,e&&e<t?e:n)},CodeMirror.StringStream.prototype.nsuffix=function(e){var t=this.pos,n=e||this.string.length-this.pos+1;return this.pos+=n,this.string.substr(t,n)},CodeMirror.StringStream.prototype.eatSuffix=function(e){var t=this.pos+e,n;t<=0?this.pos=0:t>=(n=this.string.length-1)?this.pos=n:this.pos=t},function(){function e(e){var t={},n=e.split(" ");for(var r=0;r<n.length;++r)t[n[r]]=!0;return t}function t(e){return function(t,n){return t.match(e)?n.tokenize=null:t.skipToEnd(),"string"}}var n={name:"clike",keywords:e("abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent"),blockKeywords:e("catch do else elseif for foreach if switch try while"),atoms:e("true false null TRUE FALSE NULL"),multiLineStrings:!0,hooks:{$:function(e,t){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,n){return e.match(/<</)?(e.eatWhile(/[\w\.]/),n.tokenize=t(e.current().slice(3)),n.tokenize(e,n)):!1},"#":function(e,t){while(!e.eol()&&!e.match("?>",!1))e.next();return"comment"},"/":function(e,t){if(e.eat("/")){while(!e.eol()&&!e.match("?>",!1))e.next();return"comment"}return!1}}};CodeMirror.defineMode("php",function(e,t){function u(e,t){var n=t.mode=="php";e.sol()&&t.pending!='"'&&(t.pending=null);if(t.curMode==r){if(e.match(/^<\?\w*/))return t.curMode=o,t.curState=t.php,t.curClose="?>",t.mode="php","meta";if(t.pending=='"'){while(!e.eol()&&e.next()!='"');var a="string"}else if(t.pending&&e.pos<t.pending.end){e.pos=t.pending.end;var a=t.pending.style}else var a=r.token(e,t.curState);t.pending=null;var f=e.current(),l=f.search(/<\?/);return l!=-1?(a=="string"&&/\"$/.test(f)&&!/\?>/.test(f)?t.pending='"':t.pending={end:e.pos,style:a},e.backUp(f.length-l)):a=="tag"&&e.current()==">"&&t.curState.context&&(/^script$/i.test(t.curState.context.tagName)?(t.curMode=i,t.curState=i.startState(r.indent(t.curState,"")),t.curClose=/^<\/\s*script\s*>/i,t.mode="javascript"):/^style$/i.test(t.curState.context.tagName)&&(t.curMode=s,t.curState=s.startState(r.indent(t.curState,"")),t.curClose=/^<\/\s*style\s*>/i,t.mode="css")),a}return(!n||t.php.tokenize==null)&&e.match(t.curClose,n)?(t.curMode=r,t.curState=t.html,t.curClose=null,t.mode="html",n?"meta":u(e,t)):t.curMode.token(e,t.curState)}var r=CodeMirror.getMode(e,{name:"xml",htmlMode:!0}),i=CodeMirror.getMode(e,"javascript"),s=CodeMirror.getMode(e,"css"),o=CodeMirror.getMode(e,n);return{startState:function(){var e=r.startState();return{html:e,php:o.startState(),curMode:t.startOpen?o:r,curState:t.startOpen?o.startState():e,curClose:t.startOpen?/^\?>/:null,mode:t.startOpen?"php":"html",pending:null}},copyState:function(e){var t=e.html,n=CodeMirror.copyState(r,t),i=e.php,s=CodeMirror.copyState(o,i),u;return e.curState==t?u=n:e.curState==i?u=s:u=CodeMirror.copyState(e.curMode,e.curState),{html:n,php:s,curMode:e.curMode,curState:u,curClose:e.curClose,mode:e.mode,pending:e.pending}},token:u,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?r.indent(e.html,t):e.curMode.indent(e.curState,t)},electricChars:"/{}:"}},"xml","clike","javascript","css"),CodeMirror.defineMIME("application/x-httpd-php","php"),CodeMirror.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),CodeMirror.defineMIME("text/x-php",n)}(),CodeMirror.defineMode("python",function(e,t){function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function b(e,t){if(e.sol()){var r=t.scopes[0].offset;if(e.eatSpace()){var c=e.indentation();return c>r?y="indent":c<r&&(y="dedent"),null}r>0&&S(e,t)}if(e.eatSpace())return null;var h=e.peek();if(h==="#")return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var p=!1;e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(p=!0),e.match(/^\d+\.\d*/)&&(p=!0),e.match(/^\.\d+/)&&(p=!0);if(p)return e.eat(/J/i),"number";var d=!1;e.match(/^0x[0-9a-f]+/i)&&(d=!0),e.match(/^0b[01]+/i)&&(d=!0),e.match(/^0o[0-7]+/i)&&(d=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),d=!0),e.match(/^0(?![\dx])/i)&&(d=!0);if(d)return e.eat(/L/i),"number"}return e.match(v)?(t.tokenize=w(e.current()),t.tokenize(e,t)):e.match(a)||e.match(u)?null:e.match(o)||e.match(i)||e.match(l)?"operator":e.match(s)?null:e.match(m)?"keyword":e.match(g)?"builtin":e.match(f)?"variable":(e.next(),n)}function w(e){while("rub".indexOf(e.charAt(0).toLowerCase())>=0)e=e.substr(1);var r=e.length==1,i="string";return function(o,u){while(!o.eol()){o.eatWhile(/[^'"\\]/);if(o.eat("\\")){o.next();if(r&&o.eol())return i}else{if(o.match(e))return u.tokenize=b,i;o.eat(/['"]/)}}if(r){if(t.singleLineStringErrors)return n;u.tokenize=b}return i}}function E(t,n,r){r=r||"py";var i=0;if(r==="py"){if(n.scopes[0].type!=="py"){n.scopes[0].offset=t.indentation();return}for(var s=0;s<n.scopes.length;++s)if(n.scopes[s].type==="py"){i=n.scopes[s].offset+e.indentUnit;break}}else i=t.column()+t.current().length;n.scopes.unshift({offset:i,type:r})}function S(e,t,n){n=n||"py";if(t.scopes.length==1)return;if(t.scopes[0].type==="py"){var r=e.indentation(),i=-1;for(var s=0;s<t.scopes.length;++s)if(r===t.scopes[s].offset){i=s;break}if(i===-1)return!0;while(t.scopes[0].offset!==r)t.scopes.shift();return!1}return n==="py"?(t.scopes[0].offset=e.indentation(),!1):t.scopes[0].type!=n?!0:(t.scopes.shift(),!1)}function x(e,t){y=null;var r=t.tokenize(e,t),i=e.current();if(i===".")return r=e.match(f,!1)?null:n,r===null&&t.lastToken==="meta"&&(r="meta"),r;if(i==="@")return e.match(f,!1)?"meta":n;(r==="variable"||r==="builtin")&&t.lastToken==="meta"&&(r="meta");if(i==="pass"||i==="return")t.dedent+=1;i==="lambda"&&(t.lambda=!0),(i===":"&&!t.lambda&&t.scopes[0].type=="py"||y==="indent")&&E(e,t);var s="[({".indexOf(i);return s!==-1&&E(e,t,"])}".slice(s,s+1)),y==="dedent"&&S(e,t)?n:(s="])}".indexOf(i),s!==-1&&S(e,t,i)?n:(t.dedent>0&&e.eol()&&t.scopes[0].type=="py"&&(t.scopes.length>1&&t.scopes.shift(),t.dedent-=1),r))}var n="error",i=new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),s=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),o=new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),u=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),a=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),f=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),l=r(["and","or","not","is","in"]),c=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield"],h=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"],p={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},d={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};if(!t.version||parseInt(t.version,10)!==3){c=c.concat(p.keywords),h=h.concat(p.builtins);var v=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}else{c=c.concat(d.keywords),h=h.concat(d.builtins);var v=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}var m=r(c),g=r(h),y=null,T={startState:function(e){return{tokenize:b,scopes:[{offset:e||0,type:"py"}],lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=x(e,t);return t.lastToken=n,e.eol()&&e.lambda&&(t.lambda=!1),n},indent:function(e,t){return e.tokenize!=b?0:e.scopes[0].offset}};return T}),CodeMirror.defineMIME("text/x-python","python"),CodeMirror.defineMode("r",function(e){function t(e){var t=e.split(" "),n={};for(var r=0;r<t.length;++r)n[t[r]]=!0;return n}function a(e,t){u=null;var a=e.next();if(a=="#")return e.skipToEnd(),"comment";if(a=="0"&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if(a=="."&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(a))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if(a=="'"||a=='"')return t.tokenize=f(a),"string";if(a=="."&&e.match(/.[.\d]+/))return"keyword";if(/[\w\.]/.test(a)&&a!="_"){e.eatWhile(/[\w\.]/);var l=e.current();return n.propertyIsEnumerable(l)?"atom":i.propertyIsEnumerable(l)?(s.propertyIsEnumerable(l)&&(u="block"),"keyword"):r.propertyIsEnumerable(l)?"builtin":"variable"}return a=="%"?(e.skipTo("%")&&e.next(),"variable-2"):a=="<"&&e.eat("-")?"arrow":a=="="&&t.ctx.argList?"arg-is":o.test(a)?a=="$"?"dollar":(e.eatWhile(o),"operator"):/[\(\){}\[\];]/.test(a)?(u=a,a==";"?"semi":null):null}function f(e){return function(t,n){if(t.eat("\\")){var r=t.next();return r=="x"?t.match(/^[a-f0-9]{2}/i):(r=="u"||r=="U")&&t.eat("{")&&t.skipTo("}")?t.next():r=="u"?t.match(/^[a-f0-9]{4}/i):r=="U"?t.match(/^[a-f0-9]{8}/i):/[0-7]/.test(r)&&t.match(/^[0-7]{1,2}/),"string-2"}var i;while((i=t.next())!=null){if(i==e){n.tokenize=a;break}if(i=="\\"){t.backUp(1);break}}return"string"}}function l(e,t,n){e.ctx={type:t,indent:e.indent,align:null,column:n.column(),prev:e.ctx}}function c(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}var n=t("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"),r=t("list quote bquote eval return call parse deparse"),i=t("if else repeat while function for in next break"),s=t("if else repeat while function for"),o=/[+\-*\/^<>=!&|~$:]/,u;return{startState:function(t){return{tokenize:a,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){e.sol()&&(t.ctx.align==null&&(t.ctx.align=!1),t.indent=e.indentation());if(e.eatSpace())return null;var n=t.tokenize(e,t);n!="comment"&&t.ctx.align==null&&(t.ctx.align=!0);var r=t.ctx.type;return(u==";"||u=="{"||u=="}")&&r=="block"&&c(t),u=="{"?l(t,"}",e):u=="("?(l(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):u=="["?l(t,"]",e):u=="block"?l(t,"block",e):u==r&&c(t),t.afterIdent=n=="variable"||n=="keyword",n},indent:function(t,n){if(t.tokenize!=a)return 0;var r=n&&n.charAt(0),i=t.ctx,s=r==i.type;return i.type=="block"?i.indent+(r=="{"?0:e.indentUnit):i.align?i.column+(s?0:1):i.indent+(s?0:e.indentUnit)}}}),CodeMirror.defineMIME("text/x-rsrc","r"),CodeMirror.defineMode("ruby",function(e,t){function n(e){var t={};for(var n=0,r=e.length;n<r;++n)t[e[n]]=!0;return t}function a(e,t,n){return n.tokenize.push(e),e(t,n)}function f(e,t){u=null;if(e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(p),"comment";if(e.eatSpace())return null;var n=e.next(),r;if(n=="`"||n=="'"||n=='"'||n=="/"&&!e.eol()&&e.peek()!=" ")return a(c(n,"string",n=='"'||n=="`"),e,t);if(n=="%"){var i,s=!1;e.eat("s")?i="atom":e.eat(/[WQ]/)?(i="string",s=!0):e.eat(/[wxqr]/)&&(i="string");var f=e.eat(/[^\w\s]/);return f?(o.propertyIsEnumerable(f)&&(f=o[f]),a(c(f,i,s,!0),e,t)):"operator"}if(n=="#")return e.skipToEnd(),"comment";if(n=="<"&&(r=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return a(h(r[1]),e,t);if(n=="0")return e.eat("x")?e.eatWhile(/[\da-fA-F]/):e.eat("b")?e.eatWhile(/[01]/):e.eatWhile(/[0-7]/),"number";if(/\d/.test(n))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if(n=="?"){while(e.match(/^\\[CM]-/));return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}return n==":"?e.eat("'")?a(c("'","atom",!1),e,t):e.eat('"')?a(c('"',"atom",!0),e,t):(e.eatWhile(/[\w\?]/),"atom"):n=="@"?(e.eat("@"),e.eatWhile(/[\w\?]/),"variable-2"):n=="$"?(e.next(),e.eatWhile(/[\w\?]/),"variable-3"):/\w/.test(n)?(e.eatWhile(/[\w\?]/),e.eat(":")?"atom":"ident"):n!="|"||!t.varList&&t.lastTok!="{"&&t.lastTok!="do"?/[\(\)\[\]{}\\;]/.test(n)?(u=n,null):n=="-"&&e.eat(">")?"arrow":/[=+\-\/*:\.^%<>~|]/.test(n)?(e.eatWhile(/[=+\-\/*:\.^%<>~|]/),"operator"):null:(u="|",null)}function l(){var e=1;return function(t,n){if(t.peek()=="}"){e--;if(e==0)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)}else t.peek()=="{"&&e++;return f(t,n)}}function c(e,t,n,r){return function(i,s){var o=!1,u;while((u=i.next())!=null){if(u==e&&(r||!o)){s.tokenize.pop();break}if(n&&u=="#"&&!o&&i.eat("{")){s.tokenize.push(l(arguments.callee));break}o=!o&&u=="\\"}return t}}function h(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function p(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var r=n(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload"]),i=n(["def","class","case","for","while","do","module","then","catch","loop","proc","begin"]),s=n(["end","until"]),o={"[":"]","{":"}","(":")"},u;return{startState:function(){return{tokenize:[f],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){e.sol()&&(t.indented=e.indentation());var n=t.tokenize[t.tokenize.length-1](e,t),o;if(n=="ident"){var a=e.current();n=r.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(a)?"tag":t.lastTok=="def"||t.lastTok=="class"||t.varList?"def":"variable",i.propertyIsEnumerable(a)?o="indent":s.propertyIsEnumerable(a)?o="dedent":(a=="if"||a=="unless")&&e.column()==e.indentation()&&(o="indent")}if(u||n&&n!="comment")t.lastTok=a||u||n;return u=="|"&&(t.varList=!t.varList),o=="indent"||/[\(\[\{]/.test(u)?t.context={prev:t.context,type:u||n,indented:t.indented}:(o=="dedent"||/[\)\]\}]/.test(u))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine=u=="\\"||n=="operator"),n},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=f)return 0;var r=n&&n.charAt(0),i=t.context,s=i.type==o[r]||i.type=="keyword"&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return i.indented+(s?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricChars:"}de"}}),CodeMirror.defineMIME("text/x-ruby","ruby"),CodeMirror.defineMode("shell",function(e){function n(e,n){var r=n.split(" ");for(var i=0;i<r.length;i++)t[r[i]]=e}function r(e,n){var r=e.sol(),u=e.next();if(u==="'"||u==='"'||u==="`")return n.tokens.unshift(i(u)),o(e,n);if(u==="#")return r&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if(u==="$")return n.tokens.unshift(s),o(e,n);if(u==="+"||u==="=")return"operator";if(u==="-")return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(u)){e.eatWhile(/\d/);if(!/\w/.test(e.peek()))return"number"}e.eatWhile(/\w/);var a=e.current();return e.peek()==="="&&/\w+/.test(a)?"def":t[a]||null}function i(e){return function(t,n){var r,i=!1,o=!1;while((r=t.next())!=null){if(r===e&&!o){i=!0;break}if(r==="$"&&!o&&e!=="'"){o=!0,t.backUp(1),n.tokens.unshift(s);break}o=!o&&r==="\\"}return(i||!o)&&n.tokens.shift(),e==="`"||e===")"?"quote":"string"}}function o(e,t){return(t.tokens[0]||r)(e,t)}var t={};n("atom","true false"),n("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function"),n("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo tee telnet top touch vi vim wall wc wget who write yes zsh");var s=function(e,t){t.tokens.length>1&&e.eat("$");var n=e.next(),r=/\w/;return n==="{"&&(r=/[^}]/),n==="("?(t.tokens[0]=i(")"),o(e,t)):(/\d/.test(n)||(e.eatWhile(r),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return e.eatSpace()?null:o(e,t)}}}),CodeMirror.defineMIME("text/x-sh","shell"),CodeMirror.defineMode("stex",function(e,t){function n(e,t){e.cmdState.push(t)}function r(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function i(e){if(e.cmdState.length>0){var t=e.cmdState.pop();t.closeBracket()}}function s(e){var t=e.cmdState;for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.name=="DEFAULT")continue;return r.styleIdentifier()}return null}function o(e,t,n,r){return function(){this.name=e,this.bracketNo=0,this.style=t,this.styles=r,this.brackets=n,this.styleIdentifier=function(e){return this.bracketNo<=this.styles.length?this.styles[this.bracketNo-1]:null},this.openBracket=function(e){return this.bracketNo++,"bracket"},this.closeBracket=function(e){}}}function a(e,t){e.f=t}function f(e,t){if(e.match(/^\\[a-zA-Z@]+/)){var i=e.current();i=i.substr(1,i.length-1);var o;return u.hasOwnProperty(i)?o=u[i]:o=u.DEFAULT,o=new o,n(t,o),a(t,c),o.style}if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";var f=e.next();if(f=="%")return e.eol()||a(t,l),"comment";if(f=="}"||f=="]")return o=r(t),o?(o.closeBracket(f),a(t,c),"bracket"):"error";return f=="{"||f=="["?(o=u.DEFAULT,o=new o,n(t,o),"bracket"):/\d/.test(f)?(e.eatWhile(/[\w.%]/),"atom"):(e.eatWhile(/[\w-_]/),s(t))}function l(e,t){return e.skipToEnd(),a(t,f),"comment"}function c(e,t){var n=e.peek();if(n=="{"||n=="["){var s=r(t),o=s.openBracket(n);return e.eat(n),a(t,f),"bracket"}return/[ \t\r]/.test(n)?(e.eat(n),null):(a(t,f),s=r(t),s&&i(t),f(e,t))}var u=new Array;return u.importmodule=o("importmodule","tag","{[",["string","builtin"]),u.documentclass=o("documentclass","tag","{[",["","atom"]),u.usepackage=o("documentclass","tag","[",["atom"]),u.begin=o("documentclass","tag","[",["atom"]),u.end=o("documentclass","tag","[",["atom"]),u.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=function(e){},this.openBracket=function(e){},this.closeBracket=function(e){}},{startState:function(){return{f:f,cmdState:[]}},copyState:function(e){return{f:e.f,cmdState:e.cmdState.slice(0,e.cmdState.length)}},token:function(e,t){var n=t.f(e,t),r=e.current();return n}}}),CodeMirror.defineMIME("text/x-stex","stex"),CodeMirror.defineMIME("text/x-latex","stex"),CodeMirror.defineMode("xml",function(e,t){function u(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if(r=="<"){if(e.eat("!"))return e.eat("[")?e.match("CDATA[")?n(l("atom","]]>")):null:e.match("--")?n(l("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null;if(e.eat("?"))return e.eatWhile(/[\w\._\-]/),t.tokenize=l("meta","?>"),"meta";o=e.eat("/")?"closeTag":"openTag",e.eatSpace(),s="";var i;while(i=e.eat(/[^\s\u00a0=<>\"\'\/?]/))s+=i;return t.tokenize=a,"tag"}if(r=="&"){var u;return e.eat("#")?e.eat("x")?u=e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):u=e.eatWhile(/[\d]/)&&e.eat(";"):u=e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),u?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();return n==">"||n=="/"&&e.eat(">")?(t.tokenize=u,o=n==">"?"endTag":"selfcloseTag","tag"):n=="="?(o="equals",null):/[\'\"]/.test(n)?(t.tokenize=f(n),t.tokenize(e,t)):(e.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function f(e){return function(t,n){while(!t.eol())if(t.next()==e){n.tokenize=a;break}return"string"}}function l(e,t){return function(n,r){while(!n.eol()){if(n.match(t)){r.tokenize=u;break}n.next()}return e}}function c(e){return function(t,n){var r;while((r=t.next())!=null){if(r=="<")return n.tokenize=c(e+1),n.tokenize(t,n);if(r==">"){if(e==1){n.tokenize=u;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function d(){for(var e=arguments.length-1;e>=0;e--)h.cc.push(arguments[e])}function v(){return d.apply(null,arguments),!0}function m(e,t){var n=r.doNotIndent.hasOwnProperty(e)||h.context&&h.context.noIndent;h.context={prev:h.context,tagName:e,indent:h.indented,startOfLine:t,noIndent:n}}function g(){h.context&&(h.context=h.context.prev)}function y(e){if(e=="openTag")return h.tagName=s,v(S,b(h.startOfLine));if(e=="closeTag"){var t=!1;return h.context?h.context.tagName!=s&&(r.implicitlyClosed.hasOwnProperty(h.context.tagName.toLowerCase())&&g(),t=!h.context||h.context.tagName!=s):t=!0,t&&(p="error"),v(w(t))}return v()}function b(e){return function(t){return t=="selfcloseTag"||t=="endTag"&&r.autoSelfClosers.hasOwnProperty(h.tagName.toLowerCase())?(E(h.tagName.toLowerCase()),v()):t=="endTag"?(E(h.tagName.toLowerCase()),m(h.tagName,e),v()):v()}}function w(e){return function(t){return e&&(p="error"),t=="endTag"?(g(),v()):(p="error",v(arguments.callee))}}function E(e){var t;for(;;){if(!h.context)return;t=h.context.tagName.toLowerCase();if(!r.contextGrabbers.hasOwnProperty(t)||!r.contextGrabbers[t].hasOwnProperty(e))return;g()}}function S(e){return e=="word"?(p="attribute",v(x,S)):e=="endTag"||e=="selfcloseTag"?d():(p="error",v(S))}function x(e){return e=="equals"?v(T,S):(r.allowMissing||(p="error"),e=="endTag"||e=="selfcloseTag"?d():v())}function T(e){return e=="string"?v(N):e=="word"&&r.allowUnquoted?(p="string",v()):(p="error",e=="endTag"||e=="selfCloseTag"?d():v())}function N(e){return e=="string"?v(N):d()}var n=e.indentUnit,r=t.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!1}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},i=t.alignCDATA,s,o,h,p;return{startState:function(){return{tokenize:u,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(e,t){e.sol()&&(t.startOfLine=!0,t.indented=e.indentation());if(e.eatSpace())return null;p=o=s=null;var n=t.tokenize(e,t);t.type=o;if((n||o)&&n!="comment"){h=t;for(;;){var r=t.cc.pop()||y;if(r(o||n))break}}return t.startOfLine=!1,p||n},indent:function(e,t,r){var s=e.context;if(e.tokenize!=a&&e.tokenize!=u||s&&s.noIndent)return r?r.match(/^(\s*)/)[0].length:0;if(i&&/<!\[CDATA\[/.test(t))return 0;s&&/^<\//.test(t)&&(s=s.prev);while(s&&!s.startOfLine)s=s.prev;return s?s.indent+n:0},compareStates:function(e,t){if(e.indented!=t.indented||e.tokenize!=t.tokenize)return!1;for(var n=e.context,r=t.context;;n=n.prev,r=r.prev){if(!n||!r)return n==r;if(n.tagName!=r.tagName||n.indent!=r.indent)return!1}},electricChars:"/"}}),CodeMirror.defineMIME("text/xml","xml"),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),function(){CodeMirror.simpleHint=function(e,t){function s(t){e.replaceRange(t,r.from,r.to)}function p(){if(h)return;h=!0,o.parentNode.removeChild(o)}function d(){s(i[u.selectedIndex]),p(),setTimeout(function(){e.focus()},50)}if(e.somethingSelected())return;var n=e.getTokenAt(e.getCursor());if(!/[\S]/gi.test(n.string))return;var r=t(e);if(!r||!r.list.length)return;var i=r.list;if(i.length==1)return s(i[0]),!0;var o=document.createElement("div");o.className="CodeMirror-completions";var u=o.appendChild(document.createElement("select"));window.opera||(u.multiple=!0);for(var a=0;a<i.length;++a){var f=u.appendChild(document.createElement("option"));f.appendChild(document.createTextNode(i[a]))}u.firstChild.selected=!0,u.size=Math.min(10,i.length);var l=e.cursorCoords();o.style.left=l.x+"px",o.style.top=l.yBot+"px",document.body.appendChild(o);var c=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth);c-l.x<u.clientWidth&&(o.style.left=l.x-u.clientWidth+"px"),i.length<=10&&(o.style.width=u.clientWidth-1+"px");var h=!1;return CodeMirror.connect(u,"blur",p),CodeMirror.connect(u,"keydown",function(n){var r=n.keyCode;r==13?(CodeMirror.e_stop(n),d()):r==27?(CodeMirror.e_stop(n),p(),e.focus()):r!=38&&r!=40&&(p(),e.focus(),e.triggerOnKeyDown(n),setTimeout(function(){CodeMirror.simpleHint(e,t)},50))}),CodeMirror.connect(u,"dblclick",d),u.focus(),window.opera&&setTimeout(function(){h||u.focus()},100),!0}}(),function(){function e(e,t){for(var n=0,r=e.length;n<r;++n)t(e[n])}function t(e,t){if(!Array.prototype.indexOf){var n=e.length;while(n--)if(e[n]===t)return!0;return!1}return e.indexOf(t)!=-1}function n(e,t,n){var r=e.getCursor(),i=n(e,r),s=i;/^[\w$_]*$/.test(i.string)||(i=s={start:r.ch,end:r.ch,string:"",state:i.state,className:i.string=="."?"property":null});while(s.className=="property"){s=n(e,{line:r.line,ch:s.start});if(s.string!=".")return;s=n(e,{line:r.line,ch:s.start});if(s.string==")"){var o=1;do{s=n(e,{line:r.line,ch:s.start});switch(s.string){case")":o++;break;case"(":o--;break;default:}}while(o>0);s=n(e,{line:r.line,ch:s.start});if(s.className!="variable")return;s.className="function"}if(!u)var u=[];u.push(s)}return{list:f(i,u,t),from:{line:r.line,ch:i.start},to:{line:r.line,ch:i.end}}}function r(e,t){var n=e.getTokenAt(t);return t.ch==n.start+1&&n.string.charAt(0)=="."?(n.end=n.start,n.string=".",n.className="property"):/^\.[\w$_]*$/.test(n.string)&&(n.className="property",n.start++,n.string=n.string.replace(/\./,"")),n}function f(n,r,u){function l(e){e.indexOf(f)==0&&!t(a,e)&&a.push(e)}function c(t){typeof t=="string"?e(i,l):t instanceof Array?e(s,l):t instanceof Function&&e(o,l);for(var n in t)l(n)}var a=[],f=n.string;if(r){var h=r.pop(),p;h.className=="variable"?p=window[h.string]:h.className=="string"?p="":h.className=="atom"?p=1:h.className=="function"&&(window.jQuery==null||h.string!="$"&&h.string!="jQuery"||typeof window.jQuery!="function"?window._!=null&&h.string=="_"&&typeof window._=="function"&&(p=window._()):p=window.jQuery());while(p!=null&&r.length)p=p[r.pop().string];p!=null&&c(p)}else{for(var d=n.state.localVars;d;d=d.next)l(d.name);c(window),e(u,l)}return a}CodeMirror.javascriptHint=function(e){return n(e,u,function(e,t){return e.getTokenAt(t)})},CodeMirror.coffeescriptHint=function(e){return n(e,a,r)};var i="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),s="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),o="prototype apply call bind".split(" "),u="break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch throw true try typeof var void while with".split(" "),a="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ")}(),CodeMirror.tagRangeFinder=function(e,t,n){var r="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=r+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s=new RegExp("^["+r+"]["+i+"]*"),o=e.getLine(t),u=!1,a=null,f=0;while(!u){f=o.indexOf("<",f);if(-1==f)return;if(f+1<o.length&&o[f+1]=="/"){f++;continue}if(!o.substr(f+1).match(s)){f++;continue}var l=o.indexOf(">",f+1);if(-1==l){var c=t+1,h=!1,p=e.lineCount();while(c<p&&!h){var d=e.getLine(c),v=d.indexOf(">");if(-1!=v){h=!0;var m=d.lastIndexOf("/",v);if(-1!=m&&m<v){var g=o.substr(m,v-m+1);if(!g.match(/\/\s*\>/))return n===!0&&c++,c}}c++}u=!0}else{var y=o.lastIndexOf("/",l);if(-1==y)u=!0;else{var g=o.substr(y,l-y+1);g.match(/\/\s*\>/)||(u=!0)}}if(u){var b=o.substr(f+1);a=b.match(s),a?(a=a[0],-1!=o.indexOf("</"+a+">",f)&&(u=!1)):u=!1}u||f++}if(u){var w="(\\<\\/"+a+"\\>)|(\\<"+a+"\\>)|(\\<"+a+"\\s)|(\\<"+a+"$)",E=new RegExp(w,"g"),S="</"+a+">",x=1,c=t+1,p=e.lineCount();while(c<p){o=e.getLine(c);var T=o.match(E);if(T)for(var N=0;N<T.length;N++){T[N]==S?x--:x++;if(!x)return n===!0&&c++,c}c++}return}},CodeMirror.braceRangeFinder=function(e,t,n){var r=e.getLine(t),i=r.length,s,o;for(;;){var u=r.lastIndexOf("{",i);if(u<0)break;o=e.getTokenAt({line:t,ch:u}).className;if(!/^(comment|string)/.test(o)){s=u;break}i=u-1}if(s==null||r.lastIndexOf("}")>s)return;var a=1,f=e.lineCount(),l;e:for(var c=t+1;c<f;++c){var h=e.getLine(c),p=0;for(;;){var d=h.indexOf("{",p),v=h.indexOf("}",p);d<0&&(d=h.length),v<0&&(v=h.length),p=Math.min(d,v);if(p==h.length)break;if(e.getTokenAt({line:c,ch:p+1}).className==o)if(p==d)++a;else if(!--a){l=c;break e}++p}}if(l==null||l==t+1)return;return n===!0&&l++,l},CodeMirror.indentRangeFinder=function(e,t){var n=e.getOption("tabSize"),r=e.getLineHandle(t).indentation(n),i;for(var s=t+1,o=e.lineCount();s<o;++s){var u=e.getLineHandle(s);if(!/^\s*$/.test(u.text)){if(u.indentation(n)<=r)break;i=s}}return i?i+1:null},CodeMirror.newFoldFunction=function(e,t,n){function i(e,t){for(var n=0;n<r.length;++n){var i=e.lineInfo(r[n].start);if(!i)r.splice(n--,1);else if(i.line==t)return{pos:n,region:r[n]}}}function s(e,t){e.clearMarker(t.start);for(var n=0;n<t.hidden.length;++n)e.showLine(t.hidden[n])}var r=[];return t==null&&(t='<div style="position: absolute; left: 2px; color:#600">&#x25bc;</div>%N%'),function(o,u){o.operation(function(){var a=i(o,u);if(a)r.splice(a.pos,1),s(o,a.region);else{var f=e(o,u,n);if(f==null)return;var l=[];for(var c=u+1;c<f;++c){var h=o.hideLine(c);h&&l.push(h)}var p=o.setMarker(u,t),d={start:p,hidden:l};o.onDeleteLine(p,function(){s(o,d)}),r.push(d)}})}},function(){function e(e,t){var n=e.getWrapperElement(),r=n.insertBefore(document.createElement("div"),n.firstChild);return r.className="CodeMirror-dialog",r.innerHTML="<div>"+t+"</div>",r}CodeMirror.defineExtension("openDialog",function(t,n){function o(){if(i)return;i=!0,r.parentNode.removeChild(r)}var r=e(this,t),i=!1,s=this,u=r.getElementsByTagName("input")[0],a;if(u)CodeMirror.connect(u,"keydown",function(e){if(e.keyCode==13||e.keyCode==27)CodeMirror.e_stop(e),o(),s.focus(),e.keyCode==13&&n(u.value)}),u.focus(),CodeMirror.connect(u,"blur",o);else if(a=r.getElementsByTagName("button")[0])CodeMirror.connect(a,"click",o),a.focus(),CodeMirror.connect(a,"blur",o);return o}),CodeMirror.defineExtension("openConfirm",function(t,n){function a(){if(s)return;s=!0,r.parentNode.removeChild(r),o.focus()}var r=e(this,t),i=r.getElementsByTagName("button"),s=!1,o=this,u=1;i[0].focus();for(var f=0;f<i.length;++f){var l=i[f];(function(e){CodeMirror.connect(l,"click",function(t){CodeMirror.e_preventDefault(t),a(),e&&e(o)})})(n[f]),CodeMirror.connect(l,"blur",function(){--u,setTimeout(function(){u<=0&&a()},200)}),CodeMirror.connect(l,"focus",function(){++u})}})}(),function(){function e(){this.posFrom=this.posTo=this.query=null,this.marked=[]}function t(t){return t._searchState||(t._searchState=new e)}function n(e,t,n){return e.getSearchCursor(t,n,typeof t=="string"&&t==t.toLowerCase())}function r(e,t,n,r){e.openDialog?e.openDialog(t,r):r(prompt(n,""))}function i(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function s(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);return t?new RegExp(t[1],t[2].indexOf("i")==-1?"":"i"):e}function u(e,i){var u=t(e);if(u.query)return a(e,i);r(e,o,"Search for:",function(t){e.operation(function(){if(!t||u.query)return;u.query=s(t);if(e.lineCount()<2e3)for(var r=n(e,t);r.findNext();)u.marked.push(e.markText(r.from(),r.to(),"CodeMirror-searching"));u.posFrom=u.posTo=e.getCursor(),a(e,i)})})}function a(e,r){e.operation(function(){var i=t(e),s=n(e,i.query,r?i.posFrom:i.posTo);if(!s.find(r)){s=n(e,i.query,r?{line:e.lineCount()-1}:{line:0,ch:0});if(!s.find(r))return}e.setSelection(s.from(),s.to()),i.posFrom=s.from(),i.posTo=s.to()})}function f(e){e.operation(function(){var n=t(e);if(!n.query)return;n.query=null;for(var r=0;r<n.marked.length;++r)n.marked[r].clear();n.marked.length=0})}function p(e,t){r(e,l,"Replace:",function(o){if(!o)return;o=s(o),r(e,c,"Replace with:",function(r){if(t)e.compoundChange(function(){e.operation(function(){for(var t=n(e,o);t.findNext();)if(typeof o!="string"){var i=e.getRange(t.from(),t.to()).match(o);t.replace(r.replace(/\$(\d)/,function(e,t){return i[t]}))}else t.replace(r)})});else{f(e);var s=n(e,o,e.getCursor());function u(){var t=s.from(),r;if(!(r=s.findNext())){s=n(e,o);if(!(r=s.findNext())||t&&s.from().line==t.line&&s.from().ch==t.ch)return}e.setSelection(s.from(),s.to()),i(e,h,"Replace?",[function(){a(r)},u])}function a(e){s.replace(typeof o=="string"?r:r.replace(/\$(\d)/,function(t,n){return e[n]})),u()}u()}})})}var o='Search: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>',l='Replace: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>',c='With: <input type="text" style="width: 10em"/>',h="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";CodeMirror.commands.find=function(e){f(e),u(e)},CodeMirror.commands.findNext=u,CodeMirror.commands.findPrev=function(e){u(e,!0)},CodeMirror.commands.clearSearch=f,CodeMirror.commands.replace=p,CodeMirror.commands.replaceAll=function(e){p(e,!0)}}(),function(){function e(e,t,n,r){this.atOccurrence=!1,this.cm=e,r==null&&typeof t=="string"&&(r=!1),n=n?e.clipPos(n):{line:0,ch:0},this.pos={from:n,to:n};if(typeof t!="string")this.matches=function(n,r){if(n){var i=e.getLine(r.line).slice(0,r.ch),s=i.match(t),o=0;while(s){var u=i.indexOf(s[0]);o+=u,i=i.slice(u+1);var a=i.match(t);if(!a)break;s=a,o++}}else var i=e.getLine(r.line).slice(r.ch),s=i.match(t),o=s&&r.ch+i.indexOf(s[0]);if(s)return{from:{line:r.line,ch:o},to:{line:r.line,ch:o+s[0].length},match:s}};else{r&&(t=t.toLowerCase());var i=r?function(e){return e.toLowerCase()}:function(e){return e},s=t.split("\n");s.length==1?this.matches=function(n,r){var s=i(e.getLine(r.line)),o=t.length,u;if(n?r.ch>=o&&(u=s.lastIndexOf(t,r.ch-o))!=-1:(u=s.indexOf(t,r.ch))!=-1)return{from:{line:r.line,ch:u},to:{line:r.line,ch:u+o}}}:this.matches=function(t,n){var r=n.line,o=t?s.length-1:0,u=s[o],a=i(e.getLine(r)),f=t?a.indexOf(u)+u.length:a.lastIndexOf(u);if(t?f>=n.ch||f!=u.length:f<=n.ch||f!=a.length-u.length)return;for(;;){if(t?!r:r==e.lineCount()-1)return;a=i(e.getLine(r+=t?-1:1)),u=s[t?--o:++o];if(o>0&&o<s.length-1){if(a!=u)return;continue}var l=t?a.lastIndexOf(u):a.indexOf(u)+u.length;if(t?l!=a.length-u.length:l!=u.length)return;var c={line:n.line,ch:f},h={line:r,ch:l};return{from:t?h:c,to:t?c:h}}}}}e.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function r(e){var n={line:e,ch:0};return t.pos={from:n,to:n},t.atOccurrence=!1,!1}var t=this,n=this.cm.clipPos(e?this.pos.from:this.pos.to);for(;;){if(this.pos=this.matches(e,n))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!n.line)return r(0);n={line:n.line-1,ch:this.cm.getLine(n.line-1).length}}else{var i=this.cm.lineCount();if(n.line==i-1)return r(i);n={line:n.line+1,ch:0}}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(e){var t=this;this.atOccurrence&&(t.pos.to=this.cm.replaceRange(e,t.pos.from,t.pos.to))}},CodeMirror.defineExtension("getSearchCursor",function(t,n,r){return new e(this,t,n,r)})}(),CodeMirror.modeExtensions||(CodeMirror.modeExtensions={}),CodeMirror.defineExtension("getModeExt",function(){var e=CodeMirror.resolveMode(this.getOption("mode")).name,t=CodeMirror.modeExtensions[e];if(!t)throw new Error("No extensions found for mode "+e);return t}),CodeMirror.defineExtension("getModeExtAtPos",function(e){var t=this.getTokenAt(e);return t&&t.state&&t.state.mode?CodeMirror.modeExtensions[t.state.mode=="html"?"htmlmixed":t.state.mode]:this.getModeExt()}),CodeMirror.defineExtension("commentRange",function(e,t,n){var r=this.getModeExtAtPos(this.getCursor());if(e){var i=this.getRange(t,n);this.replaceRange(r.commentStart+this.getRange(t,n)+r.commentEnd,t,n),t.line==n.line&&t.ch==n.ch&&this.setCursor(t.line,t.ch+r.commentStart.length)}else{var s=this.getRange(t,n),o=s.indexOf(r.commentStart),u=s.lastIndexOf(r.commentEnd);o>-1&&u>-1&&u>o&&(s=s.substr(0,o)+s.substring(o+r.commentStart.length,u)+s.substr(u+r.commentEnd.length)),this.replaceRange(s,t,n)}}),CodeMirror.defineExtension("autoIndentRange",function(e,t){var n=this;this.operation(function(){for(var r=e.line;r<=t.line;r++)n.indentLine(r,"smart")})}),CodeMirror.defineExtension("autoFormatRange",function(e,t){var n=this.indexFromPos(e),r=this.indexFromPos(t),i=this.getModeExt().autoFormatLineBreaks(this.getValue(),n,r),s=this;this.operation(function(){s.replaceRange(i,e,t);var r=s.posFromIndex(n).line,o=s.posFromIndex(n+i.length).line;for(var u=r;u<=o;u++)s.indentLine(u,"smart")})}),CodeMirror.modeExtensions.css={commentStart:"/*",commentEnd:"*/",wordWrapChars:[";","\\{","\\}"],autoFormatLineBreaks:function(e,t,n){return e=e.substring(t,n),e.replace(new RegExp("(;|\\{|\\})([^\r\n])","g"),"$1\n$2")}},CodeMirror.modeExtensions.javascript={commentStart:"/*",commentEnd:"*/",wordWrapChars:[";","\\{","\\}"],getNonBreakableBlocks:function(e){var t=[new RegExp("for\\s*?\\(([\\s\\S]*?)\\)"),new RegExp('\\\\"([\\s\\S]*?)(\\\\"|$)'),new RegExp("\\\\'([\\s\\S]*?)(\\\\'|$)"),new RegExp("'([\\s\\S]*?)('|$)"),new RegExp('"([\\s\\S]*?)("|$)'),new RegExp("//.*([\r\n]|$)")],n=new Array;for(var r=0;r<t.length;r++){var i=0;while(i<e.length){var s=e.substr(i).match(t[r]);if(s==null)break;n.push({start:i+s.index,end:i+s.index+s[0].length}),i+=s.index+Math.max(1,s[0].length)}}return n.sort(function(e,t){return e.start-t.start}),n},autoFormatLineBreaks:function(e,t,n){e=e.substring(t,n);var r=0,i=new RegExp("(;|\\{|\\})([^\r\n])","g"),s=this.getNonBreakableBlocks(e);if(s!=null){var o="";for(var u=0;u<s.length;u++)s[u].start>r&&(o+=e.substring(r,s[u].start).replace(i,"$1\n$2"),r=s[u].start),s[u].start<=r&&s[u].end>=r&&(o+=e.substring(r,s[u].end),r=s[u].end);return r<e.length-1&&(o+=e.substr(r).replace(i,"$1\n$2")),o}return e.replace(i,"$1\n$2")}},CodeMirror.modeExtensions.xml={commentStart:"<!--",commentEnd:"-->",wordWrapChars:[">"],autoFormatLineBreaks:function(e,t,n){e=e.substring(t,n);var r=e.split("\n"),i=new RegExp("(^\\s*?<|^[^<]*?)(.+)(>\\s*?$|[^>]*?$)"),s=new RegExp("<","g"),o=new RegExp("(>)([^\r\n])","g");for(var u=0;u<r.length;u++){var a=r[u].match(i);if(a!=null&&a.length>3){r[u]=a[1]+a[2].replace(s,"\n$&").replace(o,"$1\n$2")+a[3];continue}}return r.join("\n")}},CodeMirror.modeExtensions.htmlmixed={commentStart:"<!--",commentEnd:"-->",wordWrapChars:[">",";","\\{","\\}"],getModeInfos:function(e,t){var n=new Array;n[0]={pos:0,modeExt:CodeMirror.modeExtensions.xml,modeName:"xml"};var r=new Array;r[0]={regex:new RegExp("<style[^>]*>([\\s\\S]*?)(</style[^>]*>|$)","i"),modeExt:CodeMirror.modeExtensions.css,modeName:"css"},r[1]={regex:new RegExp("<script[^>]*>([\\s\\S]*?)(</script[^>]*>|$)","i"),modeExt:CodeMirror.modeExtensions.javascript,modeName:"javascript"};var i=typeof t!="undefined"?t:e.length-1;for(var s=0;s<r.length;s++){var o=0;while(o<=i){var u=e.substr(o).match(r[s].regex);if(u==null)break;if(u.length>1&&u[1].length>0){var a=o+u.index+u[0].indexOf(u[1]);n.push({pos:a,modeExt:r[s].modeExt,modeName:r[s].modeName}),n.push({pos:a+u[1].length,modeExt:n[0].modeExt,modeName:n[0].modeName}),o+=u.index+u[0].length;continue}o+=u.index+Math.max(u[0].length,1)}}return n.sort(function(t,n){return t.pos-n.pos}),n},autoFormatLineBreaks:function(e,t,n){var r=this.getModeInfos(e),i=new RegExp("^\\s*?\n"),s=new RegExp("\n\\s*?$"),o="";if(r.length>1)for(var u=1;u<=r.length;u++){var a=r[u-1].pos,f=u<r.length?r[u].pos:n;if(a>=n)break;if(a<t){if(f<=t)continue;a=t}f>n&&(f=n);var l=e.substring(a,f);r[u-1].modeName!="xml"&&(!i.test(l)&&a>0&&(l="\n"+l),!s.test(l)&&f<e.length-1&&(l+="\n")),o+=r[u-1].modeExt.autoFormatLineBreaks(l)}else o=r[0].modeExt.autoFormatLineBreaks(e.substring(t,n));return o}},function(){function t(){this.marked=[]}function n(e){return e._matchHighlightState||(e._matchHighlightState=new t)}function r(e){var t=n(e);for(var r=0;r<t.marked.length;++r)t.marked[r].clear();t.marked=[]}function i(t,i,s){r(t),s=typeof s!="undefined"?s:e;if(t.somethingSelected()&&t.getSelection().replace(/^\s+|\s+$/g,"").length>=s){var o=n(t),u=t.getSelection();t.operation(function(){if(t.lineCount()<2e3)for(var e=t.getSearchCursor(u);e.findNext();)(e.from().line!==t.getCursor(!0).line||e.from().ch!==t.getCursor(!0).ch)&&o.marked.push(t.markText(e.from(),e.to(),i))})}}var e=2;CodeMirror.defineExtension("matchHighlight",function(e,t){i(this,e,t)})}(),function(){function e(e,n,r,i){t(e,n,i)?(e.replaceSelection("\n\n</"+i+">","end"),e.indentLine(r.line+1),e.indentLine(r.line+2),e.setCursor({line:r.line+1,ch:e.getLine(r.line+1).length})):(e.replaceSelection("</"+i+">"),e.setCursor(r))}function t(e,t,n){if(typeof t=="undefined"||t==null||t==1)t=e.getOption("closeTagIndent");return t||(t=[]),r(t,n.toLowerCase())!=-1}function n(e,t,n){if(e.getOption("mode")=="xml")return!0;if(typeof t=="undefined"||t==null)t=e.getOption("closeTagVoid");return t||(t=[]),r(t,n.toLowerCase())==-1}function r(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function i(e,t,n){e.replaceSelection("/"+n+">"),e.setCursor({line:t.line,ch:t.ch+n.length+2})}CodeMirror.defaults.closeTagEnabled=!0,CodeMirror.defaults.closeTagIndent=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"],CodeMirror.defaults.closeTagVoid=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],CodeMirror.defineExtension("closeTag",function(t,r,s,o){if(!t.getOption("closeTagEnabled"))throw CodeMirror.Pass;var u=t.getOption("mode");if(u=="text/html"||u=="xml"){var a=t.getCursor(),f=t.getTokenAt(a),l=f.state;if(l.mode&&l.mode!="html")throw CodeMirror.Pass;if(r==">"){var c=l.htmlState?l.htmlState.type:l.type;if(f.className=="tag"&&c=="closeTag")throw CodeMirror.Pass;t.replaceSelection(">"),a={line:a.line,ch:a.ch+1},t.setCursor(a),f=t.getTokenAt(t.getCursor()),l=f.state,c=l.htmlState?l.htmlState.type:l.type;if(f.className=="tag"&&c!="selfcloseTag"){var h=l.htmlState?l.htmlState.tagName:l.tagName;h.length>0&&n(t,o,h)&&e(t,s,a,h);return}t.setSelection({line:a.line,ch:a.ch-1},a),t.replaceSelection("")}else if(r=="/"&&f.className=="tag"&&f.string=="<"){var h=l.htmlState?l.htmlState.context?l.htmlState.context.tagName:"":l.context?l.context.tagName:"";if(h.length>0){i(t,a,h);return}}}throw CodeMirror.Pass})}(),function(){function t(t){e.push(t),e.length>50&&e.shift()}function n(){return e[e.length-1]||""}function r(){return e.length>1&&e.pop(),n()}var e=[];CodeMirror.keyMap.emacs={"Ctrl-X":function(e){e.setOption("keyMap","emacs-Ctrl-X")},"Ctrl-W":function(e){t(e.getSelection()),e.replaceSelection("")},"Ctrl-Alt-W":function(e){t(e.getSelection()),e.replaceSelection("")},"Alt-W":function(e){t(e.getSelection())},"Ctrl-Y":function(e){e.replaceSelection(n())},"Alt-Y":function(e){e.replaceSelection(r())},"Ctrl-/":"undo","Shift-Ctrl--":"undo","Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findNext","Ctrl-R":"findPrev","Ctrl-G":"clearSearch","Shift-Alt-5":"replace","Ctrl-Z":"undo","Cmd-Z":"undo","Alt-/":"autocomplete",fallthrough:["basic","emacsy"]},CodeMirror.keyMap["emacs-Ctrl-X"]={"Ctrl-S":"save","Ctrl-W":"save",S:"saveAll",F:"open",U:"undo",K:"close",auto:"emacs",nofallthrough:!0}}(),function(){function o(){n=""}function u(e){n+=e}function a(t){return function(n){e+=t}}function f(){var t=parseInt(e,10);return e="",t||1}function l(e){for(var t=0,n=f();t<n;++t)e(t,t==n-1)}function c(e){return typeof e=="string"&&(e=CodeMirror.commands[e]),function(t){l(function(){e(t)})}}function h(e,t){for(var n in e)e.hasOwnProperty(n)&&t(n,e[n])}function p(e,t){for(var n in e)t(e[n])}function d(e){return e.slice(0,6)=="Shift-"?e.slice(0,1):e=="Space"?" ":e.length==3&&e[0]=="'"&&e[2]=="'"?e[1]:e.toLowerCase()}function m(e){if(e==" ")return"Space";var t=v.indexOf(e);return t!=-1?"'"+e+"'":e.toLowerCase()==e?e.toUpperCase():"Shift-"+e.toUpperCase()}function b(e,t,n,r){var i=0,s=-1;n>0&&(i=e.length,s=0);var o=i,u=i;e:for(;t!=i;t+=n)for(var a=0;a<r.length;++a)if(r[a].test(e.charAt(t+s))){o=t;for(;t!=i;t+=n)if(!r[a].test(e.charAt(t+s)))break;u=t;break e}return{from:Math.min(o,u),to:Math.max(o,u)}}function w(e,t,n,r,i){var s=e.getCursor();for(var o=0;o<r;o++){var u=e.getLine(s.line),a=s.ch,f;for(;;){s.ch==u.length&&n>0?(s.line++,s.ch=0,u=e.getLine(s.line)):s.ch==0&&n<0&&(s.line--,s.ch=u.length,u=e.getLine(s.line));if(!u)break;f=b(u,s.ch,n,t),s.ch=f[i=="end"?"to":"from"];if(a!=s.ch||f.from==f.to)break;s.ch=f[n<0?"from":"to"]}}return s}function E(e){var t=e.getCursor(),n=t.ch,r=e.getLine(t.line);CodeMirror.commands.goLineEnd(e),t.line!=e.lineCount()&&(CodeMirror.commands.goLineEnd(e),e.replaceSelection(" ","end"),CodeMirror.commands.delCharRight(e))}function S(e,t){var n=i[t];if(n===undefined)return;var r=e.getCursor().line,s=n>r?r:n,o=n>r?n:r;e.setCursor(s);for(var a=s;a<=o;a++)u("\n"+e.getLine(s)),e.removeLine(s)}function x(e,t){var n=i[t];if(n===undefined)return;var r=e.getCursor().line,s=n>r?r:n,o=n>r?n:r;for(var a=s;a<=o;a++)u("\n"+e.getLine(a));e.setCursor(s)}function T(e){var t=e.getCursor(),n=e.getLine(t.line).search(/\S/);e.setCursor(t.line,n==-1?line.length:n,!0)}function N(e,t,n){var r=e.getCursor(),i=e.getLine(r.line),s,o=d(t),u=n;return u.forward?(s=i.indexOf(o,r.ch+1),s!=-1&&u.inclusive&&(s+=1)):(s=i.lastIndexOf(o,r.ch),s!=-1&&!u.inclusive&&(s+=1)),s}function C(e,t,n){var r=N(e,t,n),i=e.getCursor();r!=-1&&e.setCursor({line:i.line,ch:r})}function k(e,t,n){var r=N(e,t,n),i=e.getCursor();r!==-1&&(n.forward?e.replaceRange("",{line:i.line,ch:i.ch},{line:i.line,ch:r}):e.replaceRange("",{line:i.line,ch:r},{line:i.line,ch:i.ch}))}function L(e){f(),e.setOption("keyMap","vim-insert")}function A(e,t,n,r){e.openDialog?e.openDialog(t,r):r(prompt(n,""))}function O(e,t){e.openDialog?e.openDialog(CodeMirror.htmlEscape(t)+" <button type=button>OK</button>"):alert(t)}function _(t){t[0]=function(t){e.length>0?a("0")(t):CodeMirror.commands.goLineStart(t)};for(var n=1;n<10;++n)t[n]=a(n)}function P(e){CodeMirror.keyMap["vim-prefix-m"][e]=function(t){i[e]=t.getCursor().line},CodeMirror.keyMap["vim-prefix-d'"][e]=function(t){S(t,e)},CodeMirror.keyMap["vim-prefix-y'"][e]=function(t){x(t,e)},CodeMirror.keyMap["vim-prefix-r"][e]=function(t){var n=t.getCursor();t.replaceRange(d(e),{line:n.line,ch:n.ch},{line:n.line,ch:n.ch+1}),CodeMirror.commands.goColumnLeft(t)},h(D,function(t,n){CodeMirror.keyMap["vim-prefix-"+t][e]=function(t){C(t,e,n)},CodeMirror.keyMap["vim-prefix-d"+t][e]=function(t){k(t,e,n)},CodeMirror.keyMap["vim-prefix-c"+t][e]=function(t){k(t,e,n),L(t)}})}function j(e,t,n){var r=t.line,n=n?n:e.getLine(r)[t.ch],i=["(","[","{"].indexOf(n)!=-1,s=function(e){switch(e){case"(":return")";case"[":return"]";case"{":return"}";case")":return"(";case"]":return"[";case"}":return"{";default:return null}}(n);if(s==null)return t;var o=i?0:1;for(;;){if(r==t.line)var u=i?e.getLine(r).substr(t.ch).split(""):e.getLine(r).substr(0,t.ch).split("").reverse();else var u=i?e.getLine(r).split(""):e.getLine(r).split("").reverse();for(var a=0;a<u.length;a++){u[a]==n?o++:u[a]==s&&o--;if(o==0)return i&&t.line==r?{line:r,ch:a+t.ch}:i?{line:r,ch:a}:{line:r,ch:u.length-a-1}}i?r++:r--}}function F(e,t,n){var r=e.getCursor(),i=j(e,r,t),s=j(e,i);return s.ch+=n?1:0,i.ch+=n?0:1,{start:s,end:i}}function U(e,t,n){for(var r=n==null?e.length:n;r>=0;--r)if(t.test(e.charAt(r)))return r;return-1}function X(e,t,n,r,i){var s=W[t](e,i),o=s.start,a=s.end;if(o.line>a.line||o.line==a.line&&o.ch>a.ch)var f=!0;u(e.getRange(f?a:o,f?o:a)),n&&e.replaceRange("",f?a:o,f?o:a),r&&e.setOption("keyMap","vim-insert")}var e="",t="f",n="",r=0,i=[],s=0,v="~`!@#$%^&*()_-+=[{}]\\|/?.,<>:;\"'1234567890",g=[/\w/,/[^\w\s]/],y=[/\S/],M=CodeMirror.keyMap.vim={"'|'":function(e){e.setCursor(e.getCursor().line,f()-1,!0)},A:function(e){e.setCursor(e.getCursor().line,e.getCursor().ch+1,!0),L(e)},"Shift-A":function(e){CodeMirror.commands.goLineEnd(e),L(e)},I:function(e){L(e)},"Shift-I":function(e){T(e),L(e)},O:function(e){CodeMirror.commands.goLineEnd(e),CodeMirror.commands.newlineAndIndent(e),L(e)},"Shift-O":function(e){CodeMirror.commands.goLineStart(e),e.replaceSelection("\n","start"),e.indentLine(e.getCursor().line),L(e)},G:function(e){e.setOption("keyMap","vim-prefix-g")},"Shift-D":function(e){o(),i["Shift-D"]=e.getCursor(!1).line,e.setCursor(e.getCursor(!0).line),S(e,"Shift-D"),i=[]},S:function(e){c(function(e){CodeMirror.commands.delCharRight(e)})(e),L(e)},M:function(e){e.setOption("keyMap","vim-prefix-m"),i=[]},Y:function(e){e.setOption("keyMap","vim-prefix-y"),o(),r=0},"Shift-Y":function(e){o(),i["Shift-D"]=e.getCursor(!1).line,e.setCursor(e.getCursor(!0).line),x(e,"Shift-D"),i=[]},"/":function(e){var n=CodeMirror.commands.find;n&&n(e),t="f"},"'?'":function(e){var n=CodeMirror.commands.find;n&&(n(e),CodeMirror.commands.findPrev(e),t="r")},N:function(e){var n=CodeMirror.commands.findNext;n&&(t!="r"?n(e):CodeMirror.commands.findPrev(e))},"Shift-N":function(e){var n=CodeMirror.commands.findNext;n&&(t!="r"?CodeMirror.commands.findPrev(e):n.findNext(e))},"Shift-G":function(t){e==""?t.setCursor(t.lineCount()):t.setCursor(parseInt(e,10)-1),f(),CodeMirror.commands.goLineStart(t)},"':'":function(e){var t=': <input type="text" style="width: 90%"/>';A(e,t,":",function(t){t.match(/^\d+$/)?e.setCursor(t-1,e.getCursor().ch):O(e,"Bad command: "+t)})},nofallthrough:!0,style:"fat-cursor"};p(["d","t","T","f","F","c","r"],function(e){CodeMirror.keyMap.vim[m(e)]=function(t){t.setOption("keyMap","vim-prefix-"+e),o()}}),_(CodeMirror.keyMap.vim),h({Left:"goColumnLeft",Right:"goColumnRight",Down:"goLineDown",Up:"goLineUp",Backspace:"goCharLeft",Space:"goCharRight",X:function(e){CodeMirror.commands.delCharRight(e)},P:function(e){var t=e.getCursor().line;n!=""&&(n[0]=="\n"&&CodeMirror.commands.goLineEnd(e),e.replaceRange(n,e.getCursor()))},"Shift-X":function(e){CodeMirror.commands.delCharLeft(e)},"Shift-J":function(e){E(e)},"Shift-P":function(e){var t=e.getCursor().line;n!=""&&(CodeMirror.commands.goLineUp(e),CodeMirror.commands.goLineEnd(e),e.replaceSelection(n,"end")),e.setCursor(t+1)},"'~'":function(e){var t=e.getCursor(),n=e.getRange({line:t.line,ch:t.ch},{line:t.line,ch:t.ch+1});n=n!=n.toLowerCase()?n.toLowerCase():n.toUpperCase(),e.replaceRange(n,{line:t.line,ch:t.ch},{line:t.line,ch:t.ch+1}),e.setCursor(t.line,t.ch+1)},"Ctrl-B":function(e){CodeMirror.commands.goPageUp(e)},"Ctrl-F":function(e){CodeMirror.commands.goPageDown(e)},"Ctrl-P":"goLineUp","Ctrl-N":"goLineDown",U:"undo","Ctrl-R":"redo"},function(e,t){M[e]=c(t)}),p(["vim-prefix-d'","vim-prefix-y'","vim-prefix-df","vim-prefix-dF","vim-prefix-dt","vim-prefix-dT","vim-prefix-c","vim-prefix-cf","vim-prefix-cF","vim-prefix-ct","vim-prefix-cT","vim-prefix-","vim-prefix-f","vim-prefix-F","vim-prefix-t","vim-prefix-T","vim-prefix-r","vim-prefix-m"],function(e){CodeMirror.keyMap[e]={auto:"vim",nofallthrough:!0,style:"fat-cursor"}}),CodeMirror.keyMap["vim-prefix-g"]={E:c(function(e){e.setCursor(w(e,g,-1,1,"start"))}),"Shift-E":c(function(e){e.setCursor(w(e,y,-1,1,"start"))}),G:function(e){e.setCursor({line:0,ch:e.getCursor().ch})},auto:"vim",nofallthrough:!0,style:"fat-cursor"},CodeMirror.keyMap["vim-prefix-d"]={D:c(function(e){u("\n"+e.getLine(e.getCursor().line)),e.removeLine(e.getCursor().line),e.setOption("keyMap","vim")}),"'":function(e){e.setOption("keyMap","vim-prefix-d'"),o()},B:function(e){var t=e.getCursor(),n=e.getLine(t.line),r=n.lastIndexOf(" ",t.ch);u(n.substring(r,t.ch)),e.replaceRange("",{line:t.line,ch:r},t),e.setOption("keyMap","vim")},nofallthrough:!0,style:"fat-cursor"},_(CodeMirror.keyMap["vim-prefix-d"]),CodeMirror.keyMap["vim-prefix-c"]={B:function(e){c("delWordLeft")(e),L(e)},C:function(e){l(function(t,n){CodeMirror.commands.deleteLine(e),t&&(CodeMirror.commands.delCharRight(e),n&&CodeMirror.commands.deleteLine(e))}),L(e)},nofallthrough:!0,style:"fat-cursor"},p(["vim-prefix-d","vim-prefix-c","vim-prefix-"],function(e){p(["f","F","T","t"],function(t){CodeMirror.keyMap[e][m(t)]=function(n){n.setOption("keyMap",e+t),o()}})});var D={t:{inclusive:!1,forward:!0},f:{inclusive:!0,forward:!0},T:{inclusive:!1,forward:!1},F:{inclusive:!0,forward:!1}};for(var H=65;H<91;H++){var B=String.fromCharCode(H);P(m(B)),P(m(B.toLowerCase()))}p(v,function(e){P(m(e))}),P("Space"),CodeMirror.keyMap["vim-prefix-y"]={Y:c(function(e){u("\n"+e.getLine(e.getCursor().line+r)),r++}),"'":function(e){e.setOption("keyMap","vim-prefix-y'"),o()},nofallthrough:!0,style:"fat-cursor"},CodeMirror.keyMap["vim-insert"]={Esc:function(e){e.setCursor(e.getCursor().line,e.getCursor().ch-1,!0),e.setOption("keyMap","vim")},"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",fallthrough:["default"]};var I=["B","E","J","K","H","L","W","Shift-W","'^'","'$'","'%'","Esc"];motions={B:function(e,t){return w(e,g,-1,t)},"Shift-B":function(e,t){return w(e,y,-1,t)},E:function(e,t){return w(e,g,1,t,"end")},"Shift-E":function(e,t){return w(e,y,1,t,"end")},J:function(e,t){var n=e.getCursor();return{line:n.line+t,ch:n.ch}},K:function(e,t){var n=e.getCursor();return{line:n.line-t,ch:n.ch}},H:function(e,t){var n=e.getCursor();return{line:n.line,ch:n.ch-t}},L:function(e,t){var n=e.getCursor();return{line:n.line,ch:n.ch+t}},W:function(e,t){return w(e,g,1,t)},"Shift-W":function(e,t){return w(e,y,1,t)},"'^'":function(e,t){var n=e.getCursor(),r=e.getLine(n.line).split("");if(r.length==0)return n;for(var i=0;i<r.length;i++)if(r[i].match(/[^\s]/))return{line:n.line,ch:i}},"'$'":function(e){var t=e.getCursor(),n=e.getLine(t.line);return{line:t.line,ch:n.length}},"'%'":function(e){return j(e,e.getCursor())},Esc:function(e){return e.setOption("vim"),s=0,e.getCursor()}},I.forEach(function(e,t,n){CodeMirror.keyMap["vim-prefix-d"][e]=function(t){var n=t.getCursor(),r=motions[e](t,s?s:1);if(n.line>r.line||n.line==r.line&&n.ch>r.ch)var i=!0;u(t.getRange(i?r:n,i?n:r)),t.replaceRange("",i?r:n,i?n:r),s=0,t.setOption("keyMap","vim")},CodeMirror.keyMap["vim-prefix-c"][e]=function(t){var n=t.getCursor(),r=motions[e](t,s?s:1);if(n.line>r.line||n.line==r.line&&n.ch>r.ch)var i=!0;u(t.getRange(i?r:n,i?n:r)),t.replaceRange("",i?r:n,i?n:r),s=0,t.setOption("keyMap","vim-insert")},CodeMirror.keyMap["vim-prefix-y"][e]=function(t){var n=t.getCursor(),r=motions[e](t,s?s:1);if(n.line>r.line||n.line==r.line&&n.ch>r.ch)var i=!0;u(t.getRange(i?r:n,i?n:r)),s=0,t.setOption("keyMap","vim")},CodeMirror.keyMap.vim[e]=function(t){var n=motions[e](t,s?s:1);t.setCursor(n.line,n.ch),s=0}});var q=[1,2,3,4,5,6,7,8,9];q.forEach(function(e,t,n){CodeMirror.keyMap.vim[e]=function(t){s=s*10+e},CodeMirror.keyMap["vim-prefix-d"][e]=function(t){s=s*10+e},CodeMirror.keyMap["vim-prefix-y"][e]=function(t){s=s*10+e},CodeMirror.keyMap["vim-prefix-c"][e]=function(t){s=s*10+e}});var R=["d","y","c"];R.forEach(function(e,t,n){CodeMirror.keyMap["vim-prefix-"+e+"a"]={auto:"vim",nofallthrough:!0,style:"fat-cursor"},CodeMirror.keyMap["vim-prefix-"+e+"i"]={auto:"vim",nofallthrough:!0,style:"fat-cursor"},CodeMirror.keyMap["vim-prefix-"+e].A=function(t){s=0,t.setOption("keyMap","vim-prefix-"+e+"a")},CodeMirror.keyMap["vim-prefix-"+e].I=function(t){s=0,t.setOption("keyMap","vim-prefix-"+e+"i")}});var z=["W","Shift-[","Shift-9","["],W={W:function(e,t){var n=e.getCursor(),r=e.getLine(n.line),i=new String(r.substring(0,n.ch)),s=U(i,/[^a-zA-Z0-9]/)+1,o=motions.E(e,1);return o.ch+=t?1:0,{start:{line:n.line,ch:s},end:o}},"Shift-[":function(e,t){return F(e,"}",t)},"Shift-9":function(e,t){return F(e,")",t)},"[":function(e,t){return F(e,"]",t)}};for(var H=0;H<z.length;++H){var V=z[H];(function(e){CodeMirror.keyMap["vim-prefix-di"][e]=function(t){X(t,e,!0,!1,!1)},CodeMirror.keyMap["vim-prefix-da"][e]=function(t){X(t,e,!0,!1,!0)},CodeMirror.keyMap["vim-prefix-yi"][e]=function(t){X(t,e,!1,!1,!1)},CodeMirror.keyMap["vim-prefix-ya"][e]=function(t){X(t,e,!1,!1,!0)},CodeMirror.keyMap["vim-prefix-ci"][e]=function(t){X(t,e,!0,!0,!1)},CodeMirror.keyMap["vim-prefix-ca"][e]=function(t){X(t,e,!0,!0,!0)}})(V)}}()