!function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof define&&define.amd)return define([],a);this.CodeMirror=a()}}(function(){"use strict";function z(a,c){if(!(this instanceof z))return new z(a,c);this.options=c=c||{},zg(Yd,c,!1),M(c);var d=c.value;"string"==typeof d&&(d=new uf(d,c.mode)),this.doc=d;var e=this.display=new A(a,d);e.wrapper.CodeMirror=this,J(this),H(this),c.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),c.autofocus&&!r&&Pc(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new pg},b&&setTimeout(Ag(Oc,this,!0),20),Sc(this);var f=this;yc(this,function(){f.curOp.forceUpdate=!0,yf(f,d),c.autofocus&&!r||Lg()==e.input?setTimeout(Ag(td,f),20):ud(f);for(var a in Zd)Zd.hasOwnProperty(a)&&Zd[a](f,c[a],_d);for(var b=0;bb.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function M(a){var b=wg(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function N(a){var b=a.display.scroller;return{clientHeight:b.clientHeight,barHeight:a.display.scrollbarV.clientHeight,scrollWidth:b.scrollWidth,clientWidth:b.clientWidth,barWidth:a.display.scrollbarH.clientWidth,docHeight:Math.round(a.doc.height+Wb(a.display))}}function O(a,b){b||(b=N(a));var c=a.display,d=b.docHeight+kg,e=b.scrollWidth>b.clientWidth,f=d>b.clientHeight;if(f?(c.scrollbarV.style.display="block",c.scrollbarV.style.bottom=e?Og(c.measure)+"px":"0",c.scrollbarV.firstChild.style.height=Math.max(0,d-b.clientHeight+(b.barHeight||c.scrollbarV.clientHeight))+"px"):(c.scrollbarV.style.display="",c.scrollbarV.firstChild.style.height="0"),e?(c.scrollbarH.style.display="block",c.scrollbarH.style.right=f?Og(c.measure)+"px":"0",c.scrollbarH.firstChild.style.width=b.scrollWidth-b.clientWidth+(b.barWidth||c.scrollbarH.clientWidth)+"px"):(c.scrollbarH.style.display="",c.scrollbarH.firstChild.style.width="0"),e&&f?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=c.scrollbarFiller.style.width=Og(c.measure)+"px"):c.scrollbarFiller.style.display="",e&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=Og(c.measure)+"px",c.gutterFiller.style.width=c.gutters.offsetWidth+"px"):c.gutterFiller.style.display="",n&&0===Og(c.measure)){c.scrollbarV.style.minWidth=c.scrollbarH.style.minHeight=o?"18px":"12px";var g=function(b){$f(b)!=c.scrollbarV&&$f(b)!=c.scrollbarH&&zc(a,Vc)(b)};ag(c.scrollbarV,"mousedown",g),ag(c.scrollbarH,"mousedown",g)}}function P(a,b,c){var d=c&&null!=c.top?c.top:a.scroller.scrollTop;d=Math.floor(d-Vb(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=Ef(b,d),g=Ef(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;if(f>h)return{from:h,to:Ef(b,Ff(zf(b,h))+a.wrapper.clientHeight)};if(Math.min(i,b.lastLine())>=g)return{from:Ef(b,Ff(zf(b,i))-a.wrapper.clientHeight),to:i}}return{from:f,to:g}}function Q(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=T(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g=a.display.viewFrom&&g.to<=a.display.viewTo)break}return a.display.updateLineNumbers=null,f&&(fg(a,"update",a),(a.display.viewFrom!=d||a.display.viewTo!=e)&&fg(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo)),f}function V(a,b,c){var d=a.display,e=a.doc;if(!d.wrapper.offsetWidth)return Gc(a),void 0;if(!(!c&&b.from>=d.viewFrom&&b.to<=d.viewTo&&0==Kc(a))){R(a)&&Gc(a);var f=$(a),g=e.first+e.size,h=Math.max(b.from-a.options.viewportMargin,e.first),i=Math.min(g,b.to+a.options.viewportMargin);d.viewFromi&&d.viewTo-i<20&&(i=Math.min(g,d.viewTo)),y&&(h=Re(a.doc,h),i=Se(a.doc,i));var j=h!=d.viewFrom||i!=d.viewTo||d.lastSizeC!=d.wrapper.clientHeight;Jc(a,h,i),d.viewOffset=Ff(zf(a.doc,d.viewFrom)),a.display.mover.style.top=d.viewOffset+"px";var k=Kc(a);if(j||0!=k||c){var l=Lg();return k>4&&(d.lineDiv.style.display="none"),_(a,d.updateLineNumbers,f),k>4&&(d.lineDiv.style.display=""),l&&Lg()!=l&&l.offsetHeight&&l.focus(),Ig(d.cursorDiv),Ig(d.selectionDiv),j&&(d.lastSizeC=d.wrapper.clientHeight,Rb(a,400)),Y(a),!0}}}function W(a){var b=a.display,c=_b(a,b.maxLine,b.maxLine.text.length).left;b.maxLineChanged=!1;var d=Math.max(0,c+3),e=Math.max(0,b.sizer.offsetLeft+d+kg-b.scroller.clientWidth);b.sizer.style.minWidth=d+"px",eg&&(g=tc(b)),(j>.001||-.001>j)&&(Cf(f.line,g),Z(f.line),f.rest))for(var k=0;k=b&&m.lineNumber;m.changes&&(wg(m.changes,"gutter")>-1&&(o=!1),ab(a,m,k,c)),o&&(Ig(m.lineNumber),m.lineNumber.appendChild(document.createTextNode(S(a.options,k)))),g=m.node.nextSibling}else{var n=ib(a,m,k,c);f.insertBefore(n,g)}k+=m.size}for(;g;)g=i(g)}function ab(a,b,c,d){for(var e=0;e=0){var g=qb(f.from(),e.from()),h=pb(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new sb(i?h:g,i?g:h))}}return new rb(a,b)}function ub(a,b){return new rb([new sb(a,b||a)],0)}function vb(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function wb(a,b){if(b.linec?mb(c,zf(a,c).text.length):xb(b,zf(a,b.line).text.length)}function xb(a,b){var c=a.ch;return null==c||c>b?mb(a.line,b):0>c?mb(a.line,0):a}function yb(a,b){return b>=a.first&&b=f.ch:j.to>f.ch))){if(d&&(cg(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find(0>g?-1:1);if(0==nb(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?wb(a,mb(l.line-1)):null:l.ch>h.text.length&&(l=l.lineb&&(b=0),f.appendChild(Gg("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?i-a:c)+"px; height: "+(d-b)+"px"))}function k(b,c,d){function m(c,d){return mc(a,mb(b,c),"div",f,d)}var k,l,f=zf(e,b),g=f.text.length;return Xg(Gf(f),c||0,null==d?g:d,function(a,b,e){var n,o,p,f=m(a,"left");if(a==b)n=f,o=p=f.left;else{if(n=m(b-1,"right"),"rtl"==e){var q=f;f=n,n=q}o=f.left,p=n.right}null==c&&0==a&&(o=h),n.top-f.top>3&&(j(o,f.top,null,f.bottom),o=h,f.bottoml.bottom||n.bottom==l.bottom&&n.right>l.right)&&(l=n),h+1>o&&(o=h),j(o,n.top,p-o,n.bottom)}),{start:k,end:l}}var d=a.display,e=a.doc,f=document.createDocumentFragment(),g=Xb(a.display),h=g.left,i=d.lineSpace.offsetWidth-g.right,l=b.from(),m=b.to();if(l.line==m.line)k(l.line,l.ch,m.ch);else{var n=zf(e,l.line),o=zf(e,m.line),p=Pe(n)==Pe(o),q=k(l.line,l.ch,p?n.text.length+1:null).end,r=k(m.line,p?0:null,m.ch).start;p&&(q.top0&&(b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate))}}function Rb(a,b){a.doc.mode.startState&&a.doc.frontier=a.display.viewTo)){var c=+new Date+a.options.workTime,d=fe(b.mode,Ub(a,b.frontier));yc(a,function(){b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(e){if(b.frontier>=a.display.viewFrom){var f=e.styles;e.styles=bf(a,e,d,!0);for(var g=!f||f.length!=e.styles.length,h=0;!g&&hc?(Rb(a,a.options.workDelay),!0):void 0})})}}function Tb(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=zf(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=qg(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function Ub(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Tb(a,b,c),g=f>d.first&&zf(d,f-1).stateAfter;return g=g?fe(d.mode,g):ge(d.mode),d.iter(f,b,function(c){df(a,c.text,g);var h=f==b-1||0==f%5||f>=e.viewFrom&&f2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Zb(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;dc)return{map:a.measure.maps[d],cache:a.measure.caches[d],before:!0}}function $b(a,b){b=Pe(b);var c=Df(b),d=a.display.externalMeasured=new Cc(a.doc,b,c);d.lineN=c;var e=d.built=hf(a,d);return d.text=e.pre,Jg(a.display.lineMeasure,e.pre),d}function _b(a,b,c,d){return cc(a,bc(a,b),c,d)}function ac(a,b){if(b>=a.display.viewFrom&&b=c.lineN&&bc?(i=0,j=1,k="left"):n>c?(i=c-m,j=i+1):(l==f.length-3||c==n&&f[l+3]>c)&&(j=n-m,i=j-1,c>=n&&(k="right")),null!=i){if(h=f[l+2],m==n&&e==(h.insertLeft?"left":"right")&&(k=e),"left"==e&&0==i)for(;l&&f[l-2]==f[l-3]&&f[l-1].insertLeft;)h=f[(l-=3)+2],k="left";if("right"==e&&i==n-m)for(;lm+j&&Fg(b.line.text.charAt(m+j));)++j;if(d&&0==i&&j==n-m)o=h.parentNode.getBoundingClientRect();else if(g&&a.options.lineWrapping){var p=Hg(h,i,j).getClientRects();o=p.length?p["right"==e?p.length-1:0]:dc}else o=Hg(h,i,j).getBoundingClientRect()}else{i>0&&(k=e="right");var p;o=a.options.lineWrapping&&(p=h.getClientRects()).length>1?p["right"==e?p.length-1:0]:h.getBoundingClientRect()}if(d&&!i&&(!o||!o.left&&!o.right)){var q=h.parentNode.getClientRects()[0];o=q?{left:q.left,right:q.left+uc(a.display),top:q.top,bottom:q.bottom}:dc}for(var r,s=(o.bottom+o.top)/2-b.rect.top,t=b.view.measure.heights,l=0;lc.from?f(a-1):f(a,d)}d=d||zf(a.doc,b.line),e||(e=bc(a,d));var h=Gf(d),i=b.ch;if(!h)return f(i);var j=eh(h,i),k=g(i,j);return null!=dh&&(k.other=g(i,dh)),k}function oc(a,b){var c=0,b=wb(a.doc,b);a.options.lineWrapping||(c=uc(a.display)*b.ch);var d=zf(a.doc,b.line),e=Ff(d)+Vb(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function pc(a,b,c,d){var e=mb(a,b);return e.xRel=d,c&&(e.outside=!0),e}function qc(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return pc(d.first,0,!0,-1);var e=Ef(d,c),f=d.first+d.size-1;if(e>f)return pc(d.first+d.size-1,zf(d,f).text.length,!0,1);0>b&&(b=0);for(var g=zf(d,e);;){var h=rc(a,g,e,b,c),i=Ne(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=Df(g=j.to.line)}}function rc(a,b,c,d,e){function j(d){var e=nc(a,mb(c,d),"line",b,i);return g=!0,f>e.bottom?e.left-h:fq)return pc(c,n,r,1);for(;;){if(k?n==m||n==gh(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);Fg(b.text.charAt(s));)++s;var u=pc(c,s,s==m?p:r,-1>t?-1:t>1?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=gh(b,w,1)}var y=j(w);y>d?(n=w,q=y,(r=g)&&(q+=1e3),l=v):(m=w,o=y,p=g,l-=v)}}function tc(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==sc){sc=Gg("pre");for(var b=0;49>b;++b)sc.appendChild(document.createTextNode("x")),sc.appendChild(Gg("br"));sc.appendChild(document.createTextNode("x"))}Jg(a.measure,sc);var c=sc.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Ig(a.measure),c||1}function uc(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Gg("span","xxxxxxxxxx"),c=Gg("pre",[b]);Jg(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function wc(a){a.curOp={viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,origin:null,cursorActivity:!1,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++vc},eg++||(dg=[])}function xc(a){var b=a.curOp,c=a.doc,d=a.display;if(a.curOp=null,b.updateMaxLine&&L(a),b.viewChanged||b.forceUpdate||null!=b.scrollTop||b.scrollToPos&&(b.scrollToPos.from.line=d.viewTo)||d.maxLineChanged&&a.options.lineWrapping){var e=U(a,{top:b.scrollTop,ensure:b.scrollToPos},b.forceUpdate);a.display.scroller.offsetHeight&&(a.doc.scrollTop=a.display.scroller.scrollTop)}if(!e&&b.selectionChanged&&Nb(a),e||b.startHeight==a.doc.height||O(a),null!=b.scrollTop&&d.scroller.scrollTop!=b.scrollTop){var f=Math.max(0,Math.min(d.scroller.scrollHeight-d.scroller.clientHeight,b.scrollTop));d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=f}if(null!=b.scrollLeft&&d.scroller.scrollLeft!=b.scrollLeft){var g=Math.max(0,Math.min(d.scroller.scrollWidth-d.scroller.clientWidth,b.scrollLeft));d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=g,Q(a)}if(b.scrollToPos){var h=Md(a,wb(a.doc,b.scrollToPos.from),wb(a.doc,b.scrollToPos.to),b.scrollToPos.margin);b.scrollToPos.isCursor&&a.state.focused&&Ld(a,h)}b.selectionChanged&&Qb(a),a.state.focused&&b.updateInput&&Oc(a,b.typing);var i=b.maybeHiddenMarkers,j=b.maybeUnhiddenMarkers;if(i)for(var k=0;kf;f=e){var g=new Cc(a.doc,zf(a.doc,f),f);e=f+g.size,d.push(g)}return d}function Ec(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0); var e=a.display;if(d&&cb)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)y&&Re(a.doc,b)e.viewFrom?Gc(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Gc(a);else if(b<=e.viewFrom){var f=Ic(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Gc(a)}else if(c>=e.viewTo){var f=Ic(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Gc(a)}else{var g=Ic(a,b,b,-1),h=Ic(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(Dc(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):Gc(a)}var i=e.externalMeasured;i&&(c=e.lineN&&b=d.viewTo)){var f=d.view[Hc(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==wg(g,c)&&g.push(c)}}}function Gc(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function Hc(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;db)return d}function Ic(a,b,c,d){var f,e=Hc(a,b),g=a.display.view;if(!y)return{index:e,lineN:c};for(var h=0,i=a.display.viewFrom;e>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(e==g.length-1)return null;f=i+g[e].size-b,e++}else f=i-b;b+=f,c+=f}for(;Re(a.doc,c)!=c;){if(e==(0>d?0:g.length-1))return null;c+=d*g[e-(0>d?1:0)].size,e+=d}return{index:e,lineN:c}}function Jc(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=Dc(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=Dc(a,b,d.viewFrom).concat(d.view):d.viewFromc&&(d.view=d.view.slice(0,Hc(a,c)))),d.viewTo=c}function Kc(a){for(var b=a.display.view,c=0,d=0;di&&c.charCodeAt(i)==f.charCodeAt(i);)++i;for(var k=f.slice(i),l=Tg(k),m=a.state.pasteIncoming&&l.length>1&&e.sel.ranges.length==l.length,n=e.sel.ranges.length-1;n>=0;n--){var o=e.sel.ranges[n],p=o.from(),q=o.to();i-1){Sd(a,o.head.line,"smart");break}}}return Qd(a),a.curOp.updateInput=r,a.curOp.typing=!0,f.length>1e3||f.indexOf("\n")>-1?b.value=a.display.prevInput="":a.display.prevInput=f,h&&xc(a),a.state.pasteIncoming=a.state.cutIncoming=!1,!0}function Oc(a,b){var c,e,f=a.doc;if(a.somethingSelected()){a.display.prevInput="";var h=f.sel.primary();c=Vg&&(h.to().line-h.from().line>100||(e=a.getSelection()).length>1e3);var i=c?"-":e||a.getSelection();a.display.input.value=i,a.state.focused&&vg(a.display.input),g&&!d&&(a.display.inputHasSelection=i)}else b||(a.display.prevInput=a.display.input.value="",g&&!d&&(a.display.inputHasSelection=null));a.display.inaccurateSelection=c}function Pc(a){"nocursor"==a.options.readOnly||r&&Lg()==a.display.input||a.display.input.focus()}function Qc(a){a.state.focused||(Pc(a),td(a))}function Rc(a){return a.options.readOnly||a.doc.cantEdit}function Sc(a){function e(){a.state.focused&&setTimeout(Ag(Pc,a),0)}function h(){null==f&&(f=setTimeout(function(){f=null,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=Ng=null,a.setSize()},100))}function i(){Kg(document.body,c.wrapper)?setTimeout(i,5e3):bg(window,"resize",h)}function j(b){hg(a,b)||Zf(b)}function k(b){if(a.somethingSelected())c.inaccurateSelection&&(c.prevInput="",c.inaccurateSelection=!1,c.input.value=a.getSelection(),vg(c.input));else{for(var d="",e=[],f=0;fd-400&&0==nb(Xc.pos,c)?e="triple":Wc&&Wc.time>d-400&&0==nb(Wc.pos,c)?(e="double",Xc={time:d,pos:c}):(e="single",Wc={time:d,pos:c});var f=a.doc.sel,g=s?b.metaKey:b.ctrlKey;a.options.dragDrop&&Mg&&!g&&!Rc(a)&&"single"==e&&f.contains(c)>-1&&f.somethingSelected()?Zc(a,b,c):$c(a,b,c,e,g)}function Zc(a,c,e){var f=a.display,g=zc(a,function(i){h&&(f.scroller.draggable=!1),a.state.draggingText=!1,bg(document,"mouseup",g),bg(f.scroller,"drop",g),Math.abs(c.clientX-i.clientX)+Math.abs(c.clientY-i.clientY)<10&&(Wf(i),Bb(a.doc,e),Pc(a),b&&!d&&setTimeout(function(){document.body.focus(),Pc(a)},20))});h&&(f.scroller.draggable=!0),a.state.draggingText=g,f.scroller.dragDrop&&f.scroller.dragDrop(),ag(document,"mouseup",g),ag(f.scroller,"drop",g)}function $c(a,b,c,d,f){function p(b){if(0!=nb(o,b))if(o=b,"rect"==d){for(var e=[],f=a.options.tabSize,g=qg(zf(i,c.line).text,c.ch,f),h=qg(zf(i,b.line).text,b.ch,f),m=Math.min(g,h),n=Math.max(g,h),p=Math.min(c.line,b.line),q=Math.min(a.lastLine(),Math.max(c.line,b.line));q>=p;p++){var r=zf(i,p).text,s=rg(r,m,f);m==n?e.push(new sb(mb(p,s),mb(p,s))):r.length>s&&e.push(new sb(mb(p,s),mb(p,rg(r,n,f))))}e.length||e.push(new sb(c,c)),Hb(i,tb(l.ranges.slice(0,k).concat(e),k),ng)}else{var t=j,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=Xd(i,b);else var w=new sb(mb(b.line,0),wb(i,mb(b.line+1,0)));nb(w.anchor,u)>0?(v=w.head,u=qb(t.from(),w.anchor)):(v=w.anchor,u=pb(t.to(),w.head))}var e=l.ranges.slice(0);e[k]=new sb(wb(i,u),v),Hb(i,tb(e,k),ng)}}function s(b){var c=++r,e=Uc(a,b,!0,"rect"==d);if(e)if(0!=nb(e,o)){Qc(a),p(e);var f=P(h,i);(e.line>=f.to||e.lineq.bottom?20:0;g&&setTimeout(zc(a,function(){r==c&&(h.scroller.scrollTop+=g,s(b))}),50)}}function t(b){r=1/0,Wf(b),Pc(a),bg(document,"mousemove",u),bg(document,"mouseup",v),i.history.lastSelOrigin=null}var h=a.display,i=a.doc;Wf(b);var j,k,l=i.sel;if(f?(k=i.sel.contains(c),j=k>-1?i.sel.ranges[k]:new sb(c,c)):j=i.sel.primary(),b.altKey)d="rect",f||(j=new sb(c,c)),c=Uc(a,b,!0,!0),k=-1;else if("double"==d){var m=Xd(i,c);j=a.display.shift||i.extend?Ab(i,j,m.anchor,m.head):m}else if("triple"==d){var n=new sb(mb(c.line,0),wb(i,mb(c.line+1,0)));j=a.display.shift||i.extend?Ab(i,j,n.anchor,n.head):n}else j=Ab(i,j,c);f?k>-1?Db(i,k,j,ng):(k=i.sel.ranges.length,Hb(i,tb(i.sel.ranges.concat([j]),k),{scroll:!1,origin:"*mouse"})):(k=0,Hb(i,new rb([j],0),ng));var o=c,q=h.wrapper.getBoundingClientRect(),r=0,u=zc(a,function(a){(g&&!e?a.buttons:_f(a))?s(a):t(a)}),v=zc(a,t);ag(document,"mousemove",u),ag(document,"mouseup",v)}function _c(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&Wf(b);var h=a.display,i=h.lineDiv.getBoundingClientRect();if(g>i.bottom||!ig(a,c))return Yf(b);g-=i.top-h.viewOffset;for(var j=0;j=f){var l=Ef(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),Yf(b)}}}function ad(a,b){return _c(a,b,"gutterClick",!0,fg)}function cd(a){var c=this;if(!hg(c,a)&&!Tc(c.display,a)){Wf(a),b&&(bd=+new Date);var d=Uc(c,a,!0),e=a.dataTransfer.files;if(d&&!Rc(c))if(e&&e.length&&window.FileReader&&window.File)for(var f=e.length,g=Array(f),h=0,i=function(a,b){var e=new FileReader;e.onload=zc(c,function(){if(g[b]=e.result,++h==f){d=wb(c.doc,d);var a={from:d,to:d,text:Tg(g.join("\n")),origin:"paste"};Ed(c.doc,a),Gb(c.doc,ub(d,yd(a)))}}),e.readAsText(a)},j=0;f>j;++j)i(e[j],j);else{if(c.state.draggingText&&c.doc.sel.contains(d)>-1)return c.state.draggingText(a),setTimeout(Ag(Pc,c),20),void 0;try{var g=a.dataTransfer.getData("Text");if(g){var k=c.state.draggingText&&c.listSelections();if(Ib(c.doc,ub(d,d)),k)for(var j=0;jg.clientWidth||e&&g.scrollHeight>g.clientHeight){if(e&&s&&h)a:for(var i=c.target,j=f.view;i!=g;i=i.parentNode)for(var l=0;lm?n=Math.max(0,n+m-50):o=Math.min(b.doc.height,o+m+50),U(b,{top:n,bottom:o})}20>gd&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout(function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(hd=(hd*gd+c)/(gd+1),++gd)}},200)):(f.wheelDX+=d,f.wheelDY+=e))}}function jd(a,b,c){if("string"==typeof b&&(b=he[b],!b))return!1;a.display.pollingFast&&Nc(a)&&(a.display.pollingFast=!1);var d=a.display.shift,e=!1;try{Rc(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=lg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function kd(a){var b=a.state.keyMaps.slice(0);return a.options.extraKeys&&b.push(a.options.extraKeys),b.push(a.options.keyMap),b}function md(a,b){var c=je(a.options.keyMap),d=c.auto;clearTimeout(ld),d&&!le(b)&&(ld=setTimeout(function(){je(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d,G(a))},50));var e=me(b,!0),f=!1;if(!e)return!1;var g=kd(a);return f=b.shiftKey?ke("Shift-"+e,g,function(b){return jd(a,b,!0)})||ke(e,g,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?jd(a,b):void 0}):ke(e,g,function(b){return jd(a,b)}),f&&(Wf(b),Qb(a),fg(a,"keyHandled",a,e,b)),f}function nd(a,b,c){var d=ke("'"+c+"'",kd(a),function(b){return jd(a,b,!0)});return d&&(Wf(b),Qb(a),fg(a,"keyHandled",a,"'"+c+"'",b)),d}function pd(a){var c=this;if(Qc(c),!hg(c,a)){b&&27==a.keyCode&&(a.returnValue=!1);var d=a.keyCode;c.display.shift=16==d||a.shiftKey;var e=md(c,a);k&&(od=e?d:null,!e&&88==d&&!Vg&&(s?a.metaKey:a.ctrlKey)&&c.replaceSelection("",null,"cut")),18!=d||/\bCodeMirror-crosshair\b/.test(c.display.lineDiv.className)||qd(c)}}function qd(a){function c(a){18!=a.keyCode&&a.altKey||(b.className=b.className.replace(" CodeMirror-crosshair",""),bg(document,"keyup",c),bg(document,"mouseover",c))}var b=a.display.lineDiv;b.className+=" CodeMirror-crosshair",ag(document,"keyup",c),ag(document,"mouseover",c)}function rd(a){hg(this,a)||16==a.keyCode&&(this.doc.sel.shift=!1)}function sd(a){var b=this;if(!hg(b,a)){var c=a.keyCode,e=a.charCode;if(k&&c==od)return od=null,Wf(a),void 0;if(!(k&&(!a.which||a.which<10)||m)||!md(b,a)){var f=String.fromCharCode(null==e?c:e);nd(b,a,f)||(g&&!d&&(b.display.inputHasSelection=null),Mc(b))}}}function td(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(cg(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=" CodeMirror-focused"),a.curOp||(Oc(a),h&&setTimeout(Ag(Oc,a,!0),0))),Lc(a),Qb(a))}function ud(a){a.state.focused&&(cg(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150)}function wd(a,b){function j(){if(null!=c.input.selectionStart){var b=c.input.value="\u200b"+(a.somethingSelected()?c.input.value:"");c.prevInput="\u200b",c.input.selectionStart=1,c.input.selectionEnd=b.length}}function l(){if(c.inputDiv.style.position="relative",c.input.style.cssText=i,d&&(c.scrollbarV.scrollTop=c.scroller.scrollTop=f),Lc(a),null!=c.input.selectionStart){(!g||d)&&j(),clearTimeout(vd);var b=0,e=function(){"\u200b"==c.prevInput&&0==c.input.selectionStart?zc(a,he.selectAll)(a):b++<10?vd=setTimeout(e,500):Oc(a)};vd=setTimeout(e,200)}}if(!hg(a,b,"contextmenu")){var c=a.display;if(!Tc(c,b)&&!xd(a,b)){var e=Uc(a,b),f=c.scroller.scrollTop;if(e&&!k){var h=a.options.resetSelectionOnContextMenu;h&&-1==a.doc.sel.contains(e)&&zc(a,Hb)(a.doc,ub(e),mg);var i=c.input.style.cssText;if(c.inputDiv.style.position="absolute",c.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: "+(g?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Pc(a),Oc(a),a.somethingSelected()||(c.input.value=c.prevInput=" "),g&&!d&&j(),w){Zf(b);var m=function(){bg(window,"mouseup",m),setTimeout(l,20)};ag(window,"mouseup",m)}else setTimeout(l,50)}}}}function xd(a,b){return ig(a,"gutterContextMenu")?_c(a,b,"gutterContextMenu",!1,cg):!1}function zd(a,b){if(nb(a,b.from)<0)return a;if(nb(a,b.to)<=0)return yd(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=yd(b).ch-b.to.ch),mb(c,d)}function Ad(a,b){for(var c=[],d=0;d=0;--e)Fd(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else Fd(a,b)}}function Fd(a,b){if(1!=b.text.length||""!=b.text[0]||0!=nb(b.from,b.to)){var c=Ad(a,b);Lf(a,b,c,a.cm?a.cm.curOp.id:0/0),Id(a,b,c,Ce(a,b));var d=[];xf(a,function(a,c){c||-1!=wg(d,a.history)||(Vf(a.history,b),d.push(a.history)),Id(a,b,null,Ce(a,b))})}}function Gd(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var e,d=a.history,f=a.sel,g="undo"==b?d.done:d.undone,h="undo"==b?d.undone:d.done,i=0;i=0;--i){var l=e.changes[i];if(l.origin=b,k&&!Dd(a,l,!1))return g.length=0,void 0;j.push(If(a,l));var m=i?Ad(a,l,null):ug(g);Id(a,l,m,Ee(a,l)),a.cm&&Qd(a.cm);var n=[];xf(a,function(a,b){b||-1!=wg(n,a.history)||(Vf(a.history,l),n.push(a.history)),Id(a,l,null,Ee(a,l))})}}}}function Hd(a,b){a.first+=b,a.sel=new rb(xg(a.sel.ranges,function(a){return new sb(mb(a.anchor.line+b,a.anchor.ch),mb(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm&&Ec(a.cm,a.first,a.first-b,b)}function Id(a,b,c,d){if(a.cm&&!a.cm.curOp)return zc(a.cm,Id)(a,b,c,d);if(b.to.linea.lastLine())){if(b.from.linef&&(b={from:b.from,to:mb(f,zf(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=Af(a,b.from,b.to),c||(c=Ad(a,b,null)),a.cm?Jd(a.cm,b,d):qf(a,b,d),Ib(a,c,mg)}}function Jd(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,i=f.line;a.options.lineWrapping||(i=Df(Pe(zf(d,f.line))),d.iter(i,g.line+1,function(a){return a==e.maxLine?(h=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&(a.curOp.cursorActivity=!0),qf(d,b,c,E(a)),a.options.lineWrapping||(d.iter(i,f.line+b.text.length,function(a){var b=K(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)}),h&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,f.line),Rb(a,400);var j=b.text.length-(g.line-f.line)-1;f.line!=g.line||1!=b.text.length||pf(a.doc,b)?Ec(a,f.line,g.line+1,j):Fc(a,f.line,"text"),(ig(a,"change")||ig(a,"changes"))&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push({from:f,to:g,text:b.text,removed:b.removed,origin:b.origin})}function Kd(a,b,c,d,e){if(d||(d=c),nb(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=Tg(b)),Ed(a,{from:c,to:d,text:b,origin:e})}function Ld(a,b){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!p){var f=Gg("div","\u200b",null,"position: absolute; top: "+(b.top-c.viewOffset-Vb(a.display))+"px; height: "+(b.bottom-b.top+kg)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}function Md(a,b,c,d){for(null==d&&(d=0);;){var e=!1,f=nc(a,b),g=c&&c!=b?nc(a,c):f,h=Od(a,Math.min(f.left,g.left),Math.min(f.top,g.top)-d,Math.max(f.left,g.left),Math.max(f.bottom,g.bottom)+d),i=a.doc.scrollTop,j=a.doc.scrollLeft;if(null!=h.scrollTop&&(ed(a,h.scrollTop),Math.abs(a.doc.scrollTop-i)>1&&(e=!0)),null!=h.scrollLeft&&(fd(a,h.scrollLeft),Math.abs(a.doc.scrollLeft-j)>1&&(e=!0)),!e)return f}}function Nd(a,b,c,d,e){var f=Od(a,b,c,d,e);null!=f.scrollTop&&ed(a,f.scrollTop),null!=f.scrollLeft&&fd(a,f.scrollLeft)}function Od(a,b,c,d,e){var f=a.display,g=tc(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=f.scroller.clientHeight-kg,j={},k=a.doc.height+Wb(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=f.scroller.clientWidth-kg;b+=f.gutters.offsetWidth,d+=f.gutters.offsetWidth;var q=f.gutters.offsetWidth,r=q+10>b;return o+q>b||r?(r&&(b=0),j.scrollLeft=Math.max(0,b-10-q)):d>p+o-3&&(j.scrollLeft=d+10-p),j}function Pd(a,b,c){(null!=b||null!=c)&&Rd(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b),null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Qd(a){Rd(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?mb(b.line,b.ch-1):b,d=mb(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Rd(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=oc(a,b.from),d=oc(a,b.to),e=Od(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(e.scrollLeft,e.scrollTop)}}function Sd(a,b,c,d){var f,e=a.doc;null==c&&(c="add"),"smart"==c&&(a.doc.mode.indent?f=Ub(a,b):c="prev");var g=a.options.tabSize,h=zf(e,b),i=qg(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var k,j=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(k=a.doc.mode.indent(f,h.text.slice(j.length),h.text),k==lg)){if(!d)return;c="prev"}}else k=0,c="not";"prev"==c?k=b>e.first?qg(zf(e,b-1).text,null,g):0:"add"==c?k=i+a.options.indentUnit:"subtract"==c?k=i-a.options.indentUnit:"number"==typeof c&&(k=i+c),k=Math.max(0,k);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(k/g);n;--n)m+=g,l+=" ";if(k>m&&(l+=tg(k-m)),l!=j)Kd(a.doc,l,mb(b,0),mb(b,j.length),"+input");else for(var n=0;n=0;b--)Kd(a.doc,"",d[b].from,d[b].to,"+delete");Qd(a)})}function Vd(a,b,c,d,e){function k(){var b=f+c;return b=a.first+a.size?j=!1:(f=b,i=zf(a,b))}function l(a){var b=(e?gh:hh)(i,g,c,!0);if(null==b){if(a||!k())return j=!1;g=e?(0>c?_g:$g)(i):0>c?i.text.length:0}else g=b;return!0}var f=b.line,g=b.ch,h=c,i=zf(a,f),j=!0;if("char"==d)l();else if("column"==d)l(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=!0;!(0>c)||l(!o);o=!1){var p=i.text.charAt(g)||"\n",q=Cg(p)?"w":n&&"\n"==p?"n":!n||/\s/.test(p)?null:"p";if(!n||o||q||(q="s"),m&&m!=q){0>c&&(c=1,l());break}if(q&&(m=q),c>0&&!l(!o))break}var r=Mb(a,mb(f,g),h,!0);return j||(r.hitSide=!0),r}function Wd(a,b,c,d){var g,e=a.doc,f=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);g=b.top+c*(h-(0>c?1.5:.5)*tc(a.display))}else"line"==d&&(g=c>0?b.bottom+3:b.top-3);for(;;){var i=qc(a,f,g);if(!i.outside)break;if(0>c?0>=g:g>=e.height){i.hitSide=!0;break}g+=5*c}return i}function Xd(a,b){var c=zf(a,b.line).text,d=b.ch,e=b.ch;if(c){(b.xRel<0||e==c.length)&&d?--d:++e;for(var f=c.charAt(d),g=Cg(f)?Cg:/\s/.test(f)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!Cg(a)};d>0&&g(c.charAt(d-1));)--d;for(;e0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Gg("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.widgetNode.ignoreEvents=!0),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(Oe(a,b.line,b,c,f)||b.line!=c.line&&Oe(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");y=!0}f.addToHistory&&Lf(a,{from:b,to:c,origin:"markText"},a.sel,0/0);var j,h=b.line,i=a.cm;if(a.iter(h,c.line+1,function(a){i&&f.collapsed&&!i.options.lineWrapping&&Pe(a)==i.display.maxLine&&(j=!0),f.collapsed&&h!=b.line&&Cf(a,0),ze(a,new we(f,h==b.line?b.ch:null,h==c.line?c.ch:null)),++h}),f.collapsed&&a.iter(b.line,c.line+1,function(b){Te(a,b)&&Cf(b,0)}),f.clearOnEnter&&ag(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(x=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++pe,f.atomic=!0),i){if(j&&(i.curOp.updateMaxLine=!0),f.collapsed)Ec(i,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle)for(var k=b.line;k<=c.line;k++)Fc(i,k,"text");f.atomic&&Kb(i.doc),fg(i,"markerAdded",i,f)}return f}function se(a,b,c,d,e){d=zg(d),d.shared=!1;var f=[qe(a,b,c,d,e)],g=f[0],h=d.widgetNode;return xf(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(qe(a,wb(a,b),wb(a,c),d,e));for(var i=0;i=b:f.to>b);(e||(e=[])).push(new we(g,f.from,i?null:f.to))}}return e}function Be(a,b,c){if(a)for(var e,d=0;d=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from0&&h)for(var l=0;ll;++l)o.push(q);o.push(i)}return o}function De(a){for(var b=0;b0)){var k=[i,1],l=nb(j.from,h.from),m=nb(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function Ge(a){var b=a.markedSpans;if(b){for(var c=0;c=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(nb(j.to,c)||Je(i.marker)-Ie(e))>0||k>=0&&(nb(j.from,d)||Ie(i.marker)-Je(e))<0))return!0}}}function Pe(a){for(var b;b=Me(a);)a=b.find(-1,!0).line;return a}function Qe(a){for(var b,c;b=Ne(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function Re(a,b){var c=zf(a,b),d=Pe(c);return c==d?b:Df(d)}function Se(a,b){if(b>a.lastLine())return b;var d,c=zf(a,b);if(!Te(a,c))return b;for(;d=Ne(c);)c=d.find(1,!0).line;return Df(c)+1}function Te(a,b){var c=y&&b.markedSpans;if(c)for(var d,e=0;ea.options.maxHighlightLength?(g=!1,f&&df(a,b,d,j.pos),j.pos=b.length,k=null):k=c.token(j,d),a.options.addModeClass){var l=z.innerMode(c,d).mode.name;l&&(k="m-"+(k?l+" "+k:l))}g&&i==k||(hi;){var d=e[h];d>a&&e.splice(h,1,a,e[h+1],d),h+=2,i=Math.min(a,d)}if(b)if(g.opaque)e.splice(c,h-c,a,b),h=c+2;else for(;h>c;c+=2){var f=e[c+1];e[c+1]=f?f+" "+b:b}})}return e}function cf(a,b){return b.styles&&b.styles[0]==a.state.modeGen||(b.styles=bf(a,b,b.stateAfter=Ub(a,Df(b)))),b.styles}function df(a,b,c,d){var e=a.doc.mode,f=new ne(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&e.blankLine&&e.blankLine(c);!f.eol()&&f.pos<=a.options.maxHighlightLength;)e.token(f,c),f.start=f.pos}function gf(a,b){if(!a)return null;for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}if(/^\s*$/.test(a))return null;var e=b.cm.options.addModeClass?ff:ef;return e[a]||(e[a]=a.replace(/\S+/g,"cm-$&"))}function hf(a,b){var c=Gg("span",null,null,h?"padding-right: .1px":null),d={pre:Gg("pre",[c]),content:c,col:0,pos:0,cm:a};b.measure={};for(var e=0;e<=(b.rest?b.rest.length:0);e++){var i,f=e?b.rest[e-1]:b.line;d.pos=0,d.addToken=kf,(g||h)&&a.getOption("lineWrapping")&&(d.addToken=lf(d.addToken)),Sg(a.display.measure)&&(i=Gf(f))&&(d.addToken=mf(d.addToken,i)),d.map=[],of(f,d,cf(a,f)),0==d.map.length&&d.map.push(0,0,d.content.appendChild(Qg(a.display.measure))),0==e?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}return cg(a,"renderLine",a,b.line,d.pre),d}function jf(a){var b=Gg("span","\u2022","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b}function kf(a,b,c,e,f,g){if(b){var h=a.cm.options.specialChars,i=!1;if(h.test(b))for(var j=document.createDocumentFragment(),k=0;;){h.lastIndex=k;var l=h.exec(b),m=l?l.index-k:b.length-k;if(m){var n=document.createTextNode(b.slice(k,k+m));d?j.appendChild(Gg("span",[n])):j.appendChild(n),a.map.push(a.pos,a.pos+m,n),a.col+=m,a.pos+=m}if(!l)break;if(k+=m+1," "==l[0]){var o=a.cm.options.tabSize,p=o-a.col%o,n=j.appendChild(Gg("span",tg(p),"cm-tab"));a.col+=p}else{var n=a.cm.options.specialCharPlaceholder(l[0]);d?j.appendChild(Gg("span",[n])):j.appendChild(n),a.col+=1}a.map.push(a.pos,a.pos+1,n),a.pos++}else{a.col+=b.length;var j=document.createTextNode(b);a.map.push(a.pos,a.pos+b.length,j),d&&(i=!0),a.pos+=b.length}if(c||e||f||i){var q=c||"";e&&(q+=e),f&&(q+=f);var r=Gg("span",[j],q);return g&&(r.title=g),a.content.appendChild(r)}a.content.appendChild(j)}}function lf(a){function b(a){for(var b=" ",c=0;ci&&l.from<=i)break}if(l.to>=j)return a(c,d,e,f,g,h);a(c,d.slice(0,l.to-i),e,f,null,h),f=null,d=d.slice(l.to-i),i=l.to}}}function nf(a,b,c,d){var e=!d&&c.widgetNode;e&&(a.map.push(a.pos,a.pos+b,e),a.content.appendChild(e)),a.pos+=b}function of(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var k,m,n,o,p,q,h=e.length,i=0,g=1,j="",l=0;;){if(l==i){m=n=o=p="",q=null,l=1/0;for(var r=[],s=0;si)?(null!=t.to&&l>t.to&&(l=t.to,n=""),u.className&&(m+=" "+u.className),u.startStyle&&t.from==i&&(o+=" "+u.startStyle),u.endStyle&&t.to==l&&(n+=" "+u.endStyle),u.title&&!p&&(p=u.title),u.collapsed&&(!q||Ke(q.marker,u)<0)&&(q=t)):t.from>i&&l>t.from&&(l=t.from),"bookmark"==u.type&&t.from==i&&u.widgetNode&&r.push(u)}if(q&&(q.from||0)==i&&(nf(b,(null==q.to?h+1:q.to)-i,q.marker,null==q.from),null==q.to))return;if(!q&&r.length)for(var s=0;s=h)break;for(var v=Math.min(h,l);;){if(j){var w=i+j.length;if(!q){var x=w>v?j.slice(0,v-i):j;b.addToken(b,x,k?k+m:m,o,i+x.length==l?n:"",p)}if(w>=v){j=j.slice(v-i),i=v;break}i=w,o=""}j=e.slice(f,f=c[g++]),k=gf(c[g++],b)}}else for(var g=1;g1&&a.remove(g.line+1,n-1),a.insert(g.line+1,p)}fg(a,"change",a,b)}function rf(a){this.lines=a,this.parent=null;for(var b=0,c=0;bb||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(f>b){c=e;break}b-=f}return c.lines[b]}function Af(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function Bf(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function Cf(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function Df(a){if(null==a.parent)return null;for(var b=a.parent,c=wg(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function Ef(a,b){var c=a.first;a:do{for(var d=0;db){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;db)break;b-=h}return c+d}function Ff(a){a=Pe(a);for(var b=0,c=a.parent,d=0;d1&&!a.done[a.done.length-2].ranges?(a.done.pop(),ug(a.done)):void 0}function Lf(a,b,c,d){var e=a.history;e.undone.length=0;var g,f=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(g=Kf(e,e.lastOp==d))){var h=ug(g.changes);0==nb(b.from,b.to)&&0==nb(b.from,h.to)?h.to=yd(b):g.changes.push(If(a,b))}else{var i=ug(e.done);for(i&&i.ranges||Of(a.sel,e.done),g={changes:[If(a,b)],generation:e.generation},e.done.push(g);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=f,e.lastOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||cg(a,"historyAdded")}function Mf(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function Nf(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||Mf(a,f,ug(e.done),b))?e.done[e.done.length-1]=b:Of(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastOp=c,d&&d.clearRedo!==!1&&Jf(e.undone)}function Of(a,b){var c=ug(b);c&&c.ranges&&c.equals(a)||b.push(a)}function Pf(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function Qf(a){if(!a)return null;for(var c,b=0;b-1&&(ug(h)[l]=j[l],delete j[l])}}}return e}function Tf(a,b,c,d){c0}function jg(a){a.prototype.on=function(a,b){ag(this,a,b)},a.prototype.off=function(a,b){bg(this,a,b)}}function pg(){this.id=null}function rg(a,b,c){for(var d=0,e=0;;){var f=a.indexOf(" ",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function tg(a){for(;sg.length<=a;)sg.push(ug(sg)+" ");return sg[a]}function ug(a){return a[a.length-1]}function wg(a,b){for(var c=0;c=768&&Eg.test(a)}function Gg(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f0;--b)a.removeChild(a.firstChild);return a}function Jg(a,b){return Ig(a).appendChild(b)}function Kg(a,b){if(a.contains)return a.contains(b);for(;b=b.parentNode;)if(b==a)return!0}function Lg(){return document.activeElement}function Og(a){if(null!=Ng)return Ng;var b=Gg("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return Jg(a,b),b.offsetWidth&&(Ng=b.offsetHeight-b.clientHeight),Ng||0}function Qg(a){if(null==Pg){var b=Gg("span","\u200b");Jg(a,Gg("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(Pg=b.offsetWidth<=1&&b.offsetHeight>2&&!c)}return Pg?Gg("span","\u200b"):Gg("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px")}function Sg(a){if(null!=Rg)return Rg;var b=Jg(a,document.createTextNode("A\u062eA")),c=Hg(b,0,1).getBoundingClientRect();if(c.left==c.right)return!1;var d=Hg(b,1,2).getBoundingClientRect();return Rg=d.right-c.right<3}function Xg(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;fb||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function Yg(a){return a.level%2?a.to:a.from}function Zg(a){return a.level%2?a.from:a.to}function $g(a){var b=Gf(a);return b?Yg(b[0]):0}function _g(a){var b=Gf(a);return b?Zg(ug(b)):a.text.length}function ah(a,b){var c=zf(a.doc,b),d=Pe(c);d!=c&&(b=Df(d));var e=Gf(d),f=e?e[0].level%2?_g(d):$g(d):0;return mb(b,f)}function bh(a,b){for(var c,d=zf(a.doc,b);c=Ne(d);)d=c.find(1,!0).line,b=null;var e=Gf(d),f=e?e[0].level%2?$g(d):_g(d):d.text.length;return mb(null==b?Df(d):b,f)}function ch(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function eh(a,b){dh=null;for(var d,c=0;cb)return c;if(e.from==b||e.to==b){if(null!=d)return ch(a,e.level,a[d].level)?(e.from!=e.to&&(dh=d),c):(e.from!=e.to&&(dh=c),d);d=c}}return d}function fh(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&Fg(a.text.charAt(b)));return b}function gh(a,b,c,d){var e=Gf(a);if(!e)return hh(a,b,c,d);for(var f=eh(e,b),g=e[f],h=fh(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?fh(a,g.to,-1,d):fh(a,g.from,1,d)}}function hh(a,b,c,d){var e=b+c;if(d)for(;e>0&&Fg(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var a=/gecko\/\d/i.test(navigator.userAgent),b=/MSIE \d/.test(navigator.userAgent),c=b&&(null==document.documentMode||document.documentMode<8),d=b&&(null==document.documentMode||document.documentMode<9),e=b&&(null==document.documentMode||document.documentMode<10),f=/Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent),g=b||f,h=/WebKit\//.test(navigator.userAgent),i=h&&/Qt\/\d+\.\d+/.test(navigator.userAgent),j=/Chrome\//.test(navigator.userAgent),k=/Opera\//.test(navigator.userAgent),l=/Apple Computer/.test(navigator.vendor),m=/KHTML\//.test(navigator.userAgent),n=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),o=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),p=/PhantomJS/.test(navigator.userAgent),q=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),r=q||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),s=q||/Mac/.test(navigator.platform),t=/win/i.test(navigator.platform),u=k&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);u&&(u=Number(u[1])),u&&u>=15&&(k=!1,h=!0);var v=s&&(i||k&&(null==u||12.11>u)),w=a||g&&!d,x=!1,y=!1,mb=z.Pos=function(a,b){return this instanceof mb?(this.line=a,this.ch=b,void 0):new mb(a,b)},nb=z.cmpPos=function(a,b){return a.line-b.line||a.ch-b.ch};rb.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b=0&&nb(a,d.to())<=0)return c}return-1}},sb.prototype={from:function(){return qb(this.anchor,this.head)},to:function(){return pb(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var sc,Wc,Xc,dc={left:0,right:0,top:0,bottom:0},vc=0,bd=0,gd=0,hd=null;g?hd=-.53:a?hd=15:j?hd=-.7:l&&(hd=-1/3);var ld,vd,od=null,yd=z.changeEnd=function(a){return a.text?mb(a.from.line+a.text.length-1,ug(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};z.prototype={constructor:z,focus:function(){window.focus(),Pc(this),Mc(this)},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,Zd.hasOwnProperty(a)&&zc(this,Zd[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;cc&&(Sd(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Qd(this));else{var f=Math.max(c,e.from().line),g=e.to();c=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var h=f;c>h;++h)Sd(this,h,a)}}}),getTokenAt:function(a,b){var c=this.doc;a=wb(c,a);for(var d=Ub(this,a.line,b),e=this.doc.mode,f=zf(c,a.line),g=new ne(f.text,this.options.tabSize);g.pos>1;if((f?b[2*f-1]:0)>=e)d=f;else{if(!(b[2*f+1]d&&(a=d,c=!0);var e=zf(this.doc,a);return kc(this,e,{top:0,left:0},b||"page").top+(c?this.doc.height-Ff(e):0)},defaultTextHeight:function(){return tc(this.display)},defaultCharWidth:function(){return uc(this.display)},setGutterMarker:Ac(function(a,b,c){return Td(this,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&Dg(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Ac(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Fc(b,d,"gutter"),Dg(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),addLineClass:Ac(function(a,b,c){return Td(this,a,"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[d]){if(new RegExp("(?:^|\\s)"+c+"(?:$|\\s)").test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:Ac(function(a,b,c){return Td(this,a,"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.match(new RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(f.index&&g!=e.length?" ":"")+e.slice(g)||null}return!0})}),addLineWidget:Ac(function(a,b,c){return Ye(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!yb(this.doc,a))return null;var b=a;if(a=zf(this.doc,a),!a)return null}else{var b=Df(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=nc(this,wb(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Nd(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Ac(pd),triggerOnKeyPress:Ac(sd),triggerOnKeyUp:Ac(rd),execCommand:function(a){return he.hasOwnProperty(a)?he[a](this):void 0},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=wb(this.doc,a);b>f&&(g=Vd(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Ac(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Vd(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},og)}),deleteH:Ac(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):Ud(this,function(c){var e=Vd(d,c.head,a,b,!1);return 0>a?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=wb(this.doc,a);b>g;++g){var i=nc(this,h,"div");if(null==f?f=i.left:i.left=f,h=Wd(this,i,e,c),h.hitSide)break}return h},moveV:Ac(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var h=nc(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=Wd(c,h,a,b);return"page"==b&&g==d.sel.primary()&&Pd(c,null,mc(c,i,"div").top-h.top),i},og),e.length)for(var g=0;g.5)&&F(this),cg(this,"refresh",this)}),swapDoc:Ac(function(a){var b=this.doc;return b.cm=null,yf(this,a),hc(this),Oc(this),this.scrollTo(a.scrollLeft,a.scrollTop),fg(this,"swapDoc",this,b),b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},jg(z);var Yd=z.defaults={},Zd=z.optionHandlers={},_d=z.Init={toString:function(){return"CodeMirror.Init"}};$d("value","",function(a,b){a.setValue(b)},!0),$d("mode",null,function(a,b){a.doc.modeOption=b,B(a)},!0),$d("indentUnit",2,B,!0),$d("indentWithTabs",!1),$d("smartIndent",!0),$d("tabSize",4,function(a){C(a),hc(a),Ec(a)},!0),$d("specialChars",/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,function(a,b){a.options.specialChars=new RegExp(b.source+(b.test(" ")?"":"| "),"g"),a.refresh()},!0),$d("specialCharPlaceholder",jf,function(a){a.refresh()},!0),$d("electricChars",!0),$d("rtlMoveVisually",!t),$d("wholeLineUpdateBefore",!0),$d("theme","default",function(a){H(a),I(a)},!0),$d("keyMap","default",G),$d("extraKeys",null),$d("lineWrapping",!1,D,!0),$d("gutters",[],function(a){M(a.options),I(a)},!0),$d("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?T(a.display)+"px":"0",a.refresh()},!0),$d("coverGutterNextToScrollbar",!1,O,!0),$d("lineNumbers",!1,function(a){M(a.options),I(a)},!0),$d("firstLineNumber",1,I,!0),$d("lineNumberFormatter",function(a){return a},I,!0),$d("showCursorWhenSelecting",!1,Nb,!0),$d("resetSelectionOnContextMenu",!0),$d("readOnly",!1,function(a,b){"nocursor"==b?(ud(a),a.display.input.blur(),a.display.disabled=!0):(a.display.disabled=!1,b||Oc(a))}),$d("disableInput",!1,function(a,b){b||Oc(a)},!0),$d("dragDrop",!0),$d("cursorBlinkRate",530),$d("cursorScrollMargin",0),$d("cursorHeight",1),$d("workTime",100),$d("workDelay",100),$d("flattenSpans",!0,C,!0),$d("addModeClass",!1,C,!0),$d("pollInterval",100),$d("undoDepth",200,function(a,b){a.doc.history.undoDepth=b}),$d("historyEventDelay",1250),$d("viewportMargin",10,function(a){a.refresh()},!0),$d("maxHighlightLength",1e4,C,!0),$d("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)}),$d("tabindex",null,function(a,b){a.display.input.tabIndex=b||""}),$d("autofocus",null);var ae=z.modes={},be=z.mimeModes={};z.defineMode=function(a,b){if(z.defaults.mode||"null"==a||(z.defaults.mode=a),arguments.length>2){b.dependencies=[];for(var c=2;c0&&d.chc;c++){var d=a.listSelections()[c];a.replaceRange("\n",d.anchor,d.head,"+input"),a.indentLine(d.from().line+1,null,!0),Qd(a)}})},toggleOverwrite:function(a){a.toggleOverwrite()}},ie=z.keyMap={};ie.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ie.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ie.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":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection",fallthrough:["basic","emacsy"]},ie.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},ie["default"]=s?ie.macDefault:ie.pcDefault;var ke=z.lookupKey=function(a,b,c){function d(b){b=je(b);var e=b[a];if(e===!1)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";var f=b.fallthrough;if(null==f)return!1;if("[object Array]"!=Object.prototype.toString.call(f))return d(f);for(var g=0;g=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos0?null:(f&&b!==!1&&(this.pos+=f[0].length),f)}var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);return d(e)==d(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var oe=z.TextMarker=function(a,b){this.lines=[],this.type=b,this.doc=a};jg(oe),oe.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&wc(a),ig(this,"clear")){var c=this.find();c&&fg(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;fa.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&this.collapsed&&Ec(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Kb(a.doc)),a&&fg(a,"markerCleared",a,this),b&&xc(a),this.parent&&this.parent.clear()}},oe.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;ec;++c){var e=this.lines[c];this.height-=e.height,_e(e),fg(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0;da;++a)if(c(this.lines[a]))return!0}},sf.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;ca){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof rf))){var h=[];this.collapse(h),this.children=[new rf(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0;b=a){if(e.insertInner(a,b,c),e.lines&&e.lines.length>50){for(;e.lines.length>50;){var g=e.lines.splice(e.lines.length-25,25),h=new rf(g);e.height-=h.height,this.children.splice(d+1,0,h),h.parent=this}this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new sf(b);if(a.parent){a.size-=c.size,a.height-=c.height;var e=wg(a.parent.children,a);a.parent.children.splice(e+1,0,c)}else{var d=new sf(a.children);d.parent=a,a.children=[d,c],a=d}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;da){var g=Math.min(b,f-a);if(e.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=f}}};var tf=0,uf=z.Doc=function(a,b,c){if(!(this instanceof uf))return new uf(a,b,c);null==c&&(c=0),sf.call(this,[new rf([new Ze("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=c;var d=mb(c,0);this.sel=ub(d),this.history=new Hf(null),this.id=++tf,this.modeOption=b,"string"==typeof a&&(a=Tg(a)),qf(this,{from:d,to:d,text:a}),Hb(this,ub(d),mg)};uf.prototype=yg(sf.prototype,{constructor:uf,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d=0;f--)Ed(this,d[f]);h?Gb(this,h):this.cm&&Qd(this.cm)},undo:Bc(function(){Gd(this,"undo")}),redo:Bc(function(){Gd(this,"redo")}),undoSelection:Bc(function(){Gd(this,"undo",!0)}),redoSelection:Bc(function(){Gd(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=wb(this,a),b=wb(this,b);var d=[],e=a.line;return this.iter(a.line,b.line+1,function(f){var g=f.markedSpans;if(g)for(var h=0;hi.to||null==i.from&&e!=a.line||e==b.line&&i.from>b.ch||c&&!c(i.marker)||d.push(i.marker.parent||i.marker)}++e}),d},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;da?(b=a,!0):(a-=e,++c,void 0)}),wb(this,mb(c,b))},indexFromPos:function(a){a=wb(this,a);var b=a.ch;return a.lineb&&(b=a.from),null!=a.to&&a.toh||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}},sg=[""],vg=function(a){a.select()};q?vg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:g&&(vg=function(a){try{a.select()}catch(b){}}),[].indexOf&&(wg=function(a,b){return a.indexOf(b)}),[].map&&(xg=function(a,b){return a.map(b)});var Hg,Bg=/[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Cg=z.isWordChar=function(a){return/\w/.test(a)||a>"\x80"&&(a.toUpperCase()!=a.toLowerCase()||Bg.test(a))},Eg=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Hg=document.createRange?function(a,b,c){var d=document.createRange();return d.setEnd(a,c),d.setStart(a,b),d}:function(a,b,c){var d=document.body.createTextRange();return d.moveToElementText(a.parentNode),d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d},b&&(Lg=function(){try{return document.activeElement}catch(a){return document.body}});var Ng,Pg,Rg,Mg=function(){if(d)return!1;var a=Gg("div");return"draggable"in a||"dragDrop"in a}(),Tg=z.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},Ug=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},Vg=function(){var a=Gg("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),Wg={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};z.keyNames=Wg,function(){for(var a=0;10>a;a++)Wg[a+48]=Wg[a+96]=String(a);for(var a=65;90>=a;a++)Wg[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)Wg[a+111]=Wg[a+63235]="F"+a}();var dh,ih=function(){function c(c){return 247>=c?a.charAt(c):c>=1424&&1524>=c?"R":c>=1536&&1773>=c?b.charAt(c-1536):c>=1774&&2220>=c?"r":c>=8192&&8203>=c?"w":8204==c?"b":"L"}function j(a,b,c){this.level=a,this.from=b,this.to=c}var a="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",b="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/,i="L";return function(a){if(!d.test(a))return!1;for(var m,b=a.length,k=[],l=0;b>l;++l)k.push(m=c(a.charCodeAt(l)));for(var l=0,n=i;b>l;++l){var m=k[l];"m"==m?k[l]=n:n=m}for(var l=0,o=i;b>l;++l){var m=k[l];"1"==m&&"r"==o?k[l]="n":f.test(m)&&(o=m,"r"==m&&(k[l]="R"))}for(var l=1,n=k[0];b-1>l;++l){var m=k[l];"+"==m&&"1"==n&&"1"==k[l+1]?k[l]="1":","!=m||n!=k[l+1]||"1"!=n&&"n"!=n||(k[l]=n),n=m}for(var l=0;b>l;++l){var m=k[l];if(","==m)k[l]="N";else if("%"==m){for(var p=l+1;b>p&&"%"==k[p];++p);for(var q=l&&"!"==k[l-1]||b>p&&"1"==k[p]?"1":"N",r=l;p>r;++r)k[r]=q;l=p-1}}for(var l=0,o=i;b>l;++l){var m=k[l];"L"==o&&"1"==m?k[l]="L":f.test(m)&&(o=m)}for(var l=0;b>l;++l)if(e.test(k[l])){for(var p=l+1;b>p&&e.test(k[p]);++p);for(var s="L"==(l?k[l-1]:i),t="L"==(b>p?k[p]:i),q=s||t?"L":"R",r=l;p>r;++r)k[r]=q;l=p-1}for(var v,u=[],l=0;b>l;)if(g.test(k[l])){var w=l;for(++l;b>l&&g.test(k[l]);++l);u.push(new j(0,w,l))}else{var x=l,y=u.length;for(++l;b>l&&"L"!=k[l];++l);for(var r=x;l>r;)if(h.test(k[r])){r>x&&u.splice(y,0,new j(1,x,r));var z=r;for(++r;l>r&&h.test(k[r]);++r);u.splice(y,0,new j(2,z,r)),x=r}else++r;l>x&&u.splice(y,0,new j(1,x,l))}return 1==u[0].level&&(v=a.match(/^\s+/))&&(u[0].from=v[0].length,u.unshift(new j(0,0,v[0].length))),1==ug(u).level&&(v=a.match(/\s+$/))&&(ug(u).to-=v[0].length,u.push(new j(0,b-v[0].length,b))),u[0].level!=ug(u).level&&u.push(new j(u[0].level,b,b)),u}}();return z.version="4.0.4",z}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("apl",function(){var a={".":"innerProduct","\\":"scan","/":"reduce","\u233f":"reduce1Axis","\u2340":"scan1Axis","\xa8":"each","\u2363":"power"},b={"+":["conjugate","add"],"\u2212":["negate","subtract"],"\xd7":["signOf","multiply"],"\xf7":["reciprocal","divide"],"\u2308":["ceiling","greaterOf"],"\u230a":["floor","lesserOf"],"\u2223":["absolute","residue"],"\u2373":["indexGenerate","indexOf"],"?":["roll","deal"],"\u22c6":["exponentiate","toThePowerOf"],"\u235f":["naturalLog","logToTheBase"],"\u25cb":["piTimes","circularFuncs"],"!":["factorial","binomial"],"\u2339":["matrixInverse","matrixDivide"],"<":[null,"lessThan"],"\u2264":[null,"lessThanOrEqual"],"=":[null,"equals"],">":[null,"greaterThan"],"\u2265":[null,"greaterThanOrEqual"],"\u2260":[null,"notEqual"],"\u2261":["depth","match"],"\u2262":[null,"notMatch"],"\u2208":["enlist","membership"],"\u2377":[null,"find"],"\u222a":["unique","union"],"\u2229":[null,"intersection"],"\u223c":["not","without"],"\u2228":[null,"or"],"\u2227":[null,"and"],"\u2371":[null,"nor"],"\u2372":[null,"nand"],"\u2374":["shapeOf","reshape"],",":["ravel","catenate"],"\u236a":[null,"firstAxisCatenate"],"\u233d":["reverse","rotate"],"\u2296":["axis1Reverse","axis1Rotate"],"\u2349":["transpose",null],"\u2191":["first","take"],"\u2193":[null,"drop"],"\u2282":["enclose","partitionWithAxis"],"\u2283":["diclose","pick"],"\u2337":[null,"index"],"\u234b":["gradeUp",null],"\u2352":["gradeDown",null],"\u22a4":["encode",null],"\u22a5":["decode",null],"\u2355":["format","formatByExample"],"\u234e":["execute",null],"\u22a3":["stop","left"],"\u22a2":["pass","right"]},c=/[\.\/\u233f\u2340\xa8\u2363]/,d=/\u236c/,e=/[\+\u2212\xd7\xf7\u2308\u230a\u2223\u2373\?\u22c6\u235f\u25cb!\u2339<\u2264=>\u2265\u2260\u2261\u2262\u2208\u2377\u222a\u2229\u223c\u2228\u2227\u2371\u2372\u2374,\u236a\u233d\u2296\u2349\u2191\u2193\u2282\u2283\u2337\u234b\u2352\u22a4\u22a5\u2355\u234e\u22a3\u22a2]/,f=/\u2190/,g=/[\u235d#].*$/,h=function(a){var b; return b=!1,function(c){return b=c,c===a?"\\"===b:!0}};return{startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(i,j){var k,l,m;return i.eatSpace()?null:(k=i.next(),'"'===k||"'"===k?(i.eatWhile(h(k)),i.next(),j.prev=!0,"string"):/[\[{\(]/.test(k)?(j.prev=!1,null):/[\]}\)]/.test(k)?(j.prev=!0,null):d.test(k)?(j.prev=!1,"niladic"):/[\xaf\d]/.test(k)?(j.func?(j.func=!1,j.prev=!1):j.prev=!0,i.eatWhile(/[\w\.]/),"number"):c.test(k)?"operator apl-"+a[k]:f.test(k)?"apl-arrow":e.test(k)?(l="apl-",null!=b[k]&&(l+=j.prev?b[k][1]:b[k][0]),j.func=!0,j.prev=!1,"function "+l):g.test(k)?(i.skipToEnd(),"comment"):"\u2218"===k&&"."===i.peek()?(i.next(),"function jot-dot"):(i.eatWhile(/[\w\$_]/),m=i.current(),j.prev=!0,"keyword"))}}}),a.defineMIME("text/apl","apl")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("clike",function(b,c){function o(a,b){var c=a.next();if(k[c]){var d=k[c](a,b);if(d!==!1)return d}if('"'==c||"'"==c)return b.tokenize=p(c),b.tokenize(a,b);if(/[\[\]{}\(\),;\:\.]/.test(c))return n=c,null;if(/\d/.test(c))return a.eatWhile(/[\w\.]/),"number";if("/"==c){if(a.eat("*"))return b.tokenize=q,q(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(m.test(c))return a.eatWhile(m),"operator";a.eatWhile(/[\w\$_]/);var e=a.current();return g.propertyIsEnumerable(e)?(i.propertyIsEnumerable(e)&&(n="newstatement"),"keyword"):h.propertyIsEnumerable(e)?(i.propertyIsEnumerable(e)&&(n="newstatement"),"builtin"):j.propertyIsEnumerable(e)?"atom":"variable"}function p(a){return function(b,c){for(var e,d=!1,f=!1;null!=(e=b.next());){if(e==a&&!d){f=!0;break}d=!d&&"\\"==e}return(f||!d&&!l)&&(c.tokenize=null),"string"}}function q(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=null;break}c="*"==d}return"comment"}function r(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function s(a,b,c){var d=a.indented;return a.context&&"statement"==a.context.type&&(d=a.context.indented),a.context=new r(d,b,c,null,a.context)}function t(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var n,d=b.indentUnit,e=c.statementIndentUnit||d,f=c.dontAlignCalls,g=c.keywords||{},h=c.builtin||{},i=c.blockKeywords||{},j=c.atoms||{},k=c.hooks||{},l=c.multiLineStrings,m=/[+\-*&%=<>!?|\/]/;return{startState:function(a){return{tokenize:null,context:new r((a||0)-d,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;n=null;var d=(b.tokenize||o)(a,b);if("comment"==d||"meta"==d)return d;if(null==c.align&&(c.align=!0),";"!=n&&":"!=n&&","!=n||"statement"!=c.type)if("{"==n)s(b,a.column(),"}");else if("["==n)s(b,a.column(),"]");else if("("==n)s(b,a.column(),")");else if("}"==n){for(;"statement"==c.type;)c=t(b);for("}"==c.type&&(c=t(b));"statement"==c.type;)c=t(b)}else n==c.type?t(b):(("}"==c.type||"top"==c.type)&&";"!=n||"statement"==c.type&&"newstatement"==n)&&s(b,a.column(),"statement");else t(b);return b.startOfLine=!1,d},indent:function(b,c){if(b.tokenize!=o&&null!=b.tokenize)return a.Pass;var g=b.context,h=c&&c.charAt(0);"statement"==g.type&&"}"==h&&(g=g.prev);var i=h==g.type;return"statement"==g.type?g.indented+("{"==h?0:e):!g.align||f&&")"==g.type?")"!=g.type||i?g.indented+(i?0:d):g.indented+e:g.column+(i?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),function(){function b(a){for(var b={},c=a.split(" "),d=0;d <- <: <% >: # @ 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:b("catch class do else finally for forSome if match switch try while"),atoms:b("true false null"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}}}),h(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:b("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadowconst attribute uniform varying break continue discard return for while do if else struct in out inout"),blockKeywords:b("for while do if else struct"),builtin:b("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smootstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:b("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragColor gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),hooks:{"#":d},modeProps:{fold:["brace","include"]}})}()}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("clojure",function(a){function l(a){for(var b={},c=a.split(" "),d=0;d ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),o=l("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),p=l("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),q={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(a,l){if(null==l.indentStack&&a.sol()&&(l.indentation=a.indentation()),a.eatSpace())return null;var r=null;switch(l.mode){case"string":for(var w,x=!1;null!=(w=a.next());){if('"'==w&&!x){l.mode=!1;break}x=!x&&"\\"==w}r=d;break;default:var y=a.next();if('"'==y)l.mode="string",r=d;else if("\\"==y)v(a),r=e;else if("'"!=y||q.digit_or_colon.test(a.peek()))if(";"==y)a.skipToEnd(),r=c;else if(u(y,a))r=g;else if("("==y||"["==y||"{"==y){var B,z="",A=a.column();if("("==y)for(;null!=(B=a.eat(q.keyword_char));)z+=B;z.length>0&&(p.propertyIsEnumerable(z)||/^(?:def|with)/.test(z))?s(l,A+j,y):(a.eatSpace(),a.eol()||";"==a.peek()?s(l,A+k,y):s(l,A+a.current().length,y)),a.backUp(a.current().length-1),r=h}else if(")"==y||"]"==y||"}"==y)r=h,null!=l.indentStack&&l.indentStack.type==(")"==y?"(":"]"==y?"[":"{")&&t(l);else{if(":"==y)return a.eatWhile(q.symbol),f;a.eatWhile(q.symbol),r=n&&n.propertyIsEnumerable(a.current())?i:o&&o.propertyIsEnumerable(a.current())?b:m&&m.propertyIsEnumerable(a.current())?f:null}else r=f}return r},indent:function(a){return null==a.indentStack?a.indentation:a.indentStack.indent},lineComment:";;"}}),a.defineMIME("text/x-clojure","clojure")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("cobol",function(){function j(a){for(var b={},c=a.split(" "),d=0;d >= "),n={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+\-]/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(j,p){if(null==p.indentStack&&j.sol()&&(p.indentation=6),j.eatSpace())return null;var q=null;switch(p.mode){case"string":for(var r=!1;null!=(r=j.next());)if('"'==r||"'"==r){p.mode=!1;break}q=c;break;default:var s=j.next(),t=j.column();if(t>=0&&5>=t)q=h;else if(t>=72&&79>=t)j.skipToEnd(),q=g;else if("*"==s&&6==t)j.skipToEnd(),q=b;else if('"'==s||"'"==s)p.mode="string",q=c;else if("'"!=s||n.digit_or_colon.test(j.peek()))if("."==s)q=i;else if(o(s,j))q=e;else{if(j.current().match(n.symbol))for(;71>t&&void 0!==j.eat(n.symbol);)t++;q=l&&l.propertyIsEnumerable(j.current().toUpperCase())?f:m&&m.propertyIsEnumerable(j.current().toUpperCase())?a:k&&k.propertyIsEnumerable(j.current().toUpperCase())?d:null}else q=d}return q},indent:function(a){return null==a.indentStack?a.indentation:a.indentStack.indent}}}),a.defineMIME("text/x-cobol","cobol")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("coffeescript",function(a){function c(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function p(a,c){if(a.sol()){null===c.scope.align&&(c.scope.align=!1);var i=c.scope.offset;if(a.eatSpace()){var j=a.indentation();return j>i&&"coffee"==c.scope.type?"indent":i>j?"dedent":null}i>0&&t(a,c)}if(a.eatSpace())return null;var n=a.peek();if(a.match("####"))return a.skipToEnd(),"comment";if(a.match("###"))return c.tokenize=r,c.tokenize(a,c);if("#"===n)return a.skipToEnd(),"comment";if(a.match(/^-?[0-9\.]/,!1)){var p=!1;if(a.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(p=!0),a.match(/^-?\d+\.\d*/)&&(p=!0),a.match(/^-?\.\d+/)&&(p=!0),p)return"."==a.peek()&&a.backUp(1),"number";var s=!1;if(a.match(/^-?0x[0-9a-f]+/i)&&(s=!0),a.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(s=!0),a.match(/^-?0(?![\dx])/i)&&(s=!0),s)return"number"}if(a.match(l))return c.tokenize=q(a.current(),!1,"string"),c.tokenize(a,c);if(a.match(m)){if("/"!=a.current()||a.match(/^.*\//,!1))return c.tokenize=q(a.current(),!0,"string-2"),c.tokenize(a,c);a.backUp(1)}return a.match(d)||a.match(h)?"operator":a.match(e)?"punctuation":a.match(o)?"atom":a.match(k)?"keyword":a.match(f)?"variable":a.match(g)?"property":(a.next(),b)}function q(c,d,e){return function(f,g){for(;!f.eol();)if(f.eatWhile(/[^'"\/\\]/),f.eat("\\")){if(f.next(),d&&f.eol())return e}else{if(f.match(c))return g.tokenize=p,e;f.eat(/['"\/]/)}return d&&(a.mode.singleLineStringErrors?e=b:g.tokenize=p),e}}function r(a,b){for(;!a.eol();){if(a.eatWhile(/[^#]/),a.match("###")){b.tokenize=p;break}a.eatWhile("#")}return"comment"}function s(b,c,d){d=d||"coffee";for(var e=0,f=!1,g=null,h=c.scope;h;h=h.prev)if("coffee"===h.type){e=h.offset+a.indentUnit;break}"coffee"!==d?(f=null,g=b.column()+b.current().length):c.scope.align&&(c.scope.align=!1),c.scope={offset:e,type:d,prev:c.scope,align:f,alignOffset:g}}function t(a,b){if(b.scope.prev){if("coffee"===b.scope.type){for(var c=a.indentation(),d=!1,e=b.scope;e;e=e.prev)if(c===e.offset){d=!0;break}if(!d)return!0;for(;b.scope.prev&&b.scope.offset!==c;)b.scope=b.scope.prev;return!1}return b.scope=b.scope.prev,!1}}function u(a,c){var d=c.tokenize(a,c),e=a.current();if("."===e)return d=c.tokenize(a,c),e=a.current(),/^\.[\w$]+$/.test(e)?"variable":b;"return"===e&&(c.dedent+=1),("->"!==e&&"=>"!==e||c.lambda||a.peek())&&"indent"!==d||s(a,c);var f="[({".indexOf(e);if(-1!==f&&s(a,c,"])}".slice(f,f+1)),i.exec(e)&&s(a,c),"then"==e&&t(a,c),"dedent"===d&&t(a,c))return b;if(f="])}".indexOf(e),-1!==f){for(;"coffee"==c.scope.type&&c.scope.prev;)c.scope=c.scope.prev;c.scope.type==e&&(c.scope=c.scope.prev)}return c.dedent>0&&a.eol()&&"coffee"==c.scope.type&&(c.scope.prev&&(c.scope=c.scope.prev),c.dedent-=1),d}var b="error",d=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?)/,e=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,f=/^[_A-Za-z$][_A-Za-z$0-9]*/,g=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/,h=c(["and","or","not","is","isnt","in","instanceof","typeof"]),i=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],j=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","throw","when","until"],k=c(i.concat(j));i=c(i);var l=/^('{3}|\"{3}|['\"])/,m=/^(\/{3}|\/)/,n=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],o=c(n),v={startState:function(a){return{tokenize:p,scope:{offset:a||0,type:"coffee",prev:null,align:!1},lastToken:null,lambda:!1,dedent:0}},token:function(a,b){var c=null===b.scope.align&&b.scope;c&&a.sol()&&(c.align=!1);var d=u(a,b);return c&&d&&"comment"!=d&&(c.align=!0),b.lastToken={style:d,content:a.current()},a.eol()&&a.lambda&&(b.lambda=!1),d},indent:function(a,b){if(a.tokenize!=p)return 0;var c=a.scope,d=b&&"])}".indexOf(b.charAt(0))>-1;if(d)for(;"coffee"==c.type&&c.prev;)c=c.prev;var e=d&&c.type===b.charAt(0);return c.align?c.alignOffset-(e?1:0):(e?c.prev:c).offset},lineComment:"#",fold:"indent"};return v}),a.defineMIME("text/x-coffeescript","coffeescript")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("commonlisp",function(a){function f(a){for(var b;b=a.next();)if("\\"==b)a.next();else if(!d.test(b)){a.backUp(1);break}return a.current()}function g(a,b){if(a.eatSpace())return e="ws",null;if(a.match(c))return"number";var d=a.next();if("\\"==d&&(d=a.next()),'"'==d)return(b.tokenize=h)(a,b);if("("==d)return e="open","bracket";if(")"==d||"]"==d)return e="close","bracket";if(";"==d)return a.skipToEnd(),e="ws","comment";if(/['`,@]/.test(d))return null;if("|"==d)return a.skipTo("|")?(a.next(),"symbol"):(a.skipToEnd(),"error");if("#"==d){var d=a.next();return"["==d?(e="open","bracket"):/[+\-=\.']/.test(d)?null:/\d/.test(d)&&a.match(/^\d*#/)?null:"|"==d?(b.tokenize=i)(a,b):":"==d?(f(a),"meta"):"error"}var g=f(a);return"."==g?null:(e="symbol","nil"==g||"t"==g?"atom":":"==g.charAt(0)?"keyword":"&"==g.charAt(0)?"variable-2":"variable")}function h(a,b){for(var d,c=!1;d=a.next();){if('"'==d&&!c){b.tokenize=g;break}c=!c&&"\\"==d}return"string"}function i(a,b){for(var c,d;c=a.next();){if("#"==c&&"|"==d){b.tokenize=g;break}d=c}return e="ws","comment"}var e,b=/^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/,c=/^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/,d=/[^\s'`,@()\[\]";]/; return{startState:function(){return{ctx:{prev:null,start:0,indentTo:0},tokenize:g}},token:function(c,d){c.sol()&&"number"!=typeof d.ctx.indentTo&&(d.ctx.indentTo=d.ctx.start+1),e=null;var f=d.tokenize(c,d);return"ws"!=e&&(null==d.ctx.indentTo?d.ctx.indentTo="symbol"==e&&b.test(c.current())?d.ctx.start+a.indentUnit:"next":"next"==d.ctx.indentTo&&(d.ctx.indentTo=c.column())),"open"==e?d.ctx={prev:d.ctx,start:c.column(),indentTo:null}:"close"==e&&(d.ctx=d.ctx.prev||d.ctx),f},indent:function(a){var c=a.ctx.indentTo;return"number"==typeof c?c:a.ctx.start+1},lineComment:";;",blockCommentStart:"#|",blockCommentEnd:"|#"}}),a.defineMIME("text/x-common-lisp","commonlisp")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=0;c")?(a.match("-->"),b.tokenize=null):a.skipToEnd(),["comment","comment"]}a.defineMode("css",function(b,c){function p(a,b){return n=b,a}function q(a,b){var c=a.next();if(e[c]){var d=e[c](a,b);if(d!==!1)return d}return"@"==c?(a.eatWhile(/[\w\\\-]/),p("def",a.current())):"="==c||("~"==c||"|"==c)&&a.eat("=")?p(null,"compare"):'"'==c||"'"==c?(b.tokenize=r(c),b.tokenize(a,b)):"#"==c?(a.eatWhile(/[\w\\\-]/),p("atom","hash")):"!"==c?(a.match(/^\s*\w*/),p("keyword","important")):/\d/.test(c)||"."==c&&a.eat(/\d/)?(a.eatWhile(/[\w.%]/),p("number","unit")):"-"!==c?/[,+>*\/]/.test(c)?p(null,"select-op"):"."==c&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?p("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(c)?p(null,c):"u"==c&&a.match("rl(")?(a.backUp(1),b.tokenize=s,p("property","word")):/[\w\\\-]/.test(c)?(a.eatWhile(/[\w\\\-]/),p("property","word")):p(null,null):/[\d.]/.test(a.peek())?(a.eatWhile(/[\w.%]/),p("number","unit")):a.match(/^[^-]+-/)?p("meta","meta"):void 0}function r(a){return function(b,c){for(var e,d=!1;null!=(e=b.next());){if(e==a&&!d){")"==a&&b.backUp(1);break}d=!d&&"\\"==e}return(e==a||!d&&")"!=a)&&(c.tokenize=null),p("string","string")}}function s(a,b){return a.next(),b.tokenize=a.match(/\s*[\"\']/,!1)?null:r(")"),p(null,"(")}function t(a,b,c){this.type=a,this.indent=b,this.prev=c}function u(a,b,c){return a.context=new t(c,b.indentation()+d,a.context),c}function v(a){return a.context=a.context.prev,a.context.type}function w(a,b,c){return z[c.context.type](a,b,c)}function x(a,b,c,d){for(var e=d||1;e>0;e--)c.context=c.context.prev;return w(a,b,c)}function y(a){var b=a.current().toLowerCase();o=k.hasOwnProperty(b)?"atom":j.hasOwnProperty(b)?"keyword":"variable"}c.propertyKeywords||(c=a.resolveMode("text/css"));var n,o,d=b.indentUnit,e=c.tokenHooks,f=c.mediaTypes||{},g=c.mediaFeatures||{},h=c.propertyKeywords||{},i=c.nonStandardPropertyKeywords||{},j=c.colorKeywords||{},k=c.valueKeywords||{},l=c.fontProperties||{},m=c.allowNested,z={};return z.top=function(a,b,c){if("{"==a)return u(c,b,"block");if("}"==a&&c.context.prev)return v(c);if("@media"==a)return u(c,b,"media");if("@font-face"==a)return"font_face_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(a))return"keyframes";if(a&&"@"==a.charAt(0))return u(c,b,"at");if("hash"==a)o="builtin";else if("word"==a)o="tag";else{if("variable-definition"==a)return"maybeprop";if("interpolation"==a)return u(c,b,"interpolation");if(":"==a)return"pseudo";if(m&&"("==a)return u(c,b,"params")}return c.context.type},z.block=function(a,b,c){if("word"==a){var d=b.current().toLowerCase();return h.hasOwnProperty(d)?(o="property","maybeprop"):i.hasOwnProperty(d)?(o="string-2","maybeprop"):m?(o=b.match(/^\s*:/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==a?"block":m||"hash"!=a&&"qualifier"!=a?z.top(a,b,c):(o="error","block")},z.maybeprop=function(a,b,c){return":"==a?u(c,b,"prop"):w(a,b,c)},z.prop=function(a,b,c){if(";"==a)return v(c);if("{"==a&&m)return u(c,b,"propBlock");if("}"==a||"{"==a)return x(a,b,c);if("("==a)return u(c,b,"parens");if("hash"!=a||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(b.current())){if("word"==a)y(b);else if("interpolation"==a)return u(c,b,"interpolation")}else o+=" error";return"prop"},z.propBlock=function(a,b,c){return"}"==a?v(c):"word"==a?(o="property","maybeprop"):c.context.type},z.parens=function(a,b,c){return"{"==a||"}"==a?x(a,b,c):")"==a?v(c):"parens"},z.pseudo=function(a,b,c){return"word"==a?(o="variable-3",c.context.type):w(a,b,c)},z.media=function(a,b,c){if("("==a)return u(c,b,"media_parens");if("}"==a)return x(a,b,c);if("{"==a)return v(c)&&u(c,b,m?"block":"top");if("word"==a){var d=b.current().toLowerCase();o="only"==d||"not"==d||"and"==d?"keyword":f.hasOwnProperty(d)?"attribute":g.hasOwnProperty(d)?"property":"error"}return c.context.type},z.media_parens=function(a,b,c){return")"==a?v(c):"{"==a||"}"==a?x(a,b,c,2):z.media(a,b,c)},z.font_face_before=function(a,b,c){return"{"==a?u(c,b,"font_face"):w(a,b,c)},z.font_face=function(a,b,c){return"}"==a?v(c):"word"==a?(o=l.hasOwnProperty(b.current().toLowerCase())?"property":"error","maybeprop"):"font_face"},z.keyframes=function(a,b,c){return"word"==a?(o="variable","keyframes"):"{"==a?u(c,b,"top"):w(a,b,c)},z.at=function(a,b,c){return";"==a?v(c):"{"==a||"}"==a?x(a,b,c):("word"==a?o="tag":"hash"==a&&(o="builtin"),"at")},z.interpolation=function(a,b,c){return"}"==a?v(c):"{"==a||";"==a?x(a,b,c):("variable"!=a&&(o="error"),"interpolation")},z.params=function(a,b,c){return")"==a?v(c):"{"==a||"}"==a?x(a,b,c):("word"==a&&y(b),"params")},{startState:function(a){return{tokenize:null,state:"top",context:new t("top",a||0,null)}},token:function(a,b){if(!b.tokenize&&a.eatSpace())return null;var c=(b.tokenize||q)(a,b);return c&&"object"==typeof c&&(n=c[1],c=c[0]),o=c,b.state=z[b.state](n,a,b),o},indent:function(a,b){var c=a.context,e=b&&b.charAt(0),f=c.indent;return"prop"==c.type&&"}"==e&&(c=c.prev),!c.prev||("}"!=e||"block"!=c.type&&"top"!=c.type&&"interpolation"!=c.type&&"font_face"!=c.type)&&(")"!=e||"parens"!=c.type&&"params"!=c.type&&"media_parens"!=c.type)&&("{"!=e||"at"!=c.type&&"media"!=c.type)||(f=c.indent-d,c=c.prev),f},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var c=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],d=b(c),e=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],f=b(e),g=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-inside","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-profile","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","kerning","text-anchor","writing-mode"],h=b(g),i=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],i=b(i),j=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],k=b(j),l=["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"],m=b(l),n=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],o=b(n),p=c.concat(e).concat(g).concat(i).concat(j).concat(l);a.registerHelper("hintWords","css",p),a.defineMIME("text/css",{mediaTypes:d,mediaFeatures:f,propertyKeywords:h,nonStandardPropertyKeywords:i,colorKeywords:k,valueKeywords:m,fontProperties:o,tokenHooks:{"<":function(a,b){return a.match("!--")?(b.tokenize=r,r(a,b)):!1},"/":function(a,b){return a.eat("*")?(b.tokenize=q,q(a,b)):!1}},name:"css"}),a.defineMIME("text/x-scss",{mediaTypes:d,mediaFeatures:f,propertyKeywords:h,nonStandardPropertyKeywords:i,colorKeywords:k,valueKeywords:m,fontProperties:o,allowNested:!0,tokenHooks:{"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=q,q(a,b)):["operator","operator"]},":":function(a){return a.match(/\s*{/)?[null,"{"]:!1},$:function(a){return a.match(/^[\w-]+/),a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(a){return a.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),a.defineMIME("text/x-less",{mediaTypes:d,mediaFeatures:f,propertyKeywords:h,nonStandardPropertyKeywords:i,colorKeywords:k,valueKeywords:m,fontProperties:o,allowNested:!0,tokenHooks:{"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=q,q(a,b)):["operator","operator"]},"@":function(a){return a.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(a.eatWhile(/[\w\\\-]/),a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d!?|\/]/;return{startState:function(a){return{tokenize:null,context:new r((a||0)-d,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;m=null;var d=(b.tokenize||n)(a,b);if("comment"==d||"meta"==d)return d;if(null==c.align&&(c.align=!0),";"!=m&&":"!=m&&","!=m||"statement"!=c.type)if("{"==m)s(b,a.column(),"}");else if("["==m)s(b,a.column(),"]");else if("("==m)s(b,a.column(),")");else if("}"==m){for(;"statement"==c.type;)c=t(b);for("}"==c.type&&(c=t(b));"statement"==c.type;)c=t(b)}else m==c.type?t(b):(("}"==c.type||"top"==c.type)&&";"!=m||"statement"==c.type&&"newstatement"==m)&&s(b,a.column(),"statement");else t(b);return b.startOfLine=!1,d},indent:function(b,c){if(b.tokenize!=n&&null!=b.tokenize)return a.Pass;var f=b.context,g=c&&c.charAt(0);"statement"==f.type&&"}"==g&&(f=f.prev);var h=g==f.type;return"statement"==f.type?f.indented+("{"==g?0:e):f.align?f.column+(h?0:1):f.indented+(h?0:d)},electricChars:"{}"}});var c="body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with";a.defineMIME("text/x-d",{name:"d",keywords:b("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters "+c),blockKeywords:b(c),builtin:b("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t"),atoms:b("exit failure success true false null"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("diff",function(){var a={"+":"positive","-":"negative","@":"meta"};return{token:function(b){var c=b.string.search(/[\t ]+?$/);if(!b.sol()||0===c)return b.skipToEnd(),("error "+(a[b.string.charAt(0)]||"")).replace(/ $/,"");var d=a[b.peek()]||b.skipToEnd();return-1===c?b.skipToEnd():b.pos=c,d}}}),a.defineMIME("text/x-diff","diff")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/overlay"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("django:inner",function(){function b(a,b){a.eatWhile(/[^\{]/);var d=a.next();return"{"==d&&(d=a.eat(/\{|%|#/))?(b.tokenize=c(d),"tag"):void 0}function c(c){return"{"==c&&(c="}"),function(d,e){var f=d.next();return f==c&&d.eat("}")?(e.tokenize=b,"tag"):d.match(a)?"keyword":"#"==c?"comment":"string"}}var a=["block","endblock","for","endfor","in","true","false","loop","none","self","super","if","endif","as","not","and","else","import","with","endwith","without","context","ifequal","endifequal","ifnotequal","endifnotequal","extends","include","load","length","comment","endcomment","empty"];return a=new RegExp("^(("+a.join(")|(")+"))\\b"),{startState:function(){return{tokenize:b}},token:function(a,b){return b.tokenize(a,b)}}}),a.defineMode("django",function(b){var c=a.getMode(b,"text/html"),d=a.getMode(b,"django:inner");return a.overlayMode(c,d)}),a.defineMIME("text/x-django","django")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("dtd",function(a){function d(a,b){return c=b,a}function e(a,b){var c=a.next();if("<"!=c||!a.eat("!")){if("<"==c&&a.eat("?"))return b.tokenize=h("meta","?>"),d("meta",c);if("#"==c&&a.eatWhile(/[\w]/))return d("atom","tag");if("|"==c)return d("keyword","seperator");if(c.match(/[\(\)\[\]\-\.,\+\?>]/))return d(null,c);if(c.match(/[\[\]]/))return d("rule",c);if('"'==c||"'"==c)return b.tokenize=g(c),b.tokenize(a,b);if(a.eatWhile(/[a-zA-Z\?\+\d]/)){var e=a.current();return null!==e.substr(e.length-1,e.length).match(/\?|\+/)&&a.backUp(1),d("tag","tag")}return"%"==c||"*"==c?d("number","number"):(a.eatWhile(/[\w\\\-_%.{,]/),d(null,null))}return a.eatWhile(/[\-]/)?(b.tokenize=f,f(a,b)):a.eatWhile(/[\w]/)?d("keyword","doindent"):void 0}function f(a,b){for(var f,c=0;null!=(f=a.next());){if(c>=2&&">"==f){b.tokenize=e;break}c="-"==f?c+1:0}return d("comment","comment")}function g(a){return function(b,c){for(var g,f=!1;null!=(g=b.next());){if(g==a&&!f){c.tokenize=e;break}f=!f&&"\\"==g}return d("string","tag")}}function h(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){d.tokenize=e;break}c.next()}return a}}var c,b=a.indentUnit;return{startState:function(a){return{tokenize:e,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;var d=b.tokenize(a,b),e=b.stack[b.stack.length-1];return"["==a.current()||"doindent"===c||"["==c?b.stack.push("rule"):"endtag"===c?b.stack[b.stack.length-1]="endtag":"]"==a.current()||"]"==c||">"==c&&"rule"==e?b.stack.pop():"["==c&&b.stack.push("["),d},indent:function(a,d){var e=a.stack.length;return d.match(/\]\s+|\]/)?e-=1:">"===d.substr(d.length-1,d.length)&&("<"===d.substr(0,1)||"doindent"==c&&d.length>1||("doindent"==c?e--:">"==c&&d.length>1||"tag"==c&&">"!==d||("tag"==c&&"rule"==a.stack[a.stack.length-1]?e--:"tag"==c?e++:">"===d&&"rule"==a.stack[a.stack.length-1]&&">"===c?e--:">"===d&&"rule"==a.stack[a.stack.length-1]||("<"!==d.substr(0,1)&&">"===d.substr(0,1)?e-=1:">"===d||(e-=1)))),(null==c||"]"==c)&&e--),a.baseIndent+e*b},electricChars:"]>"}}),a.defineMIME("application/xml-dtd","dtd")}),CodeMirror.defineMode("dylan",function(){function k(a,b,c){return b.tokenize=c,c(a,b)}function n(a,b,c){return l=a,m=c,b}function o(a,b){var c=a.peek();if("'"==c||'"'==c)return a.next(),k(a,b,q(c,"string","string"));if("/"==c)return a.next(),a.eat("*")?k(a,b,p):a.eat("/")?(a.skipToEnd(),n("comment","comment")):(a.skipTo(" "),n("operator","operator"));if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/),n("number","number");if("#"==c)return a.next(),c=a.peek(),'"'==c?(a.next(),k(a,b,q('"',"symbol","string-2"))):"b"==c?(a.next(),a.eatWhile(/[01]/),n("number","number")):"x"==c?(a.next(),a.eatWhile(/[\da-f]/i),n("number","number")):"o"==c?(a.next(),a.eatWhile(/[0-7]/),n("number","number")):(a.eatWhile(/[-a-zA-Z]/),n("hash","keyword"));if(a.match("end"))return n("end","keyword");for(var g in e)if(e.hasOwnProperty(g)){var h=e[g];if(h instanceof Array&&h.some(function(b){return a.match(b)})||a.match(h))return n(g,f[g],a.current())}return a.match("define")?n("definition","def"):(a.eatWhile(/[\w\-]/),i[a.current()]?n(i[a.current()],j[a.current()],a.current()):a.current().match(d)?n("variable","variable"):(a.next(),n("other","variable-2")))}function p(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=o;break}c="*"==d}return n("comment","comment")}function q(a,b,c){return function(d,e){for(var f,g=!1;null!=(f=d.next());)if(f==a){g=!0;break}return g&&(e.tokenize=o),n(b,c)}}var b={unnamedDefinition:["interface"],namedDefinition:["module","library","macro","C-struct","C-union","C-function","C-callable-wrapper"],typeParameterizedDefinition:["class","C-subtype","C-mapped-subtype"],otherParameterizedDefinition:["method","function","C-variable","C-address"],constantSimpleDefinition:["constant"],variableSimpleDefinition:["variable"],otherSimpleDefinition:["generic","domain","C-pointer-type","table"],statement:["if","block","begin","method","case","for","select","when","unless","until","while","iterate","profiling","dynamic-bind"],separator:["finally","exception","cleanup","else","elseif","afterwards"],other:["above","below","by","from","handler","in","instance","let","local","otherwise","slot","subclass","then","to","keyed-by","virtual"],signalingCalls:["signal","error","cerror","break","check-type","abort"]}; b.otherDefinition=b.unnamedDefinition.concat(b.namedDefinition).concat(b.otherParameterizedDefinition),b.definition=b.typeParameterizedDefinition.concat(b.otherDefinition),b.parameterizedDefinition=b.typeParameterizedDefinition.concat(b.otherParameterizedDefinition),b.simpleDefinition=b.constantSimpleDefinition.concat(b.variableSimpleDefinition).concat(b.otherSimpleDefinition),b.keyword=b.statement.concat(b.separator).concat(b.other);var c="[-_a-zA-Z?!*@<>$%]+",d=new RegExp("^"+c),e={symbolKeyword:c+":",symbolClass:"<"+c+">",symbolGlobal:"\\*"+c+"\\*",symbolConstant:"\\$"+c},f={symbolKeyword:"atom",symbolClass:"tag",symbolGlobal:"variable-2",symbolConstant:"variable-3"};for(var g in e)e.hasOwnProperty(g)&&(e[g]=new RegExp("^"+e[g]));e.keyword=[/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];var h={};h.keyword="keyword",h.definition="def",h.simpleDefinition="def",h.signalingCalls="builtin";var i={},j={};["keyword","definition","simpleDefinition","signalingCalls"].forEach(function(a){b[a].forEach(function(b){i[b]=a,j[b]=h[a]})});var l,m;return{startState:function(){return{tokenize:o,currentIndent:0}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c},blockCommentStart:"/*",blockCommentEnd:"*/"}}),CodeMirror.defineMIME("text/x-dylan","dylan"),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("ecl",function(a){function b(a){for(var b={},c=a.split(" "),d=0;d=0&&(!isNaN(m[p])||"_"==m[p]);)--p;if(p>0){var s=m.substr(0,p+1);if(h.propertyIsEnumerable(s))return j.propertyIsEnumerable(s)&&(o="newstatement"),"variable-3"}return k.propertyIsEnumerable(m)?"atom":null}function q(a){return function(b,c){for(var e,d=!1,f=!1;null!=(e=b.next());){if(e==a&&!d){f=!0;break}d=!d&&"\\"==e}return(f||!d&&!m)&&(c.tokenize=p),"string"}}function r(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=p;break}c="*"==d}return"comment"}function s(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function t(a,b,c){return a.context=new s(a.indented,b,c,null,a.context)}function u(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var m,o,d=a.indentUnit,e=b("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"),f=b("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"),g=b("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"),h=b("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"),i=b("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"),j=b("catch class do else finally for if switch try while"),k=b("true false null"),l={"#":c},n=/[+\-*&%=<>!?|\/]/;return{startState:function(a){return{tokenize:null,context:new s((a||0)-d,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;o=null;var d=(b.tokenize||p)(a,b);if("comment"==d||"meta"==d)return d;if(null==c.align&&(c.align=!0),";"!=o&&":"!=o||"statement"!=c.type)if("{"==o)t(b,a.column(),"}");else if("["==o)t(b,a.column(),"]");else if("("==o)t(b,a.column(),")");else if("}"==o){for(;"statement"==c.type;)c=u(b);for("}"==c.type&&(c=u(b));"statement"==c.type;)c=u(b)}else o==c.type?u(b):("}"==c.type||"top"==c.type||"statement"==c.type&&"newstatement"==o)&&t(b,a.column(),"statement");else u(b);return b.startOfLine=!1,d},indent:function(a,b){if(a.tokenize!=p&&null!=a.tokenize)return 0;var c=a.context,e=b&&b.charAt(0);"statement"==c.type&&"}"==e&&(c=c.prev);var f=e==c.type;return"statement"==c.type?c.indented+("{"==e?0:d):c.align?c.column+(f?0:1):c.indented+(f?0:d)},electricChars:"{}"}}),a.defineMIME("text/x-ecl","ecl")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("eiffel",function(){function a(a){for(var b={},c=0,d=a.length;d>c;++c)b[a[c]]=!0;return b}function e(a,b,c){return c.tokenize.push(a),a(b,c)}function f(a,b){if(d=null,a.eatSpace())return null;var c=a.next();return'"'==c||"'"==c?e(g(c,"string"),a,b):"-"==c&&a.eat("-")?(a.skipToEnd(),"comment"):":"==c&&a.eat("=")?"operator":/[0-9]/.test(c)?(a.eatWhile(/[xXbBCc0-9\.]/),a.eat(/[\?\!]/),"ident"):/[a-zA-Z_0-9]/.test(c)?(a.eatWhile(/[a-zA-Z_0-9]/),a.eat(/[\?\!]/),"ident"):/[=+\-\/*^%<>~]/.test(c)?(a.eatWhile(/[=+\-\/*^%<>~]/),"operator"):null}function g(a,b,c){return function(d,e){for(var g,f=!1;null!=(g=d.next());){if(g==a&&(c||!f)){e.tokenize.pop();break}f=!f&&"%"==g}return b}}var d,b=a(["note","across","when","variant","until","unique","undefine","then","strip","select","retry","rescue","require","rename","reference","redefine","prefix","once","old","obsolete","loop","local","like","is","inspect","infix","include","if","frozen","from","external","export","ensure","end","elseif","else","do","creation","create","check","alias","agent","separate","invariant","inherit","indexing","feature","expanded","deferred","class","Void","True","Result","Precursor","False","Current","create","attached","detachable","as","and","implies","not","or"]),c=a([":=","and then","and","or","<<",">>"]);return{startState:function(){return{tokenize:[f]}},token:function(a,d){var e=d.tokenize[d.tokenize.length-1](a,d);if("ident"==e){var f=a.current();e=b.propertyIsEnumerable(a.current())?"keyword":c.propertyIsEnumerable(a.current())?"operator":/^[A-Z][A-Z_0-9]*$/g.test(f)?"tag":/^0[bB][0-1]+$/g.test(f)?"number":/^0[cC][0-7]+$/g.test(f)?"number":/^0[xX][a-fA-F0-9]+$/g.test(f)?"number":/^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(f)?"number":/^[0-9]+$/g.test(f)?"number":"variable"}return e},lineComment:"--"}}),a.defineMIME("text/x-eiffel","eiffel")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMIME("text/x-erlang","erlang"),a.defineMode("erlang",function(b){function r(a,b){if(b.in_string)return b.in_string=!u(a),z(b,a,"string");if(b.in_atom)return b.in_atom=!v(a),z(b,a,"atom");if(a.eatSpace())return z(b,a,"whitespace");if(!D(b)&&a.match(/-\s*[a-z\xdf-\xf6\xf8-\xff][\w\xd8-\xde\xc0-\xd6\xdf-\xf6\xf8-\xff]*/))return y(a.current(),c)?z(b,a,"type"):z(b,a,"attribute");var r=a.next();if("%"==r)return a.skipToEnd(),z(b,a,"comment");if(":"==r)return z(b,a,"colon");if("?"==r)return a.eatSpace(),a.eatWhile(p),z(b,a,"macro");if("#"==r)return a.eatSpace(),a.eatWhile(p),z(b,a,"record");if("$"==r)return"\\"!=a.next()||a.match(q)?z(b,a,"number"):z(b,a,"error");if("."==r)return z(b,a,"dot");if("'"==r){if(!(b.in_atom=!v(a))){if(a.match(/\s*\/\s*[0-9]/,!1))return a.match(/\s*\/\s*[0-9]/,!0),z(b,a,"fun");if(a.match(/\s*\(/,!1)||a.match(/\s*:/,!1))return z(b,a,"function")}return z(b,a,"atom")}if('"'==r)return b.in_string=!u(a),z(b,a,"string");if(/[A-Z_\xd8-\xde\xc0-\xd6]/.test(r))return a.eatWhile(p),z(b,a,"variable");if(/[a-z_\xdf-\xf6\xf8-\xff]/.test(r)){if(a.eatWhile(p),a.match(/\s*\/\s*[0-9]/,!1))return a.match(/\s*\/\s*[0-9]/,!0),z(b,a,"fun");var w=a.current();return y(w,d)?z(b,a,"keyword"):y(w,g)?z(b,a,"operator"):a.match(/\s*\(/,!1)?!y(w,o)||":"==D(b).token&&"erlang"!=D(b,2).token?y(w,n)?z(b,a,"guard"):z(b,a,"function"):z(b,a,"builtin"):y(w,g)?z(b,a,"operator"):":"==x(a)?"erlang"==w?z(b,a,"builtin"):z(b,a,"function"):y(w,["true","false"])?z(b,a,"boolean"):y(w,["true","false"])?z(b,a,"boolean"):z(b,a,"atom")}var A=/[0-9]/,B=/[0-9a-zA-Z]/;return A.test(r)?(a.eatWhile(A),a.eat("#")?a.eatWhile(B)||a.backUp(1):a.eat(".")&&(a.eatWhile(A)?a.eat(/[eE]/)&&(a.eat(/[-+]/)?a.eatWhile(A)||a.backUp(2):a.eatWhile(A)||a.backUp(1)):a.backUp(1)),z(b,a,"number")):s(a,j,k)?z(b,a,"open_paren"):s(a,l,m)?z(b,a,"close_paren"):t(a,e,f)?z(b,a,"separator"):t(a,h,i)?z(b,a,"operator"):z(b,a,null)}function s(a,b,c){if(1==a.current().length&&b.test(a.current())){for(a.backUp(1);b.test(a.peek());)if(a.next(),y(a.current(),c))return!0;a.backUp(a.current().length-1)}return!1}function t(a,b,c){if(1==a.current().length&&b.test(a.current())){for(;b.test(a.peek());)a.next();for(;0c?!1:a.tokenStack[c-d]}function E(a,b){"comment"!=b.type&&"whitespace"!=b.type&&(a.tokenStack=F(a.tokenStack,b),a.tokenStack=G(a.tokenStack))}function F(a,b){var c=a.length-1;return c>0&&"record"===a[c].type&&"dot"===b.type?a.pop():c>0&&"group"===a[c].type?(a.pop(),a.push(b)):a.push(b),a}function G(a){var b=a.length-1;if("dot"===a[b].type)return[];if("fun"===a[b].type&&"fun"===a[b-1].token)return a.slice(0,b-1);switch(a[a.length-1].token){case"}":return H(a,{g:["{"]});case"]":return H(a,{i:["["]});case")":return H(a,{i:["("]});case">>":return H(a,{i:["<<"]});case"end":return H(a,{i:["begin","case","fun","if","receive","try"]});case",":return H(a,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return H(a,{r:["when"],m:["try","if","case","receive"]});case";":return H(a,{E:["case","fun","if","receive","try","when"]});case"catch":return H(a,{e:["try"]});case"of":return H(a,{e:["case"]});case"after":return H(a,{e:["receive","try"]});default:return a}}function H(a,b){for(var c in b)for(var d=a.length-1,e=b[c],f=d-1;f>-1;f--)if(y(a[f].token,e)){var g=a.slice(0,f);switch(c){case"m":return g.concat(a[f]).concat(a[d]);case"r":return g.concat(a[d]);case"i":return g;case"g":return g.concat(C("group"));case"E":return g.concat(a[f]);case"e":return g.concat(a[f])}}return"E"==c?[]:a}function I(c,d){var e,f=b.indentUnit,g=J(d),h=D(c,1),i=D(c,2);return c.in_string||c.in_atom?a.Pass:i?"when"==h.token?h.column+f:"when"===g&&"function"===i.type?i.indent+f:"("===g&&"fun"===h.token?h.column+3:"catch"===g&&(e=M(c,["try"]))?e.column:y(g,["end","after","of"])?(e=M(c,["begin","case","fun","if","receive","try"]),e?e.column:a.Pass):y(g,m)?(e=M(c,k),e?e.column:a.Pass):y(h.token,[",","|","||"])||y(g,[",","|","||"])?(e=K(c),e?e.column+e.token.length:f):"->"==h.token?y(i.token,["receive","case","if","try"])?i.column+f+f:i.column+f:y(h.token,k)?h.column+h.token.length:(e=L(c),O(e)?e.column+f:0):0}function J(a){var b=a.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return O(b)&&0===b.index?b[0]:""}function K(a){var b=a.tokenStack.slice(0,-1),c=N(b,"type",["open_paren"]);return O(b[c])?b[c]:!1}function L(a){var b=a.tokenStack,c=N(b,"type",["open_paren","separator","keyword"]),d=N(b,"type",["operator"]);return O(c)&&O(d)&&d>c?b[c+1]:O(c)?b[c]:!1}function M(a,b){var c=a.tokenStack,d=N(c,"token",b);return O(c[d])?c[d]:!1}function N(a,b,c){for(var d=a.length-1;d>-1;d--)if(y(a[d][b],c))return d;return!1}function O(a){return a!==!1&&null!=a}var c=["-type","-spec","-export_type","-opaque"],d=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],e=/[\->,;]/,f=["->",";",","],g=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],h=/[\+\-\*\/<>=\|:!]/,i=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"],j=/[<\(\[\{]/,k=["<<","(","[","{"],l=/[>\)\]\}]/,m=["}","]",")",">>"],n=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],o=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],p=/[\w@\xd8-\xde\xc0-\xd6\xdf-\xf6\xf8-\xff]/,q=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;return{startState:function(){return{tokenStack:[],in_string:!1,in_atom:!1}},token:function(a,b){return r(a,b)},indent:function(a,b){return I(a,b)},lineComment:"%"}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("fortran",function(){function a(a){for(var b={},c=0;c\/\:]/,f=new RegExp("(.and.|.or.|.eq.|.lt.|.le.|.gt.|.ge.|.ne.|.not.|.eqv.|.neqv.)","i");return{startState:function(){return{tokenize:null}},token:function(a,b){if(a.eatSpace())return null;var c=(b.tokenize||g)(a,b);return"comment"==c||"meta"==c?c:c}}}),a.defineMIME("text/x-fortran","fortran")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("gfm",function(b,c){function e(a){return a.code=!1,null}var d=0,f={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(a){return{code:a.code,codeBlock:a.codeBlock,ateSpace:a.ateSpace}},token:function(a,b){if(b.codeBlock)return a.match(/^```/)?(b.codeBlock=!1,null):(a.skipToEnd(),null);if(a.sol()&&(b.code=!1),a.sol()&&a.match(/^```/))return a.skipToEnd(),b.codeBlock=!0,null;if("`"===a.peek()){a.next();var c=a.pos;a.eatWhile("`");var e=1+a.pos-c;return b.code?e===d&&(b.code=!1):(d=e,b.code=!0),null}if(b.code)return a.next(),null;if(a.eatSpace())return b.ateSpace=!0,null;if(a.sol()||b.ateSpace){if(b.ateSpace=!1,a.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return"link";if(a.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return"link"}return a.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`!()\[\]{};:'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))/i)&&"]("!=a.string.slice(a.start-2,a.start)?"link":(a.next(),null)},blankLine:e},g={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0};for(var h in c)g[h]=c[h];return g.name="markdown",a.defineMIME("gfmBase",g),a.overlayMode(a.getMode(b,"gfmBase"),f)},"markdown")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("gas",function(a,b){function g(){d="#",f.ax="variable",f.eax="variable-2",f.rax="variable-3",f.bx="variable",f.ebx="variable-2",f.rbx="variable-3",f.cx="variable",f.ecx="variable-2",f.rcx="variable-3",f.dx="variable",f.edx="variable-2",f.rdx="variable-3",f.si="variable",f.esi="variable-2",f.rsi="variable-3",f.di="variable",f.edi="variable-2",f.rdi="variable-3",f.sp="variable",f.esp="variable-2",f.rsp="variable-3",f.bp="variable",f.ebp="variable-2",f.rbp="variable-3",f.ip="variable",f.eip="variable-2",f.rip="variable-3",f.cs="keyword",f.ds="keyword",f.ss="keyword",f.es="keyword",f.fs="keyword",f.gs="keyword"}function h(){d="@",e.syntax="builtin",f.r0="variable",f.r1="variable",f.r2="variable",f.r3="variable",f.r4="variable",f.r5="variable",f.r6="variable",f.r7="variable",f.r8="variable",f.r9="variable",f.r10="variable",f.r11="variable",f.r12="variable",f.sp="variable-2",f.lr="variable-2",f.pc="variable-2",f.r13=f.sp,f.r14=f.lr,f.r15=f.pc,c.push(function(a,b){return"#"===a?(b.eatWhile(/\w/),"number"):void 0})}function j(a,b){for(var d,c=!1;null!=(d=a.next());){if(d===b&&!c)return!1;c=!c&&"\\"===d}return c}function k(a,b){for(var d,c=!1;null!=(d=a.next());){if("/"===d&&c){b.tokenize=null;break}c="*"===d}return"comment"}var c=[],d="",e={".abort":"builtin",".align":"builtin",".altmacro":"builtin",".ascii":"builtin",".asciz":"builtin",".balign":"builtin",".balignw":"builtin",".balignl":"builtin",".bundle_align_mode":"builtin",".bundle_lock":"builtin",".bundle_unlock":"builtin",".byte":"builtin",".cfi_startproc":"builtin",".comm":"builtin",".data":"builtin",".def":"builtin",".desc":"builtin",".dim":"builtin",".double":"builtin",".eject":"builtin",".else":"builtin",".elseif":"builtin",".end":"builtin",".endef":"builtin",".endfunc":"builtin",".endif":"builtin",".equ":"builtin",".equiv":"builtin",".eqv":"builtin",".err":"builtin",".error":"builtin",".exitm":"builtin",".extern":"builtin",".fail":"builtin",".file":"builtin",".fill":"builtin",".float":"builtin",".func":"builtin",".global":"builtin",".gnu_attribute":"builtin",".hidden":"builtin",".hword":"builtin",".ident":"builtin",".if":"builtin",".incbin":"builtin",".include":"builtin",".int":"builtin",".internal":"builtin",".irp":"builtin",".irpc":"builtin",".lcomm":"builtin",".lflags":"builtin",".line":"builtin",".linkonce":"builtin",".list":"builtin",".ln":"builtin",".loc":"builtin",".loc_mark_labels":"builtin",".local":"builtin",".long":"builtin",".macro":"builtin",".mri":"builtin",".noaltmacro":"builtin",".nolist":"builtin",".octa":"builtin",".offset":"builtin",".org":"builtin",".p2align":"builtin",".popsection":"builtin",".previous":"builtin",".print":"builtin",".protected":"builtin",".psize":"builtin",".purgem":"builtin",".pushsection":"builtin",".quad":"builtin",".reloc":"builtin",".rept":"builtin",".sbttl":"builtin",".scl":"builtin",".section":"builtin",".set":"builtin",".short":"builtin",".single":"builtin",".size":"builtin",".skip":"builtin",".sleb128":"builtin",".space":"builtin",".stab":"builtin",".string":"builtin",".struct":"builtin",".subsection":"builtin",".symver":"builtin",".tag":"builtin",".text":"builtin",".title":"builtin",".type":"builtin",".uleb128":"builtin",".val":"builtin",".version":"builtin",".vtable_entry":"builtin",".vtable_inherit":"builtin",".warning":"builtin",".weak":"builtin",".weakref":"builtin",".word":"builtin"},f={},i=(b.architecture||"x86").toLowerCase();return"x86"===i?g(b):("arm"===i||"armv6"===i)&&h(b),{startState:function(){return{tokenize:null}},token:function(a,b){if(b.tokenize)return b.tokenize(a,b);if(a.eatSpace())return null;var g,h,i=a.next();if("/"===i&&a.eat("*"))return b.tokenize=k,k(a,b);if(i===d)return a.skipToEnd(),"comment";if('"'===i)return j(a,'"'),"string";if("."===i)return a.eatWhile(/\w/),h=a.current().toLowerCase(),g=e[h],g||null;if("="===i)return a.eatWhile(/\w/),"tag";if("{"===i)return"braket";if("}"===i)return"braket";if(/\d/.test(i))return"0"===i&&a.eat("x")?(a.eatWhile(/[0-9a-fA-F]/),"number"):(a.eatWhile(/\d/),"number");if(/\w/.test(i))return a.eatWhile(/\w/),a.eat(":")?"tag":(h=a.current().toLowerCase(),g=f[h],g||null);for(var l=0;l]*>?/)?"variable":(a.next(),a.eatWhile(/[^@"<#]/),null) }}}),a.defineMIME("text/x-feature","gherkin")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("go",function(a){function g(a,b){var g=a.next();if('"'==g||"'"==g||"`"==g)return b.tokenize=h(g),b.tokenize(a,b);if(/[\d\.]/.test(g))return"."==g?a.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==g?a.match(/^[xX][0-9a-fA-F]+/)||a.match(/^0[0-7]+/):a.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(g))return f=g,null;if("/"==g){if(a.eat("*"))return b.tokenize=i,i(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(e.test(g))return a.eatWhile(e),"operator";a.eatWhile(/[\w\$_]/);var j=a.current();return c.propertyIsEnumerable(j)?(("case"==j||"default"==j)&&(f="case"),"keyword"):d.propertyIsEnumerable(j)?"atom":"variable"}function h(a){return function(b,c){for(var e,d=!1,f=!1;null!=(e=b.next());){if(e==a&&!d){f=!0;break}d=!d&&"\\"==e}return(f||!d&&"`"!=a)&&(c.tokenize=g),"string"}}function i(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=g;break}c="*"==d}return"comment"}function j(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function k(a,b,c){return a.context=new j(a.indented,b,c,null,a.context)}function l(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var f,b=a.indentUnit,c={"break":!0,"case":!0,chan:!0,"const":!0,"continue":!0,"default":!0,defer:!0,"else":!0,fallthrough:!0,"for":!0,func:!0,go:!0,"goto":!0,"if":!0,"import":!0,"interface":!0,map:!0,"package":!0,range:!0,"return":!0,select:!0,struct:!0,"switch":!0,type:!0,"var":!0,bool:!0,"byte":!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,"int":!0,uint:!0,uintptr:!0},d={"true":!0,"false":!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,imag:!0,len:!0,make:!0,"new":!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},e=/[+\-*&^%:=<>!|\/]/;return{startState:function(a){return{tokenize:null,context:new j((a||0)-b,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0,"case"==c.type&&(c.type="}")),a.eatSpace())return null;f=null;var d=(b.tokenize||g)(a,b);return"comment"==d?d:(null==c.align&&(c.align=!0),"{"==f?k(b,a.column(),"}"):"["==f?k(b,a.column(),"]"):"("==f?k(b,a.column(),")"):"case"==f?c.type="case":"}"==f&&"}"==c.type?c=l(b):f==c.type&&l(b),b.startOfLine=!1,d)},indent:function(a,c){if(a.tokenize!=g&&null!=a.tokenize)return 0;var d=a.context,e=c&&c.charAt(0);if("case"==d.type&&/^(?:case|default)\b/.test(c))return a.context.type="}",d.indented;var f=e==d.type;return d.align?d.column+(f?0:1):d.indented+(f?0:b)},electricChars:"{}):",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),a.defineMIME("text/x-go","go")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("groovy",function(a){function b(a){for(var b={},c=a.split(" "),d=0;d"))return f="->",null;if(/[+\-*&%=<>!?|\/~]/.test(g))return a.eatWhile(/[+\-*&%=<>|~]/),"operator";if(a.eatWhile(/[\w\$_]/),"@"==g)return a.eatWhile(/[\w\$_\.]/),"meta";if("."==b.lastToken)return"property";if(a.eat(":"))return f="proplabel","property";var i=a.current();return e.propertyIsEnumerable(i)?"atom":c.propertyIsEnumerable(i)?(d.propertyIsEnumerable(i)&&(f="newstatement"),"keyword"):"variable"}function h(a,b,c){function e(b,c){for(var f,e=!1,g=!d;null!=(f=b.next());){if(f==a&&!e){if(!d)break;if(b.match(a+a)){g=!0;break}}if('"'==a&&"$"==f&&!e&&b.eat("{"))return c.tokenize.push(i()),"string";e=!e&&"\\"==f}return g&&c.tokenize.pop(),"string"}var d=!1;if("/"!=a&&b.eat(a)){if(!b.eat(a))return"string";d=!0}return c.tokenize.push(e),e(b,c)}function i(){function b(b,c){if("}"==b.peek()){if(a--,0==a)return c.tokenize.pop(),c.tokenize[c.tokenize.length-1](b,c)}else"{"==b.peek()&&a++;return g(b,c)}var a=1;return b.isBase=!0,b}function j(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize.pop();break}c="*"==d}return"comment"}function k(a){return!a||"operator"==a||"->"==a||/[\.\[\{\(,;:]/.test(a)||"newstatement"==a||"keyword"==a||"proplabel"==a}function l(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function m(a,b,c){return a.context=new l(a.indented,b,c,null,a.context)}function n(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var f,c=b("abstract as assert boolean break byte case catch char class const continue def default do double else enum extends final finally float for goto if implements import in instanceof int interface long native new package private protected public return short static strictfp super switch synchronized threadsafe throw throws transient try void volatile while"),d=b("catch class do else finally for if switch try while enum interface def"),e=b("null true false this");return g.isBase=!0,{startState:function(b){return{tokenize:[g],context:new l((b||0)-a.indentUnit,0,"top",!1),indented:0,startOfLine:!0,lastToken:null}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0,"statement"!=c.type||k(b.lastToken)||(n(b),c=b.context)),a.eatSpace())return null;f=null;var d=b.tokenize[b.tokenize.length-1](a,b);if("comment"==d)return d;if(null==c.align&&(c.align=!0),";"!=f&&":"!=f||"statement"!=c.type)if("->"==f&&"statement"==c.type&&"}"==c.prev.type)n(b),b.context.align=!1;else if("{"==f)m(b,a.column(),"}");else if("["==f)m(b,a.column(),"]");else if("("==f)m(b,a.column(),")");else if("}"==f){for(;"statement"==c.type;)c=n(b);for("}"==c.type&&(c=n(b));"statement"==c.type;)c=n(b)}else f==c.type?n(b):("}"==c.type||"top"==c.type||"statement"==c.type&&"newstatement"==f)&&m(b,a.column(),"statement");else n(b);return b.startOfLine=!1,b.lastToken=f||d,d},indent:function(b,c){if(!b.tokenize[b.tokenize.length-1].isBase)return 0;var d=c&&c.charAt(0),e=b.context;"statement"!=e.type||k(b.lastToken)||(e=e.prev);var f=d==e.type;return"statement"==e.type?e.indented+("{"==d?0:a.indentUnit):e.align?e.column+(f?0:1):e.indented+(f?0:a.indentUnit)},electricChars:"{}",fold:"brace"}}),a.defineMIME("text/x-groovy","groovy")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],a):a(CodeMirror)}(function(a){"use strict";!function(){a.defineMode("haml",function(b){function e(a){return function(b,c){var d=b.peek();return d==a&&1==c.rubyState.tokenize.length?(b.next(),c.tokenize=g,"closeAttributeTag"):f(b,c)}}function f(a,b){return a.match("-#")?(a.skipToEnd(),"comment"):d.token(a,b.rubyState)}function g(a,b){var d=a.peek();if("comment"==b.previousToken.style&&b.indented>b.previousToken.indented)return a.skipToEnd(),"commentLine";if(b.startOfLine){if("!"==d&&a.match("!!"))return a.skipToEnd(),"tag";if(a.match(/^%[\w:#\.]+=/))return b.tokenize=f,"hamlTag";if(a.match(/^%[\w:]+/))return"hamlTag";if("/"==d)return a.skipToEnd(),"comment"}if((b.startOfLine||"hamlTag"==b.previousToken.style)&&("#"==d||"."==d))return a.match(/[\w-#\.]*/),"hamlAttribute";if(b.startOfLine&&!a.match("-->",!1)&&("="==d||"-"==d))return b.tokenize=f,null;if("hamlTag"==b.previousToken.style||"closeAttributeTag"==b.previousToken.style||"hamlAttribute"==b.previousToken.style){if("("==d)return b.tokenize=e(")"),null;if("{"==d)return b.tokenize=e("}"),null}return c.token(a,b.htmlState)}var c=a.getMode(b,{name:"htmlmixed"}),d=a.getMode(b,"ruby");return{startState:function(){var a=c.startState(),b=d.startState();return{htmlState:a,rubyState:b,indented:0,previousToken:{style:null,indented:0},tokenize:g}},copyState:function(b){return{htmlState:a.copyState(c,b.htmlState),rubyState:a.copyState(d,b.rubyState),indented:b.indented,previousToken:b.previousToken,tokenize:b.tokenize}},token:function(a,b){if(a.sol()&&(b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;var c=b.tokenize(a,b);if(b.startOfLine=!1,c&&"commentLine"!=c&&(b.previousToken={style:c,indented:b.indented}),a.eol()&&b.tokenize==f){a.backUp(1);var d=a.peek();a.next(),d&&","!=d&&(b.tokenize=g)}return"hamlTag"==c?c="tag":"commentLine"==c?c="comment":"hamlAttribute"==c?c="attribute":"closeAttributeTag"==c&&(c=null),c}}},"htmlmixed","ruby"),a.defineMIME("text/x-haml","haml")}()}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("haskell",function(a,b){function c(a,b,c){return b(c),c(a,b)}function m(a,b){if(a.eatWhile(l))return null;var m=a.next();if(k.test(m)){if("{"==m&&a.eat("-")){var p="comment";return a.eat("#")&&(p="meta"),c(a,b,n(p,1))}return null}if("'"==m)return a.eat("\\")?a.next():a.next(),a.eat("'")?"string":"error";if('"'==m)return c(a,b,o);if(e.test(m))return a.eatWhile(i),a.eat(".")?"qualifier":"variable-2";if(d.test(m))return a.eatWhile(i),"variable";if(f.test(m)){if("0"==m){if(a.eat(/[xX]/))return a.eatWhile(g),"integer";if(a.eat(/[oO]/))return a.eatWhile(h),"number"}a.eatWhile(f);var p="number";return a.match(/^\.\d+/)&&(p="number"),a.eat(/[eE]/)&&(p="number",a.eat(/[-+]/),a.eatWhile(f)),p}if("."==m&&a.eat("."))return"keyword";if(j.test(m)){if("-"==m&&a.eat(/-/)&&(a.eatWhile(/-/),!a.eat(j)))return a.skipToEnd(),"comment";var p="variable";return":"==m&&(p="variable-2"),a.eatWhile(j),p}return"error"}function n(a,b){return 0==b?m:function(c,d){for(var e=b;!c.eol();){var f=c.next();if("{"==f&&c.eat("-"))++e;else if("-"==f&&c.eat("}")&&(--e,0==e))return d(m),a}return d(n(a,e)),a}}function o(a,b){for(;!a.eol();){var c=a.next();if('"'==c)return b(m),"string";if("\\"==c){if(a.eol()||a.eat(l))return b(p),"string";a.eat("&")||a.next()}}return b(m),"error"}function p(a,b){return a.eat("\\")?c(a,b,o):(a.next(),b(m),"error")}var d=/[a-z_]/,e=/[A-Z]/,f=/\d/,g=/[0-9A-Fa-f]/,h=/[0-7]/,i=/[a-z_A-Z0-9']/,j=/[-!#$%&*+.\/<=>?@\\^|~:]/,k=/[(),;[\]`{}]/,l=/[ \t\v\f]/,q=function(){function c(b){return function(){for(var c=0;c","@","~","=>"),c("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<=","=<<","==",">",">=",">>",">>=","^","^^","||","*","**"),c("builtin")("Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),c("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3");var d=b.overrideKeywords;if(d)for(var e in d)d.hasOwnProperty(e)&&(a[e]=d[e]);return a}();return{startState:function(){return{f:m}},copyState:function(a){return{f:a.f}},token:function(a,b){var c=b.f(a,function(a){b.f=a}),d=a.current();return q.hasOwnProperty(d)?q[d]:c},blockCommentStart:"{-",blockCommentEnd:"-}",lineComment:"--"}}),a.defineMIME("text/x-haskell","haskell")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("haxe",function(a,b){function f(a,b,c){return b.tokenize=c,c(a,b)}function g(a,b){for(var d,c=!1;null!=(d=a.next());){if(d==b&&!c)return!1;c=!c&&"\\"==d}return c}function j(a,b,c){return h=a,i=c,b}function k(a,b){var c=a.next();if('"'==c||"'"==c)return f(a,b,l(c));if(/[\[\]{}\(\),;\:\.]/.test(c))return j(c);if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),j("number","number");if(/\d/.test(c)||"-"==c&&a.eat(/\d/))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),j("number","number");if(b.reAllowed&&"~"==c&&a.eat(/\//))return g(a,"/"),a.eatWhile(/[gimsu]/),j("regexp","string-2");if("/"==c)return a.eat("*")?f(a,b,m):a.eat("/")?(a.skipToEnd(),j("comment","comment")):(a.eatWhile(e),j("operator",null,a.current()));if("#"==c)return a.skipToEnd(),j("conditional","meta");if("@"==c)return a.eat(/:/),a.eatWhile(/[\w_]/),j("metadata","meta");if(e.test(c))return a.eatWhile(e),j("operator",null,a.current());var h;if(/[A-Z]/.test(c))return a.eatWhile(/[\w_<>]/),h=a.current(),j("type","variable-3",h);a.eatWhile(/[\w_]/);var h=a.current(),i=d.propertyIsEnumerable(h)&&d[h];return i&&b.kwAllowed?j(i.type,i.style,h):j("variable","variable",h)}function l(a){return function(b,c){return g(b,a)||(c.tokenize=k),j("string","string")}}function m(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=k;break}c="*"==d}return j("comment","comment")}function o(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function p(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0}function q(a,b,c,d,e){var f=a.cc;for(t.state=a,t.stream=e,t.marked=null,t.cc=f,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var g=f.length?f.pop():D;if(g(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return t.marked?t.marked:"variable"==c&&p(a,d)?"variable-2":"variable"==c&&r(a,d)?"variable-3":b}}}function r(a,b){if(/[a-z]/.test(b.charAt(0)))return!1;for(var c=a.importedtypes.length,d=0;c>d;d++)if(a.importedtypes[d]==b)return!0}function s(a){for(var b=t.state,c=b.importedtypes;c;c=c.next)if(c.name==a)return;b.importedtypes={name:a,next:b.importedtypes}}function u(){for(var a=arguments.length-1;a>=0;a--)t.cc.push(arguments[a])}function v(){return u.apply(null,arguments),!0}function w(a){var b=t.state;if(b.context){t.marked="def";for(var c=b.localVars;c;c=c.next)if(c.name==a)return;b.localVars={name:a,next:b.localVars}}}function y(){t.state.context||(t.state.localVars=x),t.state.context={prev:t.state.context,vars:t.state.localVars}}function z(){t.state.localVars=t.state.context.vars,t.state.context=t.state.context.prev}function A(a,b){var c=function(){var c=t.state;c.lexical=new o(c.indented,t.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function B(){var a=t.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function C(a){function b(c){return c==a?v():";"==a?u():v(b)}return b}function D(a){return"@"==a?v(I):"var"==a?v(A("vardef"),R,C(";"),B):"keyword a"==a?v(A("form"),E,D,B):"keyword b"==a?v(A("form"),D,B):"{"==a?v(A("}"),y,Q,B,z):";"==a?v():"attribute"==a?v(H):"function"==a?v(V):"for"==a?v(A("form"),C("("),A(")"),T,C(")"),B,D,B):"variable"==a?v(A("stat"),M):"switch"==a?v(A("form"),E,A("}","switch"),C("{"),Q,B,B):"case"==a?v(E,C(":")):"default"==a?v(C(":")):"catch"==a?v(A("form"),y,C("("),Z,C(")"),D,B,z):"import"==a?v(K,C(";")):"typedef"==a?v(L):u(A("stat"),E,C(";"),B)}function E(a){return n.hasOwnProperty(a)?v(G):"function"==a?v(V):"keyword c"==a?v(F):"("==a?v(A(")"),F,C(")"),B,G):"operator"==a?v(E):"["==a?v(A("]"),P(E,"]"),B,G):"{"==a?v(A("}"),P(O,"}"),B,G):v()}function F(a){return a.match(/[;\}\)\],]/)?u():u(E)}function G(a,b){if("operator"==a&&/\+\+|--/.test(b))return v(G);if("operator"==a||":"==a)return v(E);if(";"!=a)return"("==a?v(A(")"),P(E,")"),B,G):"."==a?v(N,G):"["==a?v(A("]"),E,C("]"),B,G):void 0}function H(a){return"attribute"==a?v(H):"function"==a?v(V):"var"==a?v(R):void 0}function I(a){return":"==a?v(I):"variable"==a?v(I):"("==a?v(A(")"),P(J,")"),B,D):void 0}function J(a){return"variable"==a?v():void 0}function K(a,b){return"variable"==a&&/[A-Z]/.test(b.charAt(0))?(s(b),v()):"variable"==a||"property"==a||"."==a?v(K):void 0}function L(a,b){return"variable"==a&&/[A-Z]/.test(b.charAt(0))?(s(b),v()):"type"==a&&/[A-Z]/.test(b.charAt(0))?v():void 0}function M(a){return":"==a?v(B,D):u(G,C(";"),B)}function N(a){return"variable"==a?(t.marked="property",v()):void 0}function O(a){return"variable"==a&&(t.marked="property"),n.hasOwnProperty(a)?v(C(":"),E):void 0}function P(a,b){function c(d){return","==d?v(a,c):d==b?v():v(C(b))}return function(d){return d==b?v():u(a,c)}}function Q(a){return"}"==a?v():u(D,Q)}function R(a,b){return"variable"==a?(w(b),v(W,S)):v()}function S(a,b){return"="==b?v(E,S):","==a?v(R):void 0}function T(a,b){return"variable"==a&&w(b),v(A(")"),y,U,E,B,D,z)}function U(a,b){return"in"==b?v():void 0}function V(a,b){return"variable"==a?(w(b),v(V)):"new"==b?v(V):"("==a?v(A(")"),y,P(Z,")"),B,W,D,z):void 0}function W(a){return":"==a?v(X):void 0}function X(a){return"type"==a?v():"variable"==a?v():"{"==a?v(A("}"),P(Y,"}"),B):void 0}function Y(a){return"variable"==a?v(W):void 0}function Z(a,b){return"variable"==a?(w(b),v(W)):void 0}var h,i,c=a.indentUnit,d=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),f={type:"atom",style:"atom"},g={type:"attribute",style:"attribute"},h=a("typedef");return{"if":b,"while":b,"else":c,"do":c,"try":c,"return":d,"break":d,"continue":d,"new":d,"throw":d,"var":a("var"),inline:g,"static":g,using:a("import"),"public":g,"private":g,cast:a("cast"),"import":a("import"),macro:a("macro"),"function":a("function"),"catch":a("catch"),untyped:a("untyped"),callback:a("cb"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,never:a("property_access"),trace:a("trace"),"class":h,"enum":h,"interface":h,typedef:h,"extends":h,"implements":h,dynamic:h,"true":f,"false":f,"null":f}}(),e=/[+\-*&%=<>!?|]/,n={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},t={state:null,column:null,marked:null,cc:null},x={name:"this",next:null};return B.lex=!0,{startState:function(a){var d=["Int","Float","String","Void","Std","Bool","Dynamic","Array"];return{tokenize:k,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new o((a||0)-c,0,"block",!1),localVars:b.localVars,importedtypes:d,context:b.localVars&&{vars:b.localVars},indented:0}},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==h?c:(b.reAllowed=!("operator"!=h&&"keyword c"!=h&&!h.match(/^[\[{}\(,;:]$/)),b.kwAllowed="."!=h,q(b,c,h,i,a))},indent:function(a,b){if(a.tokenize!=k)return 0;var d=b&&b.charAt(0),e=a.lexical;"stat"==e.type&&"}"==d&&(e=e.prev);var f=e.type,g=d==f;return"vardef"==f?e.indented+4:"form"==f&&"{"==d?e.indented:"stat"==f||"form"==f?e.indented+c:"switch"!=e.info||g?e.align?e.column+(g?0:1):e.indented+(g?0:c):e.indented+(/^(?:case|default)\b/.test(b)?c:2*c)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),a.defineMIME("text/x-haxe","haxe")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("htmlembedded",function(b,c){function h(a,b){return a.match(d,!1)?(b.token=i,f.token(a,b.scriptState)):g.token(a,b.htmlState)}function i(a,b){return a.match(e,!1)?(b.token=h,g.token(a,b.htmlState)):f.token(a,b.scriptState)}var f,g,d=c.scriptStartRegex||/^<%/i,e=c.scriptEndRegex||/^%>/i;return{startState:function(){return f=f||a.getMode(b,c.scriptingModeSpec),g=g||a.getMode(b,"htmlmixed"),{token:c.startOpen?i:h,htmlState:a.startState(g),scriptState:a.startState(f)}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return a.token==h?g.indent(a.htmlState,b):f.indent?f.indent(a.scriptState,b):void 0},copyState:function(b){return{token:b.token,htmlState:a.copyState(g,b.htmlState),scriptState:a.copyState(f,b.scriptState)}},innerMode:function(a){return a.token==i?{state:a.scriptState,mode:f}:{state:a.htmlState,mode:g}}}},"htmlmixed"),a.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),a.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),a.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),a.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("htmlmixed",function(b,c){function j(a,b){var c=b.htmlState.tagName,g=d.token(a,b.htmlState);if("script"==c&&/\btag\b/.test(g)&&">"==a.current()){var h=a.string.slice(Math.max(0,a.pos-100),a.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);h=h?h[1]:"",h&&/[\"\']/.test(h.charAt(0))&&(h=h.slice(1,h.length-1));for(var i=0;i"==a.current()&&(b.token=m,b.localMode=e,b.localState=e.startState(d.indent(b.htmlState,"")));return g}function k(a,b,c){var f,d=a.current(),e=d.search(b);return e>-1?a.backUp(d.length-e):(f=d.match(/<\/?$/))&&(a.backUp(d.length),a.match(b,!1)||a.match(d)),c}function l(a,b){return a.match(/^<\/\s*script\s*>/i,!1)?(b.token=j,b.localState=b.localMode=null,j(a,b)):k(a,/<\/\s*script\s*>/,b.localMode.token(a,b.localState))}function m(a,b){return a.match(/^<\/\s*style\s*>/i,!1)?(b.token=j,b.localState=b.localMode=null,j(a,b)):k(a,/<\/\s*style\s*>/,e.token(a,b.localState))}var d=a.getMode(b,{name:"xml",htmlMode:!0,multilineTagIndentFactor:c.multilineTagIndentFactor,multilineTagIndentPastTag:c.multilineTagIndentPastTag}),e=a.getMode(b,"css"),f=[],g=c&&c.scriptTypes;if(f.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:a.getMode(b,"javascript")}),g)for(var h=0;h=100&&200>f?"positive informational":f>=200&&300>f?"positive success":f>=300&&400>f?"positive redirect":f>=400&&500>f?"negative client-error":f>=500&&600>f?"negative server-error":"error"}function d(a,b){return a.skipToEnd(),b.cur=g,null}function e(a,b){return a.eatWhile(/\S/),b.cur=f,"string-2"}function f(b,c){return b.match(/^HTTP\/\d\.\d$/)?(c.cur=g,"keyword"):a(b,c)}function g(a){return a.sol()&&!a.eat(/[ \t]/)?a.match(/^.*?:/)?"atom":(a.skipToEnd(),"error"):(a.skipToEnd(),"string")}function h(a){return a.skipToEnd(),null}return{token:function(a,b){var c=b.cur;return c!=g&&c!=h&&a.eatSpace()?null:c(a,b)},blankLine:function(a){a.cur=h},startState:function(){return{cur:b}}}}),a.defineMIME("message/http","http")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("jade",function(){var a=/^(?:~|!|%|\^|\*|\+|=|\\|:|;|,|\/|\?|&|<|>|\|)/,b=/^(\(|\[)/,c=/^(\)|\])/,d=/^(if|else|return|var|function|include|doctype|each)/,e=/^(#|{|}|\.)/,f=/^(in)/,g=/^(html|head|title|meta|link|script|body|br|div|input|span|a|img)/,h=/^(h1|h2|h3|h4|h5|p|strong|em)/;return{startState:function(){return{inString:!1,stringType:"",beforeTag:!0,justMatchedKeyword:!1,afterParen:!1}},token:function(i,j){if(j.inString||'"'!=i.peek()&&"'"!=i.peek()||(j.stringType=i.peek(),i.next(),j.inString=!0),j.inString)return i.skipTo(j.stringType)?(i.next(),j.inString=!1):i.skipToEnd(),j.justMatchedKeyword=!1,"string";if(i.sol()&&i.eatSpace()){if(i.match(d))return j.justMatchedKeyword=!0,i.eatSpace(),"keyword";if(i.match(g)||i.match(h))return j.justMatchedKeyword=!0,"variable"}else{if(i.sol()&&i.match(d))return j.justMatchedKeyword=!0,i.eatSpace(),"keyword";if(i.sol()&&(i.match(g)||i.match(h)))return j.justMatchedKeyword=!0,"variable";if(i.eatSpace()){if(j.justMatchedKeyword=!1,i.match(f)&&i.eatSpace())return j.justMatchedKeyword=!0,"keyword"}else{if(i.match(a))return j.justMatchedKeyword=!1,"atom";if(i.match(b))return j.afterParen=!0,j.justMatchedKeyword=!0,"def";if(i.match(c))return j.afterParen=!1,j.justMatchedKeyword=!0,"def";if(i.match(e))return j.justMatchedKeyword=!0,"keyword";if(i.eatSpace())j.justMatchedKeyword=!1;else{if(i.next(),j.justMatchedKeyword)return"property";if(j.afterParen)return"property"}}}return null}}}),a.defineMIME("text/x-jade","jade")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("javascript",function(b,c){function l(a){for(var c,b=!1,d=!1;null!=(c=a.next());){if(!b){if("/"==c&&!d)return;"["==c?d=!0:d&&"]"==c&&(d=!1)}b=!b&&"\\"==c}}function o(a,b,c){return m=a,n=c,b}function p(a,b){var c=a.next();if('"'==c||"'"==c)return b.tokenize=q(c),b.tokenize(a,b);if("."==c&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==c&&a.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(c))return o(c);if("="==c&&a.eat(">"))return o("=>","operator");if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),o("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==c)return a.eat("*")?(b.tokenize=r,r(a,b)):a.eat("/")?(a.skipToEnd(),o("comment","comment")):"operator"==b.lastType||"keyword c"==b.lastType||"sof"==b.lastType||/^[\[{}\(,;:]$/.test(b.lastType)?(l(a),a.eatWhile(/[gimy]/),o("regexp","string-2")):(a.eatWhile(j),o("operator","operator",a.current()));if("`"==c)return b.tokenize=s,s(a,b);if("#"==c)return a.skipToEnd(),o("error","error");if(j.test(c))return a.eatWhile(j),o("operator","operator",a.current());a.eatWhile(/[\w\$_]/);var d=a.current(),e=i.propertyIsEnumerable(d)&&i[d];return e&&"."!=b.lastType?o(e.type,e.style,d):o("variable","variable",d)}function q(a){return function(b,c){var e,d=!1;if(f&&"@"==b.peek()&&b.match(k))return c.tokenize=p,o("jsonld-keyword","meta");for(;null!=(e=b.next())&&(e!=a||d);)d=!d&&"\\"==e;return d||(c.tokenize=p),o("string","string")}}function r(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=p;break}c="*"==d}return o("comment","comment")}function s(a,b){for(var d,c=!1;null!=(d=a.next());){if(!c&&("`"==d||"$"==d&&a.eat("{"))){b.tokenize=p;break}c=!c&&"\\"==d}return o("quasi","string-2",a.current())}function u(a,b){b.fatArrowAt&&(b.fatArrowAt=null);var c=a.string.indexOf("=>",a.start);if(!(0>c)){for(var d=0,e=!1,f=c-1;f>=0;--f){var g=a.string.charAt(f),h=t.indexOf(g);if(h>=0&&3>h){if(!d){++f;break}if(0==--d)break}else if(h>=3&&6>h)++d;else if(/[$\w]/.test(g))e=!0;else if(e&&!d){++f;break}}e&&!d&&(b.fatArrowAt=f)}}function w(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function x(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0;for(var d=a.context;d;d=d.prev)for(var c=d.vars;c;c=c.next)if(c.name==b)return!0}function y(a,b,c,d,e){var f=a.cc;for(z.state=a,z.stream=e,z.marked=null,z.cc=f,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var h=f.length?f.pop():g?K:J;if(h(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return z.marked?z.marked:"variable"==c&&x(a,d)?"variable-2":b}}}function A(){for(var a=arguments.length-1;a>=0;a--)z.cc.push(arguments[a])}function B(){return A.apply(null,arguments),!0}function C(a){function b(b){for(var c=b;c;c=c.next)if(c.name==a)return!0;return!1}var d=z.state;if(d.context){if(z.marked="def",b(d.localVars))return;d.localVars={name:a,next:d.localVars}}else{if(b(d.globalVars))return;c.globalVars&&(d.globalVars={name:a,next:d.globalVars})}}function E(){z.state.context={prev:z.state.context,vars:z.state.localVars},z.state.localVars=D}function F(){z.state.localVars=z.state.context.vars,z.state.context=z.state.context.prev}function G(a,b){var c=function(){var c=z.state,d=c.indented;"stat"==c.lexical.type&&(d=c.lexical.indented),c.lexical=new w(d,z.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function H(){var a=z.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function I(a){function b(c){return c==a?B():";"==a?A():B(b)}return b}function J(a,b){return"var"==a?B(G("vardef",b.length),db,I(";"),H):"keyword a"==a?B(G("form"),K,J,H):"keyword b"==a?B(G("form"),J,H):"{"==a?B(G("}"),ab,H):";"==a?B():"if"==a?B(G("form"),K,J,H,ib):"function"==a?B(ob):"for"==a?B(G("form"),jb,J,H):"variable"==a?B(G("stat"),V):"switch"==a?B(G("form"),K,G("}","switch"),I("{"),ab,H,H):"case"==a?B(K,I(":")):"default"==a?B(I(":")):"catch"==a?B(G("form"),E,I("("),pb,I(")"),J,H,F):"module"==a?B(G("form"),E,tb,F,H):"class"==a?B(G("form"),qb,sb,H):"export"==a?B(G("form"),ub,H):"import"==a?B(G("form"),vb,H):A(G("stat"),K,I(";"),H) }function K(a){return M(a,!1)}function L(a){return M(a,!0)}function M(a,b){if(z.state.fatArrowAt==z.stream.start){var c=b?U:T;if("("==a)return B(E,G(")"),$(eb,")"),H,I("=>"),c,F);if("variable"==a)return A(E,eb,I("=>"),c,F)}var d=b?Q:P;return v.hasOwnProperty(a)?B(d):"function"==a?B(ob,d):"keyword c"==a?B(b?O:N):"("==a?B(G(")"),N,Ab,I(")"),H,d):"operator"==a||"spread"==a?B(b?L:K):"["==a?B(G("]"),yb,H,d):"{"==a?_(X,"}",null,d):B()}function N(a){return a.match(/[;\}\)\],]/)?A():A(K)}function O(a){return a.match(/[;\}\)\],]/)?A():A(L)}function P(a,b){return","==a?B(K):Q(a,b,!1)}function Q(a,b,c){var d=0==c?P:Q,e=0==c?K:L;return"=>"==b?B(E,c?U:T,F):"operator"==a?/\+\+|--/.test(b)?B(d):"?"==b?B(K,I(":"),e):B(e):"quasi"==a?(z.cc.push(d),R(b)):";"!=a?"("==a?_(L,")","call",d):"."==a?B(W,d):"["==a?B(G("]"),N,I("]"),H,d):void 0:void 0}function R(a){return"${"!=a.slice(a.length-2)?B():B(K,S)}function S(a){return"}"==a?(z.marked="string-2",z.state.tokenize=s,B()):void 0}function T(a){return u(z.stream,z.state),"{"==a?A(J):A(K)}function U(a){return u(z.stream,z.state),"{"==a?A(J):A(L)}function V(a){return":"==a?B(H,J):A(P,I(";"),H)}function W(a){return"variable"==a?(z.marked="property",B()):void 0}function X(a,b){if("variable"==a){if(z.marked="property","get"==b||"set"==b)return B(Y)}else if("number"==a||"string"==a)z.marked=f?"property":a+" property";else if("["==a)return B(K,I("]"),Z);return v.hasOwnProperty(a)?B(Z):void 0}function Y(a){return"variable"!=a?A(Z):(z.marked="property",B(ob))}function Z(a){return":"==a?B(L):"("==a?A(ob):void 0}function $(a,b){function c(d){if(","==d){var e=z.state.lexical;return"call"==e.info&&(e.pos=(e.pos||0)+1),B(a,c)}return d==b?B():B(I(b))}return function(d){return d==b?B():A(a,c)}}function _(a,b,c){for(var d=3;d!?|~^]/,k=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,t="([{}])",v={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},z={state:null,column:null,marked:null,cc:null},D={name:"this",next:{name:"arguments"}};return H.lex=!0,{startState:function(a){var b={tokenize:p,lastType:"sof",cc:[],lexical:new w((a||0)-d,0,"block",!1),localVars:c.localVars,context:c.localVars&&{vars:c.localVars},indented:0};return c.globalVars&&"object"==typeof c.globalVars&&(b.globalVars=c.globalVars),b},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),u(a,b)),b.tokenize!=r&&a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==m?c:(b.lastType="operator"!=m||"++"!=n&&"--"!=n?m:"incdec",y(b,c,m,n,a))},indent:function(b,f){if(b.tokenize==r)return a.Pass;if(b.tokenize!=p)return 0;for(var g=f&&f.charAt(0),h=b.lexical,i=b.cc.length-1;i>=0;--i){var j=b.cc[i];if(j==H)h=h.prev;else if(j!=ib)break}"stat"==h.type&&"}"==g&&(h=h.prev),e&&")"==h.type&&"stat"==h.prev.type&&(h=h.prev);var k=h.type,l=g==k;return"vardef"==k?h.indented+("operator"==b.lastType||","==b.lastType?h.info+1:0):"form"==k&&"{"==g?h.indented:"form"==k?h.indented+d:"stat"==k?h.indented+("operator"==b.lastType||","==b.lastType?e||d:0):"switch"!=h.info||l||0==c.doubleIndentSwitch?h.align?h.column+(l?0:1):h.indented+(l?0:d):h.indented+(/^(?:case|default)\b/.test(f)?d:2*d)},electricChars:":{}",blockCommentStart:g?null:"/*",blockCommentEnd:g?null:"*/",lineComment:g?null:"//",fold:"brace",helperType:g?"json":"javascript",jsonldMode:f,jsonMode:g}}),a.defineMIME("text/javascript","javascript"),a.defineMIME("text/ecmascript","javascript"),a.defineMIME("application/javascript","javascript"),a.defineMIME("application/ecmascript","javascript"),a.defineMIME("application/json",{name:"javascript",json:!0}),a.defineMIME("application/x-json",{name:"javascript",json:!0}),a.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),a.defineMIME("text/typescript",{name:"javascript",typescript:!0}),a.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("jinja2",function(){function b(a,b){var d=a.next();return"{"==d&&(d=a.eat(/\{|%|#/))?(a.eat("-"),b.tokenize=c(d),"tag"):void 0}function c(c){return"{"==c&&(c="}"),function(d,e){var f=d.next();return(f==c||"-"==f&&d.eat(c))&&d.eat("}")?(e.tokenize=b,"tag"):d.match(a)?"keyword":"#"==c?"comment":"string"}}var a=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","plural"];return a=new RegExp("^(("+a.join(")|(")+"))\\b"),{startState:function(){return{tokenize:b}},token:function(a,b){return b.tokenize(a,b)}}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("julia",function(a,b){function d(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function t(a){var b=u(a);return"["==b||"{"==b?!0:!1}function u(a){return 0==a.scopes.length?null:a.scopes[a.scopes.length-1]}function v(a,b){var d=b.leaving_expr;if(a.sol()&&(d=!1),b.leaving_expr=!1,d&&a.match(/^'+/))return"operator";if(a.match(/^\.{2,3}/))return"operator";if(a.eatSpace())return null;var h=a.peek();if("#"===h)return a.skipToEnd(),"comment";"["===h&&b.scopes.push("["),"{"===h&&b.scopes.push("{");var i=u(b);"["===i&&"]"===h&&(b.scopes.pop(),b.leaving_expr=!0),"{"===i&&"}"===h&&(b.scopes.pop(),b.leaving_expr=!0),")"===h&&(b.leaving_expr=!0);var j;if(!t(b)&&(j=a.match(o,!1))&&b.scopes.push(j),!t(b)&&a.match(p,!1)&&b.scopes.pop(),t(b)&&a.match(/^end/))return"number";if(a.match(/^=>/))return"operator";if(a.match(/^[0-9\.]/,!1)){var k=RegExp(/^im\b/),s=!1;if(a.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)&&(s=!0),a.match(/^\d+\.(?!\.)\d*/)&&(s=!0),a.match(/^\.\d+/)&&(s=!0),s)return a.match(k),b.leaving_expr=!0,"number";var v=!1;if(a.match(/^0x[0-9a-f]+/i)&&(v=!0),a.match(/^0b[01]+/i)&&(v=!0),a.match(/^0o[0-7]+/i)&&(v=!0),a.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(v=!0),a.match(/^0(?![\dx])/i)&&(v=!0),v)return a.match(k),b.leaving_expr=!0,"number"}return a.match(/^(::)|(<:)/)?"operator":!d&&a.match(r)?"string":a.match(e)?"operator":a.match(l)?(b.tokenize=w(a.current()),b.tokenize(a,b)):a.match(q)?"meta":a.match(f)?null:a.match(m)?"keyword":a.match(n)?"builtin":a.match(g)?(b.leaving_expr=!0,"variable"):(a.next(),c)}function w(a){function f(f,g){for(;!f.eol();)if(f.eatWhile(/[^'"\\]/),f.eat("\\")){if(f.next(),d&&f.eol())return e}else{if(f.match(a))return g.tokenize=v,e;f.eat(/['"]/)}if(d){if(b.singleLineStringErrors)return c;g.tokenize=v}return e}for(;"rub".indexOf(a.charAt(0).toLowerCase())>=0;)a=a.substr(1);var d=1==a.length,e="string";return f.isString=!0,f}function x(a,b){s=null;var d=b.tokenize(a,b),e=a.current();return"."===e?(d=a.match(g,!1)?null:c,null===d&&"meta"===b.lastStyle&&(d="meta"),d):d}var c="error",e=b.operators||/^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/,f=b.delimiters||/^[;,()[\]{}]/,g=b.identifiers||/^[_A-Za-z][_A-Za-z0-9]*!*/,h=["begin","function","type","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"],i=["end","else","elseif","catch","finally"],j=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","macro","module","baremodule","type","immutable","quote","typealias","abstract","bitstype","ccall"],k=["true","false","enumerate","open","close","nothing","NaN","Inf","print","println","Int","Int8","Uint8","Int16","Uint16","Int32","Uint32","Int64","Uint64","Int128","Uint128","Bool","Char","Float16","Float32","Float64","Array","Vector","Matrix","String","UTF8String","ASCIIString","error","warn","info","@printf"],l=/^(`|'|"{3}|([br]?"))/,m=d(j),n=d(k),o=d(h),p=d(i),q=/^@[_A-Za-z][_A-Za-z0-9]*/,r=/^:[_A-Za-z][_A-Za-z0-9]*/,s=null,y={startState:function(){return{tokenize:v,scopes:[],leaving_expr:!1}},token:function(a,b){var c=x(a,b);return b.lastStyle=c,c},indent:function(a,b){var c=0;return("end"==b||"]"==b||"}"==b||"else"==b||"elseif"==b||"catch"==b||"finally"==b)&&(c=-1),4*(a.scopes.length+c)},lineComment:"#",fold:"indent",electricChars:"edlsifyh]}"};return y}),a.defineMIME("text/x-julia","julia")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";!function(){a.defineMode("livescript",function(){var a,b;return a=function(a,b){var c,d,e,g,h,i;if(c=b.next||"start"){if(b.next=b.next,Array.isArray(d=f[c])){for(e=0,g=d.length;g>e;++e)if(h=d[e],h.regex&&(i=a.match(h.regex)))return b.next=h.next,h.token;return a.next(),"error"}if(a.match(h=f[c]))return h.regex&&a.match(h.regex)?(b.next=h.next,h.token):(a.next(),"error")}return a.next(),"error"},b={startState:function(){return{next:"start",lastToken:null}},token:function(b,c){var d;return d=a(b,c),c.lastToken={style:d,indent:b.indentation(),content:b.current()},d.replace(/\./g," ")},indent:function(a){var b;return b=a.lastToken.indent,a.lastToken.content.match(c)&&(b+=2),b}}});var b="(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*",c=RegExp("(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*"+b+")?))\\s*$"),d="(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))",e={token:"string",regex:".+"},f={start:[{token:"comment.doc",regex:"/\\*",next:"comment"},{token:"comment",regex:"#.*"},{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)"+d},{token:"constant.language",regex:"(?:true|false|yes|no|on|off|null|void|undefined)"+d},{token:"invalid.illegal",regex:"(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)"+d},{token:"language.support.class",regex:"(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)"+d},{token:"language.support.function",regex:"(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)"+d},{token:"variable.language",regex:"(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)"+d},{token:"identifier",regex:b+"\\s*:(?![:=])"},{token:"variable",regex:b},{token:"keyword.operator",regex:"(?:\\.{3}|\\s+\\?)"},{token:"keyword.variable",regex:"(?:@+|::|\\.\\.)",next:"key"},{token:"keyword.operator",regex:"\\.\\s*",next:"key"},{token:"string",regex:"\\\\\\S[^\\s,;)}\\]]*"},{token:"string.doc",regex:"'''",next:"qdoc"},{token:"string.doc",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string",regex:"<\\[",next:"words"},{token:"string.regex",regex:"//",next:"heregex"},{token:"string.regex",regex:"\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",next:"key"},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[)}\\]]",next:"key"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],heregex:[{token:"string.regex",regex:".*?//[gimy$?]{0,4}",next:"start"},{token:"string.regex",regex:"\\s*#{"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],key:[{token:"keyword.operator",regex:"[.?@!]+"},{token:"identifier",regex:b,next:"start"},{token:"text",regex:".",next:"start"}],comment:[{token:"comment.doc",regex:".*?\\*/",next:"start"},{token:"comment.doc",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},e],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},e],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"key"},e],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"key"},e],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"key"},e],words:[{token:"string",regex:".*?\\]>",next:"key"},e]};for(var g in f){var h=f[g];if(Array.isArray(h))for(var i=0,j=h.length;j>i;++i){var k=h[i];k.regex&&(f[g][i].regex=new RegExp("^"+k.regex))}else h.regex&&(f[g].regex=new RegExp("^"+h.regex))}}(),a.defineMIME("text/x-livescript","livescript")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("lua",function(a,b){function d(a){return new RegExp("^(?:"+a.join("|")+")","i")}function e(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function l(a){for(var b=0;a.eat("=");)++b;return a.eat("["),b}function m(a,b){var c=a.next();return"-"==c&&a.eat("-")?a.eat("[")&&a.eat("[")?(b.cur=n(l(a),"comment"))(a,b):(a.skipToEnd(),"comment"):'"'==c||"'"==c?(b.cur=o(c))(a,b):"["==c&&/[\[=]/.test(a.peek())?(b.cur=n(l(a),"string"))(a,b):/\d/.test(c)?(a.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(c)?(a.eatWhile(/[\w\\\-_.]/),"variable"):null}function n(a,b){return function(c,d){for(var f,e=null;null!=(f=c.next());)if(null==e)"]"==f&&(e=0);else if("="==f)++e;else{if("]"==f&&e==a){d.cur=m;break}e=null}return b}}function o(a){return function(b,c){for(var e,d=!1;null!=(e=b.next())&&(e!=a||d);)d=!d&&"\\"==e;return d||(c.cur=m),"string"}}var c=a.indentUnit,f=e(b.specials||[]),g=e(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),h=e(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),i=e(["function","if","repeat","do","\\(","{"]),j=e(["end","until","\\)","}"]),k=d(["end","until","\\)","}","else","elseif"]);return{startState:function(a){return{basecol:a||0,indentDepth:0,cur:m}},token:function(a,b){if(a.eatSpace())return null;var c=b.cur(a,b),d=a.current();return"variable"==c&&(h.test(d)?c="keyword":g.test(d)?c="builtin":f.test(d)&&(c="variable-2")),"comment"!=c&&"string"!=c&&(i.test(d)?++b.indentDepth:j.test(d)&&--b.indentDepth),c},indent:function(a,b){var d=k.test(b);return a.basecol+c*(a.indentDepth-(d?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),a.defineMIME("text/x-lua","lua")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror",require("../xml/xml"))):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("markdown",function(b,c){function E(a,b,c){return b.f=b.inline=c,c(a,b)}function F(a,b,c){return b.f=b.block=c,c(a,b)}function G(a){return a.linkTitle=!1,a.em=!1,a.strong=!1,a.quote=0,d||a.f!=I||(a.f=M,a.block=H),a.trailingSpace=0,a.trailingSpaceNewLine=!1,a.thisLineHasContent=!1,null}function H(a,b){var d=a.sol(),e=b.list!==!1;b.list!==!1&&b.indentationDiff>=0?(b.indentationDiff<4&&(b.indentation-=b.indentationDiff),b.list=null):b.list!==!1&&b.indentation>0?(b.list=null,b.listDepth=Math.floor(b.indentation/4)):b.list!==!1&&(b.list=!1,b.listDepth=0);var f=null;if(b.indentationDiff>=4)return b.indentation-=4,a.skipToEnd(),j;if(a.eatSpace())return null;if(f=a.match(B))return b.header=f[0].length<=6?f[0].length:6,c.highlightFormatting&&(b.formatting="header"),b.f=b.inline,K(b);if(b.prevLineHasContent&&(f=a.match(C)))return b.header="="==f[0].charAt(0)?1:2,c.highlightFormatting&&(b.formatting="header"),b.f=b.inline,K(b);if(a.eat(">"))return b.indentation++,b.quote=d?1:b.quote+1,c.highlightFormatting&&(b.formatting="quote"),a.eatSpace(),K(b);if("["===a.peek())return E(a,b,Q);if(a.match(x,!0))return o;if((!b.prevLineHasContent||e)&&(a.match(y,!1)||a.match(z,!1))){var h=null;return a.match(y,!0)?h="ul":(a.match(z,!0),h="ol"),b.indentation+=4,b.list=!0,b.listDepth++,c.taskLists&&a.match(A,!1)&&(b.taskList=!0),b.f=b.inline,c.highlightFormatting&&(b.formatting=["list","list-"+h]),K(b)}return c.fencedCodeBlocks&&a.match(/^```([\w+#]*)/,!0)?(b.localMode=g(RegExp.$1),b.localMode&&(b.localState=b.localMode.startState()),F(a,b,J),c.highlightFormatting&&(b.formatting="code-block"),b.code=!0,K(b)):E(a,b,b.inline)}function I(a,b){var c=e.token(a,b.htmlState);return(d&&!b.htmlState.tagName&&!b.htmlState.context||b.md_inside&&a.current().indexOf(">")>-1)&&(b.f=M,b.block=H,b.htmlState=null),c}function J(a,b){if(a.sol()&&a.match(/^```/,!0)){b.localMode=b.localState=null,b.f=M,b.block=H,c.highlightFormatting&&(b.formatting="code-block"),b.code=!0;var d=K(b);return b.code=!1,d}return b.localMode?b.localMode.token(a,b.localState):(a.skipToEnd(),j)}function K(a){var b=[];if(a.formatting){b.push(q),"string"==typeof a.formatting&&(a.formatting=[a.formatting]);for(var d=0;d=a.quote?b.push(q+"-"+a.formatting[d]+"-"+a.quote):b.push("error"))}if(a.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(a.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(a.linkHref)return b.push(u),b.length?b.join(" "):null;if(a.strong&&b.push(w),a.em&&b.push(v),a.linkText&&b.push(t),a.code&&b.push(j),a.header&&(b.push(i),b.push(i+"-"+a.header)),a.quote&&(b.push(k),!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=a.quote?b.push(k+"-"+a.quote):b.push(k+"-"+c.maxBlockquoteDepth)),a.list!==!1){var e=(a.listDepth-1)%3;e?1===e?b.push(m):b.push(n):b.push(l)}return a.trailingSpaceNewLine?b.push("trailing-space-new-line"):a.trailingSpace&&b.push("trailing-space-"+(a.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function L(a,b){return a.match(D,!0)?K(b):void 0}function M(b,d){var f=d.text(b,d);if("undefined"!=typeof f)return f;if(d.list)return d.list=null,K(d);if(d.taskList){var g="x"!==b.match(A,!0)[1];return g?d.taskOpen=!0:d.taskClosed=!0,c.highlightFormatting&&(d.formatting="task"),d.taskList=!1,K(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&b.match(/^#+$/,!0))return c.highlightFormatting&&(d.formatting="header"),K(d);var i=b.sol(),j=b.next();if(d.escape)return d.escape=!1,K(d);if("\\"===j)return c.highlightFormatting&&(d.formatting="escape"),d.escape=!0,K(d);if(d.linkTitle){d.linkTitle=!1;var k=j;"("===j&&(k=")"),k=(k+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var l="^\\s*(?:[^"+k+"\\\\]+|\\\\\\\\|\\\\.)"+k;if(b.match(new RegExp(l),!0))return u}if("`"===j){var m=d.formatting;c.highlightFormatting&&(d.formatting="code");var n=K(d),o=b.pos;b.eatWhile("`");var q=1+b.pos-o;return d.code?q===h?(d.code=!1,n):(d.formatting=m,K(d)):(h=q,d.code=!0,K(d))}if(d.code)return K(d);if("!"===j&&b.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.match(/\[[^\]]*\]/),d.inline=d.f=O,p;if("["===j&&b.match(/.*\](\(| ?\[)/,!1))return d.linkText=!0,c.highlightFormatting&&(d.formatting="link"),K(d);if("]"===j&&d.linkText){c.highlightFormatting&&(d.formatting="link");var t=K(d);return d.linkText=!1,d.inline=d.f=O,t}if("<"===j&&b.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=N,c.highlightFormatting&&(d.formatting="link");var t=K(d);return t?t+=" ":t="",t+r}if("<"===j&&b.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=N,c.highlightFormatting&&(d.formatting="link");var t=K(d);return t?t+=" ":t="",t+s}if("<"===j&&b.match(/^\w/,!1)){if(-1!=b.string.indexOf(">")){var v=b.string.substring(1,b.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(v)&&(d.md_inside=!0)}return b.backUp(1),d.htmlState=a.startState(e),F(b,d,I)}if("<"===j&&b.match(/^\/\w*?>/))return d.md_inside=!1,"tag";var w=!1;if(!c.underscoresBreakWords&&"_"===j&&"_"!==b.peek()&&b.match(/(\w)/,!1)){var x=b.pos-2;if(x>=0){var y=b.string.charAt(x);"_"!==y&&y.match(/(\w)/,!1)&&(w=!0)}}if("*"===j||"_"===j&&!w)if(i&&" "===b.peek());else{if(d.strong===j&&b.eat(j)){c.highlightFormatting&&(d.formatting="strong");var n=K(d);return d.strong=!1,n}if(!d.strong&&b.eat(j))return d.strong=j,c.highlightFormatting&&(d.formatting="strong"),K(d);if(d.em===j){c.highlightFormatting&&(d.formatting="em");var n=K(d);return d.em=!1,n}if(!d.em)return d.em=j,c.highlightFormatting&&(d.formatting="em"),K(d)}else if(" "===j&&(b.eat("*")||b.eat("_"))){if(" "===b.peek())return K(d);b.backUp(1)}return" "===j&&(b.match(/ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),K(d)}function N(a,b){var d=a.next();if(">"===d){b.f=b.inline=M,c.highlightFormatting&&(b.formatting="link");var e=K(b);return e?e+=" ":e="",e+r}return a.match(/^[^>]+/,!0),r}function O(a,b){if(a.eatSpace())return null;var d=a.next();return"("===d||"["===d?(b.f=b.inline=P("("===d?")":"]"),c.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,K(b)):"error"}function P(a){return function(b,d){var e=b.next();if(e===a){d.f=d.inline=M,c.highlightFormatting&&(d.formatting="link-string");var f=K(d);return d.linkHref=!1,f}return b.match(U(a),!0)&&b.backUp(1),d.linkHref=!0,K(d)}}function Q(a,b){return a.match(/^[^\]]*\]:/,!1)?(b.f=R,a.next(),c.highlightFormatting&&(b.formatting="link"),b.linkText=!0,K(b)):E(a,b,M)}function R(a,b){if(a.match(/^\]:/,!0)){b.f=b.inline=S,c.highlightFormatting&&(b.formatting="link");var d=K(b);return b.linkText=!1,d}return a.match(/^[^\]]+/,!0),t}function S(a,b){return a.eatSpace()?null:(a.match(/^[^\s]+/,!0),void 0===a.peek()?b.linkTitle=!0:a.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.inline=M,u)}function U(a){return T[a]||(a=(a+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),T[a]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+a+")")),T[a]}var d=a.modes.hasOwnProperty("xml"),e=a.getMode(b,d?{name:"xml",htmlMode:!0}:"text/plain"),f={html:"htmlmixed",js:"javascript",json:"application/json",c:"text/x-csrc","c++":"text/x-c++src",java:"text/x-java",csharp:"text/x-csharp","c#":"text/x-csharp",scala:"text/x-scala"},g=function(){var c,g,d={},e={},h=[];for(var i in a.modes)a.modes.propertyIsEnumerable(i)&&h.push(i);for(c=0;c` "'(]+/,T=[],V={startState:function(){return{f:H,prevLineHasContent:!1,thisLineHasContent:!1,block:H,htmlState:null,indentation:0,inline:M,text:L,escape:!1,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1}},copyState:function(b){return{f:b.f,prevLineHasContent:b.prevLineHasContent,thisLineHasContent:b.thisLineHasContent,block:b.block,htmlState:b.htmlState&&a.copyState(e,b.htmlState),indentation:b.indentation,localMode:b.localMode,localState:b.localMode?a.copyState(b.localMode,b.localState):null,inline:b.inline,text:b.text,escape:!1,formatting:!1,linkTitle:b.linkTitle,em:b.em,strong:b.strong,header:b.header,taskList:b.taskList,list:b.list,listDepth:b.listDepth,quote:b.quote,trailingSpace:b.trailingSpace,trailingSpaceNewLine:b.trailingSpaceNewLine,md_inside:b.md_inside}},token:function(a,b){if(b.formatting=!1,a.sol()){var c=a.match(/^\s*$/,!0)||b.header;if(b.header=0,c)return b.prevLineHasContent=!1,G(b);b.prevLineHasContent=b.thisLineHasContent,b.thisLineHasContent=!0,b.escape=!1,b.taskList=!1,b.code=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,b.f=b.block;var d=a.match(/^\s*/,!0)[0].replace(/\t/g," ").length,e=4*Math.floor((d-b.indentation)/4);e>4&&(e=4);var f=b.indentation+e;if(b.indentationDiff=f-b.indentation,b.indentation=f,d>0)return null}return b.f(a,b)},innerMode:function(a){return a.block==I?{state:a.htmlState,mode:e}:a.localState?{state:a.localState,mode:a.localMode}:{state:a,mode:V}},blankLine:G,getType:K,fold:"markdown"};return V},"xml"),a.defineMIME("text/x-markdown","markdown")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMIME("text/mirc","mirc"),a.defineMode("mirc",function(){function a(a){for(var b={},c=a.split(" "),d=0;d!?^\/\|]/; return{startState:function(){return{tokenize:g,beforeParams:!1,inParams:!1}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)}}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("mllike",function(a,b){function f(a,d){var e=a.next();if('"'===e)return d.tokenize=g,d.tokenize(a,d);if("("===e&&a.eat("*"))return d.commentLevel++,d.tokenize=h,d.tokenize(a,d);if("~"===e)return a.eatWhile(/\w/),"variable-2";if("`"===e)return a.eatWhile(/\w/),"quote";if("/"===e&&b.slashComments&&a.eat("/"))return a.skipToEnd(),"comment";if(/\d/.test(e))return a.eatWhile(/[\d]/),a.eat(".")&&a.eatWhile(/[\d]/),"number";if(/[+\-*&%=<>!?|]/.test(e))return"operator";a.eatWhile(/\w/);var f=a.current();return c[f]||"variable"}function g(a,b){for(var c,d=!1,e=!1;null!=(c=a.next());){if('"'===c&&!e){d=!0;break}e=!e&&"\\"===c}return d&&!e&&(b.tokenize=f),"string"}function h(a,b){for(var c,d;b.commentLevel>0&&null!=(d=a.next());)"("===c&&"*"===d&&b.commentLevel++,"*"===c&&")"===d&&b.commentLevel--,c=d;return b.commentLevel<=0&&(b.tokenize=f),"comment"}var c={let:"keyword",rec:"keyword","in":"keyword",of:"keyword",and:"keyword","if":"keyword",then:"keyword","else":"keyword","for":"keyword",to:"keyword","while":"keyword","do":"keyword",done:"keyword",fun:"keyword","function":"keyword",val:"keyword",type:"keyword",mutable:"keyword",match:"keyword","with":"keyword","try":"keyword",open:"builtin",ignore:"builtin",begin:"keyword",end:"keyword"},d=b.extraWords||{};for(var e in d)d.hasOwnProperty(e)&&(c[e]=b.extraWords[e]);return{startState:function(){return{tokenize:f,commentLevel:0}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)},blockCommentStart:"(*",blockCommentEnd:"*)",lineComment:b.slashComments?"//":null}}),a.defineMIME("text/x-ocaml",{name:"mllike",extraWords:{succ:"keyword",trace:"builtin",exit:"builtin",print_string:"builtin",print_endline:"builtin","true":"atom","false":"atom",raise:"keyword"}}),a.defineMIME("text/x-fsharp",{name:"mllike",extraWords:{"abstract":"keyword",as:"keyword",assert:"keyword",base:"keyword","class":"keyword","default":"keyword",delegate:"keyword",downcast:"keyword",downto:"keyword",elif:"keyword",exception:"keyword",extern:"keyword","finally":"keyword",global:"keyword",inherit:"keyword",inline:"keyword","interface":"keyword",internal:"keyword",lazy:"keyword","let!":"keyword",member:"keyword",module:"keyword",namespace:"keyword","new":"keyword","null":"keyword",override:"keyword","private":"keyword","public":"keyword","return":"keyword","return!":"keyword",select:"keyword","static":"keyword",struct:"keyword",upcast:"keyword",use:"keyword","use!":"keyword",val:"keyword",when:"keyword",yield:"keyword","yield!":"keyword",List:"builtin",Seq:"builtin",Map:"builtin",Set:"builtin","int":"builtin",string:"builtin",raise:"builtin",failwith:"builtin",not:"builtin","true":"builtin","false":"builtin"},slashComments:!0})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("nginx",function(a){function b(a){for(var b={},c=a.split(" "),d=0;d*\/]/.test(g)?h(null,"select-op"):/[;{}:\[\]]/.test(g)?h(null,g):(a.eatWhile(/[\w\\\-]/),h("variable","variable")):h(null,"compare"):(h(null,"compare"),void 0)}function j(a,b){for(var d,c=!1;null!=(d=a.next());){if(c&&"/"==d){b.tokenize=i;break}c="*"==d}return h("comment","comment")}function k(a,b){for(var d,c=0;null!=(d=a.next());){if(c>=2&&">"==d){b.tokenize=i;break}c="-"==d?c+1:0}return h("comment","comment")}function l(a){return function(b,c){for(var e,d=!1;null!=(e=b.next())&&(e!=a||d);)d=!d&&"\\"==e;return d||(c.tokenize=i),h("string","string")}}var g,c=b("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),d=b("http mail events server types location upstream charset_map limit_except if geo map"),e=b("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),f=a.indentUnit;return{startState:function(a){return{tokenize:i,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;g=null;var c=b.tokenize(a,b),d=b.stack[b.stack.length-1];return"hash"==g&&"rule"==d?c="atom":"variable"==c&&("rule"==d?c="number":d&&"@media{"!=d||(c="tag")),"rule"==d&&/^[\{\};]$/.test(g)&&b.stack.pop(),"{"==g?"@media"==d?b.stack[b.stack.length-1]="@media{":b.stack.push("{"):"}"==g?b.stack.pop():"@media"==g?b.stack.push("@media"):"{"==d&&"comment"!=g&&b.stack.push("rule"),c},indent:function(a,b){var c=a.stack.length;return/^\}/.test(b)&&(c-="rule"==a.stack[a.stack.length-1]?2:1),a.baseIndent+c*f},electricChars:"}"}}),a.defineMIME("text/nginx","text/x-nginx-conf")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("ntriples",function(){function b(b,c){var e,d=b.location;e=d==a.PRE_SUBJECT&&"<"==c?a.WRITING_SUB_URI:d==a.PRE_SUBJECT&&"_"==c?a.WRITING_BNODE_URI:d==a.PRE_PRED&&"<"==c?a.WRITING_PRED_URI:d==a.PRE_OBJ&&"<"==c?a.WRITING_OBJ_URI:d==a.PRE_OBJ&&"_"==c?a.WRITING_OBJ_BNODE:d==a.PRE_OBJ&&'"'==c?a.WRITING_OBJ_LITERAL:d==a.WRITING_SUB_URI&&">"==c?a.PRE_PRED:d==a.WRITING_BNODE_URI&&" "==c?a.PRE_PRED:d==a.WRITING_PRED_URI&&">"==c?a.PRE_OBJ:d==a.WRITING_OBJ_URI&&">"==c?a.POST_OBJ:d==a.WRITING_OBJ_BNODE&&" "==c?a.POST_OBJ:d==a.WRITING_OBJ_LITERAL&&'"'==c?a.POST_OBJ:d==a.WRITING_LIT_LANG&&" "==c?a.POST_OBJ:d==a.WRITING_LIT_TYPE&&">"==c?a.POST_OBJ:d==a.WRITING_OBJ_LITERAL&&"@"==c?a.WRITING_LIT_LANG:d==a.WRITING_OBJ_LITERAL&&"^"==c?a.WRITING_LIT_TYPE:" "!=c||d!=a.PRE_SUBJECT&&d!=a.PRE_PRED&&d!=a.PRE_OBJ&&d!=a.POST_OBJ?d==a.POST_OBJ&&"."==c?a.PRE_SUBJECT:a.ERROR:d,b.location=e}var a={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12};return{startState:function(){return{location:a.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(a,c){var d=a.next();if("<"==d){b(c,d);var e="";return a.eatWhile(function(a){return"#"!=a&&">"!=a?(e+=a,!0):!1}),c.uris.push(e),a.match("#",!1)?"variable":(a.next(),b(c,">"),"variable")}if("#"==d){var f="";return a.eatWhile(function(a){return">"!=a&&" "!=a?(f+=a,!0):!1}),c.anchors.push(f),"variable-2"}if(">"==d)return b(c,">"),"variable";if("_"==d){b(c,d);var g="";return a.eatWhile(function(a){return" "!=a?(g+=a,!0):!1}),c.bnodes.push(g),a.next(),b(c," "),"builtin"}if('"'==d)return b(c,d),a.eatWhile(function(a){return'"'!=a}),a.next(),"@"!=a.peek()&&"^"!=a.peek()&&b(c,'"'),"string";if("@"==d){b(c,"@");var h="";return a.eatWhile(function(a){return" "!=a?(h+=a,!0):!1}),c.langs.push(h),a.next(),b(c," "),"string-2"}if("^"==d){a.next(),b(c,"^");var i="";return a.eatWhile(function(a){return">"!=a?(i+=a,!0):!1}),c.types.push(i),a.next(),b(c,">"),"variable"}" "==d&&b(c,d),"."==d&&b(c,d)}}}),a.defineMIME("text/n-triples","ntriples")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("octave",function(){function a(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function k(a,b){return a.sol()||"'"!==a.peek()?(b.tokenize=m,m(a,b)):(a.next(),b.tokenize=m,"operator")}function l(a,b){return a.match(/^.*%}/)?(b.tokenize=m,"comment"):(a.skipToEnd(),"comment")}function m(n,o){if(n.eatSpace())return null;if(n.match("%{"))return o.tokenize=l,n.skipToEnd(),"comment";if(n.match(/^[%#]/))return n.skipToEnd(),"comment";if(n.match(/^[0-9\.+-]/,!1)){if(n.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/))return n.tokenize=m,"number";if(n.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/))return"number";if(n.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/))return"number"}return n.match(a(["nan","NaN","inf","Inf"]))?"number":n.match(/^"([^"]|(""))*"/)?"string":n.match(/^'([^']|(''))*'/)?"string":n.match(j)?"keyword":n.match(i)?"builtin":n.match(h)?"variable":n.match(b)||n.match(d)?"operator":n.match(c)||n.match(e)||n.match(f)?null:n.match(g)?(o.tokenize=k,null):(n.next(),"error")}var b=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),c=new RegExp("^[\\(\\[\\{\\},:=;]"),d=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),e=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),f=new RegExp("^((>>=)|(<<=))"),g=new RegExp("^[\\]\\)]"),h=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),i=a(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),j=a(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);return{startState:function(){return{tokenize:m}},token:function(a,b){var c=b.tokenize(a,b);return("number"===c||"variable"===c)&&(b.tokenize=k),c}}}),a.defineMIME("text/x-octave","octave")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("pascal",function(){function a(a){for(var b={},c=a.split(" "),d=0;d!?|\/]/;return{startState:function(){return{tokenize:null}},token:function(a,b){if(a.eatSpace())return null;var c=(b.tokenize||e)(a,b);return"comment"==c||"meta"==c?c:c},electricChars:"{}"}}),a.defineMIME("text/x-pascal","pascal")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../javascript/javascript")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("pegjs",function(b){function d(a){return a.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)}var c=a.getMode(b,"javascript");return{startState:function(){return{inString:!1,stringType:null,inComment:!1,inChracterClass:!1,braced:0,lhs:!0,localState:null}},token:function(a,b){if(a&&(b.inString||b.inComment||'"'!=a.peek()&&"'"!=a.peek()||(b.stringType=a.peek(),a.next(),b.inString=!0)),b.inString||b.inComment||!a.match(/^\/\*/)||(b.inComment=!0),b.inString){for(;b.inString&&!a.eol();)a.peek()===b.stringType?(a.next(),b.inString=!1):"\\"===a.peek()?(a.next(),a.next()):a.match(/^.[^\\\"\']*/);return b.lhs?"property string":"string"}if(b.inComment){for(;b.inComment&&!a.eol();)a.match(/\*\//)?b.inComment=!1:a.match(/^.[^\*]*/);return"comment"}if(b.inChracterClass)for(;b.inChracterClass&&!a.eol();)a.match(/^[^\]\\]+/)||a.match(/^\\./)||(b.inChracterClass=!1);else{if("["===a.peek())return a.next(),b.inChracterClass=!0,"bracket";if(a.match(/^\/\//))return a.skipToEnd(),"comment";if(b.braced||"{"===a.peek()){null===b.localState&&(b.localState=c.startState());var e=c.token(a,b.localState),f=a.current();if(!e)for(var g=0;g=0?c:0,b)}return a.string.substr(0,a.pos-1)}function d(a,b){var c=a.string.length,d=c-a.pos+1;return a.string.substr(a.pos,b&&c>b?b:d)}function e(a,b){var d,c=a.pos+b;a.pos=0>=c?0:c>=(d=a.string.length-1)?d:c}a.defineMode("perl",function(){function h(a,b,c,d,e){return b.chain=null,b.style=null,b.tail=null,b.tokenize=function(a,b){for(var g,f=!1,h=0;g=a.next();){if(g===c[h]&&!f)return void 0!==c[++h]?(b.chain=c[h],b.style=d,b.tail=e):e&&a.eatWhile(e),b.tokenize=j,d;f=!f&&"\\"==g}return d},b.tokenize(a,b)}function i(a,b,c){return b.tokenize=function(a,b){return a.string==c&&(b.tokenize=j),a.skipToEnd(),"string"},b.tokenize(a,b)}function j(j,k){if(j.eatSpace())return null;if(k.chain)return h(j,k,k.chain,k.style,k.tail);if(j.match(/^\-?[\d\.]/,!1)&&j.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(j.match(/^<<(?=\w)/))return j.eatWhile(/\w/),i(j,k,j.current().substr(2));if(j.sol()&&j.match(/^\=item(?!\w)/))return i(j,k,"=cut");var l=j.next();if('"'==l||"'"==l){if(c(j,3)=="<<"+l){var m=j.pos;j.eatWhile(/\w/);var n=j.current().substr(1);if(n&&j.eat(l))return i(j,k,n);j.pos=m}return h(j,k,[l],"string")}if("q"==l){var o=b(j,-2);if(!o||!/\w/.test(o))if(o=b(j,0),"x"==o){if(o=b(j,1),"("==o)return e(j,2),h(j,k,[")"],f,g);if("["==o)return e(j,2),h(j,k,["]"],f,g);if("{"==o)return e(j,2),h(j,k,["}"],f,g);if("<"==o)return e(j,2),h(j,k,[">"],f,g);if(/[\^'"!~\/]/.test(o))return e(j,1),h(j,k,[j.eat(o)],f,g)}else if("q"==o){if(o=b(j,1),"("==o)return e(j,2),h(j,k,[")"],"string");if("["==o)return e(j,2),h(j,k,["]"],"string");if("{"==o)return e(j,2),h(j,k,["}"],"string");if("<"==o)return e(j,2),h(j,k,[">"],"string");if(/[\^'"!~\/]/.test(o))return e(j,1),h(j,k,[j.eat(o)],"string")}else if("w"==o){if(o=b(j,1),"("==o)return e(j,2),h(j,k,[")"],"bracket");if("["==o)return e(j,2),h(j,k,["]"],"bracket");if("{"==o)return e(j,2),h(j,k,["}"],"bracket");if("<"==o)return e(j,2),h(j,k,[">"],"bracket");if(/[\^'"!~\/]/.test(o))return e(j,1),h(j,k,[j.eat(o)],"bracket")}else if("r"==o){if(o=b(j,1),"("==o)return e(j,2),h(j,k,[")"],f,g);if("["==o)return e(j,2),h(j,k,["]"],f,g);if("{"==o)return e(j,2),h(j,k,["}"],f,g);if("<"==o)return e(j,2),h(j,k,[">"],f,g);if(/[\^'"!~\/]/.test(o))return e(j,1),h(j,k,[j.eat(o)],f,g)}else if(/[\^'"!~\/(\[{<]/.test(o)){if("("==o)return e(j,1),h(j,k,[")"],"string");if("["==o)return e(j,1),h(j,k,["]"],"string");if("{"==o)return e(j,1),h(j,k,["}"],"string");if("<"==o)return e(j,1),h(j,k,[">"],"string");if(/[\^'"!~\/]/.test(o))return h(j,k,[j.eat(o)],"string")}}if("m"==l){var o=b(j,-2);if((!o||!/\w/.test(o))&&(o=j.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(o))return h(j,k,[o],f,g);if("("==o)return h(j,k,[")"],f,g);if("["==o)return h(j,k,["]"],f,g);if("{"==o)return h(j,k,["}"],f,g);if("<"==o)return h(j,k,[">"],f,g)}}if("s"==l){var o=/[\/>\]})\w]/.test(b(j,-2));if(!o&&(o=j.eat(/[(\[{<\^'"!~\/]/)))return"["==o?h(j,k,["]","]"],f,g):"{"==o?h(j,k,["}","}"],f,g):"<"==o?h(j,k,[">",">"],f,g):"("==o?h(j,k,[")",")"],f,g):h(j,k,[o,o],f,g)}if("y"==l){var o=/[\/>\]})\w]/.test(b(j,-2));if(!o&&(o=j.eat(/[(\[{<\^'"!~\/]/)))return"["==o?h(j,k,["]","]"],f,g):"{"==o?h(j,k,["}","}"],f,g):"<"==o?h(j,k,[">",">"],f,g):"("==o?h(j,k,[")",")"],f,g):h(j,k,[o,o],f,g)}if("t"==l){var o=/[\/>\]})\w]/.test(b(j,-2));if(!o&&(o=j.eat("r"),o&&(o=j.eat(/[(\[{<\^'"!~\/]/))))return"["==o?h(j,k,["]","]"],f,g):"{"==o?h(j,k,["}","}"],f,g):"<"==o?h(j,k,[">",">"],f,g):"("==o?h(j,k,[")",")"],f,g):h(j,k,[o,o],f,g)}if("`"==l)return h(j,k,[l],"variable-2");if("/"==l)return/~\s*$/.test(c(j))?h(j,k,[l],f,g):"operator";if("$"==l){var m=j.pos;if(j.eatWhile(/\d/)||j.eat("{")&&j.eatWhile(/\d/)&&j.eat("}"))return"variable-2";j.pos=m}if(/[$@%]/.test(l)){var m=j.pos;if(j.eat("^")&&j.eat(/[A-Z]/)||!/[@$%&]/.test(b(j,-2))&&j.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var o=j.current();if(a[o])return"variable-2"}j.pos=m}if(/[$@%&]/.test(l)&&(j.eatWhile(/[\w$\[\]]/)||j.eat("{")&&j.eatWhile(/[\w$\[\]]/)&&j.eat("}"))){var o=j.current();return a[o]?"variable-2":"variable"}if("#"==l&&"$"!=b(j,-2))return j.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(l)){var m=j.pos;if(j.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),a[j.current()])return"operator";j.pos=m}if("_"==l&&1==j.pos){if("_END__"==d(j,6))return h(j,k,["\0"],"comment");if("_DATA__"==d(j,7))return h(j,k,["\0"],"variable-2");if("_C__"==d(j,7))return h(j,k,["\0"],"string")}if(/\w/.test(l)){var m=j.pos;if("{"==b(j,-2)&&("}"==b(j,0)||j.eatWhile(/\w/)&&"}"==b(j,0)))return"string";j.pos=m}if(/[A-Z]/.test(l)){var p=b(j,-2),m=j.pos;if(j.eatWhile(/[A-Z_]/),!/[\da-z]/.test(b(j,0))){var o=a[j.current()];return o?(o[1]&&(o=o[0]),":"!=p?1==o?"keyword":2==o?"def":3==o?"atom":4==o?"operator":5==o?"variable-2":"meta":"meta"):"meta"}j.pos=m}if(/[a-zA-Z_]/.test(l)){var p=b(j,-2);j.eatWhile(/\w/);var o=a[j.current()];return o?(o[1]&&(o=o[0]),":"!=p?1==o?"keyword":2==o?"def":3==o?"atom":4==o?"operator":5==o?"variable-2":"meta":"meta"):"meta"}return null}var a={"->":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},f="string-2",g=/[goseximacplud]/;return{startState:function(){return{tokenize:j,chain:null,style:null,tail:null}},token:function(a,b){return(b.tokenize||j)(a,b)},electricChars:"{}"}}),a.defineMIME("text/x-perl","perl")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d",!1);)a.next();return"comment"},"/":function(a){if(a.eat("/")){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"}return!1}}};a.defineMode("php",function(b,c){function g(a,b){var c=b.curMode==f;if(a.sol()&&b.pending&&'"'!=b.pending&&"'"!=b.pending&&(b.pending=null),c)return c&&null==b.php.tokenize&&a.match("?>")?(b.curMode=e,b.curState=b.html,"meta"):f.token(a,b.curState);if(a.match(/^<\?\w*/))return b.curMode=f,b.curState=b.php,"meta";if('"'==b.pending||"'"==b.pending){for(;!a.eol()&&a.next()!=b.pending;);var d="string"}else if(b.pending&&a.pos/.test(g)?i[0]:{end:a.pos,style:d},a.backUp(g.length-h)),d}var e=a.getMode(b,"text/html"),f=a.getMode(b,d);return{startState:function(){var b=a.startState(e),d=a.startState(f);return{html:b,php:d,curMode:c.startOpen?f:e,curState:c.startOpen?d:b,pending:null}},copyState:function(b){var i,c=b.html,d=a.copyState(e,c),g=b.php,h=a.copyState(f,g);return i=b.curMode==e?d:h,{html:d,php:h,curMode:b.curMode,curState:i,pending:b.pending}},token:g,indent:function(a,b){return a.curMode!=f&&/^\s*<\//.test(b)||a.curMode==f&&/^\?>/.test(b)?e.indent(a.html,b):a.curMode.indent(a.curState,b)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(a){return{state:a.curState,mode:a.curMode}}}},"htmlmixed","clike"),a.defineMIME("application/x-httpd-php","php"),a.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),a.defineMIME("text/x-php",d)}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("pig",function(a,b){function h(a,b,c){return b.tokenize=c,c(a,b)}function j(a,b){return i=a,b}function k(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=m;break}c="*"==d}return j("comment","comment")}function l(a){return function(b,c){for(var e,d=!1,g=!1;null!=(e=b.next());){if(e==a&&!d){g=!0;break}d=!d&&"\\"==e}return(g||!d&&!f)&&(c.tokenize=m),j("string","error")}}function m(a,b){var f=a.next();return'"'==f||"'"==f?h(a,b,l(f)):/[\[\]{}\(\),;\.]/.test(f)?j(f):/\d/.test(f)?(a.eatWhile(/[\w\.]/),j("number","number")):"/"==f?a.eat("*")?h(a,b,k):(a.eatWhile(g),j("operator","operator")):"-"==f?a.eat("-")?(a.skipToEnd(),j("comment","comment")):(a.eatWhile(g),j("operator","operator")):g.test(f)?(a.eatWhile(g),j("operator","operator")):(a.eatWhile(/[\w\$_]/),c&&c.propertyIsEnumerable(a.current().toUpperCase())&&!a.eat(")")&&!a.eat(".")?"keyword":d&&d.propertyIsEnumerable(a.current().toUpperCase())?"variable-2":e&&e.propertyIsEnumerable(a.current().toUpperCase())?"variable-3":j("variable","pig-word"))}var i,c=b.keywords,d=b.builtins,e=b.types,f=b.multiLineStrings,g=/[*+\-%<>=&?:\/!|]/;return{startState:function(){return{tokenize:m,startOfLine:!0}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c}}}),function(){function b(a){for(var b={},c=a.split(" "),d=0;dc?u="indent":c>e&&(u="dedent"),null}c>0&&y(a,b)}if(a.eatSpace())return null;var l=a.peek();if("#"===l)return a.skipToEnd(),"comment";if(a.match(/^[0-9\.]/,!1)){var n=!1;if(a.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(n=!0),a.match(/^\d+\.\d*/)&&(n=!0),a.match(/^\.\d+/)&&(n=!0),n)return a.eat(/J/i),"number";var o=!1;if(a.match(/^0x[0-9a-f]+/i)&&(o=!0),a.match(/^0b[01]+/i)&&(o=!0),a.match(/^0o[0-7]+/i)&&(o=!0),a.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(a.eat(/J/i),o=!0),a.match(/^0(?![\dx])/i)&&(o=!0),o)return a.eat(/L/i),"number"}return a.match(r)?(b.tokenize=w(a.current()),b.tokenize(a,b)):a.match(j)||a.match(i)?null:a.match(h)||a.match(f)||a.match(m)?"operator":a.match(g)?null:a.match(s)?"keyword":a.match(t)?"builtin":a.match(/^(self|cls)\b/)?"variable-2":a.match(k)?"def"==b.lastToken||"class"==b.lastToken?"def":"variable":(a.next(),d)}function w(a){function f(f,g){for(;!f.eol();)if(f.eatWhile(/[^'"\\]/),f.eat("\\")){if(f.next(),b&&f.eol())return e}else{if(f.match(a))return g.tokenize=v,e;f.eat(/['"]/)}if(b){if(c.singleLineStringErrors)return d;g.tokenize=v}return e}for(;"rub".indexOf(a.charAt(0).toLowerCase())>=0;)a=a.substr(1);var b=1==a.length,e="string";return f.isString=!0,f}function x(a,c,d){d=d||"py";var e=0;if("py"===d){if("py"!==c.scopes[0].type)return c.scopes[0].offset=a.indentation(),void 0;for(var f=0;f0&&a.eol()&&"py"==b.scopes[0].type&&(b.scopes.length>1&&b.scopes.shift(),b.dedent-=1),c))}var d="error",f=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),g=c.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),h=c.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),i=c.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),j=c.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),k=c.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),l=c.hangingIndent||c.indentUnit,m=e(["and","or","not","is","in"]),n=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield"],o=["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"]},q={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};if(void 0!=c.extra_keywords&&(n=n.concat(c.extra_keywords)),void 0!=c.extra_builtins&&(o=o.concat(c.extra_builtins)),c.version&&3===parseInt(c.version,10)){n=n.concat(q.keywords),o=o.concat(q.builtins);var r=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{n=n.concat(p.keywords),o=o.concat(p.builtins);var r=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var s=e(n),t=e(o),u=null,A={startState:function(a){return{tokenize:v,scopes:[{offset:a||0,type:"py"}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(a,b){var c=z(a,b);b.lastStyle=c;var d=a.current();return d&&c&&(b.lastToken=d),a.eol()&&b.lambda&&(b.lambda=!1),c},indent:function(b){return b.tokenize!=v?b.tokenize.isString?a.Pass:0:b.scopes[0].offset},lineComment:"#",fold:"indent"};return A}),a.defineMIME("text/x-python","python");var b=function(a){return a.split(" ")};a.defineMIME("text/x-cython",{name:"python",extra_keywords:b("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("puppet",function(){function c(b,c){for(var d=c.split(" "),e=0;e.*/,!1),h=c.match(/(\s+)?[\w:_]+(\s+)?{/,!1),i=c.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/,!1),j=c.next();if("$"===j)return c.match(b)?e.continueString?"variable-2":"variable":"error";if(e.continueString)return c.backUp(1),d(c,e);if(e.inDefinition){if(c.match(/(\s+)?[\w:_]+(\s+)?/))return"def";c.match(/\s+{/),e.inDefinition=!1}return e.inInclude?(c.match(/(\s+)?\S+(\s+)?/),e.inInclude=!1,"def"):c.match(/(\s+)?\w+\(/)?(c.backUp(1),"def"):g?(c.match(/(\s+)?\w+/),"tag"):f&&a.hasOwnProperty(f)?(c.backUp(1),c.match(/[\w]+/),c.match(/\s+\S+\s+{/,!1)&&(e.inDefinition=!0),"include"==f&&(e.inInclude=!0),a[f]):/(\s+)?[A-Z]/.test(f)?(c.backUp(1),c.match(/(\s+)?[A-Z][\w:_]+/),"def"):h?(c.match(/(\s+)?[\w:_]+/),"def"):i?(c.match(/(\s+)?[@]{1,2}/),"special"):"#"==j?(c.skipToEnd(),"comment"):"'"==j||'"'==j?(e.pending=j,d(c,e)):"{"==j||"}"==j?"bracket":"/"==j?(c.match(/.*\//),"variable-3"):j.match(/[0-9]/)?(c.eatWhile(/[0-9]+/),"number"):"="==j?(">"==c.peek()&&c.next(),"operator"):(c.eatWhile(/[\w-]/),null)}var a={},b=/({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;return c("keyword","class define site node include import inherits"),c("keyword","case if else in and elsif default or"),c("atom","false true running present absent file directory undef"),c("builtin","action augeas burst chain computer cron destination dport exec file filebucket group host icmp iniface interface jump k5login limit log_level log_prefix macauthorization mailalias maillist mcx mount nagios_command nagios_contact nagios_contactgroup nagios_host nagios_hostdependency nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo nagios_servicegroup nagios_timeperiod name notify outiface package proto reject resources router schedule scheduled_task selboolean selmodule service source sport ssh_authorized_key sshkey stage state table tidy todest toports tosource user vlan yumrepo zfs zone zpool"),{startState:function(){var a={};return a.inDefinition=!1,a.inInclude=!1,a.continueString=!1,a.pending=!1,a},token:function(a,b){return a.eatSpace()?null:e(a,b)}}}),a.defineMIME("text/x-puppet","puppet")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("q",function(a){function f(a){return new RegExp("^("+a.join("|")+")$")}function g(a,b){var f=a.sol(),i=a.next();if(c=null,f){if("/"==i)return(b.tokenize=h)(a,b);if("\\"==i)return a.eol()||/\s/.test(a.peek())?(a.skipToEnd(),/^\\\s*$/.test(a.current())?(b.tokenize=j)(a,b):b.tokenize=g,"comment"):(b.tokenize=g,"builtin")}if(/\s/.test(i))return"/"==a.peek()?(a.skipToEnd(),"comment"):"whitespace";if('"'==i)return(b.tokenize=k)(a,b);if("`"==i)return a.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol";if("."==i&&/\d/.test(a.peek())||/\d/.test(i)){var l=null;return a.backUp(1),a.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)||a.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)||a.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)||a.match(/^\d+[ptuv]{1}/)?l="temporal":(a.match(/^0[NwW]{1}/)||a.match(/^0x[\d|a-f|A-F]*/)||a.match(/^[0|1]+[b]{1}/)||a.match(/^\d+[chijn]{1}/)||a.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))&&(l="number"),!l||(i=a.peek())&&!e.test(i)?(a.next(),"error"):l}return/[A-Z|a-z]|\./.test(i)?(a.eatWhile(/[A-Z|a-z|\.|_|\d]/),d.test(a.current())?"keyword":"variable"):/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(i)?null:/[{}\(\[\]\)]/.test(i)?null:"error"}function h(a,b){return a.skipToEnd(),/\/\s*$/.test(a.current())?(b.tokenize=i)(a,b):b.tokenize=g,"comment"}function i(a,b){var c=a.sol()&&"\\"==a.peek();return a.skipToEnd(),c&&/^\\\s*$/.test(a.current())&&(b.tokenize=g),"comment"}function j(a){return a.skipToEnd(),"comment"}function k(a,b){for(var d,c=!1,e=!1;d=a.next();){if('"'==d&&!c){e=!0;break}c=!c&&"\\"==d}return e&&(b.tokenize=g),"string"}function l(a,b,c){a.context={prev:a.context,indent:a.indent,col:c,type:b}}function m(a){a.indent=a.context.indent,a.context=a.context.prev}var c,b=a.indentUnit,d=f(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]),e=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/;return{startState:function(){return{tokenize:g,context:null,indent:0,col:0}},token:function(a,b){a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation());var d=b.tokenize(a,b);if("comment"!=d&&b.context&&null==b.context.align&&"pattern"!=b.context.type&&(b.context.align=!0),"("==c)l(b,")",a.column());else if("["==c)l(b,"]",a.column());else if("{"==c)l(b,"}",a.column());else if(/[\]\}\)]/.test(c)){for(;b.context&&"pattern"==b.context.type;)m(b);b.context&&c==b.context.type&&m(b)}else"."==c&&b.context&&"pattern"==b.context.type?m(b):/atom|string|variable/.test(d)&&b.context&&(/[\}\]]/.test(b.context.type)?l(b,"pattern",a.column()):"pattern"!=b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return d},indent:function(a,c){var d=c&&c.charAt(0),e=a.context;if(/[\]\}]/.test(d))for(;e&&"pattern"==e.type;)e=e.prev;var f=e&&d==e.type;return e?"pattern"==e.type?e.col:e.align?e.col+(f?0:1):e.indent+(f?0:b):0}}}),a.defineMIME("text/x-q","q")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("r",function(a){function b(a){for(var b=a.split(" "),c={},d=0;d=!&|~$:]/;return{startState:function(){return{tokenize:i,ctx:{type:"top",indent:-a.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(a,b){if(a.sol()&&(null==b.ctx.align&&(b.ctx.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var c=b.tokenize(a,b);"comment"!=c&&null==b.ctx.align&&(b.ctx.align=!0);var d=b.ctx.type;return";"!=h&&"{"!=h&&"}"!=h||"block"!=d||l(b),"{"==h?k(b,"}",a):"("==h?(k(b,")",a),b.afterIdent&&(b.ctx.argList=!0)):"["==h?k(b,"]",a):"block"==h?k(b,"block",a):h==d&&l(b),b.afterIdent="variable"==c||"keyword"==c,c},indent:function(b,c){if(b.tokenize!=i)return 0;var d=c&&c.charAt(0),e=b.ctx,f=d==e.type;return"block"==e.type?e.indent+("{"==d?0:a.indentUnit):e.align?e.column+(f?0:1):e.indent+(f?0:a.indentUnit)}}}),a.defineMIME("text/x-rsrc","r")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("rpm-changes",function(){var a=/^-+$/,b=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /,c=/^[\w+.-]+@[\w.-]+/;return{token:function(d){if(d.sol()){if(d.match(a))return"tag";if(d.match(b))return"tag"}return d.match(c)?"string":(d.next(),null)}}}),a.defineMIME("text/x-rpm-changes","rpm-changes"),a.defineMode("rpm-spec",function(){var a=/^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/,b=/^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/,c=/^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/,d=/^%(ifnarch|ifarch|if)/,e=/^%(else|endif)/,f=/^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/;return{startState:function(){return{controlFlow:!1,macroParameters:!1,section:!1}},token:function(g,h){var i=g.peek();if("#"==i)return g.skipToEnd(),"comment";if(g.sol()){if(g.match(b))return"preamble";if(g.match(c))return"section"}if(g.match(/^\$\w+/))return"def";if(g.match(/^\$\{\w+\}/))return"def";if(g.match(e))return"keyword";if(g.match(d))return h.controlFlow=!0,"keyword";if(h.controlFlow){if(g.match(f))return"operator";if(g.match(/^(\d+)/))return"number";g.eol()&&(h.controlFlow=!1)}if(g.match(a))return"number";if(g.match(/^%[\w]+/))return g.match(/^\(/)&&(h.macroParameters=!0),"macro";if(h.macroParameters){if(g.match(/^\d+/))return"number";if(g.match(/^\)/))return h.macroParameters=!1,"macro"}return g.match(/^%\{\??[\w \-]+\}/)?"macro":(g.next(),null)}}}),a.defineMIME("text/x-rpm-spec","rpm-spec")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../python/python"),require("../stex/stex"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../python/python","../stex/stex","../../addon/mode/overlay"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("rst",function(b,c){var d=/^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/,e=/^\*[^\*\s](?:[^\*]*[^\*\s])?\*/,f=/^``[^`\s](?:[^`]*[^`\s])``/,g=/^(?:[\d]+(?:[\.,]\d+)*)/,h=/^(?:\s\+[\d]+(?:[\.,]\d+)*)/,i=/^(?:\s\-[\d]+(?:[\.,]\d+)*)/,j="[Hh][Tt][Tt][Pp][Ss]?://",k="(?:[\\d\\w.-]+)\\.(?:\\w{2,6})",l="(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*",m=new RegExp("^"+j+k+l),n={token:function(a){if(a.match(d)&&a.match(/\W+|$/,!1))return"strong";if(a.match(e)&&a.match(/\W+|$/,!1))return"em";if(a.match(f)&&a.match(/\W+|$/,!1))return"string-2";if(a.match(g))return"number";if(a.match(h))return"positive";if(a.match(i))return"negative";if(a.match(m))return"link";for(;!(null==a.next()||a.match(d,!1)||a.match(e,!1)||a.match(f,!1)||a.match(g,!1)||a.match(h,!1)||a.match(i,!1)||a.match(m,!1)););return null}},o=a.getMode(b,c.backdrop||"rst-base");return a.overlayMode(o,n,!0)},"python","stex"),a.defineMode("rst-base",function(b){function c(a){var b=Array.prototype.slice.call(arguments,1);return a.replace(/{(\d+)}/g,function(a,c){return"undefined"!=typeof b[c]?b[c]:a})}function d(a){this.message=a}function e(a,b){if(!a)throw new d(b);return a}function R(b,c){var d=null;if(b.sol()&&b.match(Q,!1))Y(c,W,{mode:f,local:a.startState(f)});else if(b.sol()&&b.match(s))Y(c,S),d="meta";else if(b.sol()&&b.match(r))Y(c,R),d="header";else if($(c)==D||b.match(D,!1))switch(Z(c)){case 0:Y(c,R,X(D,1)),e(b.match(/^:/)),d="meta";break;case 1:Y(c,R,X(D,2)),e(b.match(l)),d="keyword",b.current().match(/^(?:math|latex)/)&&(c.tmp_stex=!0);break;case 2:Y(c,R,X(D,3)),e(b.match(/^:`/)),d="meta";break;case 3:if(c.tmp_stex&&(c.tmp_stex=void 0,c.tmp={mode:g,local:a.startState(g)}),c.tmp){if("`"==b.peek()){Y(c,R,X(D,4)),c.tmp=void 0;break}d=c.tmp.mode.token(b,c.tmp.local);break}Y(c,R,X(D,4)),e(b.match(q)),d="string";break;case 4:Y(c,R,X(D,5)),e(b.match(/^`/)),d="meta";break;case 5:Y(c,R,X(D,6)),e(b.match(j));break;default:Y(c,R),e(""==b.current())}else if($(c)==E||b.match(E,!1))switch(Z(c)){case 0:Y(c,R,X(E,1)),e(b.match(/^`/)),d="meta";break;case 1:Y(c,R,X(E,2)),e(b.match(q)),d="string";break;case 2:Y(c,R,X(E,3)),e(b.match(/^`:/)),d="meta";break;case 3:Y(c,R,X(E,4)),e(b.match(l)),d="keyword";break;case 4:Y(c,R,X(E,5)),e(b.match(/^:/)),d="meta";break;case 5:Y(c,R,X(E,6)),e(b.match(j));break;default:Y(c,R),e(""==b.current())}else if($(c)==F||b.match(F,!1))switch(Z(c)){case 0:Y(c,R,X(F,1)),e(b.match(/^:/)),d="meta";break;case 1:Y(c,R,X(F,2)),e(b.match(l)),d="keyword";break;case 2:Y(c,R,X(F,3)),e(b.match(/^:/)),d="meta";break;case 3:Y(c,R,X(F,4)),e(b.match(j));break;default:Y(c,R),e(""==b.current())}else if($(c)==y||b.match(y,!1))switch(Z(c)){case 0:Y(c,R,X(y,1)),e(b.match(I)),d="variable-2";break;case 1:Y(c,R,X(y,2)),b.match(/^_?_?/)&&(d="link");break;default:Y(c,R),e(""==b.current())}else if(b.match(z))Y(c,R),d="quote";else if(b.match(A))Y(c,R),d="quote";else if(b.match(B))Y(c,R),(!b.peek()||b.peek().match(/^\W$/))&&(d="link");else if($(c)==C||b.match(C,!1))switch(Z(c)){case 0:!b.peek()||b.peek().match(/^\W$/)?Y(c,R,X(C,1)):b.match(C);break;case 1:Y(c,R,X(C,2)),e(b.match(/^`/)),d="link";break;case 2:Y(c,R,X(C,3)),e(b.match(q));break;case 3:Y(c,R,X(C,4)),e(b.match(/^`_/)),d="link";break;default:Y(c,R),e(""==b.current())}else b.match(P)?Y(c,U):b.next()&&Y(c,R);return d}function S(b,c){var d=null;if($(c)==v||b.match(v,!1))switch(Z(c)){case 0:Y(c,S,X(v,1)),e(b.match(I)),d="variable-2";break;case 1:Y(c,S,X(v,2)),e(b.match(J));break;case 2:Y(c,S,X(v,3)),e(b.match(K)),d="keyword";break;case 3:Y(c,S,X(v,4)),e(b.match(L)),d="meta";break;default:Y(c,R),e(""==b.current())}else if($(c)==u||b.match(u,!1))switch(Z(c)){case 0:Y(c,S,X(u,1)),e(b.match(G)),d="keyword",b.current().match(/^(?:math|latex)/)?c.tmp_stex=!0:b.current().match(/^python/)&&(c.tmp_py=!0);break;case 1:Y(c,S,X(u,2)),e(b.match(H)),d="meta",(b.match(/^latex\s*$/)||c.tmp_stex)&&(c.tmp_stex=void 0,Y(c,W,{mode:g,local:a.startState(g)}));break;case 2:Y(c,S,X(u,3)),(b.match(/^python\s*$/)||c.tmp_py)&&(c.tmp_py=void 0,Y(c,W,{mode:f,local:a.startState(f)}));break;default:Y(c,R),e(""==b.current())}else if($(c)==t||b.match(t,!1))switch(Z(c)){case 0:Y(c,S,X(t,1)),e(b.match(M)),e(b.match(N)),d="link";break;case 1:Y(c,S,X(t,2)),e(b.match(O)),d="meta";break;default:Y(c,R),e(""==b.current())}else b.match(w)?(Y(c,R),d="quote"):b.match(x)?(Y(c,R),d="quote"):(b.eatSpace(),b.eol()?Y(c,R):(b.skipToEnd(),Y(c,T),d="comment"));return d}function T(a,b){return V(a,b,"comment")}function U(a,b){return V(a,b,"meta")}function V(a,b,c){return a.eol()||a.eatSpace()?(a.skipToEnd(),c):(Y(b,R),null)}function W(a,b){return b.ctx.mode&&b.ctx.local?a.sol()?(a.eatSpace()||Y(b,R),null):b.ctx.mode.token(a,b.ctx.local):(Y(b,R),null)}function X(a,b,c,d){return{phase:a,stage:b,mode:c,local:d}}function Y(a,b,c){a.tok=b,a.ctx=c||{}}function Z(a){return a.ctx.stage||0}function $(a){return a.ctx.phase}d.prototype.toString=function(){return"AssertException: "+this.message};var f=a.getMode(b,"python"),g=a.getMode(b,"stex"),h="\\s+",i="(?:\\s*|\\W|$)",j=new RegExp(c("^{0}",i)),k="(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",l=new RegExp(c("^{0}",k)),m="(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",n=c("(?:{0}|`{1}`)",k,m),o="(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)",p="(?:[^\\`]+)",q=new RegExp(c("^{0}",p)),r=new RegExp("^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"),s=new RegExp(c("^\\.\\.{0}",h)),t=new RegExp(c("^_{0}:{1}|^__:{1}",n,i)),u=new RegExp(c("^{0}::{1}",n,i)),v=new RegExp(c("^\\|{0}\\|{1}{2}::{3}",o,h,n,i)),w=new RegExp(c("^\\[(?:\\d+|#{0}?|\\*)]{1}",n,i)),x=new RegExp(c("^\\[{0}\\]{1}",n,i)),y=new RegExp(c("^\\|{0}\\|",o)),z=new RegExp(c("^\\[(?:\\d+|#{0}?|\\*)]_",n)),A=new RegExp(c("^\\[{0}\\]_",n)),B=new RegExp(c("^{0}__?",n)),C=new RegExp(c("^`{0}`_",p)),D=new RegExp(c("^:{0}:`{1}`{2}",k,p,i)),E=new RegExp(c("^`{1}`:{0}:{2}",k,p,i)),F=new RegExp(c("^:{0}:{1}",k,i)),G=new RegExp(c("^{0}",n)),H=new RegExp(c("^::{0}",i)),I=new RegExp(c("^\\|{0}\\|",o)),J=new RegExp(c("^{0}",h)),K=new RegExp(c("^{0}",n)),L=new RegExp(c("^::{0}",i)),M=new RegExp("^_"),N=new RegExp(c("^{0}|_",n)),O=new RegExp(c("^:{0}",i)),P=new RegExp("^::\\s*$"),Q=new RegExp("^\\s+(?:>>>|In \\[\\d+\\]:)\\s");return{startState:function(){return{tok:R,ctx:X(void 0,0)}},copyState:function(b){var c=b.ctx,d=b.tmp;return c.local&&(c={mode:c.mode,local:a.copyState(c.mode,c.local)}),d&&(d={mode:d.mode,local:a.copyState(d.mode,d.local)}),{tok:b.tok,ctx:c,tmp:d}},innerMode:function(a){return a.tmp?{state:a.tmp.local,mode:a.tmp.mode}:a.ctx.mode?{state:a.ctx.local,mode:a.ctx.mode}:null},token:function(a,b){return b.tok(a,b)}}},"python","stex"),a.defineMIME("text/x-rst","rst")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("ruby",function(a){function b(a){for(var b={},c=0,d=a.length;d>c;++c)b[a[c]]=!0;return b}function h(a,b,c){return c.tokenize.push(a),a(b,c)}function i(a,b){if(g=null,a.sol()&&a.match("=begin")&&a.eol())return b.tokenize.push(n),"comment";if(a.eatSpace())return null;var d,c=a.next();if("`"==c||"'"==c||'"'==c)return h(l(c,"string",'"'==c||"`"==c),a,b);if("/"!=c||a.eol()||" "==a.peek()){if("%"==c){var e="string",i=!0;a.eat("s")?e="atom":a.eat(/[WQ]/)?e="string":a.eat(/[r]/)?e="string-2":a.eat(/[wxq]/)&&(e="string",i=!1);var j=a.eat(/[^\w\s]/);return j?(f.propertyIsEnumerable(j)&&(j=f[j]),h(l(j,e,i,!0),a,b)):"operator"}if("#"==c)return a.skipToEnd(),"comment";if("<"==c&&(d=a.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return h(m(d[1]),a,b);if("0"==c)return a.eat("x")?a.eatWhile(/[\da-fA-F]/):a.eat("b")?a.eatWhile(/[01]/):a.eatWhile(/[0-7]/),"number";if(/\d/.test(c))return a.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==c){for(;a.match(/^\\[CM]-/););return a.eat("\\")?a.eatWhile(/\w/):a.next(),"string"}return":"==c?a.eat("'")?h(l("'","atom",!1),a,b):a.eat('"')?h(l('"',"atom",!0),a,b):a.eat(/[\<\>]/)?(a.eat(/[\<\>]/),"atom"):a.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":a.eat(/[a-zA-Z$@_]/)?(a.eatWhile(/[\w]/),a.eat(/[\?\!\=]/),"atom"):"operator":"@"==c&&a.match(/^@?[a-zA-Z_]/)?(a.eat("@"),a.eatWhile(/[\w]/),"variable-2"):"$"==c?(a.eat(/[a-zA-Z_]/)?a.eatWhile(/[\w]/):a.eat(/\d/)?a.eat(/\d/):a.next(),"variable-3"):/[a-zA-Z_]/.test(c)?(a.eatWhile(/[\w]/),a.eat(/[\?\!]/),a.eat(":")?"atom":"ident"):"|"!=c||!b.varList&&"{"!=b.lastTok&&"do"!=b.lastTok?/[\(\)\[\]{}\\;]/.test(c)?(g=c,null):"-"==c&&a.eat(">")?"arrow":/[=+\-\/*:\.^%<>~|]/.test(c)?(a.eatWhile(/[=+\-\/*:\.^%<>~|]/),"operator"):null:(g="|",null) }return a.eat("=")?"operator":h(l(c,"string-2",!0),a,b)}function j(){var a=1;return function(b,c){if("}"==b.peek()){if(a--,0==a)return c.tokenize.pop(),c.tokenize[c.tokenize.length-1](b,c)}else"{"==b.peek()&&a++;return i(b,c)}}function k(){var a=!1;return function(b,c){return a?(c.tokenize.pop(),c.tokenize[c.tokenize.length-1](b,c)):(a=!0,i(b,c))}}function l(a,b,c,d){return function(e,f){var h,g=!1;for("read-quoted-paused"===f.context.type&&(f.context=f.context.prev,e.eat("}"));null!=(h=e.next());){if(h==a&&(d||!g)){f.tokenize.pop();break}if(c&&"#"==h&&!g){if(e.eat("{")){"}"==a&&(f.context={prev:f.context,type:"read-quoted-paused"}),f.tokenize.push(j());break}if(/[@\$]/.test(e.peek())){f.tokenize.push(k());break}}g=!g&&"\\"==h}return b}}function m(a){return function(b,c){return b.match(a)?c.tokenize.pop():b.skipToEnd(),"string"}}function n(a,b){return a.sol()&&a.match("=end")&&a.eol()&&b.tokenize.pop(),a.skipToEnd(),"comment"}var g,c=b(["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","__END__","__FILE__","__LINE__","__dir__"]),d=b(["def","class","case","for","while","module","then","catch","loop","proc","begin"]),e=b(["end","until"]),f={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[i],indented:0,context:{type:"top",indented:-a.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(a,b){a.sol()&&(b.indented=a.indentation());var h,f=b.tokenize[b.tokenize.length-1](a,b);if("ident"==f){var i=a.current();f=c.propertyIsEnumerable(a.current())?"keyword":/^[A-Z]/.test(i)?"tag":"def"==b.lastTok||"class"==b.lastTok||b.varList?"def":"variable",d.propertyIsEnumerable(i)?h="indent":e.propertyIsEnumerable(i)?h="dedent":"if"!=i&&"unless"!=i||a.column()!=a.indentation()?"do"==i&&b.context.indented")?h("->",null):c.match(e)?(a.eatWhile(e),h("op",null)):(a.eatWhile(/\w/),g=a.current(),a.match(/^::\w/)?(a.backUp(1),h("prefix","variable-2")):b.keywords.propertyIsEnumerable(g)?h(b.keywords[g],g.match(/true|false/)?"atom":"keyword"):h("name","variable"))}function j(a,b){for(var c,d=!1;c=a.next();){if('"'==c&&!d)return b.tokenize=i,h("atom","string");d=!d&&"\\"==c}return h("op","string")}function k(a){return function(b,c){for(var e,d=null;e=b.next();){if("/"==e&&"*"==d){if(1==a){c.tokenize=i;break}return c.tokenize=k(a-1),c.tokenize(b,c)}if("*"==e&&"/"==d)return c.tokenize=k(a+1),c.tokenize(b,c);d=e}return"comment"}}function m(){for(var a=arguments.length-1;a>=0;a--)l.cc.push(arguments[a])}function n(){return m.apply(null,arguments),!0}function o(a,b){var c=function(){var c=l.state;c.lexical={indented:c.indented,column:l.stream.column(),type:a,prev:c.lexical,info:b}};return c.lex=!0,c}function p(){var a=l.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function q(){l.state.keywords=d}function r(){l.state.keywords=c}function s(a,b){function c(d){return","==d?n(a,c):d==b?n():n(c)}return function(d){return d==b?n():m(a,c)}}function t(a,b){return n(o("stat",b),a,p,u)}function u(a){return"}"==a?n():"let"==a?t(C,"let"):"fn"==a?t(G):"type"==a?n(o("stat"),H,v,p,u):"enum"==a?t(I):"mod"==a?t(K):"iface"==a?t(L):"impl"==a?t(M):"open-attr"==a?n(o("]"),s(w,"]"),p):"ignore"==a||a.match(/[\]\);,]/)?n(u):m(o("stat"),w,p,v,u)}function v(a){return";"==a?n():m()}function w(a){return"atom"==a||"name"==a?n(x):"{"==a?n(o("}"),z,p):a.match(/[\[\(]/)?Y(a,w):a.match(/[\]\)\};,]/)?m():"if-style"==a?n(w,w):"else-style"==a||"op"==a?n(w):"for"==a?n(S,E,F,w,w):"alt"==a?n(w,U):"fn"==a?n(G):"macro"==a?n(X):n()}function x(a){return"."==g?n(y):"::<"==g?n(N,x):"op"==a||":"==g?n(w):"("==a||"["==a?Y(a,w):m()}function y(){return g.match(/^\w+$/)?(l.marked="variable",n(x)):m(w)}function z(a){if("op"==a){if("|"==g)return n(B,p,o("}","block"),u);if("||"==g)return n(p,o("}","block"),u)}return"mutable"==g||g.match(/^\w+$/)&&":"==l.stream.peek()&&!l.stream.match("::",!1)?m(A(w)):m(u)}function A(a){function b(c){return"mutable"==g||"with"==g?(l.marked="keyword",n(b)):g.match(/^\w*$/)?(l.marked="variable",n(b)):":"==c?n(a,b):"}"==c?n():n(b)}return b}function B(a){return"name"==a?(l.marked="def",n(B)):"op"==a&&"|"==g?n():n(B)}function C(a){return a.match(/[\]\)\};]/)?n():"="==g?n(w,D):","==a?n(C):m(S,E,C)}function D(a){return a.match(/[\]\)\};,]/)?m(C):m(w,D)}function E(a){return":"==a?n(q,P,r):m()}function F(a){return"name"==a&&"in"==g?(l.marked="keyword",n()):m()}function G(a){return"@"==g||"~"==g?(l.marked="keyword",n(G)):"name"==a?(l.marked="def",n(G)):"<"==g?n(N,G):"{"==a?m(w):"("==a?n(o(")"),s(O,")"),p,G):"->"==a?n(q,P,r,G):";"==a?n():n(G)}function H(a){return"name"==a?(l.marked="def",n(H)):"<"==g?n(N,H):"="==g?n(q,P,r):n(H)}function I(a){return"name"==a?(l.marked="def",n(I)):"<"==g?n(N,I):"="==g?n(q,P,r,v):"{"==a?n(o("}"),q,J,r,p):n(I)}function J(a){return"}"==a?n():"("==a?n(o(")"),s(P,")"),p,J):(g.match(/^\w+$/)&&(l.marked="def"),n(J))}function K(a){return"name"==a?(l.marked="def",n(K)):"{"==a?n(o("}"),u,p):m()}function L(a){return"name"==a?(l.marked="def",n(L)):"<"==g?n(N,L):"{"==a?n(o("}"),u,p):m()}function M(a){return"<"==g?n(N,M):"of"==g||"for"==g?(l.marked="keyword",n(P,M)):"name"==a?(l.marked="def",n(M)):"{"==a?n(o("}"),u,p):m()}function N(){return">"==g?n():","==g?n(N):":"==g?n(P,N):m(P,N)}function O(a){return"name"==a?(l.marked="def",n(O)):":"==a?n(q,P,r):m()}function P(a){return"name"==a?(l.marked="variable-3",n(Q)):"mutable"==g?(l.marked="keyword",n(P)):"atom"==a?n(Q):"op"==a||"obj"==a?n(P):"fn"==a?n(R):"{"==a?n(o("{"),A(P),p):Y(a,P)}function Q(){return"<"==g?n(N):m()}function R(a){return"("==a?n(o("("),s(P,")"),p,R):"->"==a?n(P):m()}function S(a){return"name"==a?(l.marked="def",n(T)):"atom"==a?n(T):"op"==a?n(S):a.match(/[\]\)\};,]/)?m():Y(a,S)}function T(a){return"op"==a&&"."==g?n():"to"==g?(l.marked="keyword",n(S)):m()}function U(a){return"{"==a?n(o("}","alt"),V,p):m()}function V(a){return"}"==a?n():"|"==a?n(V):"when"==g?(l.marked="keyword",n(w,W)):a.match(/[\]\);,]/)?n(V):m(S,W)}function W(a){return"{"==a?n(o("}","alt"),u,p,V):m(V)}function X(a){return a.match(/[\[\(\{]/)?Y(a,w):m()}function Y(a,b){return"["==a?n(o("]"),s(b,"]"),p):"("==a?n(o(")"),s(b,")"),p):"{"==a?n(o("}"),s(b,"}"),p):n()}function Z(a,b,c){var d=a.cc;for(l.state=a,l.stream=b,l.marked=null,l.cc=d;;){var e=d.length?d.pop():u;if(e(f)){for(;d.length&&d[d.length-1].lex;)d.pop()();return l.marked||c}}}var f,g,a=4,b=2,c={"if":"if-style","while":"if-style","else":"else-style","do":"else-style",ret:"else-style",fail:"else-style","break":"atom",cont:"atom","const":"let",resource:"fn",let:"let",fn:"fn","for":"for",alt:"alt",iface:"iface",impl:"impl",type:"type","enum":"enum",mod:"mod",as:"op","true":"atom","false":"atom",assert:"op",check:"op",claim:"op","native":"ignore",unsafe:"ignore","import":"else-style","export":"else-style",copy:"op",log:"op",log_err:"op",use:"op",bind:"op",self:"atom"},d=function(){for(var a={fn:"fn",block:"fn",obj:"obj"},b="bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "),c=0,d=b.length;d>c;++c)a[b[c]]="atom";return a}(),e=/[+\-*&%=<>!?|\.@]/,l={state:null,stream:null,marked:null,cc:null};return p.lex=q.lex=r.lex=!0,{startState:function(){return{tokenize:i,cc:[],lexical:{indented:-a,column:0,type:"top",align:!1},keywords:c,indented:0}},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation()),a.eatSpace())return null;f=g=null;var c=b.tokenize(a,b);return"comment"==c?c:(b.lexical.hasOwnProperty("align")||(b.lexical.align=!0),"prefix"==f?c:(g||(g=a.current()),Z(b,a,c)))},indent:function(c,d){if(c.tokenize!=i)return 0;var e=d&&d.charAt(0),f=c.lexical,g=f.type,h=e==g;return"stat"==g?f.indented+a:f.align?f.column+(h?0:1):f.indented+(h?0:"alt"==f.info?b:a)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),a.defineMIME("text/x-rustsrc","rust")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("sass",function(a){var b=function(a){return new RegExp("^"+a.join("|"))},c=["true","false","null","auto"],d=new RegExp("^"+c.join("|")),e=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not"],f=b(e),g=/^::?[\w\-]+/,h=function(a,b){var c=a.peek();return")"===c?(a.next(),b.tokenizer=n,"operator"):"("===c?(a.next(),a.eatSpace(),"operator"):"'"===c||'"'===c?(b.tokenizer=j(a.next()),"string"):(b.tokenizer=j(")",!1),"string")},i=function(a,b){return a.skipTo("*/")?(a.next(),a.next(),b.tokenizer=n):a.next(),"comment"},j=function(a,b){function c(d,e){var f=d.next(),g=d.peek(),h=d.string.charAt(d.pos-2),i="\\"!==f&&g===a||f===a&&"\\"!==h;return i?(f!==a&&b&&d.next(),e.tokenizer=n,"string"):"#"===f&&"{"===g?(e.tokenizer=k(c),d.next(),"operator"):"string"}return null==b&&(b=!0),c},k=function(a){return function(b,c){return"}"===b.peek()?(b.next(),c.tokenizer=a,"operator"):n(b,c)}},l=function(b){if(0==b.indentCount){b.indentCount++;var c=b.scopes[0].offset,d=c+a.indentUnit;b.scopes.unshift({offset:d})}},m=function(a){1!=a.scopes.length&&a.scopes.shift()},n=function(a,b){var c=a.peek();if(a.match("//"))return a.skipToEnd(),"comment";if(a.match("/*"))return b.tokenizer=i,b.tokenizer(a,b);if(a.match("#{"))return b.tokenizer=k(n),"operator";if("."===c)return a.next(),a.match(/^[\w-]+/)?(l(b),"atom"):"#"===a.peek()?(l(b),"atom"):"operator";if("#"===c){if(a.next(),a.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/))return"number";if(a.match(/^[\w-]+/))return l(b),"atom";if("#"===a.peek())return l(b),"atom"}return a.match(/^-?[0-9\.]+/)?"number":a.match(/^(px|em|in)\b/)?"unit":a.match(d)?"keyword":a.match(/^url/)&&"("===a.peek()?(b.tokenizer=h,"atom"):"$"===c?(a.next(),a.eatWhile(/[\w-]/),":"===a.peek()?(a.next(),"variable-2"):"variable-3"):"!"===c?(a.next(),a.match(/^[\w]+/)?"keyword":"operator"):"="===c?(a.next(),a.match(/^[\w-]+/)?(l(b),"meta"):"operator"):"+"===c?(a.next(),a.match(/^[\w-]+/)?"variable-3":"operator"):a.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)?(l(b),"meta"):"@"===c?(a.next(),a.eatWhile(/[\w-]/),"meta"):'"'===c||"'"===c?(a.next(),b.tokenizer=j(c),"string"):":"==c&&a.match(g)?"keyword":a.eatWhile(/[\w-&]/)?":"!==a.peek()||a.match(g,!1)?"atom":"property":a.match(f)?"operator":(a.next(),null)},o=function(b,c){b.sol()&&(c.indentCount=0);var d=c.tokenizer(b,c),e=b.current();if("@return"===e&&m(c),"atom"===d&&l(c),null!==d){for(var f=b.pos-e.length,g=f+a.indentUnit*c.indentCount,h=[],i=0;iinteger char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"),j=h("define let letrec let* lambda"),n=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),o=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),p=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),q=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);return{startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1}},token:function(h,k){if(null==k.indentStack&&h.sol()&&(k.indentation=h.indentation()),h.eatSpace())return null;var n=null;switch(k.mode){case"string":for(var o,p=!1;null!=(o=h.next());){if('"'==o&&!p){k.mode=!1;break}p=!p&&"\\"==o}n=c;break;case"comment":for(var o,q=!1;null!=(o=h.next());){if("#"==o&&q){k.mode=!1;break}q="|"==o}n=b;break;case"s-expr-comment":if(k.mode=!1,"("!=h.peek()&&"["!=h.peek()){h.eatWhile(/[^/s]/),n=b;break}k.sExprComment=0;default:var v=h.next();if('"'==v)k.mode="string",n=c;else if("'"==v)n=d;else if("#"==v)if(h.eat("|"))k.mode="comment",n=b;else if(h.eat(/[tf]/i))n=d;else if(h.eat(";"))k.mode="s-expr-comment",n=b;else{var w=null,x=!1,y=!0;h.eat(/[ei]/i)?x=!0:h.backUp(1),h.match(/^#b/i)?w=r:h.match(/^#o/i)?w=s:h.match(/^#x/i)?w=u:h.match(/^#d/i)?w=t:h.match(/^[-+0-9.]/,!1)?(y=!1,w=t):x||h.eat("#"),null!=w&&(y&&!x&&h.match(/^#[ei]/i),w(h)&&(n=e))}else if(/^[-+0-9.]/.test(v)&&t(h,!0))n=e;else if(";"==v)h.skipToEnd(),n=b;else if("("==v||"["==v){for(var B,z="",A=h.column();null!=(B=h.eat(/[^\s\(\[\;\)\]]/));)z+=B;z.length>0&&j.propertyIsEnumerable(z)?l(k,A+g,v):(h.eatSpace(),h.eol()||";"==h.peek()?l(k,A+1,v):l(k,A+h.current().length,v)),h.backUp(h.current().length-1),"number"==typeof k.sExprComment&&k.sExprComment++,n=f}else")"==v||"]"==v?(n=f,null!=k.indentStack&&k.indentStack.type==(")"==v?"(":"[")&&(m(k),"number"==typeof k.sExprComment&&0==--k.sExprComment&&(n=b,k.sExprComment=!1))):(h.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/),n=i&&i.propertyIsEnumerable(h.current())?a:"variable")}return"number"==typeof k.sExprComment?b:n},indent:function(a){return null==a.indentStack?a.indentation:a.indentStack.indent},lineComment:";;"}}),a.defineMIME("text/x-scheme","scheme")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("shell",function(){function b(b,c){for(var d=c.split(" "),e=0;e1&&a.eat("$");var c=a.next(),e=/\w/;return"{"===c&&(e=/[^}]/),"("===c?(b.tokens[0]=d(")"),f(a,b)):(/\d/.test(c)||(a.eatWhile(e),a.eat("}")),b.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(a,b){return a.eatSpace()?null:f(a,b)}}}),a.defineMIME("text/x-sh","shell")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("sieve",function(a){function b(a){for(var b={},c=a.split(" "),d=0;dc&&(c=0),c*e},electricChars:"}"}}),a.defineMIME("application/sieve","sieve")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("smalltalk",function(a){var b=/[+\-\/\\*~<>=@%|&?!.,:;^]/,c=/true|false|nil|self|super|thisContext/,d=function(a,b){this.next=a,this.parent=b},e=function(a,b,c){this.name=a,this.context=b,this.eos=c},f=function(){this.context=new d(g,null),this.expectVariable=!0,this.indentation=0,this.userIndentationDelta=0};f.prototype.userIndent=function(b){this.userIndentationDelta=b>0?b/a.indentUnit-this.indentation:0};var g=function(a,f,g){var l=new e(null,f,!1),m=a.next();return'"'===m?l=h(a,new d(h,f)):"'"===m?l=i(a,new d(i,f)):"#"===m?"'"===a.peek()?(a.next(),l=j(a,new d(j,f))):l.name=a.eatWhile(/[^ .{}\[\]()]/)?"string-2":"meta":"$"===m?("<"===a.next()&&(a.eatWhile(/[^ >]/),a.next()),l.name="string-2"):"|"===m&&g.expectVariable?l.context=new d(k,f):/[\[\]{}()]/.test(m)?(l.name="bracket",l.eos=/[\[{(]/.test(m),"["===m?g.indentation++:"]"===m&&(g.indentation=Math.max(0,g.indentation-1))):b.test(m)?(a.eatWhile(b),l.name="operator",l.eos=";"!==m):/\d/.test(m)?(a.eatWhile(/[\w\d]/),l.name="number"):/[\w_]/.test(m)?(a.eatWhile(/[\w\d_]/),l.name=g.expectVariable?c.test(a.current())?"keyword":"variable":null):l.eos=g.expectVariable,l},h=function(a,b){return a.eatWhile(/[^"]/),new e("comment",a.eat('"')?b.parent:b,!0)},i=function(a,b){return a.eatWhile(/[^']/),new e("string",a.eat("'")?b.parent:b,!1)},j=function(a,b){return a.eatWhile(/[^']/),new e("string-2",a.eat("'")?b.parent:b,!1)},k=function(a,b){var c=new e(null,b,!1),d=a.next();return"|"===d?(c.context=b.parent,c.eos=!0):(a.eatWhile(/[^|]/),c.name="variable"),c};return{startState:function(){return new f},token:function(a,b){if(b.userIndent(a.indentation()),a.eatSpace())return null;var c=b.context.next(a,b.context,b);return b.context=c.context,b.expectVariable=c.eos,c.name},blankLine:function(a){a.userIndent(0)},indent:function(b,c){var d=b.context.next===g&&c&&"]"===c.charAt(0)?-1:b.userIndentationDelta;return(b.indentation+d)*a.indentUnit},electricChars:"]"}}),a.defineMIME("text/x-stsrc",{name:"smalltalk"})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("smarty",function(a){var b={rightDelimiter:"}",leftDelimiter:"{",smartyVersion:2};a.hasOwnProperty("leftDelimiter")&&(b.leftDelimiter=a.leftDelimiter),a.hasOwnProperty("rightDelimiter")&&(b.rightDelimiter=a.rightDelimiter),a.hasOwnProperty("smartyVersion")&&3===a.smartyVersion&&(b.smartyVersion=3);var d,c=["debug","extends","function","include","literal"],e={operatorChars:/[+\-*&%=<>!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/},f={cont:function(a,b){return d=b,a},chain:function(a,b,c){return b.tokenize=c,c(a,b)}},g={tokenizer:function(a,c){if(a.match(b.leftDelimiter,!0)){if(a.eat("*"))return f.chain(a,c,g.inBlock("comment","*"+b.rightDelimiter));c.depth++;var e=a.eol(),h=/\s/.test(a.peek());return 3===b.smartyVersion&&"{"===b.leftDelimiter&&(e||h)?(c.depth--,null):(c.tokenize=g.smarty,d="startTag","tag")}return a.next(),null},smarty:function(a,h){if(a.match(b.rightDelimiter,!0))return 3===b.smartyVersion?(h.depth--,h.depth<=0&&(h.tokenize=g.tokenizer)):h.tokenize=g.tokenizer,f.cont("tag",null);if(a.match(b.leftDelimiter,!0))return h.depth++,f.cont("tag","startTag");var i=a.next();if("$"==i)return a.eatWhile(e.validIdentifier),f.cont("variable-2","variable");if("|"==i)return f.cont("operator","pipe");if("."==i)return f.cont("operator","property");if(e.stringChar.test(i))return h.tokenize=g.inAttribute(i),f.cont("string","string");if(e.operatorChars.test(i))return a.eatWhile(e.operatorChars),f.cont("operator","operator");if("["==i||"]"==i)return f.cont("bracket","bracket");if("("==i||")"==i)return f.cont("bracket","operator");if(/\d/.test(i))return a.eatWhile(/\d/),f.cont("number","number");if("variable"==h.last){if("@"==i)return a.eatWhile(e.validIdentifier),f.cont("property","property");if("|"==i)return a.eatWhile(e.validIdentifier),f.cont("qualifier","modifier")}else{if("pipe"==h.last)return a.eatWhile(e.validIdentifier),f.cont("qualifier","modifier");if("whitespace"==h.last)return a.eatWhile(e.validIdentifier),f.cont("attribute","modifier")}if("property"==h.last)return a.eatWhile(e.validIdentifier),f.cont("property",null);if(/\s/.test(i))return d="whitespace",null;var j="";"/"!=i&&(j+=i);for(var k=null;k=a.eat(e.validIdentifier);)j+=k;for(var l=0,m=c.length;m>l;l++)if(c[l]==j)return f.cont("keyword","keyword");return/\s/.test(i)?null:f.cont("tag","tag")},inAttribute:function(a){return function(b,c){for(var d=null,e=null;!b.eol();){if(e=b.peek(),b.next()==a&&"\\"!==d){c.tokenize=g.smarty;break}d=e}return"string"}},inBlock:function(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){d.tokenize=g.tokenizer;break}c.next()}return a}}};return{startState:function(){return{tokenize:g.tokenizer,mode:"smarty",last:null,depth:0}},token:function(a,b){var c=b.tokenize(a,b);return b.last=d,c},electricChars:""}}),a.defineMIME("text/x-smarty","smarty")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../smarty/smarty")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../smarty/smarty"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("smartymixed",function(b){var c,d,e,f,g=a.getMode(b,"htmlmixed"),h=a.getMode(b,"smarty"),c={rightDelimiter:"}",leftDelimiter:"{"};return b.hasOwnProperty("leftDelimiter")&&(c.leftDelimiter=b.leftDelimiter),b.hasOwnProperty("rightDelimiter")&&(c.rightDelimiter=b.rightDelimiter),d={smartyComment:new RegExp("^"+c.leftDelimiter+"\\*"),literalOpen:new RegExp(c.leftDelimiter+"literal"+c.rightDelimiter),literalClose:new RegExp(c.leftDelimiter+"/literal"+c.rightDelimiter),hasLeftDelimeter:new RegExp(".*"+c.leftDelimiter),htmlHasLeftDelimeter:new RegExp("[^<>]*"+c.leftDelimiter)},e={chain:function(a,b,c){return b.tokenize=c,c(a,b)},cleanChain:function(a,b,c){return b.tokenize=null,b.localState=null,b.localMode=null,"string"==typeof c?c?c:null:c(a,b)},maybeBackup:function(a,b,c){var f,d=a.current(),e=d.search(b);return e>-1?a.backUp(d.length-e):(f=d.match(/<\/?$/))&&(a.backUp(d.length),a.match(b,!1)||a.match(d[0])),c}},f={html:function(a,b){return!b.inLiteral&&a.match(d.htmlHasLeftDelimeter,!1)&&null===b.htmlMixedState.htmlState.tagName?(b.tokenize=f.smarty,b.localMode=h,b.localState=h.startState(g.indent(b.htmlMixedState,"")),e.maybeBackup(a,c.leftDelimiter,h.token(a,b.localState))):!b.inLiteral&&a.match(c.leftDelimiter,!1)?(b.tokenize=f.smarty,b.localMode=h,b.localState=h.startState(g.indent(b.htmlMixedState,"")),e.maybeBackup(a,c.leftDelimiter,h.token(a,b.localState))):g.token(a,b.htmlMixedState)},smarty:function(a,b){if(a.match(c.leftDelimiter,!1)){if(a.match(d.smartyComment,!1))return e.chain(a,b,f.inBlock("comment","*"+c.rightDelimiter))}else if(a.match(c.rightDelimiter,!1))return a.eat(c.rightDelimiter),b.tokenize=f.html,b.localMode=g,b.localState=b.htmlMixedState,"tag";return e.maybeBackup(a,c.rightDelimiter,h.token(a,b.localState))},inBlock:function(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){e.cleanChain(c,d,"");break}c.next()}return a}}},{startState:function(){var a=g.startState();return{token:f.html,localMode:null,localState:null,htmlMixedState:a,tokenize:null,inLiteral:!1}},copyState:function(b){var c=null,d=b.tokenize||b.token;return b.localState&&(c=a.copyState(d!=f.html?h:g,b.localState)),{token:b.token,tokenize:b.tokenize,localMode:b.localMode,localState:c,htmlMixedState:a.copyState(g,b.htmlMixedState),inLiteral:b.inLiteral}},token:function(a,b){if(a.match(c.leftDelimiter,!1)){if(!b.inLiteral&&a.match(d.literalOpen,!0))return b.inLiteral=!0,"keyword";if(b.inLiteral&&a.match(d.literalClose,!0))return b.inLiteral=!1,"keyword"}b.inLiteral&&b.localState!=b.htmlMixedState&&(b.tokenize=f.html,b.localMode=g,b.localState=b.htmlMixedState);var e=(b.tokenize||b.token)(a,b);return e},indent:function(b,c){return b.localMode==h||b.inLiteral&&!b.localMode||d.hasLeftDelimeter.test(c)?a.Pass:g.indent(b.htmlMixedState,c)},innerMode:function(a){return{state:a.localState||a.htmlMixedState,mode:a.localMode||g}}}},"htmlmixed","smarty"),a.defineMIME("text/x-smarty","smartymixed")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("sql",function(a,b){function k(a,b){var k=a.next();if(i[k]){var n=i[k](a,b);if(n!==!1)return n}if(1==h.hexNumber&&("0"==k&&a.match(/^[xX][0-9a-fA-F]+/)||("x"==k||"X"==k)&&a.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==h.binaryNumber&&(("b"==k||"B"==k)&&a.match(/^'[01]+'/)||"0"==k&&a.match(/^b[01]+/)))return"number";if(k.charCodeAt(0)>47&&k.charCodeAt(0)<58)return a.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==h.decimallessFloat&&a.eat("."),"number";if("?"==k&&(a.eatSpace()||a.eol()||a.eat(";")))return"variable-3";if("'"==k||'"'==k&&h.doubleQuote)return b.tokenize=l(k),b.tokenize(a,b); if((1==h.nCharCast&&("n"==k||"N"==k)||1==h.charsetCast&&"_"==k&&a.match(/[a-z][a-z0-9]*/i))&&("'"==a.peek()||'"'==a.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(k))return null;if(h.commentSlashSlash&&"/"==k&&a.eat("/"))return a.skipToEnd(),"comment";if(h.commentHash&&"#"==k||"-"==k&&a.eat("-")&&(!h.commentSpaceRequired||a.eat(" ")))return a.skipToEnd(),"comment";if("/"==k&&a.eat("*"))return b.tokenize=m,b.tokenize(a,b);if("."!=k){if(g.test(k))return a.eatWhile(g),null;if("{"==k&&(a.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||a.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";a.eatWhile(/^[_\w\d]/);var o=a.current().toLowerCase();return j.hasOwnProperty(o)&&(a.match(/^( )+'[^']*'/)||a.match(/^( )+"[^"]*"/))?"number":d.hasOwnProperty(o)?"atom":e.hasOwnProperty(o)?"builtin":f.hasOwnProperty(o)?"keyword":c.hasOwnProperty(o)?"string-2":null}return 1==h.zerolessFloat&&a.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==h.ODBCdotTable&&a.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function l(a){return function(b,c){for(var e,d=!1;null!=(e=b.next());){if(e==a&&!d){c.tokenize=k;break}d=!d&&"\\"==e}return"string"}}function m(a,b){for(;;){if(!a.skipTo("*")){a.skipToEnd();break}if(a.next(),a.eat("/")){b.tokenize=k;break}}return"comment"}function n(a,b,c){b.context={prev:b.context,indent:a.indentation(),col:a.column(),type:c}}function o(a){a.indent=a.context.indent,a.context=a.context.prev}var c=b.client||{},d=b.atoms||{"false":!0,"true":!0,"null":!0},e=b.builtin||{},f=b.keywords||{},g=b.operatorChars||/^[*+\-%<>!=&|~^]/,h=b.support||{},i=b.hooks||{},j=b.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:k,context:null}},token:function(a,b){if(a.sol()&&b.context&&null==b.context.align&&(b.context.align=!1),a.eatSpace())return null;var c=b.tokenize(a,b);if("comment"==c)return c;b.context&&null==b.context.align&&(b.context.align=!0);var d=a.current();return"("==d?n(a,b,")"):"["==d?n(a,b,"]"):b.context&&b.context.type==d&&o(b),c},indent:function(b,c){var d=b.context;if(!d)return 0;var e=c.charAt(0)==d.type;return d.align?d.col+(e?0:1):d.indent+(e?0:a.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:h.commentSlashSlash?"//":h.commentHash?"#":null}}),function(){function b(a){for(var b;null!=(b=a.next());)if("`"==b&&!a.eat("`"))return"variable-2";return null}function c(a){return a.eat("@")&&(a.match(/^session\./),a.match(/^local\./),a.match(/^global\./)),a.eat("'")?(a.match(/^.*'/),"variable-2"):a.eat('"')?(a.match(/^.*"/),"variable-2"):a.eat("`")?(a.match(/^.*`/),"variable-2"):a.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function d(a){return a.eat("N")?"atom":a.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function f(a){for(var b={},c=a.split(" "),d=0;d!=]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable doubleQuote binaryNumber hexNumber")}),a.defineMIME("text/x-mssql",{name:"sql",client:f("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:f(e+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"),builtin:f("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:f("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":c}}),a.defineMIME("text/x-mysql",{name:"sql",client:f("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:f(e+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:f("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":c,"`":b,"\\":d}}),a.defineMIME("text/x-mariadb",{name:"sql",client:f("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:f(e+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:f("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:f("date time timestamp"),support:f("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":c,"`":b,"\\":d}}),a.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:f("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"),builtin:f("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"),atoms:f("false true"),operatorChars:/^[<>=]/,dateSQL:{},support:f("commentSlashSlash decimallessFloat"),hooks:{}}),a.defineMIME("text/x-plsql",{name:"sql",client:f("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:f("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:f("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:f("date time timestamp"),support:f("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),a.defineMIME("text/x-hive",{name:"sql",keywords:f("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:f("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:f("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:f("date timestamp"),support:f("ODBCdotTable doubleQuote binaryNumber hexNumber")})}()}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("sparql",function(a){function d(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function h(a,b){var d=a.next();if(c=null,"$"==d||"?"==d)return a.match(/^[\w\d]*/),"variable-2";if("<"!=d||a.match(/^[\s\u00a0=]/,!1)){if('"'==d||"'"==d)return b.tokenize=i(d),b.tokenize(a,b);if(/[{}\(\),\.;\[\]]/.test(d))return c=d,null;if("#"==d)return a.skipToEnd(),"comment";if(g.test(d))return a.eatWhile(g),null;if(":"==d)return a.eatWhile(/[\w\d\._\-]/),"atom";if(a.eatWhile(/[_\w\d]/),a.eat(":"))return a.eatWhile(/[\w\d_\-]/),"atom";var h=a.current();return e.test(h)?null:f.test(h)?"keyword":"variable"}return a.match(/^[^\s\u00a0>]*>?/),"atom"}function i(a){return function(b,c){for(var e,d=!1;null!=(e=b.next());){if(e==a&&!d){c.tokenize=h;break}d=!d&&"\\"==e}return"string"}}function j(a,b,c){a.context={prev:a.context,indent:a.indent,col:c,type:b}}function k(a){a.indent=a.context.indent,a.context=a.context.prev}var c,b=a.indentUnit,e=d(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","isblank","isliteral","a"]),f=d(["base","prefix","select","distinct","reduced","construct","describe","ask","from","named","where","order","limit","offset","filter","optional","graph","by","asc","desc","as","having","undef","values","group","minus","in","not","service","silent","using","insert","delete","union","data","copy","to","move","add","create","drop","clear","load"]),g=/[*+\-<>=&|]/;return{startState:function(){return{tokenize:h,context:null,indent:0,col:0}},token:function(a,b){if(a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var d=b.tokenize(a,b);if("comment"!=d&&b.context&&null==b.context.align&&"pattern"!=b.context.type&&(b.context.align=!0),"("==c)j(b,")",a.column());else if("["==c)j(b,"]",a.column());else if("{"==c)j(b,"}",a.column());else if(/[\]\}\)]/.test(c)){for(;b.context&&"pattern"==b.context.type;)k(b);b.context&&c==b.context.type&&k(b)}else"."==c&&b.context&&"pattern"==b.context.type?k(b):/atom|string|variable/.test(d)&&b.context&&(/[\}\]]/.test(b.context.type)?j(b,"pattern",a.column()):"pattern"!=b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return d},indent:function(a,c){var d=c&&c.charAt(0),e=a.context;if(/[\]\}]/.test(d))for(;e&&"pattern"==e.type;)e=e.prev;var f=e&&d==e.type;return e?"pattern"==e.type?e.col:e.align?e.col+(f?0:1):e.indent+(f?0:b):0}}}),a.defineMIME("application/x-sparql-query","sparql")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("stex",function(){function a(a,b){a.cmdState.push(b)}function b(a){return a.cmdState.length>0?a.cmdState[a.cmdState.length-1]:null}function c(a){var b=a.cmdState.pop();b&&b.closeBracket()}function d(a){for(var b=a.cmdState,c=b.length-1;c>=0;c--){var d=b[c];if("DEFAULT"!=d.name)return d}return{styleIdentifier:function(){return null}}}function e(a,b,c){return function(){this.name=a,this.bracketNo=0,this.style=b,this.styles=c,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}function g(a,b){a.f=b}function h(c,e){var h;if(c.match(/^\\[a-zA-Z@]+/)){var l=c.current().slice(1);return h=f[l]||f.DEFAULT,h=new h,a(e,h),g(e,k),h.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return g(e,function(a,b){return j(a,b,"\\]")}),"keyword";if(c.match("$$"))return g(e,function(a,b){return j(a,b,"$$")}),"keyword";if(c.match("$"))return g(e,function(a,b){return j(a,b,"$")}),"keyword";var m=c.next();return"%"==m?(c.eol()||g(e,i),"comment"):"}"==m||"]"==m?(h=b(e))?(h.closeBracket(m),g(e,k),"bracket"):"error":"{"==m||"["==m?(h=f.DEFAULT,h=new h,a(e,h),"bracket"):/\d/.test(m)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),h=d(e),"begin"==h.name&&(h.argument=c.current()),h.styleIdentifier())}function i(a,b){return a.skipToEnd(),g(b,h),"comment"}function j(a,b,c){if(a.eatSpace())return null;if(a.match(c))return g(b,h),"keyword";if(a.match(/^\\[a-zA-Z@]+/))return"tag";if(a.match(/^[a-zA-Z]+/))return"variable-2";if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/]/))return"tag";if(a.match(/^[\^_&]/))return"tag";if(a.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(a.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var d=a.next();return"{"==d||"}"==d||"["==d||"]"==d||"("==d||")"==d?"bracket":"%"==d?(a.eol()||a.skipToEnd(),"comment"):"error"}function k(a,d){var f,e=a.peek();return"{"==e||"["==e?(f=b(d),f.openBracket(e),a.eat(e),g(d,h),"bracket"):/[ \t\r]/.test(e)?(a.eat(e),null):(g(d,h),c(d),h(a,d))}var f={};return f.importmodule=e("importmodule","tag",["string","builtin"]),f.documentclass=e("documentclass","tag",["","atom"]),f.usepackage=e("usepackage","tag",["atom"]),f.begin=e("begin","tag",["atom"]),f.end=e("end","tag",["atom"]),f.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:h}},copyState:function(a){return{cmdState:a.cmdState.slice(),f:a.f}},token:function(a,b){return b.f(a,b)}}}),a.defineMIME("text/x-stex","stex"),a.defineMIME("text/x-latex","stex")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("tcl",function(){function a(a){for(var b={},c=a.split(" "),d=0;d!?^\/\|]/;return{startState:function(){return{tokenize:f,beforeParams:!1,inParams:!1}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)}}}),a.defineMIME("text/x-tcl","tcl")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("tiddlywiki",function(){function o(a,b,c){return b.tokenize=c,c(a,b)}function r(a,b,c){return p=a,q=c,b}function s(b,m){var p,n=b.sol();if(m.block=!1,p=b.peek(),n&&/[<\/\*{}\-]/.test(p)){if(b.match(l))return m.block=!0,o(b,m,v);if(b.match(g))return r("quote","quote");if(b.match(e)||b.match(f))return r("code","comment");if(b.match(h)||b.match(i)||b.match(j)||b.match(k))return r("code","comment");if(b.match(d))return r("hr","hr")}if(p=b.next(),n&&/[\/\*!#;:>|]/.test(p)){if("!"==p)return b.skipToEnd(),r("header","header");if("*"==p)return b.eatWhile("*"),r("list","comment");if("#"==p)return b.eatWhile("#"),r("list","comment");if(";"==p)return b.eatWhile(";"),r("list","comment");if(":"==p)return b.eatWhile(":"),r("list","comment");if(">"==p)return b.eatWhile(">"),r("quote","quote");if("|"==p)return r("table","header")}if("{"==p&&b.match(/\{\{/))return o(b,m,v);if(/[hf]/i.test(p)&&/[ti]/i.test(b.peek())&&b.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return r("link","link");if('"'==p)return r("string","string");if("~"==p)return r("text","brace");if(/[\[\]]/.test(p)&&b.peek()==p)return b.next(),r("brace","brace");if("@"==p)return b.eatWhile(c),r("link","link");if(/\d/.test(p))return b.eatWhile(/\d/),r("number","number");if("/"==p){if(b.eat("%"))return o(b,m,t);if(b.eat("/"))return o(b,m,w)}if("_"==p&&b.eat("_"))return o(b,m,x);if("-"==p&&b.eat("-")){if(" "!=b.peek())return o(b,m,y);if(" "==b.peek())return r("text","brace")}if("'"==p&&b.eat("'"))return o(b,m,u);if("<"!=p)return r(p);if(b.eat("<"))return o(b,m,z);b.eatWhile(/[\w\$_]/);var q=b.current(),s=a.propertyIsEnumerable(q)&&a[q];return s?r(s.type,s.style,q):r("text",null,q)}function t(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=s;break}c="%"==d}return r("comment","comment")}function u(a,b){for(var d,c=!1;d=a.next();){if("'"==d&&c){b.tokenize=s;break}c="'"==d}return r("text","strong")}function v(a,b){var c,d=b.block;return d&&a.current()?r("code","comment"):!d&&a.match(n)?(b.tokenize=s,r("code","comment")):d&&a.sol()&&a.match(m)?(b.tokenize=s,r("code","comment")):(c=a.next(),d?r("code","comment"):r("code","comment"))}function w(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=s;break}c="/"==d}return r("text","em")}function x(a,b){for(var d,c=!1;d=a.next();){if("_"==d&&c){b.tokenize=s;break}c="_"==d}return r("text","underlined")}function y(a,b){for(var d,c=!1;d=a.next();){if("-"==d&&c){b.tokenize=s;break}c="-"==d}return r("text","strikethrough")}function z(a,c){var d,e,f;return"<<"==a.current()?r("brace","macro"):(d=a.next())?">"==d&&">"==a.peek()?(a.next(),c.tokenize=s,r("brace","macro")):(a.eatWhile(/[\w\$_]/),e=a.current(),f=b.propertyIsEnumerable(e)&&b[e],f?r(f.type,f.style,e):r("macro",null,e)):(c.tokenize=s,r(d))}var p,q,a={},b=function(){function a(a){return{type:a,style:"macro"}}return{allTags:a("allTags"),closeAll:a("closeAll"),list:a("list"),newJournal:a("newJournal"),newTiddler:a("newTiddler"),permaview:a("permaview"),saveChanges:a("saveChanges"),search:a("search"),slider:a("slider"),tabs:a("tabs"),tag:a("tag"),tagging:a("tagging"),tags:a("tags"),tiddler:a("tiddler"),timeline:a("timeline"),today:a("today"),version:a("version"),option:a("option"),"with":a("with"),filter:a("filter")}}(),c=/[\w_\-]/i,d=/^\-\-\-\-+$/,e=/^\/\*\*\*$/,f=/^\*\*\*\/$/,g=/^<<<$/,h=/^\/\/\{\{\{$/,i=/^\/\/\}\}\}$/,j=/^$/,k=/^$/,l=/^\{\{\{$/,m=/^\}\}\}$/,n=/.*?\}\}\}/;return{startState:function(){return{tokenize:s,indented:0,level:0}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c},electricChars:""}}),a.defineMIME("text/x-tiddlywiki","tiddlywiki")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("tiki",function(a){function b(a,b,c){return function(e,f){for(;!e.eol();){if(e.match(b)){f.tokenize=d;break}e.next()}return c&&(f.tokenize=c),a}}function c(a){return function(b,c){for(;!b.eol();)b.next();return c.tokenize=d,a}}function d(a,e){function f(b){return e.tokenize=b,b(a,e)}var g=a.sol(),i=a.next();switch(i){case"{":a.eat("/"),a.eatSpace();for(var k,j="";k=a.eat(/[^\s\u00a0=\"\'\/?(}]/);)j+=k;return e.tokenize=h,"tag";case"_":if(a.eat("_"))return f(b("strong","__",d));break;case"'":if(a.eat("'"))return f(b("em","''",d));break;case"(":if(a.eat("("))return f(b("variable-2","))",d));break;case"[":return f(b("variable-3","]",d));case"|":if(a.eat("|"))return f(b("comment","||"));break;case"-":if(a.eat("="))return f(b("header string","=-",d));if(a.eat("-"))return f(b("error tw-deleted","--",d));break;case"=":if(a.match("=="))return f(b("tw-underline","===",d));break;case":":if(a.eat(":"))return f(b("comment","::"));break;case"^":return f(b("tw-box","^"));case"~":if(a.match("np~"))return f(b("meta","~/np~"))}if(g)switch(i){case"!":return a.match("!!!!!")?f(c("header string")):a.match("!!!!")?f(c("header string")):a.match("!!!")?f(c("header string")):a.match("!!")?f(c("header string")):f(c("header string"));case"*":case"#":case"+":return f(c("tw-listitem bracket"))}return null}function h(a,b){var c=a.next(),e=a.peek();return"}"==c?(b.tokenize=d,"tag"):"("==c||")"==c?"bracket":"="==c?(g="equals",">"==e&&(c=a.next(),e=a.peek()),/[\'\"]/.test(e)||(b.tokenize=j()),"operator"):/[\'\"]/.test(c)?(b.tokenize=i(c),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=\"\'\/?]/),"keyword")}function i(a){return function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=h;break}return"string"}}function j(){return function(a,b){for(;!a.eol();){var c=a.next(),d=a.peek();if(" "==c||","==c||/[ )}]/.test(d)){b.tokenize=h;break}}return"string"}}function m(){for(var a=arguments.length-1;a>=0;a--)k.cc.push(arguments[a]) }function n(){return m.apply(null,arguments),!0}function o(a,b){var c=k.context&&k.context.noIndent;k.context={prev:k.context,pluginName:a,indent:k.indented,startOfLine:b,noIndent:c}}function p(){k.context&&(k.context=k.context.prev)}function q(a){if("openPlugin"==a)return k.pluginName=f,n(t,r(k.startOfLine));if("closePlugin"==a){var b=!1;return k.context?(b=k.context.pluginName!=f,p()):b=!0,b&&(l="error"),n(s(b))}return"string"==a?(k.context&&"!cdata"==k.context.name||o("!cdata"),k.tokenize==d&&p(),n()):n()}function r(a){return function(b){return"selfclosePlugin"==b||"endPlugin"==b?n():"endPlugin"==b?(o(k.pluginName,a),n()):n()}}function s(a){return function(b){return a&&(l="error"),"endPlugin"==b?n():m()}}function t(a){return"keyword"==a?(l="attribute",n(t)):"equals"==a?n(u,t):m()}function u(a){return"keyword"==a?(l="string",n()):"string"==a?n(v):m()}function v(a){return"string"==a?n(v):m()}var f,g,k,l,e=a.indentUnit;return{startState:function(){return{tokenize:d,cc:[],indented:0,startOfLine:!0,pluginName:null,context:null}},token:function(a,b){if(a.sol()&&(b.startOfLine=!0,b.indented=a.indentation()),a.eatSpace())return null;l=g=f=null;var c=b.tokenize(a,b);if((c||g)&&"comment"!=c)for(k=b;;){var d=b.cc.pop()||q;if(d(g||c))break}return b.startOfLine=!1,l||c},indent:function(a,b){var c=a.context;if(c&&c.noIndent)return 0;for(c&&/^{\//.test(b)&&(c=c.prev);c&&!c.startOfLine;)c=c.prev;return c?c.indent+e:0},electricChars:"/"}}),a.defineMIME("text/tiki","tiki")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("toml",function(){return{startState:function(){return{inString:!1,stringType:"",lhs:!0,inArray:0}},token:function(a,b){if(b.inString||'"'!=a.peek()&&"'"!=a.peek()||(b.stringType=a.peek(),a.next(),b.inString=!0),a.sol()&&0===b.inArray&&(b.lhs=!0),b.inString){for(;b.inString&&!a.eol();)a.peek()===b.stringType?(a.next(),b.inString=!1):"\\"===a.peek()?(a.next(),a.next()):a.match(/^.[^\\\"\']*/);return b.lhs?"property string":"string"}return b.inArray&&"]"===a.peek()?(a.next(),b.inArray--,"bracket"):b.lhs&&"["===a.peek()&&a.skipTo("]")?(a.next(),"]"===a.peek()&&a.next(),"atom"):"#"===a.peek()?(a.skipToEnd(),"comment"):a.eatSpace()?null:b.lhs&&a.eatWhile(function(a){return"="!=a&&" "!=a})?"property":b.lhs&&"="===a.peek()?(a.next(),b.lhs=!1,null):!b.lhs&&a.match(/^\d\d\d\d[\d\-\:\.T]*Z/)?"atom":b.lhs||!a.match("true")&&!a.match("false")?b.lhs||"["!==a.peek()?!b.lhs&&a.match(/^\-?\d+(?:\.\d+)?/)?"number":(a.eatSpace()||a.next(),null):(b.inArray++,a.next(),"bracket"):"atom"}}}),a.defineMIME("text/x-toml","toml")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("turtle",function(a){function d(a){return new RegExp("^(?:"+a.join("|")+")$","i")}function h(a,b){var d=a.next();if(c=null,"<"==d&&!a.match(/^[\s\u00a0=]/,!1))return a.match(/^[^\s\u00a0>]*>?/),"atom";if('"'==d||"'"==d)return b.tokenize=i(d),b.tokenize(a,b);if(/[{}\(\),\.;\[\]]/.test(d))return c=d,null;if("#"==d)return a.skipToEnd(),"comment";if(g.test(d))return a.eatWhile(g),null;if(":"==d)return"operator";if(a.eatWhile(/[_\w\d]/),":"==a.peek())return"variable-3";var h=a.current();return f.test(h)?"meta":d>="A"&&"Z">=d?"comment":"keyword";var h}function i(a){return function(b,c){for(var e,d=!1;null!=(e=b.next());){if(e==a&&!d){c.tokenize=h;break}d=!d&&"\\"==e}return"string"}}function j(a,b,c){a.context={prev:a.context,indent:a.indent,col:c,type:b}}function k(a){a.indent=a.context.indent,a.context=a.context.prev}var c,b=a.indentUnit,f=(d([]),d(["@prefix","@base","a"])),g=/[*+\-<>=&|]/;return{startState:function(){return{tokenize:h,context:null,indent:0,col:0}},token:function(a,b){if(a.sol()&&(b.context&&null==b.context.align&&(b.context.align=!1),b.indent=a.indentation()),a.eatSpace())return null;var d=b.tokenize(a,b);if("comment"!=d&&b.context&&null==b.context.align&&"pattern"!=b.context.type&&(b.context.align=!0),"("==c)j(b,")",a.column());else if("["==c)j(b,"]",a.column());else if("{"==c)j(b,"}",a.column());else if(/[\]\}\)]/.test(c)){for(;b.context&&"pattern"==b.context.type;)k(b);b.context&&c==b.context.type&&k(b)}else"."==c&&b.context&&"pattern"==b.context.type?k(b):/atom|string|variable/.test(d)&&b.context&&(/[\}\]]/.test(b.context.type)?j(b,"pattern",a.column()):"pattern"!=b.context.type||b.context.align||(b.context.align=!0,b.context.col=a.column()));return d},indent:function(a,c){var d=c&&c.charAt(0),e=a.context;if(/[\]\}]/.test(d))for(;e&&"pattern"==e.type;)e=e.prev;var f=e&&d==e.type;return e?"pattern"==e.type?e.col:e.align?e.col+(f?0:1):e.indent+(f?0:b):0}}}),a.defineMIME("text/turtle","turtle")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("vb",function(a,b){function d(a){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function z(a,b){b.currentIndent++}function A(a,b){b.currentIndent--}function B(a,b){if(a.eatSpace())return null;var d=a.peek();if("'"===d)return a.skipToEnd(),"comment";if(a.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var k=!1;if(a.match(/^\d*\.\d+F?/i)?k=!0:a.match(/^\d+\.\d*F?/)?k=!0:a.match(/^\.\d+F?/)&&(k=!0),k)return a.eat(/J/i),"number";var l=!1;if(a.match(/^&H[0-9a-f]+/i)?l=!0:a.match(/^&O[0-7]+/i)?l=!0:a.match(/^[1-9]\d*F?/)?(a.eat(/J/i),l=!0):a.match(/^0(?![\dx])/i)&&(l=!0),l)return a.eat(/L/i),"number"}return a.match(s)?(b.tokenize=C(a.current()),b.tokenize(a,b)):a.match(i)||a.match(h)?null:a.match(g)||a.match(e)||a.match(n)?"operator":a.match(f)?null:a.match(x)?(z(a,b),b.doInCurrentLine=!0,"keyword"):a.match(t)?(b.doInCurrentLine?b.doInCurrentLine=!1:z(a,b),"keyword"):a.match(u)?"keyword":a.match(w)?(A(a,b),A(a,b),"keyword"):a.match(v)?(A(a,b),"keyword"):a.match(r)?"keyword":a.match(q)?"keyword":a.match(j)?"variable":(a.next(),c)}function C(a){var d=1==a.length,e="string";return function(f,g){for(;!f.eol();){if(f.eatWhile(/[^'"]/),f.match(a))return g.tokenize=B,e;f.eat(/['"]/)}if(d){if(b.singleLineStringErrors)return c;g.tokenize=B}return e}}function D(a,b){var d=b.tokenize(a,b),e=a.current();if("."===e)return d=b.tokenize(a,b),e=a.current(),"variable"===d?"variable":c;var f="[({".indexOf(e);return-1!==f&&z(a,b),"dedent"===y&&A(a,b)?c:(f="])}".indexOf(e),-1!==f&&A(a,b)?c:d)}var c="error",e=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),f=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),g=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),h=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),i=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),j=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),k=["class","module","sub","enum","select","while","if","function","get","set","property","try"],l=["else","elseif","case","catch"],m=["next","loop"],n=d(["and","or","not","xor","in"]),o=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],p=["integer","string","double","decimal","boolean","short","char","float","single"],q=d(o),r=d(p),s='"',t=d(k),u=d(l),v=d(m),w=d(["end"]),x=d(["do"]),y=null,E={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:B,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(a,b){a.sol()&&(b.currentIndent+=b.nextLineIndent,b.nextLineIndent=0,b.doInCurrentLine=0);var c=D(a,b);return b.lastToken={style:c,content:a.current()},c},indent:function(b,c){var d=c.replace(/^\s+|\s+$/g,"");return d.match(v)||d.match(w)||d.match(u)?a.indentUnit*(b.currentIndent-1):b.currentIndent<0?0:b.currentIndent*a.indentUnit}};return E}),a.defineMIME("text/x-vb","vb")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("vbscript",function(a,b){function d(a){return new RegExp("^(("+a.join(")|(")+"))\\b","i")}function L(a,b){b.currentIndent++}function M(a,b){b.currentIndent--}function N(a,b){if(a.eatSpace())return"space";var d=a.peek();if("'"===d)return a.skipToEnd(),"comment";if(a.match(K))return a.skipToEnd(),"comment";if(a.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!a.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var j=!1;if(a.match(/^\d*\.\d+/i)?j=!0:a.match(/^\d+\.\d*/)?j=!0:a.match(/^\.\d+/)&&(j=!0),j)return a.eat(/J/i),"number";var k=!1;if(a.match(/^&H[0-9a-f]+/i)?k=!0:a.match(/^&O[0-7]+/i)?k=!0:a.match(/^[1-9]\d*F?/)?(a.eat(/J/i),k=!0):a.match(/^0(?![\dx])/i)&&(k=!0),k)return a.eat(/L/i),"number"}return a.match(D)?(b.tokenize=O(a.current()),b.tokenize(a,b)):a.match(f)||a.match(e)||a.match(m)?"operator":a.match(g)?null:a.match(h)?"bracket":a.match(J)?(b.doInCurrentLine=!0,"keyword"):a.match(I)?(L(a,b),b.doInCurrentLine=!0,"keyword"):a.match(E)?(b.doInCurrentLine?b.doInCurrentLine=!1:L(a,b),"keyword"):a.match(F)?"keyword":a.match(H)?(M(a,b),M(a,b),"keyword"):a.match(G)?(b.doInCurrentLine?b.doInCurrentLine=!1:M(a,b),"keyword"):a.match(y)?"keyword":a.match(z)?"atom":a.match(C)?"variable-2":a.match(A)?"builtin":a.match(B)?"variable-2":a.match(i)?"variable":(a.next(),c)}function O(a){var d=1==a.length,e="string";return function(f,g){for(;!f.eol();){if(f.eatWhile(/[^'"]/),f.match(a))return g.tokenize=N,e;f.eat(/['"]/)}if(d){if(b.singleLineStringErrors)return c;g.tokenize=N}return e}}function P(a,b){var d=b.tokenize(a,b),e=a.current();return"."===e?(d=b.tokenize(a,b),e=a.current(),"variable"===d.substr(0,8)||"builtin"===d||"keyword"===d?(("builtin"===d||"keyword"===d)&&(d="variable"),x.indexOf(e.substr(1))>-1&&(d="variable-2"),d):c):d}var c="error",e=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),f=new RegExp("^((<>)|(<=)|(>=))"),g=new RegExp("^[\\.,]"),h=new RegExp("^[\\(\\)]"),i=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),j=["class","sub","select","while","if","function","property","with","for"],k=["else","elseif","case"],l=["next","loop","wend"],m=d(["and","or","not","xor","is","mod","eqv","imp"]),n=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"],o=["true","false","nothing","empty","null"],p=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"],q=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"],r=["WScript","err","debug","RegExp"],s=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],t=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],u=["server","response","request","session","application"],v=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],w=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],x=t.concat(s);r=r.concat(q),a.isASP&&(r=r.concat(u),x=x.concat(w,v));var y=d(n),z=d(o),A=d(p),B=d(r),C=d(x),D='"',E=d(j),F=d(k),G=d(l),H=d(["end"]),I=d(["do"]),J=d(["on error resume next","exit"]),K=d(["rem"]),Q={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:N,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(a,b){a.sol()&&(b.currentIndent+=b.nextLineIndent,b.nextLineIndent=0,b.doInCurrentLine=0);var c=P(a,b);return b.lastToken={style:c,content:a.current()},"space"===c&&(c=null),c},indent:function(b,c){var d=c.replace(/^\s+|\s+$/g,"");return d.match(G)||d.match(H)||d.match(F)?a.indentUnit*(b.currentIndent-1):b.currentIndent<0?0:b.currentIndent*a.indentUnit}};return Q}),a.defineMIME("text/vbscript","vbscript")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("velocity",function(){function a(a){for(var b={},c=a.split(" "),d=0;dm.length&&"."==a.string.charAt(a.pos-m.length-1)&&g.lastTokenWasBuiltin?"builtin":(g.lastTokenWasBuiltin=!1,null)}return g.lastTokenWasBuiltin=!1,g.inString?(g.inString=!1,"string"):g.inParams?f(a,g,h(l)):void 0}function h(a){return function(b,c){for(var e,d=!1,f=!1;null!=(e=b.next());){if(e==a&&!d){f=!0;break}if('"'==a&&"$"==b.peek()&&!d){c.inString=!0,f=!0;break}d=!d&&"\\"==e}return f&&(c.tokenize=g),"string"}}function i(a,b){for(var d,c=!1;d=a.next();){if("#"==d&&c){b.tokenize=g;break}c="*"==d}return"comment"}function j(a,b){for(var d,c=0;d=a.next();){if("#"==d&&2==c){b.tokenize=g;break}"]"==d?c++:" "!=d&&(c=0)}return"meta"}var b=a("#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}"),c=a("#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"),d=a("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent"),e=/[+\-*&%=<>!?:\/|]/;return{startState:function(){return{tokenize:g,beforeParams:!1,inParams:!1,inString:!1,lastTokenWasBuiltin:!1}},token:function(a,b){return a.eatSpace()?null:b.tokenize(a,b)},blockCommentStart:"#*",blockCommentEnd:"*#",lineComment:"##",fold:"velocity"}}),a.defineMIME("text/velocity","velocity")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d")):null:a.match("--")?c(n("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(o(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=n("meta","?>"),"meta"):(i=a.eat("/")?"closeTag":"openTag",b.tokenize=l,"tag bracket");if("&"==d){var e;return e=a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),e?"atom":"error"}return a.eatWhile(/[^&<]/),null}function l(a,b){var c=a.next();if(">"==c||"/"==c&&a.eat(">"))return b.tokenize=k,i=">"==c?"endTag":"selfcloseTag","tag bracket";if("="==c)return i="equals",null;if("<"==c){b.tokenize=k,b.state=s,b.tagName=b.tagStart=null;var d=b.tokenize(a,b);return d?d+" error":"error"}return/[\'\"]/.test(c)?(b.tokenize=m(c),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function m(a){var b=function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=l;break}return"string"};return b.isInAttribute=!0,b}function n(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){d.tokenize=k;break}c.next()}return a}}function o(a){return function(b,c){for(var d;null!=(d=b.next());){if("<"==d)return c.tokenize=o(a+1),c.tokenize(b,c);if(">"==d){if(1==a){c.tokenize=k;break}return c.tokenize=o(a-1),c.tokenize(b,c)}}return"meta"}}function p(a,b,c){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=c,(g.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function q(a){a.context&&(a.context=a.context.prev)}function r(a,b){for(var c;;){if(!a.context)return;if(c=a.context.tagName,!g.contextGrabbers.hasOwnProperty(c)||!g.contextGrabbers[c].hasOwnProperty(b))return;q(a)}}function s(a,b,c){return"openTag"==a?(c.tagStart=b.column(),t):"closeTag"==a?u:s}function t(a,b,c){return"word"==a?(c.tagName=b.current(),j="tag",x):(j="error",t)}function u(a,b,c){if("word"==a){var d=b.current();return c.context&&c.context.tagName!=d&&g.implicitlyClosed.hasOwnProperty(c.context.tagName)&&q(c),c.context&&c.context.tagName==d?(j="tag",v):(j="tag error",w)}return j="error",w}function v(a,b,c){return"endTag"!=a?(j="error",v):(q(c),s)}function w(a,b,c){return j="error",v(a,b,c)}function x(a,b,c){if("word"==a)return j="attribute",y;if("endTag"==a||"selfcloseTag"==a){var d=c.tagName,e=c.tagStart;return c.tagName=c.tagStart=null,"selfcloseTag"==a||g.autoSelfClosers.hasOwnProperty(d)?r(c,d):(r(c,d),c.context=new p(c,d,e==c.indented)),s}return j="error",x}function y(a,b,c){return"equals"==a?z:(g.allowMissing||(j="error"),x(a,b,c))}function z(a,b,c){return"string"==a?A:"word"==a&&g.allowUnquoted?(j="string",x):(j="error",x(a,b,c))}function A(a,b,c){return"string"==a?A:x(a,b,c)}var d=b.indentUnit,e=c.multilineTagIndentFactor||1,f=c.multilineTagIndentPastTag;null==f&&(f=!0);var i,j,g=c.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:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},h=c.alignCDATA;return{startState:function(){return{tokenize:k,state:s,indented:0,tagName:null,tagStart:null,context:null}},token:function(a,b){if(!b.tagName&&a.sol()&&(b.indented=a.indentation()),a.eatSpace())return null;i=null;var c=b.tokenize(a,b);return(c||i)&&"comment"!=c&&(j=null,b.state=b.state(i||c,a,b),j&&(c="error"==j?c+" error":j)),c},indent:function(b,c,i){var j=b.context;if(b.tokenize.isInAttribute)return b.stringStartCol+1;if(j&&j.noIndent)return a.Pass;if(b.tokenize!=l&&b.tokenize!=k)return i?i.match(/^(\s*)/)[0].length:0;if(b.tagName)return f?b.tagStart+b.tagName.length+2:b.tagStart+d*e;if(h&&/",configuration:c.htmlMode?"html":"xml",helperType:c.htmlMode?"html":"xml"}}),a.defineMIME("text/xml","xml"),a.defineMIME("application/xml","xml"),a.mimeModes.hasOwnProperty("text/html")||a.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("xquery",function(){function d(a,d,e){return b=a,c=e,d}function e(a,b,c){return b.tokenize=c,c(a,b)}function f(b,c){var f=b.next(),k=!1,p=s(b);if("<"==f){if(b.match("!--",!0))return e(b,c,l);if(b.match("![CDATA",!1))return c.tokenize=m,d("tag","tag");if(b.match("?",!1))return e(b,c,n);var r=b.eat("/");b.eatSpace();for(var w,t="";w=b.eat(/[^\s\u00a0=<>\"\'\/?]/);)t+=w;return e(b,c,j(t,r))}if("{"==f)return u(c,{type:"codeblock"}),d("",null);if("}"==f)return v(c),d("",null);if(o(c))return">"==f?d("tag","tag"):"/"==f&&b.eat(">")?(v(c),d("tag","tag")):d("word","variable");if(/\d/.test(f))return b.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),d("number","atom");if("("===f&&b.eat(":"))return u(c,{type:"comment"}),e(b,c,g);if(p||'"'!==f&&"'"!==f){if("$"===f)return e(b,c,i);if(":"===f&&b.eat("="))return d("operator","keyword");if("("===f)return u(c,{type:"paren"}),d("",null);if(")"===f)return v(c),d("",null);if("["===f)return u(c,{type:"bracket"}),d("",null);if("]"===f)return v(c),d("",null);var x=a.propertyIsEnumerable(f)&&a[f];if(p&&'"'===f)for(;'"'!==b.next(););if(p&&"'"===f)for(;"'"!==b.next(););x||b.eatWhile(/[\w\$_-]/);var y=b.eat(":");!b.eat(":")&&y&&b.eatWhile(/[\w\$_-]/),b.match(/^[ \t]*\(/,!1)&&(k=!0);var z=b.current();return x=a.propertyIsEnumerable(z)&&a[z],k&&!x&&(x={type:"function_call",style:"variable def"}),q(c)?(v(c),d("word","variable",z)):(("element"==z||"attribute"==z||"axis_specifier"==x.type)&&u(c,{type:"xmlconstructor"}),x?d(x.type,x.style,z):d("word","variable",z))}return e(b,c,h(f))}function g(a,b){for(var g,c=!1,e=!1,f=0;g=a.next();){if(")"==g&&c){if(!(f>0)){v(b);break}f--}else":"==g&&e&&f++;c=":"==g,e="("==g}return d("comment","comment")}function h(a,b){return function(c,e){var g;if(r(e)&&c.current()==a)return v(e),b&&(e.tokenize=b),d("string","string");if(u(e,{type:"string",name:a,tokenize:h(a,b)}),c.match("{",!1)&&p(e))return e.tokenize=f,d("string","string");for(;g=c.next();){if(g==a){v(e),b&&(e.tokenize=b);break}if(c.match("{",!1)&&p(e))return e.tokenize=f,d("string","string")}return d("string","string")}}function i(a,b){var c=/[\w\$_-]/;if(a.eat('"')){for(;'"'!==a.next(););a.eat(":")}else a.eatWhile(c),a.match(":=",!1)||a.eat(":");return a.eatWhile(c),b.tokenize=f,d("variable","variable")}function j(a,b){return function(c,e){return c.eatSpace(),b&&c.eat(">")?(v(e),e.tokenize=f,d("tag","tag")):(c.eat("/")||u(e,{type:"tag",name:a,tokenize:f}),c.eat(">")?(e.tokenize=f,d("tag","tag")):(e.tokenize=k,d("tag","tag")))}}function k(a,b){var c=a.next();return"/"==c&&a.eat(">")?(p(b)&&v(b),o(b)&&v(b),d("tag","tag")):">"==c?(p(b)&&v(b),d("tag","tag")):"="==c?d("",null):'"'==c||"'"==c?e(a,b,h(c,k)):(p(b)||u(b,{type:"attribute",tokenize:k}),a.eat(/[a-zA-Z_:]/),a.eatWhile(/[-a-zA-Z0-9_:.]/),a.eatSpace(),(a.match(">",!1)||a.match("/",!1))&&(v(b),b.tokenize=f),d("attribute","attribute"))}function l(a,b){for(var c;c=a.next();)if("-"==c&&a.match("->",!0))return b.tokenize=f,d("comment","comment")}function m(a,b){for(var c;c=a.next();)if("]"==c&&a.match("]",!0))return b.tokenize=f,d("comment","comment")}function n(a,b){for(var c;c=a.next();)if("?"==c&&a.match(">",!0))return b.tokenize=f,d("comment","comment meta")}function o(a){return t(a,"tag")}function p(a){return t(a,"attribute")}function q(a){return t(a,"xmlconstructor")}function r(a){return t(a,"string")}function s(a){return'"'===a.current()?a.match(/^[^\"]+\"\:/,!1):"'"===a.current()?a.match(/^[^\"]+\'\:/,!1):!1}function t(a,b){return a.stack.length&&a.stack[a.stack.length-1].type==b}function u(a,b){a.stack.push(b)}function v(a){a.stack.pop();var b=a.stack.length&&a.stack[a.stack.length-1].tokenize;a.tokenize=b||f}var b,c,a=function(){function a(a){return{type:a,style:"keyword"}}for(var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),f={type:"atom",style:"atom"},g={type:"punctuation",style:null},h={type:"axis_specifier",style:"qualifier"},i={"if":b,"switch":b,"while":b,"for":b,"else":c,then:c,"try":c,"finally":c,"catch":c,element:d,attribute:d,let:d,"implements":d,"import":d,module:d,namespace:d,"return":d,"super":d,"this":d,"throws":d,where:d,"private":d,",":g,"null":f,"fn:false()":f,"fn:true()":f},j=["after","ancestor","ancestor-or-self","and","as","ascending","assert","attribute","before","by","case","cast","child","comment","declare","default","define","descendant","descendant-or-self","descending","document","document-node","element","else","eq","every","except","external","following","following-sibling","follows","for","function","if","import","in","instance","intersect","item","let","module","namespace","node","node","of","only","or","order","parent","precedes","preceding","preceding-sibling","processing-instruction","ref","return","returns","satisfies","schema","schema-element","self","some","sortby","stable","text","then","to","treat","typeswitch","union","variable","version","where","xquery","empty-sequence"],k=0,l=j.length;l>k;k++)i[j[k]]=a(j[k]);for(var m=["xs:string","xs:float","xs:decimal","xs:double","xs:integer","xs:boolean","xs:date","xs:dateTime","xs:time","xs:duration","xs:dayTimeDuration","xs:time","xs:yearMonthDuration","numeric","xs:hexBinary","xs:base64Binary","xs:anyURI","xs:QName","xs:byte","xs:boolean","xs:anyURI","xf:yearMonthDuration"],k=0,l=m.length;l>k;k++)i[m[k]]=f;for(var n=["eq","ne","lt","le","gt","ge",":=","=",">",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"],k=0,l=n.length;l>k;k++)i[n[k]]=e;for(var o=["self::","attribute::","child::","descendant::","descendant-or-self::","parent::","ancestor::","ancestor-or-self::","following::","preceding::","following-sibling::","preceding-sibling::"],k=0,l=o.length;l>k;k++)i[o[k]]=h; return i}();return{startState:function(){return{tokenize:f,cc:[],stack:[]}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c},blockCommentStart:"(:",blockCommentEnd:":)"}}),a.defineMIME("application/xquery","xquery")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("yaml",function(){var a=["true","false","on","off","yes","no"],b=new RegExp("\\b(("+a.join(")|(")+"))$","i");return{token:function(a,c){var d=a.peek(),e=c.escaped;if(c.escaped=!1,"#"==d&&(0==a.pos||/\s/.test(a.string.charAt(a.pos-1))))return a.skipToEnd(),"comment";if(c.literal&&a.indentation()>c.keyCol)return a.skipToEnd(),"string";if(c.literal&&(c.literal=!1),a.sol()){if(c.keyCol=0,c.pair=!1,c.pairStart=!1,a.match(/---/))return"def";if(a.match(/\.\.\./))return"def";if(a.match(/\s*-\s+/))return"meta"}if(a.match(/^(\{|\}|\[|\])/))return"{"==d?c.inlinePairs++:"}"==d?c.inlinePairs--:"["==d?c.inlineList++:c.inlineList--,"meta";if(c.inlineList>0&&!e&&","==d)return a.next(),"meta";if(c.inlinePairs>0&&!e&&","==d)return c.keyCol=0,c.pair=!1,c.pairStart=!1,a.next(),"meta";if(c.pairStart){if(a.match(/^\s*(\||\>)\s*/))return c.literal=!0,"meta";if(a.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==c.inlinePairs&&a.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(c.inlinePairs>0&&a.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(a.match(b))return"keyword"}return!c.pair&&a.match(/^\s*\S+(?=\s*:($|\s))/i)?(c.pair=!0,c.keyCol=a.indentation(),"atom"):c.pair&&a.match(/^:\s*/)?(c.pairStart=!0,"meta"):(c.pairStart=!1,c.escaped="\\"==d,a.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),a.defineMIME("text/x-yaml","yaml")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("z80",function(){var a=/^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i,b=/^(call|j[pr]|ret[in]?)\b/i,c=/^b_?(call|jump)\b/i,d=/^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i,e=/^(n?[zc]|p[oe]?|m)\b/i,f=/^([hl][xy]|i[xy][hl]|slia|sll)\b/i,g=/^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i;return{startState:function(){return{context:0}},token:function(h,i){if(h.column()||(i.context=0),h.eatSpace())return null;var j;if(h.eatWhile(/\w/)){if(j=h.current(),!h.indentation())return g.test(j)?"number":null;if(1==i.context&&d.test(j))return"variable-2";if(2==i.context&&e.test(j))return"variable-3";if(a.test(j))return i.context=1,"keyword";if(b.test(j))return i.context=2,"keyword";if(c.test(j))return i.context=3,"keyword";if(f.test(j))return"error"}else{if(h.eat(";"))return h.skipToEnd(),"comment";if(h.eat('"')){for(;(j=h.next())&&'"'!=j;)"\\"==j&&h.next();return"string"}if(h.eat("'")){if(h.match(/\\?.'/))return"number"}else if(h.eat(".")||h.sol()&&h.eat("#")){if(i.context=4,h.eatWhile(/\w/))return"def"}else if(h.eat("$")){if(h.eatWhile(/[\da-f]/i))return"number"}else if(h.eat("%")){if(h.eatWhile(/[01]/))return"number"}else h.next()}return null}}}),a.defineMIME("text/x-z80","z80")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function d(a){for(var d=0;d=p;p+=2)for(var q=h.line,r=Math.min(Math.max(q+p*g,d.firstLine()),d.lastLine())+p;q!=r;q+=p)for(var t,s=d.getLine(q);t=o.exec(s);)(q!=h.line||t[0]!==l)&&(l&&0!=t[0].lastIndexOf(l,0)||Object.prototype.hasOwnProperty.call(n,t[0])||(n[t[0]]=!0,m.push(t[0])));return{list:m,from:a.Pos(h.line,j),to:a.Pos(h.line,k)}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.registerHelper("fold","brace",function(b,c){function h(f){for(var h=c.ch,i=0;;){var j=0>=h?-1:e.lastIndexOf(f,h-1);if(-1!=j){if(1==i&&j=o;++o)for(var p=b.getLine(o),q=o==d?f:0;;){var r=p.indexOf(i,q),s=p.indexOf(j,q);if(0>r&&(r=p.length),0>s&&(s=p.length),q=Math.min(r,s),q==p.length)break;if(b.getTokenTypeAt(a.Pos(o,q+1))==g)if(q==r)++k;else if(!--k){m=o,n=q;break a}++q}if(null!=m&&(d!=m||n!=f))return{from:a.Pos(d,f),to:a.Pos(m,n)}}}),a.registerHelper("fold","import",function(b,c){function d(c){if(cb.lastLine())return null;var d=b.getTokenAt(a.Pos(c,1));if(/\S/.test(d.string)||(d=b.getTokenAt(a.Pos(c,d.end+1))),"keyword"!=d.type||"import"!=d.string)return null;for(var e=c,f=Math.min(b.lastLine(),c+10);f>=e;++e){var g=b.getLine(e),h=g.indexOf(";");if(-1!=h)return{startCh:d.end,end:a.Pos(e,h)}}}var f,c=c.line,e=d(c);if(!e||d(c-1)||(f=d(c-2))&&f.end.line==c-1)return null;for(var g=e.end;;){var h=d(g.line+1);if(null==h)break;g=h.end}return{from:b.clipPos(a.Pos(c,e.startCh+1)),to:g}}),a.registerHelper("fold","include",function(b,c){function d(c){if(cb.lastLine())return null;var d=b.getTokenAt(a.Pos(c,1));return/\S/.test(d.string)||(d=b.getTokenAt(a.Pos(c,d.end+1))),"meta"==d.type&&"#include"==d.string.slice(0,8)?d.start+8:void 0}var c=c.line,e=d(c);if(null==e||null!=d(c-1))return null;for(var f=c;;){var g=d(f+1);if(null==g)break;++f}return{from:a.Pos(c,e+1),to:b.clipPos(a.Pos(f))}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function f(a,b){var c=a.getRange(e(b.line,b.ch-1),e(b.line,b.ch+1));return 2==c.length?c:null}function g(b){for(var c={name:"autoCloseBrackets",Backspace:function(c){if(c.getOption("disableInput"))return a.Pass;for(var d=c.listSelections(),g=0;g=0;g--){var i=d[g].head;c.replaceRange("",e(i.line,i.ch-1),e(i.line,i.ch+1))}}},g="",h=0;h1&&c.getRange(e(m.line,m.ch-2),m)==b+b)n="addFour";else{if(b==f&&a.isWordChar(j))return a.Pass;if(!(c.getLine(m.line).length==m.ch||g.indexOf(j)>=0||d.test(j)))return a.Pass;n="both"}else n="surround";if(i){if(i!=n)return a.Pass}else i=n}c.action(function(){if("skip"==i)c.execCommand("goCharRight");else if("skipThree"==i)for(var a=0;3>a;a++)c.execCommand("goCharRight");else if("surround"==i){for(var d=c.getSelections(),a=0;ai.ch&&(q=q.slice(0,q.length-j.end+i.ch));var r=q.toLowerCase();if(!q||"string"==j.type&&(j.end!=i.ch||!/[\"\']/.test(j.string.charAt(j.string.length-1))||1==j.string.length)||"tag"==j.type&&"closeTag"==l.type||j.string.indexOf("/")==j.string.length-1||o&&f(o,r)>-1||a.scanForClosingTag&&a.scanForClosingTag(d,i,q,Math.min(d.lastLine()+1,i.line+50)))return a.Pass;var s=p&&f(p,r)>-1;g[h]={indent:s,text:">"+(s?"\n\n":"")+"",newPos:s?a.Pos(i.line+1,0):a.Pos(i.line,i.ch+1)}}for(var h=e.length-1;h>=0;h--){var t=g[h];d.replaceRange(t.text,e[h].head,e[h].anchor,"+insert");var u=d.listSelections().slice(0);u[h]={head:t.newPos,anchor:t.newPos},d.setSelections(u),t.indent&&(d.indentLine(t.newPos.line,null,!0),d.indentLine(t.newPos.line+1,null,!0))}}function e(b){if(b.getOption("disableInput"))return a.Pass;for(var c=b.listSelections(),d=[],e=0;e"}b.replaceSelections(d)}function f(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;++c)if(a[c]==b)return c;return-1}a.defineOption("autoCloseTags",!1,function(b,c,f){if(f!=a.Init&&f&&b.removeKeyMap("autoCloseTags"),c){var g={name:"autoCloseTags"};("object"!=typeof c||c.whenClosing)&&(g["'/'"]=function(a){return e(a)}),("object"!=typeof c||c.whenOpening)&&(g["'>'"]=function(a){return d(a)}),b.addKeyMap(g)}});var b=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],c=["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"]}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./runmode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./runmode"],a):a(CodeMirror)}(function(a){"use strict";function c(a,d){if(3==a.nodeType)return d.push(a.nodeValue);for(var e=a.firstChild;e;e=e.nextSibling)c(e,d),b.test(a.nodeType)&&d.push("\n")}var b=/^(p|li|div|h\\d|pre|blockquote|td)$/;a.colorize=function(b,d){b||(b=document.body.getElementsByTagName("pre"));for(var e=0;e=0;f--){var g=c[f].from(),h=c[f].to();g.line>=b||(h.line>=b&&(h=d(b,0)),b=g.line,null==e?a.uncomment(g,h)?e="un":(a.lineComment(g,h),e="line"):"un"==e?a.uncomment(g,h):a.lineComment(g,h))}},a.defineExtension("lineComment",function(a,f,g){g||(g=b);var h=this,i=h.getModeAt(a),j=g.lineComment||i.lineComment;if(!j)return(g.blockCommentStart||i.blockCommentStart)&&(g.fullLines=!0,h.blockComment(a,f,g)),void 0;var k=h.getLine(a.line);if(null!=k){var l=Math.min(0!=f.ch||f.line==a.line?f.line+1:f.line,h.lastLine()+1),m=null==g.padding?" ":g.padding,n=g.commentBlankLines||a.line==f.line;h.action(function(){if(g.indent)for(var b=k.slice(0,e(k)),f=a.line;l>f;++f){var i=h.getLine(f),o=b.length;(n||c.test(i))&&(i.slice(0,o)!=b&&(o=e(i)),h.replaceRange(b+j+m,d(f,0),d(f,o)))}else for(var f=a.line;l>f;++f)(n||c.test(h.getLine(f)))&&h.replaceRange(j+m,d(f,0))})}}),a.defineExtension("blockComment",function(a,e,f){f||(f=b);var g=this,h=g.getModeAt(a),i=f.blockCommentStart||h.blockCommentStart,j=f.blockCommentEnd||h.blockCommentEnd;if(!i||!j)return(f.lineComment||h.lineComment)&&0!=f.fullLines&&g.lineComment(a,e,f),void 0;var k=Math.min(e.line,g.lastLine());k!=a.line&&0==e.ch&&c.test(g.getLine(k))&&--k;var l=null==f.padding?" ":f.padding;a.line>k||g.action(function(){if(0!=f.fullLines){var b=c.test(g.getLine(k));g.replaceRange(l+j,d(k)),g.replaceRange(i+l,d(a.line,0));var m=f.blockCommentLead||h.blockCommentLead;if(null!=m)for(var n=a.line+1;k>=n;++n)(n!=k||b)&&g.replaceRange(m+l,d(n,0))}else g.replaceRange(j,e),g.replaceRange(i,a)})}),a.defineExtension("uncomment",function(a,e,f){f||(f=b);var n,g=this,h=g.getModeAt(a),i=Math.min(e.line,g.lastLine()),j=Math.min(a.line,i),k=f.lineComment||h.lineComment,l=[],m=null==f.padding?" ":f.padding;a:if(k){for(var o=j;i>=o;++o){var p=g.getLine(o),q=p.indexOf(k);if(q>-1&&!/comment/.test(g.getTokenTypeAt(d(o,q+1)))&&(q=-1),-1==q&&(o!=i||o==j)&&c.test(p))break a;if(q>-1&&c.test(p.slice(0,q)))break a;l.push(p)}if(g.action(function(){for(var a=j;i>=a;++a){var b=l[a-j],c=b.indexOf(k),e=c+k.length;0>c||(b.slice(e,e+m.length)==m&&(e+=m.length),n=!0,g.replaceRange("",d(a,c),d(a,e)))}}),n)return!0}var r=f.blockCommentStart||h.blockCommentStart,s=f.blockCommentEnd||h.blockCommentEnd;if(!r||!s)return!1;var t=f.blockCommentLead||h.blockCommentLead,u=g.getLine(j),v=i==j?u:g.getLine(i),w=u.indexOf(r),x=v.lastIndexOf(s);return-1==x&&j!=i&&(v=g.getLine(--i),x=v.lastIndexOf(s)),-1!=w&&-1!=x&&/comment/.test(g.getTokenTypeAt(d(j,w+1)))&&/comment/.test(g.getTokenTypeAt(d(i,x+1)))?(g.action(function(){g.replaceRange("",d(i,x-(m&&v.slice(x-m.length,x)==m?m.length:0)),d(i,x+s.length));var a=w+r.length;if(m&&u.slice(a,a+m.length)==m&&(a+=m.length),g.replaceRange("",d(j,w),d(j,a)),t)for(var b=j+1;i>=b;++b){var e=g.getLine(b),f=e.indexOf(t);if(-1!=f&&!c.test(e.slice(0,f))){var h=f+t.length;m&&e.slice(h,h+m.length)==m&&(h+=m.length),g.replaceRange("",d(b,f),d(b,h))}}}),!0):!1})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.registerGlobalHelper("fold","comment",function(a){return a.blockCommentStart&&a.blockCommentEnd},function(b,c){var d=b.getModeAt(c),e=d.blockCommentStart,f=d.blockCommentEnd;if(e&&f){for(var i,g=c.line,h=b.getLine(g),j=c.ch,k=0;;){var l=0>=j?-1:h.lastIndexOf(e,j-1);if(-1!=l){if(1==k&&l=q;++q)for(var r=b.getLine(q),s=q==g?i:0;;){var t=r.indexOf(e,s),u=r.indexOf(f,s);if(0>t&&(t=r.length),0>u&&(u=r.length),s=Math.min(t,u),s==r.length)break;if(s==t)++m;else if(!--m){o=q,p=s;break a}++s}if(null!=o&&(g!=o||p!=i))return{from:a.Pos(g,i),to:a.Pos(o,p)}}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function d(b){if(b.getOption("disableInput"))return a.Pass;for(var d,c=b.listSelections(),f=[],g=0;g=l);else if(0==i.string.indexOf(d.blockCommentStart)){if(k=m.slice(0,i.start),!/^\s*$/.test(k)){k="";for(var o=0;oi.start&&/^\s*$/.test(m.slice(0,n))&&(k=m.slice(0,n));null!=k&&(k+=d.blockCommentContinue)}if(null==k&&d.lineComment&&e(b)){var p=b.getLine(h.line),n=p.indexOf(d.lineComment);n>-1&&(k=p.slice(0,n),/\S/.test(k)?k=null:k+=d.lineComment+p.slice(n+d.lineComment.length).match(/^\s*/)[0])}if(null==k)return a.Pass;f[g]="\n"+k}b.action(function(){for(var a=c.length-1;a>=0;a--)b.replaceRange(f[a],c[a].from(),c[a].to(),"+insert")})}function e(a){var b=a.getOption("continueComments");return b&&"object"==typeof b?b.continueLineComment!==!1:!0}for(var b=["clike","css","javascript"],c=0;c=0?i[2]:parseInt(i[3],10)+1+".";f[g]="\n"+k+m+l}d.replaceSelections(f)}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],a):a(CodeMirror)}(function(a){"use strict";var b={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};a.registerHelper("hint","css",function(c){function l(a){for(var b in a)g&&0!=b.lastIndexOf(g,0)||k.push(b)}var d=c.getCursor(),e=c.getTokenAt(d),f=a.innerMode(c.getMode(),e.state);if("css"==f.mode.name){var g=e.string,h=e.start,i=e.end;/[^\w$_-]/.test(g)&&(g="",h=i=d.ch);var j=a.resolveMode("text/css"),k=[],m=e.state.state;return"pseudo"==m||"variable-3"==e.type?l(b):"block"==m||"maybeprop"==m?l(j.propertyKeywords):"prop"==m||"parens"==m||"at"==m||"params"==m?(l(j.valueKeywords),l(j.colorKeywords)):("media"==m||"media_parens"==m)&&(l(j.mediaTypes),l(j.mediaFeatures)),k.length?{list:k,from:a.Pos(d.line,h),to:a.Pos(d.line,i)}:void 0}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function b(a,b,c){var e,d=a.getWrapperElement();return e=d.appendChild(document.createElement("div")),e.className=c?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof b?e.innerHTML=b:e.appendChild(b),e}function c(a,b){a.state.currentNotificationClose&&a.state.currentNotificationClose(),a.state.currentNotificationClose=b}a.defineExtension("openDialog",function(d,e,f){function j(){h||(h=!0,g.parentNode.removeChild(g))}c(this,null);var l,g=b(this,d,f&&f.bottom),h=!1,i=this,k=g.getElementsByTagName("input")[0];return k?(f&&f.value&&(k.value=f.value),a.on(k,"keydown",function(b){f&&f.onKeyDown&&f.onKeyDown(b,k.value,j)||(13==b.keyCode||27==b.keyCode)&&(k.blur(),a.e_stop(b),j(),i.focus(),13==b.keyCode&&e(k.value))}),f&&f.onKeyUp&&a.on(k,"keyup",function(a){f.onKeyUp(a,k.value,j)}),f&&f.value&&(k.value=f.value),k.focus(),a.on(k,"blur",j)):(l=g.getElementsByTagName("button")[0])&&(a.on(l,"click",function(){j(),i.focus()}),l.focus(),a.on(l,"blur",j)),j}),a.defineExtension("openConfirm",function(d,e,f){function l(){i||(i=!0,g.parentNode.removeChild(g),j.focus())}c(this,null);var g=b(this,d,f&&f.bottom),h=g.getElementsByTagName("button"),i=!1,j=this,k=1;h[0].focus();for(var m=0;m=k&&l()},200)}),a.on(n,"focus",function(){++k})}}),a.defineExtension("openNotification",function(d,e){function j(){h||(h=!0,clearTimeout(i),f.parentNode.removeChild(f))}c(this,j);var i,f=b(this,d,e&&e.bottom),g=e&&(void 0===e.duration?5e3:e.duration),h=!1;a.on(f,"click",function(b){a.e_preventDefault(b),j()}),g&&(i=setTimeout(j,e.duration))})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(b,d,e,f){function i(a){var c=g(b,d);if(!c||c.to.line-c.from.lineb.firstLine();)d=a.Pos(d.line-1,0),j=i(!1);if(j&&!j.cleared&&"unfold"!==f){var k=c(e);a.on(k,"mousedown",function(){l.clear()});var l=b.markText(j.from,j.to,{replacedWith:k,clearOnEnter:!0,__isFold:!0});l.on("clear",function(c,d){a.signal(b,"unfold",b,c,d)}),a.signal(b,"fold",b,j.from,j.to)}}function c(a){var b=a&&a.widget||"\u2194";if("string"==typeof b){var c=document.createTextNode(b);b=document.createElement("span"),b.appendChild(c),b.className="CodeMirror-foldmarker"}return b}a.newFoldFunction=function(a,c){return function(d,e){b(d,e,{rangeFinder:a,widget:c})}},a.defineExtension("foldCode",function(a,c,d){b(this,a,c,d)}),a.defineExtension("isFolded",function(a){for(var b=this.findMarksAt(a),c=0;c=c;c++)b.foldCode(a.Pos(c,0),null,"fold")})},a.commands.unfoldAll=function(b){b.action(function(){for(var c=b.firstLine(),d=b.lastLine();d>=c;c++)b.foldCode(a.Pos(c,0),null,"unfold")})},a.registerHelper("fold","combine",function(){var a=Array.prototype.slice.call(arguments,0);return function(b,c){for(var d=0;d20||b.from-c.to>20?h(a):a.action(function(){c.fromb.to&&(g(a,b.to,c.to),b.to=c.to)})},c.updateViewportTimeSpan||400)}function l(a,b){var c=a.state.foldGutter,d=b.line;d>=c.from&&df;--e){var g=a.getLine(e);if(d&&d.test(g))break;if(!/\S/.test(g)){++e;break}}for(var h=c.paragraphEnd||a.getHelper(b,"paragraphEnd"),i=b.line+1,j=a.lastLine();j>=i;++i){var g=a.getLine(i);if(h&&h.test(g)){++i;break}if(!/\S/.test(g))break}return{from:e,to:i}}function d(a,b,c,d){for(var e=b;e>0&&!c.test(a.slice(e-1,e+1));--e);0==e&&(e=b);var f=e;if(d)for(;" "==a.charAt(f-1);)--f;return{from:f,to:e}}function e(c,e,f,g){e=c.clipPos(e),f=c.clipPos(f);var h=g.column||80,i=g.wrapOn||/\s\S|-[^\.\d]/,j=g.killTrailingSpace!==!1,k=[],l="",m=e.line,n=c.getRange(e,f,!1);if(!n.length)return null;for(var o=n[0].match(/^[ \t]*/)[0],p=0;ph&&o==t&&d(l,h,i,j);u&&u.from==r&&u.to==r+s?(l=o+q,++m):k.push({text:[s?" ":""],from:b(m,r),to:b(m+1,t.length)})}for(;l.length>h;){var v=d(l,h,i,j);k.push({text:["",o],from:b(m,v.from),to:b(m,v.to)}),l=o+l.slice(v.to),++m}}return k.length&&c.action(function(){for(var a=0;a=0;g--){var i,h=d[g];if(h.empty()){var j=c(a,h.head,{});i={from:b(j.from,0),to:b(j.to-1)}}else i={from:h.from(),to:h.to()};i.to.line>=f||(f=i.from.line,e(a,i.from,i.to,{}))}})},a.defineExtension("wrapRange",function(a,b,c){return e(this,a,b,c||{})}),a.defineExtension("wrapParagraphsInRange",function(a,d,f){f=f||{};for(var g=this,h=[],i=a.line;i<=d.line;){var j=c(g,b(i,0),f);h.push(j),i=j.to}var k=!1;return h.length&&g.action(function(){for(var a=h.length-1;a>=0;--a)k=k||e(g,b(h[a].from,0),b(h[a].to-1),f)}),k})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function k(a){for(var b in j)j.hasOwnProperty(b)&&(a.attrs[b]=j[b])}function m(b,c){var d={schemaInfo:i};if(c)for(var e in c)d[e]=c[e];return a.hint.xml(b,d)}var b="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "),c=["_blank","_self","_top","_parent"],d=["ascii","utf-8","utf-16","latin1","latin1"],e=["get","post","put","delete"],f=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],h={attrs:{}},i={a:{attrs:{href:null,ping:null,type:null,media:g,target:c,hreflang:b}},abbr:h,acronym:h,address:h,applet:h,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:g,hreflang:b,type:null,shape:["default","rect","circle","poly"]}},article:h,aside:h,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:h,base:{attrs:{href:null,target:c}},basefont:h,bdi:h,bdo:h,big:h,blockquote:{attrs:{cite:null}},body:h,br:h,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:f,formmethod:e,formnovalidate:["","novalidate"],formtarget:c,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:h,center:h,cite:h,code:h,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:h,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:h,dir:h,div:h,dl:h,dt:h,em:h,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:h,figure:h,font:h,footer:h,form:{attrs:{action:null,name:null,"accept-charset":d,autocomplete:["on","off"],enctype:f,method:e,novalidate:["","novalidate"],target:c}},frame:h,frameset:h,h1:h,h2:h,h3:h,h4:h,h5:h,h6:h,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:h,hgroup:h,hr:h,html:{attrs:{manifest:null},children:["head","body"]},i:h,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:f,formmethod:e,formnovalidate:["","novalidate"],formtarget:c,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:h,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{"for":null,form:null}},legend:h,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:b,media:g,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:h,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:d,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:h,noframes:h,noscript:h,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{"for":null,form:null,name:null}},p:h,param:{attrs:{name:null,value:null}},pre:h,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:h,rt:h,ruby:h,s:h,samp:h,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:d}},section:h,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:h,source:{attrs:{src:null,type:null,media:null}},span:h,strike:h,strong:h,style:{attrs:{type:["text/css"],media:g,scoped:null}},sub:h,summary:h,sup:h,table:h,tbody:h,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:h,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:h,time:{attrs:{datetime:null}},title:h,tr:h,track:{attrs:{src:null,label:null,"default":null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:b}},tt:h,u:h,ul:h,"var":h,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:h},j={accesskey:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"],"class":null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]}; k(h);for(var l in i)i.hasOwnProperty(l)&&i[l]!=h&&k(i[l]);a.htmlSchema=i,a.registerHelper("hint","html",m)}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.registerHelper("fold","indent",function(b,c){var d=b.getOption("tabSize"),e=b.getLine(c.line);if(/\S/.test(e)){for(var f=function(b){return a.countColumn(b,null,d)},g=f(e),h=null,i=c.line+1,j=b.lastLine();j>=i;++i){var k=b.getLine(i),l=f(k);if(l>g)h=i;else if(/\S/.test(k))break}return h?{from:a.Pos(c.line,e.length),to:a.Pos(h,b.getLine(h).length)}:void 0}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function c(a,b){for(var c=0,d=a.length;d>c;++c)b(a[c])}function d(a,b){if(!Array.prototype.indexOf){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1}return-1!=a.indexOf(b)}function e(c,d,e,f){var g=c.getCursor(),h=e(c,g),i=h;if(!/\b(?:string|comment)\b/.test(h.type)){for(h.state=a.innerMode(c.getMode(),h.state).state,/^[\w$_]*$/.test(h.string)||(h=i={start:g.ch,end:g.ch,string:"",state:h.state,type:"."==h.string?"property":null});"property"==i.type;){if(i=e(c,b(g.line,i.start)),"."!=i.string)return;if(i=e(c,b(g.line,i.start)),!j)var j=[];j.push(i)}return{list:n(h,j,d,f),from:b(g.line,h.start),to:b(g.line,h.end)}}}function f(a,b){return e(a,l,function(a,b){return a.getTokenAt(b)},b)}function g(a,b){var c=a.getTokenAt(b);return b.ch==c.start+1&&"."==c.string.charAt(0)?(c.end=c.start,c.string=".",c.type="property"):/^\.[\w$_]*$/.test(c.string)&&(c.type="property",c.start++,c.string=c.string.replace(/\./,"")),c}function h(a,b){return e(a,m,g,b)}function n(a,b,e,f){function l(a){0!=a.lastIndexOf(h,0)||d(g,a)||g.push(a)}function m(a){"string"==typeof a?c(i,l):a instanceof Array?c(j,l):a instanceof Function&&c(k,l);for(var b in a)l(b)}var g=[],h=a.string;if(b&&b.length){var o,n=b.pop();for(n.type&&0===n.type.indexOf("variable")?(f&&f.additionalContext&&(o=f.additionalContext[n.string]),o=o||window[n.string]):"string"==n.type?o="":"atom"==n.type?o=1:"function"==n.type&&(null==window.jQuery||"$"!=n.string&&"jQuery"!=n.string||"function"!=typeof window.jQuery?null!=window._&&"_"==n.string&&"function"==typeof window._&&(o=window._()):o=window.jQuery());null!=o&&b.length;)o=o[b.pop().string];null!=o&&m(o)}else{for(var p=a.state.localVars;p;p=p.next)l(p.name);for(var p=a.state.globalVars;p;p=p.next)l(p.name);m(window),c(e,l)}return g}var b=a.Pos;a.registerHelper("hint","javascript",f),a.registerHelper("hint","coffeescript",h);var i="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),j="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),k="prototype apply call bind".split(" "),l="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(" "),m="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(" ")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function e(a,b){if(!window.JSHINT)return[];JSHINT(a,b);var c=JSHINT.data().errors,d=[];return c&&i(c,d),d}function f(a){return g(a,c,"warning",!0),g(a,d,"error"),h(a)?null:a}function g(a,b,c,d){var e,f,g,h,i;e=a.description;for(var j=0;j0){var k=e.character;i.forEach(function(a){k>a&&(k-=1)}),e.character=k}}var l=e.character-1,m=l+1;e.evidence&&(h=e.evidence.substring(l).search(/.\b/),h>-1&&(m+=h)),e.description=e.reason,e.start=e.character,e.end=m,e=f(e),e&&c.push({message:e.description,severity:e.severity,from:a.Pos(e.line-1,l),to:a.Pos(e.line-1,m)})}}}var b=["Dangerous comment"],c=[["Expected '{'","Statement body should be inside '{ }' braces."]],d=["Missing semicolon","Extra comma","Missing property name","Unmatched "," and instead saw"," is not defined","Unclosed string","Stopping, unable to continue"];a.registerHelper("lint","javascript",e)}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.registerHelper("lint","json",function(b){var c=[];jsonlint.parseError=function(b,d){var e=d.loc;c.push({from:a.Pos(e.first_line-1,e.first_column),to:a.Pos(e.last_line-1,e.last_column),message:b})};try{jsonlint.parse(b)}catch(d){}return c})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function d(b,c){function e(b){return d.parentNode?(d.style.top=Math.max(0,b.clientY-d.offsetHeight-5)+"px",d.style.left=b.clientX+5+"px",void 0):a.off(document,"mousemove",e)}var d=document.createElement("div");return d.className="CodeMirror-lint-tooltip",d.appendChild(c.cloneNode(!0)),document.body.appendChild(d),a.on(document,"mousemove",e),e(b),null!=d.style.opacity&&(d.style.opacity=1),d}function e(a){a.parentNode&&a.parentNode.removeChild(a)}function f(a){a.parentNode&&(null==a.style.opacity&&e(a),a.style.opacity=0,setTimeout(function(){e(a)},600))}function g(b,c,e){function h(){a.off(e,"mouseout",h),g&&(f(g),g=null)}var g=d(b,c),i=setInterval(function(){if(g)for(var a=e;;a=a.parentNode){if(a==document.body)return;if(!a){h();break}}return g?void 0:clearInterval(i)},400);a.on(e,"mouseout",h)}function h(a,b,c){this.marked=[],this.options=b,this.timeout=null,this.hasGutter=c,this.onMouseOver=function(b){t(a,b)}}function i(b,c){if(c instanceof Function)return{getAnnotations:c};if(c&&c!==!0||(c={}),c.getAnnotations||(c.getAnnotations=b.getHelper(a.Pos(0,0),"lint")),!c.getAnnotations)throw new Error("Required option 'getAnnotations' missing (lint addon)");return c}function j(a){var c=a.state.lint;c.hasGutter&&a.clearGutter(b);for(var d=0;d1,e.options.tooltips))}}f.onUpdateLinting&&f.onUpdateLinting(d,g,a)}function q(a){var b=a.state.lint;clearTimeout(b.timeout),b.timeout=setTimeout(function(){o(a)},b.options.delay||500)}function r(a,b){var c=b.target||b.srcElement;g(b,n(a),c)}function t(a,b){if(/\bCodeMirror-lint-mark-/.test((b.target||b.srcElement).className))for(var c=0;c100?clearInterval(j):(a.modes.hasOwnProperty(c)&&(clearInterval(j),b[c]=null,d(c,function(){for(var a=0;ak&&!(f(k+1,h,l)<=i);)++k,h=l,l=b.getLine(k+2);return{from:a.Pos(c.line,g.length),to:a.Pos(k,b.getLine(k).length)}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){a.action(function(){j(a)})}function c(a){a.state.markedSelection.length&&a.action(function(){h(a)})}function g(a,b,c,g){if(0!=f(b,c))for(var h=a.state.markedSelection,i=a.state.markedSelectionStyle,j=b.line;;){var k=j==b.line?b:e(j,0),l=j+d,m=l>=c.line,n=m?c:e(l,0),o=a.markText(k,n,{className:i});if(null==g?h.push(o):h.splice(g++,0,o),m)break;j=l}}function h(a){for(var b=a.state.markedSelection,c=0;c1)return i(a);var b=a.getCursor("start"),c=a.getCursor("end"),e=a.state.markedSelection;if(!e.length)return g(a,b,c);var j=e[0].find(),k=e[e.length-1].find();if(!j||!k||c.line-b.line=0||f(c,j.from)<=0)return i(a);for(;f(b,j.from)>0;)e.shift().clear(),j=e[0].find();for(f(b,j.from)<0&&(j.to.line-b.line0&&(c.line-k.from.linef&&a.addOverlay(b.overlay=i(e.slice(f,g),c,b.style)),void 0}if(a.getCursor("head").line==a.getCursor("anchor").line){var h=a.getSelections()[0].replace(/^\s+|\s+$/g,"");h.length>=b.minChars&&a.addOverlay(b.overlay=i(h,!1,b.style))}})}function h(a,b){return!(a.start&&b.test(a.string.charAt(a.start-1))||a.pos!=a.string.length&&b.test(a.string.charAt(a.pos)))}function i(a,b,c){return{token:function(d){return!d.match(a)||b&&!h(d,b)?(d.next(),d.skipTo(a.charAt(0))||d.skipToEnd(),void 0):c}}}var b=2,c="matchhighlight",d=100;a.defineOption("highlightSelectionMatches",!1,function(b,c,d){if(d&&d!=a.Init){var h=b.state.matchHighlighter.overlay;h&&b.removeOverlay(h),clearTimeout(b.state.matchHighlighter.timeout),b.state.matchHighlighter=null,b.off("cursorActivity",f)}c&&(b.state.matchHighlighter=new e(c),g(b),b.on("cursorActivity",f))})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function e(a,b,e,g){var h=a.getLineHandle(b.line),i=b.ch-1,j=i>=0&&d[h.text.charAt(i)]||d[h.text.charAt(++i)];if(!j)return null;var k=">"==j.charAt(1)?1:-1;if(e&&k>0!=(i==b.ch))return null;var l=a.getTokenTypeAt(c(b.line,i+1)),m=f(a,c(b.line,i+(k>0?1:0)),k,l||null,g);return{from:c(b.line,i),to:m&&m.pos,match:m&&m.ch==j.charAt(0),forward:k>0}}function f(a,b,e,f,g){for(var h=g&&g.maxScanLineLength||1e4,i=g&&g.maxScanLines||500,j=[],k=g&&g.bracketRegex?g.bracketRegex:/[(){}[\]]/,l=e>0?Math.min(b.line+i,a.lastLine()+1):Math.max(a.firstLine()-1,b.line-i),m=b.line;m!=l;m+=e){var n=a.getLine(m);if(n){var o=e>0?0:n.length-1,p=e>0?n.length:-1;if(!(n.length>h))for(m==b.line&&(o=b.ch-(0>e?1:0));o!=p;o+=e){var q=n.charAt(o);if(k.test(q)&&(void 0===f||a.getTokenTypeAt(c(m,o+1))==f)){var r=d[q];if(">"==r.charAt(1)==e>0)j.push(q);else{if(!j.length)return{pos:c(m,o),ch:q};j.pop()}}}}}}function g(a,d,f){for(var g=a.state.matchBrackets.maxHighlightLineLength||1e3,h=[],i=a.listSelections(),j=0;j",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},h=null;a.defineOption("matchBrackets",!1,function(b,c,d){d&&d!=a.Init&&b.off("cursorActivity",i),c&&(b.state.matchBrackets="object"==typeof c?c:{},b.on("cursorActivity",i))}),a.defineExtension("matchBrackets",function(){g(this,!0)}),a.defineExtension("findMatchingBracket",function(a,b,c){return e(this,a,b,c)}),a.defineExtension("scanForBracket",function(a,b,c,d){return f(this,a,b,c,d)})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],a):a(CodeMirror)}(function(a){"use strict";function b(a){a.state.tagHit&&a.state.tagHit.clear(),a.state.tagOther&&a.state.tagOther.clear(),a.state.tagHit=a.state.tagOther=null}function c(c){c.state.failedTagMatch=!1,c.action(function(){if(b(c),!c.somethingSelected()){var d=c.getCursor(),e=c.getViewport();e.from=Math.min(e.from,d.line),e.to=Math.max(d.line+1,e.to);var f=a.findMatchingTag(c,d,e);if(f){if(c.state.matchBothTags){var g="open"==f.at?f.open:f.close;g&&(c.state.tagHit=c.markText(g.from,g.to,{className:"CodeMirror-matchingtag"}))}var h="close"==f.at?f.open:f.close;h?c.state.tagOther=c.markText(h.from,h.to,{className:"CodeMirror-matchingtag"}):c.state.failedTagMatch=!0}}})}function d(a){a.state.failedTagMatch&&c(a)}a.defineOption("matchTags",!1,function(e,f,g){g&&g!=a.Init&&(e.off("cursorActivity",c),e.off("viewportChange",d),b(e)),f&&(e.state.matchBothTags="object"==typeof f&&f.bothTags,e.on("cursorActivity",c),e.on("viewportChange",d),c(e))}),a.commands.toMatchingTag=function(b){var c=a.findMatchingTag(b,b.getCursor());if(c){var d="close"==c.at?c.open:c.close;d&&b.extendSelection(d.to,d.from)}}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function d(a,b){this.mv=a,this.type=b,this.classes="left"==b?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"}}function e(b){function f(e){"full"==e&&(b.svg&&z(b.svg),z(b.copyButtons),j(b.edit,c.marked,b.classes),j(b.orig,d.marked,b.classes),c.from=c.to=d.from=d.to=0),b.diffOutOfDate&&(b.diff=s(b.orig.getValue(),b.edit.getValue()),b.diffOutOfDate=!1,a.signal(b.edit,"updateDiff",b.diff)),b.showDifferences&&(k(b.edit,b.diff,c,DIFF_INSERT,b.classes),k(b.orig,b.diff,d,DIFF_DELETE,b.classes)),m(b)}function g(a){clearTimeout(e),e=setTimeout(f,1==a?250:100)}function h(){b.diffOutOfDate||(b.diffOutOfDate=!0,c.from=c.to=d.from=d.to=0),g(!0)}var e,c={from:0,to:0,marked:[]},d={from:0,to:0,marked:[]};return b.edit.on("change",h),b.orig.on("change",h),b.edit.on("markerAdded",g),b.edit.on("markerCleared",g),b.orig.on("markerAdded",g),b.orig.on("markerCleared",g),b.edit.on("viewportChange",g),b.orig.on("viewportChange",g),f(),f}function f(a){a.edit.on("scroll",function(){g(a,DIFF_INSERT)&&m(a)}),a.orig.on("scroll",function(){g(a,DIFF_DELETE)&&m(a)})}function g(a,b){if(a.diffOutOfDate)return!1;if(!a.lockScroll)return!0;var c,d,e=+new Date;if(b==DIFF_INSERT?(c=a.edit,d=a.orig):(c=a.orig,d=a.edit),c.state.scrollSetBy==a&&(c.state.scrollSetAt||0)+50>e)return!1;var p,q,f=c.getScrollInfo(),g=.5*f.clientHeight,i=f.top+g,j=c.lineAtHeight(i,"local"),k=x(a.diff,j,b==DIFF_INSERT),l=h(c,b==DIFF_INSERT?k.edit:k.orig),m=h(d,b==DIFF_INSERT?k.orig:k.edit),n=(i-l.top)/(l.bot-l.top),o=m.top-g+n*(m.bot-m.top);if(o>f.top&&(q=f.top/g)<1)o=o*q+f.top*(1-q);else if((p=f.height-f.clientHeight-f.top)p&&(q=p/g)<1&&(o=o*q+(r.height-r.clientHeight-p)*(1-q))}return d.scrollTo(f.left,o),d.state.scrollSetAt=e,d.state.scrollSetBy=a,!0}function h(a,b){var c=b.after;return null==c&&(c=a.lastLine()+1),{top:a.heightAtLine(b.before||0,"local"),bot:a.heightAtLine(c,"local")}}function i(a,b,c){a.lockScroll=b,b&&0!=c&&g(a,DIFF_INSERT)&&m(a),a.lockButton.innerHTML=b?"\u21db\u21da":"\u21db  \u21da"}function j(b,c,d){for(var e=0;e20||c.from-f.to>20?(j(a,c.marked,e),l(a,b,d,c.marked,f.from,f.to,e),c.from=f.from,c.to=f.to):(f.fromc.to&&(l(a,b,d,c.marked,c.to,f.to,e),c.to=f.to))})}function l(a,c,d,e,f,g,h){function m(b,c){for(var d=Math.max(f,b),i=Math.min(g,c),j=d;i>j;++j){var k=a.addLineClass(j,"background",h.chunk);j==b&&a.addLineClass(k,"background",h.start),j==c-1&&a.addLineClass(k,"background",h.end),e.push(k)}b==c&&d==c&&i==c&&(d?e.push(a.addLineClass(d-1,"background",h.end)):e.push(a.addLineClass(d,"background",h.start)))}for(var i=b(0,0),j=b(f,0),k=a.clipPos(b(g-1)),l=d==DIFF_DELETE?h.del:h.insert,n=0,o=0;os&&(o&&m(n,s),n=t)}else if(q==d){var u=C(i,r,!0),x=E(j,i),y=D(k,u);F(x,y)||e.push(a.markText(x,y,{className:l})),i=u}}n<=i.line&&m(n,i.line+1)}function m(a){if(a.showDifferences){if(a.svg){z(a.svg);var b=a.gap.offsetWidth;A(a.svg,"width",b,"height",a.gap.offsetHeight)}z(a.copyButtons);var d="left"==a.type,e=a.edit.getViewport(),f=a.orig.getViewport(),g=a.edit.getScrollInfo().top,h=a.orig.getScrollInfo().top;t(a.diff,function(i,j,k,l){if(!(k>e.to||lf.to||jl&&(h&&c(e,m,d,l),d=o,e=p)}else C(j==DIFF_INSERT?f:g,i[1])}(d<=f.line||e<=g.line)&&c(e,g.line+1,d,f.line+1)}function u(a){var b=[];return t(a,function(a,c,d,e){b.push({origFrom:a,origTo:c,editFrom:d,editTo:e})}),b}function v(a,b){if(b==a.length-1)return!0;var c=a[b+1][1];return 1==c.length||10!=c.charCodeAt(0)?!1:b==a.length-2?!0:(c=a[b+2][1],c.length>1&&10==c.charCodeAt(0))}function w(a,b){if(0==b)return!0;var c=a[b-1][1];return 10!=c.charCodeAt(c.length-1)?!1:1==b?!0:(c=a[b-2][1],10==c.charCodeAt(c.length-1))}function x(a,b,c){var d,e,f,g;return t(a,function(a,h,i,j){var k=c?i:a,l=c?j:h;null==e&&(k>b?(e=i,g=a):l>b&&(e=j,g=h)),b>=l?(d=j,f=h):b>=k&&(d=i,f=a)}),{edit:{before:d,after:e},orig:{before:f,after:g}}}function y(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f0;--b)a.removeChild(a.firstChild)}function A(a){for(var b=1;b0?a:b}function F(a,b){return a.line==b.line&&a.ch==b.ch}var b=a.Pos,c="http://www.w3.org/2000/svg";d.prototype={constructor:d,init:function(b,c,d){this.edit=this.mv.edit,this.orig=a(b,B({value:c,readOnly:!0},B(d))),this.diff=s(q(c),q(d.value)),this.diffOutOfDate=!1,this.showDifferences=d.showDifferences!==!1,this.forceUpdate=e(this),i(this,!0,!1),f(this)},setShowDifferences:function(a){a=a!==!1,a!=this.showDifferences&&(this.showDifferences=a,this.forceUpdate("full"))}};var o=a.MergeView=function(b,c){if(!(this instanceof o))return new o(b,c);var e=c.origLeft,f=null==c.origRight?c.orig:c.origRight,g=null!=e,h=null!=f,i=1+(g?1:0)+(h?1:0),j=[],k=this.left=null,l=this.right=null;if(g){k=this.left=new d(this,"left");var n=y("div",null,"CodeMirror-merge-pane");j.push(n),j.push(p(k))}var q=y("div",null,"CodeMirror-merge-pane");if(j.push(q),h){l=this.right=new d(this,"right"),j.push(p(l));var r=y("div",null,"CodeMirror-merge-pane");j.push(r)}(h?r:q).className+=" CodeMirror-merge-pane-rightmost",j.push(y("div",null,null,"height: 0; clear: both;"));var s=this.wrap=b.appendChild(y("div",j,"CodeMirror-merge CodeMirror-merge-"+i+"pane"));this.edit=a(q,B(c)),k&&k.init(n,e,c),l&&l.init(r,f,c);var t=function(){k&&m(k),l&&m(l)};a.on(window,"resize",t);var u=setInterval(function(){for(var b=s.parentNode;b&&b!=document.body;b=b.parentNode);b||(clearInterval(u),a.off(window,"resize",t))},5e3)};o.prototype={constuctor:o,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(a){this.right&&this.right.setShowDifferences(a),this.left&&this.left.setShowDifferences(a)},rightChunks:function(){return this.right&&u(this.right.diff)},leftChunks:function(){return this.left&&u(this.left.diff)}};var r=new diff_match_patch}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.multiplexingMode=function(b){function e(a,b,c){if("string"==typeof b)return a.indexOf(b,c);var d=b.exec(c?a.slice(c):a);return d?d.index+c:-1}var c=Array.prototype.slice.call(arguments,1),d=c.length;return{startState:function(){return{outer:a.startState(b),innerActive:null,inner:null}},copyState:function(c){return{outer:a.copyState(b,c.outer),innerActive:c.innerActive,inner:c.innerActive&&a.copyState(c.innerActive.mode,c.inner)}},token:function(f,g){if(g.innerActive){var n=g.innerActive,i=f.string;if(!n.close&&f.sol())return g.innerActive=g.inner=null,this.token(f,g);var l=n.close?e(i,n.close,f.pos):-1;if(l==f.pos)return f.match(n.close),g.innerActive=g.inner=null,n.delimStyle;l>-1&&(f.string=i.slice(0,l));var o=n.mode.token(f,g.inner);return l>-1&&(f.string=i),n.innerStyle&&(o=o?o+" "+n.innerStyle:n.innerStyle),o}for(var h=1/0,i=f.string,j=0;d>j;++j){var k=c[j],l=e(i,k.open,f.pos);if(l==f.pos)return f.match(k.open),g.innerActive=k,g.inner=a.startState(k.mode,b.indent?b.indent(g.outer,""):0),k.delimStyle;-1!=l&&h>l&&(h=l)}1/0!=h&&(f.string=i.slice(0,h));var m=b.token(f,g.outer);return 1/0!=h&&(f.string=i),m},indent:function(c,d){var e=c.innerActive?c.innerActive.mode:b;return e.indent?e.indent(c.innerActive?c.inner:c.outer,d):a.Pass},blankLine:function(e){var f=e.innerActive?e.innerActive.mode:b;if(f.blankLine&&f.blankLine(e.innerActive?e.inner:e.outer),e.innerActive)"\n"===e.innerActive.close&&(e.innerActive=e.inner=null);else for(var g=0;d>g;++g){var h=c[g];"\n"===h.open&&(e.innerActive=h,e.inner=a.startState(h.mode,f.indent?f.indent(e.outer,""):0))}},electricChars:b.electricChars,innerMode:function(a){return a.inner?{state:a.inner,mode:a.innerActive.mode}:{state:a.outer,mode:b}}}}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";a.overlayMode=function(b,c,d){return{startState:function(){return{base:a.startState(b),overlay:a.startState(c),basePos:0,baseCur:null,overlayPos:0,overlayCur:null}},copyState:function(d){return{base:a.copyState(b,d.base),overlay:a.copyState(c,d.overlay),basePos:d.basePos,baseCur:null,overlayPos:d.overlayPos,overlayCur:null}},token:function(a,e){return a.start==e.basePos&&(e.baseCur=b.token(a,e.base),e.basePos=a.pos),a.start==e.overlayPos&&(a.pos=a.start,e.overlayCur=c.token(a,e.overlay),e.overlayPos=a.pos),a.pos=Math.min(e.basePos,e.overlayPos),a.eol()&&(e.basePos=e.overlayPos=0),null==e.overlayCur?e.baseCur:null!=e.baseCur&&d?e.baseCur+" "+e.overlayCur:e.overlayCur},indent:b.indent&&function(a,c){return b.indent(a.base,c)},electricChars:b.electricChars,innerMode:function(a){return{state:a.base,mode:b}},blankLine:function(a){b.blankLine&&b.blankLine(a.base),c.blankLine&&c.blankLine(a.overlay)}}}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function b(a){a.state.placeholder&&(a.state.placeholder.parentNode.removeChild(a.state.placeholder),a.state.placeholder=null)}function c(a){b(a);var c=a.state.placeholder=document.createElement("pre");c.style.cssText="height: 0; overflow: visible",c.className="CodeMirror-placeholder",c.appendChild(document.createTextNode(a.getOption("placeholder"))),a.display.lineSpace.insertBefore(c,a.display.lineSpace.firstChild)}function d(a){f(a)&&c(a)}function e(a){var d=a.getWrapperElement(),e=f(a);d.className=d.className.replace(" CodeMirror-empty","")+(e?" CodeMirror-empty":""),e?c(a):b(a)}function f(a){return 1===a.lineCount()&&""===a.getLine(0)}a.defineOption("placeholder","",function(c,f,g){var h=g&&g!=a.Init;if(f&&!h)c.on("blur",d),c.on("change",e),e(c);else if(!f&&h){c.off("blur",d),c.off("change",e),b(c);var i=c.getWrapperElement();i.className=i.className.replace(" CodeMirror-empty","")}f&&!c.hasFocus()&&d(c)})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b){for(var c=0,d=a.length;d>c;++c)b(a[c])}function c(a,b){if(!Array.prototype.indexOf){for(var c=a.length;c--;)if(a[c]===b)return!0; return!1}return-1!=a.indexOf(b)}function d(b,c,d){var e=b.getCursor(),f=d(b,e),g=f;if(/^[\w$_]*$/.test(f.string)||(f=g={start:e.ch,end:e.ch,string:"",state:f.state,className:":"==f.string?"python-type":null}),!h)var h=[];h.push(g);var i=l(f,h);return i=i.sort(),{list:i,from:a.Pos(e.line,f.start),to:a.Pos(e.line,f.end)}}function e(a){return d(a,h,function(a,b){return a.getTokenAt(b)})}function l(a,d){function i(a){0!=a.lastIndexOf(f,0)||c(e,a)||e.push(a)}function l(){b(j,i),b(k,i),b(g,i),b(h,i)}var e=[],f=a.string;if(d){var n,m=d.pop();for("variable"==m.type?n=m.string:"variable-3"==m.type&&(n=":"+m.string);null!=n&&d.length;)n=n[d.pop().string];null!=n&&l(n)}return e}a.registerHelper("hint","python",e);var f="and del from not while as elif global or with assert else if pass yieldbreak except import print class exec in raise continue finally is return def for lambda try",g=f.split(" "),h=f.toUpperCase().split(" "),i="abs divmod input open staticmethod all enumerate int ord str any eval isinstance pow sum basestring execfile issubclass print superbin file iter property tuple bool filter len range typebytearray float list raw_input unichr callable format locals reduce unicodechr frozenset long reload vars classmethod getattr map repr xrangecmp globals max reversed zip compile hasattr memoryview round __import__complex hash min set apply delattr help next setattr bufferdict hex object slice coerce dir id oct sorted intern ",j=i.split(" ").join("() ").split(" "),k=i.toUpperCase().split(" ").join("() ").split(" ")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b=a.display.lineSpace.childNodes.length-1;b>=0;b--){var c=a.display.lineSpace.childNodes[b];/(^|\s)CodeMirror-ruler($|\s)/.test(c.className)&&c.parentNode.removeChild(c)}}function c(b){for(var c=b.getOption("rulers"),d=b.defaultCharWidth(),e=b.charCoords(a.Pos(b.firstLine(),0),"div").left,f=-b.display.scroller.offsetHeight,g=0;g-1)return k=d(i,j,k),{from:b(f.line,k),to:b(f.line,k+g.length)}}else{var i=a.getLine(f.line).slice(f.ch),j=h(i),k=j.indexOf(c);if(k>-1)return k=d(i,j,k)+f.ch,{from:b(f.line,k),to:b(f.line,k+g.length)}}}:function(){};else{var j=g.split("\n");this.matches=function(c,d){var e=i.length-1;if(c){if(d.line-(i.length-1)=1;--k,--g)if(i[k]!=h(a.getLine(g)))return;var l=a.getLine(g),m=l.length-j[0].length;if(h(l.slice(m))!=i[0])return;return{from:b(g,m),to:f}}if(!(d.line+(i.length-1)>a.lastLine())){var l=a.getLine(d.line),m=l.length-j[0].length;if(h(l.slice(m))==i[0]){for(var n=b(d.line,m),g=d.line+1,k=1;e>k;++k,++g)if(i[k]!=h(a.getLine(g)))return;if(a.getLine(g).slice(0,j[e].length)==i[e])return{from:n,to:b(g,j[e].length)}}}}}}}function d(a,b,c){if(a.length==b.length)return c;for(var d=Math.min(c,a.length);;){var e=a.slice(0,d).toLowerCase().length;if(c>e)++d;else{if(!(e>c))return d;--d}}}var b=a.Pos;c.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(a){function e(a){var d=b(a,0);return c.pos={from:d,to:d},c.atOccurrence=!1,!1}for(var c=this,d=this.doc.clipPos(a?this.pos.from:this.pos.to);;){if(this.pos=this.matches(a,d))return this.atOccurrence=!0,this.pos.match||!0;if(a){if(!d.line)return e(0);d=b(d.line-1,this.doc.getLine(d.line-1).length)}else{var f=this.doc.lineCount();if(d.line==f-1)return e(f);d=b(d.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(c){if(this.atOccurrence){var d=a.splitLines(c);this.doc.replaceRange(d,this.pos.from,this.pos.to),this.pos.to=b(this.pos.from.line+d.length-1,d[d.length-1].length+(1==d.length?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",function(a,b,d){return new c(this.doc,a,b,d)}),a.defineDocExtension("getSearchCursor",function(a,b,d){return new c(this,a,b,d)}),a.defineExtension("selectMatches",function(b,c){for(var e,d=[],f=this.getSearchCursor(b,this.getCursor("from"),c);(e=f.findNext())&&!(a.cmpPos(f.to(),this.getCursor("to"))>0);)d.push({anchor:f.from(),head:f.to()});d.length&&this.setSelections(d,0)})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function d(a,b,c){this.cm=a,this.getHints=b,this.options=c,this.widget=this.onClose=null}function e(a){return"string"==typeof a?a:a.text}function f(a,b){function e(a,e){var f;f="string"!=typeof e?function(a){return e(a,b)}:c.hasOwnProperty(e)?c[e]:e,d[a]=f}var c={Up:function(){b.moveFocus(-1)},Down:function(){b.moveFocus(1)},PageUp:function(){b.moveFocus(-b.menuSize()+1,!0)},PageDown:function(){b.moveFocus(b.menuSize()-1,!0)},Home:function(){b.setFocus(0)},End:function(){b.setFocus(b.length-1)},Enter:b.pick,Tab:b.pick,Esc:b.close},d=a.customKeys?{}:c;if(a.customKeys)for(var f in a.customKeys)a.customKeys.hasOwnProperty(f)&&e(f,a.customKeys[f]);if(a.extraKeys)for(var f in a.extraKeys)a.extraKeys.hasOwnProperty(f)&&e(f,a.extraKeys[f]);return d}function g(a,b){for(;b&&b!=a;){if("LI"===b.nodeName.toUpperCase()&&b.parentNode==a)return b;b=b.parentNode}}function h(d,h){this.completion=d,this.data=h;var i=this,j=d.cm,k=d.options,l=this.hints=document.createElement("ul");l.className="CodeMirror-hints",this.selectedHint=k.getDefaultSelection?k.getDefaultSelection(j,k,h):0;for(var m=h.list,n=0;n0){var z=x.bottom-x.top,A=x.top-(r.bottom-r.top);if(A-z>0)l.style.top=(t=A-z)+"px",u=!1;else if(z>w){l.style.height=w-5+"px",l.style.top=(t=r.bottom-x.top)+"px";var B=j.getCursor();h.from.ch!=B.ch&&(r=j.cursorCoords(B),l.style.left=(s=r.left)+"px",x=l.getBoundingClientRect())}}var C=x.left-v;if(C>0&&(x.right-x.left>v&&(l.style.width=v-5+"px",C-=x.right-x.left-v),l.style.left=(s=r.left-C)+"px"),j.addKeyMap(this.keyMap=f(k,{moveFocus:function(a,b){i.changeActive(i.selectedHint+a,b)},setFocus:function(a){i.changeActive(a)},menuSize:function(){return i.screenAmount()},length:m.length,close:function(){d.close()},pick:function(){i.pick()},data:h})),k.closeOnUnfocus!==!1){var D;j.on("blur",this.onBlur=function(){D=setTimeout(function(){d.close()},100)}),j.on("focus",this.onFocus=function(){clearTimeout(D)})}var E=j.getScrollInfo();return j.on("scroll",this.onScroll=function(){var a=j.getScrollInfo(),b=j.getWrapperElement().getBoundingClientRect(),c=t+E.top-a.top,e=c-(window.pageYOffset||(document.documentElement||document.body).scrollTop);return u||(e+=l.offsetHeight),e<=b.top||e>=b.bottom?d.close():(l.style.top=c+"px",l.style.left=s+E.left-a.left+"px",void 0)}),a.on(l,"dblclick",function(a){var b=g(l,a.target||a.srcElement);b&&null!=b.hintId&&(i.changeActive(b.hintId),i.pick())}),a.on(l,"click",function(a){var b=g(l,a.target||a.srcElement);b&&null!=b.hintId&&(i.changeActive(b.hintId),k.completeOnSingleClick&&i.pick())}),a.on(l,"mousedown",function(){setTimeout(function(){j.focus()},20)}),a.signal(h,"select",m[0],l.firstChild),!0}var b="CodeMirror-hint",c="CodeMirror-hint-active";a.showHint=function(b,c,e){if(!(b.listSelections().length>1||b.somethingSelected())){if(null==c){if(e&&e.async)return;c=a.hint.auto}b.state.completionActive&&b.state.completionActive.close();var f=b.state.completionActive=new d(b,c,e||{});return a.signal(b,"startCompletion",b),f.options.async?(c(b,function(a){f.showHints(a)},f.options),void 0):f.showHints(c(b,f.options))}},d.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.widget&&this.widget.close(),this.onClose&&this.onClose(),a.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(b,c){var d=b.list[c];d.hint?d.hint(this.cm,b,d):this.cm.replaceRange(e(d),d.from||b.from,d.to||b.to,"complete"),a.signal(b,"pick",d),this.close()},showHints:function(a){return a&&a.list.length&&this.active()?(0!=this.options.completeSingle&&1==a.list.length?this.pick(a,0):this.showWidget(a),void 0):this.close()},showWidget:function(b){function l(){e||(e=!0,d.close(),d.cm.off("cursorActivity",p),b&&a.signal(b,"close"))}function m(){e||(a.signal(b,"update"),d.options.async?d.getHints(d.cm,n,d.options):n(d.getHints(d.cm,d.options)))}function n(a){if(b=a,!e){if(!b||!b.list.length)return l();d.widget&&d.widget.close(),d.widget=new h(d,b)}}function o(){c&&(k(c),c=0)}function p(){o();var a=d.cm.getCursor(),b=d.cm.getLine(a.line);a.line!=g.line||b.length-a.ch!=i-g.ch||a.ch,]/,g=this.cm.getCursor(),i=this.cm.getLine(g.line).length,j=window.requestAnimationFrame||function(a){return setTimeout(a,1e3/60)},k=window.cancelAnimationFrame||clearTimeout;this.cm.on("cursorActivity",p),this.onClose=l}},h.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var a=this.completion.cm;this.completion.options.closeOnUnfocus!==!1&&(a.off("blur",this.onBlur),a.off("focus",this.onFocus)),a.off("scroll",this.onScroll)}},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(b,d){if(b>=this.data.list.length?b=d?this.data.list.length-1:0:0>b&&(b=d?0:this.data.list.length-1),this.selectedHint!=b){var e=this.hints.childNodes[this.selectedHint];e.className=e.className.replace(" "+c,""),e=this.hints.childNodes[this.selectedHint=b],e.className+=" "+c,e.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=e.offsetTop+e.offsetHeight-this.hints.clientHeight+3),a.signal(this.data,"select",this.data.list[this.selectedHint],e)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},a.registerHelper("hint","auto",function(b,c){var e,d=b.getHelpers(b.getCursor(),"hint");if(d.length)for(var f=0;fq&&t>=r){o={start:l(q),end:l(t)};break}q=t}for(var u=f.getRange(o.start,o.end,!1),s=0;sa.pos?(a.pos=c,null):(a.pos=b,"trailingspace")},name:"trailingspace"})})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function e(a,b,c){var d=a.docs[b];d?c(I(a,d)):a.options.getFile?a.options.getFile(b,c):c(null)}function f(a,b,c){for(var d in a.docs){var e=a.docs[d];if(e.doc==b)return e}if(!c)for(var f=0;;++f)if(d="[doc"+(f||"")+"]",!a.docs[d]){c=d;break}return a.addDoc(c,b)}function g(a,b,c){var e=f(a,b),g=a.cachedArgHints;g&&g.doc==b&&z(g.start,c.to)<=0&&(a.cachedArgHints=null);var i=e.changed;null==i&&(e.changed=i={from:c.from.line,to:c.from.line});var j=c.from.line+(c.text.length-1);c.from.line=i.to&&(i.to=j+1),i.from>c.from.line&&(i.from=c.from.line),b.lineCount()>d&&c.to-i.from>100&&setTimeout(function(){e.changed&&e.changed.to-e.changed.from>100&&h(a,e)},200)}function h(a,b){a.server.request({files:[{type:"full",name:b.name,text:I(a,b)}]},function(a){a?window.console.error(a):b.changed=null})}function i(d,e,f){d.request(e,{type:"completions",types:!0,docs:!0,urls:!0},function(g,h){if(g)return G(d,e,g);var i=[],k="",l=h.start,m=h.end;'["'==e.getRange(b(l.line,l.ch-2),l)&&'"]'!=e.getRange(m,b(m.line,m.ch+2))&&(k='"]');for(var n=0;n=l;--k){for(var p=d.getLine(k),q=0,r=0;;){var s=p.indexOf(" ",r);if(-1==s)break;q+=j-(s+q)%j-1,r=s+1}if(h=g.column-q,"("==p.charAt(h)){o=!0;break}}if(o){var t=b(k,h),u=c.cachedArgHints;return u&&u.doc==d.getDoc()&&0==z(t,u.start)?m(c,d,i):(c.request(d,{type:"type",preferFunction:!0,end:t},function(a,b){!a&&b.type&&/^fn\(/.test(b.type)&&(c.cachedArgHints={start:r,type:n(b.type),name:b.exprName||b.name||"fn",guess:b.guess,doc:d.getDoc()},m(c,d,i))}),void 0)}}}}}function m(a,b,d){H(a);for(var e=a.cachedArgHints,f=e.type,g=A("span",e.guess?c+"fhint-guess":null,A("span",c+"fname",e.name),"("),h=0;h\xa0":")")),f.rettype&&g.appendChild(A("span",c+"type",f.rettype));var j=b.cursorCoords(null,"page");a.activeArgHints=D(j.right+1,j.bottom,g)}function n(a){function d(b){for(var d=0,e=c;;){var f=a.charAt(c);if(b.test(f)&&!d)return a.slice(e,c);/[{\[\(]/.test(f)?++d:/[}\]\)]/.test(f)&&--d,++c}}var b=[],c=3;if(")"!=a.charAt(c))for(;;){var e=a.slice(c).match(/^([^, \(\[\{]+): /);if(e&&(c+=e[0].length,e=e[1]),b.push({name:e,type:d(/[\),]/)}),")"==a.charAt(c))break;c+=2}var f=a.slice(c).match(/^\) -> (.*)$/);return{args:b,rettype:f&&f[1]}}function o(a,b){function c(c){var d={type:"definition",variable:c||null},e=f(a,b.getDoc());a.server.request(x(a,e,d),function(c,d){if(c)return G(a,b,c);if(!d.file&&d.url)return window.open(d.url),void 0;if(d.file){var g,f=a.docs[d.file];if(f&&(g=r(f.doc,d)))return a.jumpStack.push({file:e.name,start:b.getCursor("from"),end:b.getCursor("to")}),q(a,e,f,g.start,g.end),void 0}G(a,b,"Could not find a definition.")})}s(b)?c():B(b,"Jump to variable",function(a){a&&c(a)})}function p(a,b){var c=a.jumpStack.pop(),d=c&&a.docs[c.file];d&&q(a,f(a,b.getDoc()),d,c.start,c.end)}function q(a,b,c,d,e){c.doc.setSelection(e,d),b!=c&&a.options.switchToDoc&&(H(a),a.options.switchToDoc(c.name))}function r(a,c){for(var d=c.context.slice(0,c.contextOffset).split("\n"),e=c.start.line-(d.length-1),f=b(e,(1==d.length?c.start.ch:a.getLine(e).length)-d[0].length),g=a.getLine(e).slice(f.ch),h=e+1;hm&&(j=l,k=m)}if(!j)return null;if(1==d.length?j.ch+=d[0].length:j=b(j.line+(d.length-1),d[d.length-1].length),c.start.line==c.end.line)var n=b(j.line,j.ch+(c.end.ch-c.start.ch));else var n=b(j.line+(c.end.line-c.start.line),c.end.ch);return{start:j,end:n}}function s(a){var b=a.getCursor("end"),c=a.getTokenAt(b);return c.start=0&&z(g,i.end)<=0&&(g=f.length-1))}b.setSelections(f,g)})}function w(a,b){for(var c=Object.create(null),d=0;dd&&i!==!1&&c.changed.to-c.changed.from<100&&c.changed.from<=j.line&&c.changed.to>e.end.line){g.push(y(c,j,e.end)),e.file="#0";var h=g[0].offsetLines;null!=e.start&&(e.start=b(e.start.line- -h,e.start.ch)),e.end=b(e.end.line-h,e.end.ch)}else g.push({type:"full",name:c.name,text:I(a,c)}),e.file=c.name,c.changed=null;else e.file=c.name;for(var k in a.docs){var l=a.docs[k];l.changed&&l!=c&&(g.push({type:"full",name:l.name,text:I(a,l)}),l.changed=null)}return{query:e,files:g}}function y(c,d,e){for(var i,f=c.doc,g=null,h=null,j=4,k=d.line-1,l=Math.max(0,k-50);k>=l;--k){var m=f.getLine(k),n=m.search(/\bfunction\b/);if(!(0>n)){var o=a.countColumn(m,null,j);null!=g&&o>=g||(g=o,h=k)}}null==h&&(h=l);var p=Math.min(f.lastLine(),e.line+20);if(null==g||g==a.countColumn(f.getLine(d.line),null,j))i=p;else for(i=e.line+1;p>i;++i){var o=a.countColumn(f.getLine(i),null,j);if(g>=o)break}var q=b(h,0);return{type:"part",name:c.name,offsetLines:q.line,text:f.getRange(q,b(i,0))}}function A(a,b){var c=document.createElement(a);b&&(c.className=b);for(var d=2;d",c):c(prompt(b,""))}function C(a,b){function e(){d.parentNode&&(a.off("cursorActivity",e),F(d))}var c=a.cursorCoords(),d=D(c.right+1,c.bottom,b);setTimeout(e,1700),a.on("cursorActivity",e)}function D(a,b,d){var e=A("div",c+"tooltip",d);return e.style.left=a+"px",e.style.top=b+"px",document.body.appendChild(e),e}function E(a){var b=a&&a.parentNode;b&&b.removeChild(a)}function F(a){a.style.opacity="0",setTimeout(function(){E(a)},1100)}function G(a,b,c){a.options.showError?a.options.showError(b,c):C(b,String(c))}function H(a){a.activeArgHints&&(E(a.activeArgHints),a.activeArgHints=null)}function I(a,b){var c=b.doc.getValue();return a.options.fileFilter&&(c=a.options.fileFilter(c,b.name,b.doc)),c}function J(a){function f(a,e){e&&(a.id=++c,d[c]=e),b.postMessage(a)}var b=new Worker(a.options.workerScript);b.postMessage({type:"init",defs:a.options.defs,plugins:a.options.plugins,scripts:a.options.workerDeps});var c=0,d={};b.onmessage=function(b){var c=b.data;"getFile"==c.type?e(a,c.name,function(a,b){f({type:"getFile",err:String(a),text:b,id:c.id})}):"debug"==c.type?window.console.log(c.message):c.id&&d[c.id]&&(d[c.id](c.err,c.body),delete d[c.id])},b.onerror=function(a){for(var b in d)d[b](a);d={}},this.addFile=function(a,b){f({type:"add",name:a,text:b})},this.delFile=function(a){f({type:"del",name:a})},this.request=function(a,b){f({type:"req",body:a},b)}}a.TernServer=function(a){var b=this;this.options=a||{};var c=this.options.plugins||(this.options.plugins={});c.doc_comment||(c.doc_comment=!0),this.server=this.options.useWorker?new J(this):new tern.Server({getFile:function(a,c){return e(b,a,c)},async:!0,defs:this.options.defs||[],plugins:c}),this.docs=Object.create(null),this.trackChange=function(a,c){g(b,a,c)},this.cachedArgHints=null,this.activeArgHints=null,this.jumpStack=[]},a.TernServer.prototype={addDoc:function(b,c){var d={doc:c,name:b,changed:null};return this.server.addFile(b,I(this,d)),a.on(c,"change",this.trackChange),this.docs[b]=d},delDoc:function(b){var c=this.docs[b];c&&(a.off(c.doc,"change",this.trackChange),delete this.docs[b],this.server.delFile(b))},hideDoc:function(a){H(this);var b=this.docs[a];b&&b.changed&&h(this,b)},complete:function(b){var c=this;a.showHint(b,function(a,b){return i(c,a,b)},{async:!0})},getHint:function(a,b){return i(this,a,b)},showType:function(a,b){k(this,a,b)},updateArgHints:function(a){l(this,a)},jumpToDef:function(a){o(this,a)},jumpBack:function(a){p(this,a)},rename:function(a){t(this,a)},selectName:function(a){u(this,a)},request:function(a,b,c,d){var e=this,g=f(this,a.getDoc()),h=x(this,g,b,d);this.server.request(h,function(a,d){!a&&e.options.responseFilter&&(d=e.options.responseFilter(g,b,h,a,d)),c(a,d)})}};var b=a.Pos,c="CodeMirror-Tern-",d=250,v=0,z=a.cmpPos}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function c(a,b){return a.line-b.line||a.ch-b.ch}function g(a,b,c,d){this.line=b,this.ch=c,this.cm=a,this.text=a.getLine(b),this.min=d?d.from:a.firstLine(),this.max=d?d.to-1:a.lastLine()}function h(a,c){var d=a.cm.getTokenTypeAt(b(a.line,c));return d&&/\btag\b/.test(d)}function i(a){return a.line>=a.max?void 0:(a.ch=0,a.text=a.cm.getLine(++a.line),!0)}function j(a){return a.line<=a.min?void 0:(a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0)}function k(a){for(;;){var b=a.text.indexOf(">",a.ch);if(-1==b){if(i(a))continue;return}{if(h(a,b+1)){var c=a.text.lastIndexOf("/",b),d=c>-1&&!/\S/.test(a.text.slice(c+1,b));return a.ch=b+1,d?"selfClose":"regular"}a.ch=b+1}}}function l(a){for(;;){var b=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(-1==b){if(j(a))continue;return}if(h(a,b+1)){f.lastIndex=b,a.ch=b;var c=f.exec(a.text);if(c&&c.index==b)return c}else a.ch=b}}function m(a){for(;;){f.lastIndex=a.ch;var b=f.exec(a.text);if(!b){if(i(a))continue;return}{if(h(a,b.index+1))return a.ch=b.index+b[0].length,b;a.ch=b.index+1}}}function n(a){for(;;){var b=a.ch?a.text.lastIndexOf(">",a.ch-1):-1;if(-1==b){if(j(a))continue;return}{if(h(a,b+1)){var c=a.text.lastIndexOf("/",b),d=c>-1&&!/\S/.test(a.text.slice(c+1,b));return a.ch=b+1,d?"selfClose":"regular"}a.ch=b}}}function o(a,c){for(var d=[];;){var f,e=m(a),g=a.line,h=a.ch-(e?e[0].length:0);if(!e||!(f=k(a)))return;if("selfClose"!=f)if(e[1]){for(var i=d.length-1;i>=0;--i)if(d[i]==e[2]){d.length=i;break}if(0>i&&(!c||c==e[2]))return{tag:e[2],from:b(g,h),to:b(a.line,a.ch)}}else d.push(e[2])}}function p(a,c){for(var d=[];;){var e=n(a);if(!e)return;if("selfClose"!=e){var f=a.line,g=a.ch,h=l(a);if(!h)return;if(h[1])d.push(h[2]);else{for(var i=d.length-1;i>=0;--i)if(d[i]==h[2]){d.length=i;break}if(0>i&&(!c||c==h[2]))return{tag:h[2],from:b(a.line,a.ch),to:b(f,g)}}}else l(a)}}var b=a.Pos,d="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",e=d+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",f=new RegExp("<(/?)(["+d+"]["+e+"]*)","g"); a.registerHelper("fold","xml",function(a,c){for(var d=new g(a,c.line,0);;){var f,e=m(d);if(!e||d.line!=c.line||!(f=k(d)))return;if(!e[1]&&"selfClose"!=f){var c=b(d.line,d.ch),h=o(d,e[2]);return h&&{from:c,to:h.from}}}}),a.findMatchingTag=function(a,d,e){var f=new g(a,d.line,d.ch,e);if(-1!=f.text.indexOf(">")||-1!=f.text.indexOf("<")){var h=k(f),i=h&&b(f.line,f.ch),j=h&&l(f);if(h&&"selfClose"!=h&&j&&!(c(f,d)>0)){var m={from:b(f.line,f.ch),to:i,tag:j[2]};return j[1]?{open:p(f,j[2]),close:m,at:"close"}:(f=new g(a,i.line,i.ch,e),{open:m,close:o(f,j[2]),at:"open"})}}},a.findEnclosingTag=function(a,b,c){for(var d=new g(a,b.line,b.ch,c);;){var e=p(d);if(!e)break;var f=new g(a,b.line,b.ch,c),h=o(f,e.tag);if(h)return{open:e,close:h}}},a.scanForClosingTag=function(a,b,c,d){var e=new g(a,b.line,b.ch,d?{from:0,to:d}:null);return!!o(e,c)}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function c(c,d){var e=d&&d.schemaInfo,f=d&&d.quoteChar||'"';if(e){var g=c.getCursor(),h=c.getTokenAt(g),i=a.innerMode(c.getMode(),h.state);if("xml"==i.mode.name){var l,o,j=[],k=!1,m=/\btag\b/.test(h.type),n=m&&/^\w/.test(h.string);if(n){var p=c.getLine(g.line).slice(Math.max(0,h.start-2),h.start),q=/<\/$/.test(p)?"close":/<$/.test(p)?"open":null;q&&(o=h.start-("close"==q?2:1))}else m&&"<"==h.string?q="open":m&&"")}else{var s=e[i.state.tagName],w=s&&s.attrs;if(!w)return;if("string"==h.type||"="==h.string){var y,p=c.getRange(b(g.line,Math.max(0,g.ch-60)),b(g.line,"string"==h.type?h.start:h.end)),x=p.match(/([^\s\u00a0=<>\"\']+)=$/);if(!x||!w.hasOwnProperty(x[1])||!(y=w[x[1]]))return;"function"==typeof y&&(y=y.call(this,c)),"string"==h.type&&(l=h.string,/['"]/.test(h.string.charAt(0))&&(f=h.string.charAt(0),l=h.string.slice(1)),k=!0);for(var u=0;u50&&d.shift()}function f(a){return d.length?(d[d.length-1]+=a,void 0):e(a)}function g(a){return d[d.length-(a?Math.min(a,1):1)]||""}function h(){return d.length>1&&d.pop(),g()}function j(a,b,d,g,h){null==h&&(h=a.getRange(b,d)),g&&i&&i.cm==a&&c(b,i.pos)&&a.isClean(i.gen)?f(h):e(h),a.replaceRange("",b,d,"+delete"),i=g?{cm:a,pos:b,gen:a.changeGeneration()}:null}function k(a,b,c){return a.findPosH(b,c,"char",!0)}function l(a,b,c){return a.findPosH(b,c,"word",!0)}function m(a,b,c){return a.findPosV(b,c,"line",a.doc.sel.goalColumn)}function n(a,b,c){return a.findPosV(b,c,"page",a.doc.sel.goalColumn)}function o(a,c,d){for(var e=c.line,f=a.getLine(e),g=/\S/.test(0>d?f.slice(0,c.ch):f.slice(c.ch)),h=a.firstLine(),i=a.lastLine();;){if(e+=d,h>e||e>i)return a.clipPos(b(e-d,0>d?0:null));f=a.getLine(e);var j=/\S/.test(f);if(j)g=!0;else if(g)return b(e,0)}}function p(a,c,d){for(var e=c.line,f=c.ch,g=a.getLine(c.line),h=!1;;){var i=g.charAt(f+(0>d?-1:0));if(i){if(h&&/[!?.]/.test(i))return b(e,f+(d>0?1:0));h||(h=/\w/.test(i)),f+=d}else{if(e==(0>d?a.firstLine():a.lastLine()))return b(e,f);if(g=a.getLine(e+d),!/\S/.test(g))return b(e,f);e+=d,f=0>d?g.length:0}}}function q(a,d,e){var f;if(a.findMatchingBracket&&(f=a.findMatchingBracket(d,!0))&&f.match&&(f.forward?1:-1)==e)return e>0?b(f.to.line,f.to.ch+1):f.to;for(var g=!0;;g=!1){var h=a.getTokenAt(d),i=b(d.line,0>e?h.start:h.end);if(!(g&&e>0&&h.end==d.ch)&&/\w/.test(h.string))return i;var j=a.findPosH(i,e,"char");if(c(i,j))return d;d=j}}function r(a,b){var c=a.state.emacsPrefix;return c?(z(a),"-"==c?-1:Number(c)):b?null:1}function s(a){var b="string"==typeof a?function(b){b.execCommand(a)}:a;return function(a){var c=r(a);b(a);for(var d=1;c>d;++d)b(a)}}function t(a,b,d){var e=a.getCursor(),f=r(a);0>f&&(d=-d,f=-f);for(var g=0;f>g;++g){var h=b(a,e,d);if(c(h,e))break;e=h}return e}function u(a,b){var c=function(c){c.extendSelection(t(c,a,b))};return c.motion=!0,c}function v(a,b,c){j(a,a.getCursor(),t(a,b,c),!0)}function w(a,b){return a.state.emacsPrefix?("-"!=b&&(a.state.emacsPrefix+=b),void 0):(a.state.emacsPrefix=b,a.on("keyHandled",y),a.on("inputRead",A),void 0)}function y(a,b){a.state.emacsPrefixMap||x.hasOwnProperty(b)||z(a)}function z(a){a.state.emacsPrefix=null,a.off("keyHandled",y),a.off("inputRead",A)}function A(a,b){var c=r(a);if(c>1&&"+input"==b.origin){for(var d=b.text.join("\n"),e="",f=1;c>f;++f)e+=d;a.replaceSelection(e)}}function B(a){a.state.emacsPrefixMap=!0,a.addKeyMap(K),a.on("keyHandled",C),a.on("inputRead",C)}function C(a,b){("string"!=typeof b||!/^\d$/.test(b)&&"Ctrl-U"!=b)&&(a.removeKeyMap(K),a.state.emacsPrefixMap=!1,a.off("keyHandled",C),a.off("inputRead",C))}function D(a){a.setCursor(a.getCursor()),a.setExtending(!a.getExtending()),a.on("change",function(){a.setExtending(!1)})}function E(a){a.setExtending(!1),a.setCursor(a.getCursor())}function F(a,b,c){a.openDialog?a.openDialog(b+': ',c,{bottom:!0}):c(prompt(b,""))}function G(a,b){var c=a.getCursor(),d=a.findPosH(c,1,"word");a.replaceRange(b(a.getRange(c,d)),c,d),a.setCursor(d)}function H(a){for(var c=a.getCursor(),d=c.line,e=c.ch,f=[];d>=a.firstLine();){for(var g=a.getLine(d),h=null==e?g.length:e;h>0;){var e=g.charAt(--h);if(")"==e)f.push("(");else if("]"==e)f.push("[");else if("}"==e)f.push("{");else if(/[\(\{\[]/.test(e)&&(!f.length||f.pop()!=e))return a.extendSelection(b(d,h))}--d,e=null}}function I(a){a.execCommand("clearSearch"),E(a)}function L(a){K[a]=function(b){w(b,a)},J["Ctrl-"+a]=function(b){w(b,a)},x["Ctrl-"+a]=!0}var b=a.Pos,d=[],i=null,x={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0},J=a.keyMap.emacs={"Ctrl-W":function(a){j(a,a.getCursor("start"),a.getCursor("end"))},"Ctrl-K":s(function(a){var c=a.getCursor(),d=a.clipPos(b(c.line)),e=a.getRange(c,d);/\S/.test(e)||(e+="\n",d=b(c.line+1,0)),j(a,c,d,!0,e)}),"Alt-W":function(a){e(a.getSelection()),E(a)},"Ctrl-Y":function(a){var b=a.getCursor();a.replaceRange(g(r(a)),b,b,"paste"),a.setSelection(b,a.getCursor())},"Alt-Y":function(a){a.replaceSelection(h(),"around","paste")},"Ctrl-Space":D,"Ctrl-Shift-2":D,"Ctrl-F":u(k,1),"Ctrl-B":u(k,-1),Right:u(k,1),Left:u(k,-1),"Ctrl-D":function(a){v(a,k,1)},Delete:function(a){v(a,k,1)},"Ctrl-H":function(a){v(a,k,-1)},Backspace:function(a){v(a,k,-1)},"Alt-F":u(l,1),"Alt-B":u(l,-1),"Alt-D":function(a){v(a,l,1)},"Alt-Backspace":function(a){v(a,l,-1)},"Ctrl-N":u(m,1),"Ctrl-P":u(m,-1),Down:u(m,1),Up:u(m,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":u(n,-1),"Ctrl-V":u(n,1),PageUp:u(n,-1),PageDown:u(n,1),"Ctrl-Up":u(o,-1),"Ctrl-Down":u(o,1),"Alt-A":u(p,-1),"Alt-E":u(p,1),"Alt-K":function(a){v(a,p,1)},"Ctrl-Alt-K":function(a){v(a,q,1)},"Ctrl-Alt-Backspace":function(a){v(a,q,-1)},"Ctrl-Alt-F":u(q,1),"Ctrl-Alt-B":u(q,-1),"Shift-Ctrl-Alt-2":function(a){a.setSelection(t(a,q,1),a.getCursor())},"Ctrl-Alt-T":function(a){var b=q(a,a.getCursor(),-1),c=q(a,b,1),d=q(a,c,1),e=q(a,d,-1);a.replaceRange(a.getRange(e,d)+a.getRange(c,e)+a.getRange(b,c),b,d)},"Ctrl-Alt-U":s(H),"Alt-Space":function(a){for(var c=a.getCursor(),d=c.ch,e=c.ch,f=a.getLine(c.line);d&&/\s/.test(f.charAt(d-1));)--d;for(;e0?a.setCursor(b-1):(F(a,"Goto line",function(b){var c;b&&!isNaN(c=Number(b))&&0|c==c&&c>0&&a.setCursor(c-1)}),void 0)},auto:"emacs",nofallthrough:!0,disableInput:!0},a.keyMap["emacs-Ctrl-Q"]={Tab:s("insertTab"),auto:"emacs",nofallthrough:!0};for(var K={"Ctrl-G":z},M=0;10>M;++M)L(String(M));L("-")}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],a):a(CodeMirror)}(function(a){"use strict";function f(b,c,e){if(0>e&&0==c.ch)return b.clipPos(d(c.line-1));var f=b.getLine(c.line);if(e>0&&c.ch>=f.length)return b.clipPos(d(c.line+1,0));for(var h,g="start",i=c.ch,j=0>e?0:f.length,k=0;i!=j;i+=e,k++){var l=f.charAt(0>e?i-1:i),m="_"!=l&&a.isWordChar(l)?"w":"o";if("w"==m&&l.toUpperCase()==l&&(m="W"),"start"==g)"o"!=m&&(g="in",h=m);else if("in"==g&&h!=m){if("w"==h&&"W"==m&&0>e&&i--,"W"==h&&"w"==m&&e>0){h="w";continue}break}}return d(c.line,i)}function g(a,b){a.extendSelectionsBy(function(c){return a.display.shift||a.doc.extend||c.empty()?f(a.doc,c.head,b):0>b?c.from():c.to()})}function h(a,b){a.action(function(){for(var c=a.listSelections().length,e=[],f=-1,g=0;c>g;g++){var h=a.listSelections()[g].head;if(!(h.line<=f)){var i=d(h.line+(b?0:1),0);a.replaceRange("\n",i,null,"+insertLine"),a.indentLine(i.line,null,!0),e.push({head:i,anchor:i}),f=h.line+1}}a.setSelections(e)})}function i(b,c){for(var e=c.ch,f=e,g=b.getLine(c.line);e&&a.isWordChar(g.charAt(e-1));)--e;for(;fa?-1:a==b?0:1}),a.replaceRange(l,j,k),f&&c.push({anchor:j,head:k})}f&&a.setSelections(c,0)})}function n(b,c){b.action(function(){for(var d=b.listSelections(),e=[],f=[],g=0;g=0;g--){var h=d[e[g]];if(!(j&&a.cmpPos(h.head,j)>0)){var k=i(b,h.head);j=k.from,b.replaceRange(c(k.word),k.from,k.to)}}})}function o(b,c){var e=b.getCursor("from"),f=b.getCursor("to");if(0==a.cmpPos(e,f)){var g=i(b,e);if(!g.word)return;e=g.from,f=g.to}var h=b.getRange(e,f),j=b.getSearchCursor(h,c?f:e);(c?j.findNext():j.findPrevious())?b.setSelection(j.from(),j.to()):(j=b.getSearchCursor(h,c?d(b.firstLine(),0):b.clipPos(d(b.lastLine()))),(c?j.findNext():j.findPrevious())?b.setSelection(j.from(),j.to()):g&&b.setSelection(e,f))}var b=a.keyMap.sublime={fallthrough:"default"},c=a.commands,d=a.Pos,e=a.keyMap["default"]==a.keyMap.pcDefault?"Ctrl-":"Cmd-";c[b["Alt-Left"]="goSubwordLeft"]=function(a){g(a,-1)},c[b["Alt-Right"]="goSubwordRight"]=function(a){g(a,1)},c[b[e+"Up"]="scrollLineUp"]=function(a){a.scrollTo(null,a.getScrollInfo().top-a.defaultTextHeight())},c[b[e+"Down"]="scrollLineDown"]=function(a){a.scrollTo(null,a.getScrollInfo().top+a.defaultTextHeight())},c[b["Shift-"+e+"L"]="splitSelectionByLine"]=function(a){for(var b=a.listSelections(),c=[],e=0;ef.line&&h==g.line&&0==g.ch||c.push({anchor:h==f.line?f:d(h,0),head:h==g.line?g:d(h)});a.setSelections(c,0)},b["Shift-Tab"]="indentLess",c[b.Esc="singleSelectionTop"]=function(a){var b=a.listSelections()[0];a.setSelection(b.anchor,b.head,{scroll:!1})},c[b[e+"L"]="selectLine"]=function(a){for(var b=a.listSelections(),c=[],e=0;ee?c.push(h,i):c.length&&(c[c.length-1]=i),e=i}a.action(function(){for(var b=0;ba.lastLine()){a.replaceRange("\n"+g,d(a.lastLine()),null,"+swapLine");var h=a.listSelections(),i=h[h.length-1],j=i.head.line==f?d(f-1):i.head,k=i.anchor.line==f?d(f-1):i.anchor;a.setSelections(h.slice(0,h.length-1).concat([{head:j,anchor:k}]))}else a.replaceRange(g+"\n",d(f,0),null,"+swapLine")}a.scrollIntoView()})},c[b["Shift-"+e+"Down"]="swapLineDown"]=function(a){for(var b=a.listSelections(),c=[],e=a.lastLine()+1,f=b.length-1;f>=0;f--){var g=b[f],h=g.to().line+1,i=g.from().line;e>h?c.push(h,i):c.length&&(c[c.length-1]=i),e=i}a.action(function(){for(var b=c.length-2;b>=0;b-=2){var e=c[b],f=c[b+1],g=a.getLine(e);e==a.lastLine()?a.replaceRange("",d(e-1),d(e),"+swapLine"):a.replaceRange("",d(e,0),d(e+1,0),"+swapLine"),a.replaceRange(g+"\n",d(f,0),null,"+swapLine")}a.scrollIntoView()})},b[e+"/"]="toggleComment",c[b[e+"J"]="joinLines"]=function(a){for(var b=a.listSelections(),c=[],e=0;ec;c++){var e=a.listSelections()[c];e.empty()?a.replaceRange(a.getLine(e.head.line)+"\n",d(e.head.line,0)):a.replaceRange(a.getRange(e.from(),e.to()),e.from())}a.scrollIntoView()})},b[e+"T"]="transposeChars",c[b.F9="sortLines"]=function(a){l(a,!0)},c[b[e+"F9"]="sortLinesInsensitive"]=function(a){l(a,!1)},c[b.F2="nextBookmark"]=function(a){var b=a.state.sublimeBookmarks;if(b)for(;b.length;){var c=b.shift(),d=c.find();if(d)return b.push(c),a.setSelection(d.from,d.to)}},c[b["Shift-F2"]="prevBookmark"]=function(a){var b=a.state.sublimeBookmarks;if(b)for(;b.length;){b.unshift(b.pop());var c=b[b.length-1].find();if(c)return a.setSelection(c.from,c.to);b.pop()}},c[b[e+"F2"]="toggleBookmark"]=function(a){for(var b=a.listSelections(),c=a.state.sublimeBookmarks||(a.state.sublimeBookmarks=[]),d=0;d=0;c--)a.replaceRange("",b[c].anchor,d(b[c].to().line),"+delete");a.scrollIntoView()})},c[m[e+"U"]="upcaseAtCursor"]=function(a){n(a,function(a){return a.toUpperCase()})},c[m[e+"L"]="downcaseAtCursor"]=function(a){n(a,function(a){return a.toLowerCase()})},c[m[e+"Space"]="setSublimeMark"]=function(a){a.state.sublimeMark&&a.state.sublimeMark.clear(),a.state.sublimeMark=a.setBookmark(a.getCursor())},c[m[e+"A"]="selectToSublimeMark"]=function(a){var b=a.state.sublimeMark&&a.state.sublimeMark.find();b&&a.setSelection(a.getCursor(),b)},c[m[e+"W"]="deleteToSublimeMark"]=function(b){var c=b.state.sublimeMark&&b.state.sublimeMark.find();if(c){var d=b.getCursor(),e=c;if(a.cmpPos(d,e)>0){var f=e;e=d,d=f}b.state.sublimeKilled=b.getRange(d,e),b.replaceRange("",d,e)}},c[m[e+"X"]="swapWithSublimeMark"]=function(a){var b=a.state.sublimeMark&&a.state.sublimeMark.find();b&&(a.state.sublimeMark.clear(),a.state.sublimeMark=a.setBookmark(a.getCursor()),a.setCursor(b))},c[m[e+"Y"]="sublimeYank"]=function(a){null!=a.state.sublimeKilled&&a.replaceSelection(a.state.sublimeKilled,null,"paste")},m[e+"G"]="clearBookmarks",c[m[e+"C"]="showInCenter"]=function(a){var b=a.cursorCoords(null,"local");a.scrollTo(null,(b.top+b.bottom)/2-a.getScrollInfo().clientHeight/2)},c[b["Shift-Alt-Up"]="selectLinesUpward"]=function(a){a.action(function(){for(var b=a.listSelections(),c=0;ca.firstLine()&&a.addSelection(d(e.head.line-1,e.head.ch))}})},c[b["Shift-Alt-Down"]="selectLinesDownward"]=function(a){a.action(function(){for(var b=a.listSelections(),c=0;c"],type:"keyToKey",toKeys:["h"]},{keys:[""],type:"keyToKey",toKeys:["l"]},{keys:[""],type:"keyToKey",toKeys:["k"]},{keys:[""],type:"keyToKey",toKeys:["j"]},{keys:[""],type:"keyToKey",toKeys:["l"]},{keys:[""],type:"keyToKey",toKeys:["h"]},{keys:[""],type:"keyToKey",toKeys:["W"]},{keys:[""],type:"keyToKey",toKeys:["B"]},{keys:[""],type:"keyToKey",toKeys:["w"]},{keys:[""],type:"keyToKey",toKeys:["b"]},{keys:[""],type:"keyToKey",toKeys:["j"]},{keys:[""],type:"keyToKey",toKeys:["k"]},{keys:[""],type:"keyToKey",toKeys:[""]},{keys:[""],type:"keyToKey",toKeys:[""]},{keys:["s"],type:"keyToKey",toKeys:["c","l"],context:"normal"},{keys:["s"],type:"keyToKey",toKeys:["x","i"],context:"visual"},{keys:["S"],type:"keyToKey",toKeys:["c","c"],context:"normal"},{keys:["S"],type:"keyToKey",toKeys:["d","c","c"],context:"visual"},{keys:[""],type:"keyToKey",toKeys:["0"]},{keys:[""],type:"keyToKey",toKeys:["$"]},{keys:[""],type:"keyToKey",toKeys:[""]},{keys:[""],type:"keyToKey",toKeys:[""]},{keys:[""],type:"keyToKey",toKeys:["j","^"],context:"normal"},{keys:["H"],type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:["M"],type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:["L"],type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:["h"],type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:["l"],type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:["j"],type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:["k"],type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:["g","j"],type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:["g","k"],type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:["w"],type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:["W"],type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:["e"],type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:["E"],type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:["b"],type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:["B"],type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:["g","e"],type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:["g","E"],type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:["{"],type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:["}"],type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:[""],type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:[""],type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:[""],type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:[""],type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:["g","g"],type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:["G"],type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:["0"],type:"motion",motion:"moveToStartOfLine"},{keys:["^"],type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:["+"],type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:["-"],type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:["_"],type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:["$"],type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:["%"],type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:["f","character"],type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:["F","character"],type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:["t","character"],type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:["T","character"],type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:[";"],type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:[","],type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:["'","character"],type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:["`","character"],type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:["]","`"],type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:["[","`"],type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:["]","'"],type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:["[","'"],type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:["]","p"],type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:["[","p"],type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:["]","character"],type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:["[","character"],type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:["|"],type:"motion",motion:"moveToColumn",motionArgs:{}},{keys:["o"],type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{},context:"visual"},{keys:["d"],type:"operator",operator:"delete"},{keys:["y"],type:"operator",operator:"yank"},{keys:["c"],type:"operator",operator:"change"},{keys:[">"],type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:["<"],type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:["g","~"],type:"operator",operator:"swapcase"},{keys:["n"],type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:["N"],type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:["x"],type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:["X"],type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:["D"],type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},operatorMotionArgs:{visualLine:!0}},{keys:["Y"],type:"operatorMotion",operator:"yank",motion:"moveToEol",motionArgs:{inclusive:!0},operatorMotionArgs:{visualLine:!0}},{keys:["C"],type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},operatorMotionArgs:{visualLine:!0}},{keys:["~"],type:"operatorMotion",operator:"swapcase",operatorArgs:{shouldMoveCursor:!0},motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:[""],type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:[""],type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:[""],type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:[""],type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:["a"],type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"}},{keys:["A"],type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"}},{keys:["i"],type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"}},{keys:["I"],type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"}},{keys:["o"],type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0}},{keys:["O"],type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1}},{keys:["v"],type:"action",action:"toggleVisualMode"},{keys:["V"],type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:["g","v"],type:"action",action:"reselectLastSelection"},{keys:["J"],type:"action",action:"joinLines",isEdit:!0},{keys:["p"],type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:["P"],type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:["r","character"],type:"action",action:"replace",isEdit:!0},{keys:["@","character"],type:"action",action:"replayMacro"},{keys:["q","character"],type:"action",action:"enterMacroRecordMode"},{keys:["R"],type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0}},{keys:["u"],type:"action",action:"undo"},{keys:[""],type:"action",action:"redo"},{keys:["m","character"],type:"action",action:"setMark"},{keys:['"',"character"],type:"action",action:"setRegister"},{keys:["z","z"],type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:["z","."],type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:["z","t"],type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:["z",""],type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:["z","-"],type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:["z","b"],type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:["."],type:"action",action:"repeatLastEdit"},{keys:[""],type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:[""],type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:["a","character"],type:"motion",motion:"textObjectManipulation"},{keys:["i","character"],type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:["/"],type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:["?"],type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:["*"],type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:["#"],type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:["g","*"],type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:["g","#"],type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:[":"],type:"ex"}],c=a.Pos,d=function(){function e(a,b){var d=a.state.vim;if(!d.insertMode&&!d.exMode){var e=b.ranges[0].head,f=b.ranges[0].anchor;if(e.ch&&e.ch==a.doc.getLine(e.line).length){var g=c(e.line,e.ch-1);b.update([{anchor:W(e,f)?g:f,head:g}])}}}function f(a){var b=a.state.vim;return b.onPasteFn||(b.onPasteFn=function(){b.insertMode||(a.setCursor(S(a.getCursor(),0,1)),P.enterInsertMode(a,{},b))}),b.onPasteFn}function j(a,b){for(var c=[],d=a;a+b>d;d++)c.push(String.fromCharCode(d)); return c}function r(a,b){return b>=a.firstLine()&&b<=a.lastLine()}function s(a){return/^[a-z]$/.test(a)}function t(a){return-1!="()[]{}".indexOf(a)}function u(a){return g.test(a)}function v(a){return/^[A-Z]$/.test(a)}function w(a){return/^\s*$/.test(a)}function x(a,b){for(var c=0;cd;d++)b(a)}}function V(a){return c(a.line,a.ch)}function W(a,b){return a.ch==b.ch&&a.line==b.line}function X(a,b){return a.line"].find(),visualMode:c.visualMode,visualLine:c.visualLine},c.visualMode=!1,c.visualLine=!1;var d=b.getCursor("anchor"),e=b.getCursor("head");W(d,e)||b.setCursor(Q(b,e)),a.signal(b,"vim-mode-change",{mode:"normal"})}function cb(a,b,c){var d=a.getRange(b,c);if(/\n\s*$/.test(d)){var e=d.split("\n");e.pop();for(var f,f=e.pop();e.length>0&&f&&w(f);f=e.pop())c.line--,c.ch=0;f?(c.line--,c.ch=Z(a,c.line)):c.ch=0}}function db(a,b,c){b.ch=0,c.ch=0,c.line++}function eb(a){if(!a)return 0;var b=a.search(/\S/);return-1==b?a.length:b}function fb(a,b,d,e,f){var k,g=a.getCursor(),h=a.getLine(g.line),i=g.ch,j=h.substring(i);if(k=f?j.search(/\w/):j.search(/\S/),-1==k)return null;i+=k,j=h.substring(i);var m,l=h.substring(0,i);m=e?/^\S+/:/\w/.test(h.charAt(i))?/^\w+/:/^[^\w\s]+/;var n=m.exec(j),o=i,p=i+n[0].length,q=$(l),r=m.exec(q);if(r&&(o-=r[0].length),b){var s=h.substring(p),t=s.match(/^\s*/)[0].length;if(t>0)p+=t;else{var u=q.length-o,v=q.substring(u),w=v.match(/^\s*/)[0].length;o-=w}}return{start:c(g.line,o),end:c(g.line,p)}}function gb(a,b,c){W(b,c)||G.jumpList.add(a,b,c)}function hb(a,b){G.lastChararacterSearch.increment=a,G.lastChararacterSearch.forward=b.forward,G.lastChararacterSearch.selectedCharacter=b.selectedCharacter}function kb(a,b,d,e){var f=V(a.getCursor()),g=d?1:-1,h=d?a.lineCount():-1,i=f.ch,j=f.line,k=a.getLine(j),l={lineText:k,nextCh:k.charAt(i),lastCh:null,index:i,symb:e,reverseSymb:(d?{")":"(","}":"{"}:{"(":")","{":"}"})[e],forward:d,depth:0,curMoveThrough:!1},m=ib[e];if(!m)return f;var n=jb[m].init,o=jb[m].isComplete;for(n&&n(l);j!==h&&b;){if(l.index+=g,l.nextCh=l.lineText.charAt(l.index),!l.nextCh){if(j+=g,l.lineText=a.getLine(j)||"",g>0)l.index=0;else{var p=l.lineText.length;l.index=p>0?p-1:0}l.nextCh=l.lineText.charAt(l.index)}o(l)&&(f.line=j,f.ch=l.index,b--)}return l.nextCh||l.curMoveThrough?c(j,l.index):f}function lb(a,b,c,d,e){var f=b.line,g=b.ch,j=a.getLine(f),k=c?1:-1,l=d?i:h;if(e&&""==j){if(f+=k,j=a.getLine(f),!r(a,f))return null;g=c?0:j.length}for(;;){if(e&&""==j)return{from:0,to:0,line:f};for(var m=k>0?j.length:-1,n=m,o=m;g!=m;){for(var p=!1,q=0;q0?0:j.length}throw new Error("The impossible happened.")}function mb(a,b,d,e,f){var g=a.getCursor(),h=V(g),i=[];(d&&!e||!d&&e)&&b++;for(var j=!(d&&e),k=0;b>k;k++){var l=lb(a,g,d,f,j);if(!l){var m=Z(a,a.lastLine());i.push(d?{line:a.lastLine(),from:m,to:m}:{line:0,from:0,to:0});break}i.push(l),g=c(l.line,d?l.to-1:l.from)}var n=i.length!=b,o=i[0],p=i.pop();return d&&!e?(n||o.from==h.ch&&o.line==h.line||(p=i.pop()),c(p.line,p.from)):d&&e?c(p.line,p.to-1):!d&&e?(n||o.to==h.ch&&o.line==h.line||(p=i.pop()),c(p.line,p.to)):c(p.line,p.from)}function nb(a,b,d,e){for(var h,f=a.getCursor(),g=f.ch,i=0;b>i;i++){var j=a.getLine(f.line);if(h=qb(g,j,e,d,!0),-1==h)return null;g=h}return c(a.getCursor().line,h)}function ob(a,b){var d=a.getCursor().line;return Q(a,c(d,b-1))}function pb(a,b,c,d){x(c,p)&&(b.marks[c]&&b.marks[c].clear(),b.marks[c]=a.setBookmark(d))}function qb(a,b,c,d,e){var f;return d?(f=b.indexOf(c,a+1),-1==f||e||(f-=1)):(f=b.lastIndexOf(c,a-1),-1==f||e||(f+=1)),f}function rb(a,b,d){var f,g,e=a.getCursor(),h={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[b],i={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[b],j=a.getLine(e.line).charAt(e.ch),k=j===i?1:0;if(f=a.scanForBracket(c(e.line,e.ch+k),-1,null,{bracketRegex:h}),g=a.scanForBracket(c(e.line,e.ch+k),1,null,{bracketRegex:h}),!f||!g)return{start:e,end:e};if(f=f.pos,g=g.pos,f.line==g.line&&f.ch>g.ch||f.line>g.line){var l=f;f=g,g=l}return d?g.ch+=1:f.ch+=1,{start:f,end:g}}function sb(a,b,d){var h,i,j,k,e=V(a.getCursor()),f=a.getLine(e.line),g=f.split(""),l=g.indexOf(b);if(e.ch-1&&!h;j--)g[j]==b&&(h=j+1);else h=e.ch+1;if(h&&!i)for(j=h,k=g.length;k>j&&!i;j++)g[j]==b&&(i=j);return h&&i?(d&&(--h,++i),{start:c(e.line,h),end:c(e.line,i)}):{start:e,end:e}}function tb(){}function ub(a){var b=a.state.vim;return b.searchState_||(b.searchState_=new tb)}function vb(a,b,c,d,e){a.openDialog?a.openDialog(b,d,{bottom:!0,value:e.value,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp}):d(prompt(c,""))}function wb(a){for(var b=!1,c=[],d=0;d'+b+"",{bottom:!0,duration:5e3}):alert(b)}function Cb(a,b){var c="";return a&&(c+=''+a+""),c+=' ',b&&(c+='',c+=b,c+=""),c}function Eb(a,b){var c=(b.prefix||"")+" "+(b.desc||""),d=Cb(b.prefix,b.desc);vb(a,d,c,b.onClose,b)}function Fb(a,b){if(a instanceof RegExp&&b instanceof RegExp){for(var c=["global","multiline","ignoreCase","source"],d=0;dh;h++){var i=g.find(b);if(0==h&&i&&W(g.from(),f)&&(i=g.find(b)),!i&&(g=a.getSearchCursor(d,b?c(a.lastLine()):c(a.firstLine(),0)),!g.find(b)))return}return g.from()})}function Kb(a){a.removeOverlay(ub(a).getOverlay()),ub(a).setOverlay(null)}function Lb(a,b,c){return"number"!=typeof a&&(a=a.line),b instanceof Array?x(a,b):c?a>=b&&c>=a:a==b}function Mb(a){var b=a.getScrollInfo(),c=6,d=10,e=a.coordsChar({left:0,top:c+b.top},"local"),f=b.clientHeight-d+b.top,g=a.coordsChar({left:0,top:f},"local");return{top:e.line,bottom:g.line}}function Ob(a){for(var b,c,d=[];a&&(c=/<\w+-.+?>|<\w+>|./.exec(a),null!==c);)b=c[0],a=a.substring(c.index+b.length),d.push(b);return d}function Rb(b,c,d,e,f,g,h){function k(){b.action(function(){for(;!i;)l(),m();n()})}function l(){var a=b.getRange(f.from(),f.to()),c=a.replace(g,h);f.replace(c)}function m(){var a=f.findNext();a?Lb(f.from(),d,e)?(b.scrollIntoView(f.from(),30),b.setSelection(f.from(),f.to()),j=f.from(),i=!1):i=!0:i=!0}function n(a){if(a&&a(),b.focus(),j){b.setCursor(j);var c=b.state.vim;c.exMode=!1,c.lastHPos=c.lastHSPos=j.ch}}function o(c,d,e){a.e_stop(c);var f=a.keyName(c);switch(f){case"Y":l(),m();break;case"N":m();break;case"A":b.action(k);break;case"L":l();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":n(e)}i&&n(e)}b.state.vim.exMode=!0;var i=!1,j=f.from();return m(),i?(Bb(b,"No matches for "+g.source),void 0):c?(Eb(b,{prefix:"replace with "+h+" (y/n/a/q/l)",onKeyDown:o}),void 0):(k(),void 0)}function Sb(){function b(a,b){var c=a;v(c)&&"Ctrl"==b&&(c=c.toLowerCase()),b&&(c=b.charAt(0)+"-"+c);var d={Enter:"CR",Backspace:"BS",Delete:"Del"}[c];return c=d?d:c,c=c.length>1?"<"+c+">":c}function c(b){return function(c){a.Vim.handleKey(c,b)}}function e(a,e){for(var f=0;f1&&(ac(b,c,c.insertModeRepeat-1,!0),c.lastEditInputState.repeatOverride=c.insertModeRepeat),delete c.insertModeRepeat,c.insertMode=!1,b.setCursor(b.getCursor().line,b.getCursor().ch-1),b.setOption("keyMap","vim"),b.setOption("disableInput",!0),b.toggleOverwrite(!1),e.setText(d.lastInsertModeChanges.changes.join("")),a.signal(b,"vim-mode-change",{mode:"normal"}),d.isRecording&&Wb(d)}function Ub(b,c,d,e){var f=G.registerController.getRegister(e),g=f.keyBuffer,h=0;d.isPlaying=!0,d.replaySearchQueries=f.searchQueries.slice(0);for(var i=0;i|<\w+>|./.exec(j),l=k[0],j=j.substring(k.index+l.length),a.Vim.handleKey(b,l),c.insertMode&&(bc(b,f.insertModeChanges[h++].changes,1),Tb(b));d.isPlaying=!1}function Vb(a,b){if(!a.isPlaying){var c=a.latestRegister,d=G.registerController.getRegister(c);d&&d.pushText(b)}}function Wb(a){if(!a.isPlaying){var b=a.latestRegister,c=G.registerController.getRegister(b);c&&c.pushInsertModeChanges(a.lastInsertModeChanges)}}function Xb(a,b){if(!a.isPlaying){var c=a.latestRegister,d=G.registerController.getRegister(c);d&&d.pushSearchQuery(b)}}function Yb(a,b){var c=G.macroModeState,d=c.lastInsertModeChanges;if(!c.isPlaying)for(;b;){if(d.expectCursorActivityForChange=!0,"+input"==b.origin||"paste"==b.origin||void 0===b.origin){var e=b.text.join("\n");d.changes.push(e)}b=b.next}}function Zb(a,b){var c=a.state.vim;if(c.insertMode){var d=G.macroModeState;if(d.isPlaying)return;var e=d.lastInsertModeChanges;e.expectCursorActivityForChange?e.expectCursorActivityForChange=!1:e.changes=[]}else"*mouse"==b&&(c.lastHPos=a.doc.getCursor().ch)}function $b(a){this.keyName=a}function _b(b){function f(){return d.changes.push(new $b(e)),!0}var c=G.macroModeState,d=c.lastInsertModeChanges,e=a.keyName(b);(-1!=e.indexOf("Delete")||-1!=e.indexOf("Backspace"))&&a.lookupKey(e,["vim-insert"],f)}function ac(a,b,c,d){function h(){f?M.processAction(a,b,b.lastEditActionCommand):M.evalInput(a,b)}function i(c){if(e.lastInsertModeChanges.changes.length>0){c=b.lastEditActionCommand?c:1;var d=e.lastInsertModeChanges;e.lastInsertModeChanges={},bc(a,d.changes,c),e.lastInsertModeChanges=d}}var e=G.macroModeState;e.isPlaying=!0;var f=!!b.lastEditActionCommand,g=b.inputState;if(b.inputState=b.lastEditInputState,f&&b.lastEditActionCommand.interlaceInsertRepeat)for(var j=0;c>j;j++)h(),i(1);else d||h(),i(c);b.inputState=g,b.insertMode&&!d&&Tb(a),e.isPlaying=!1}function bc(b,c,d){function e(c){return"string"==typeof c?a.commands[c](b):c(b),!0}for(var f=0;d>f;f++)for(var g=0;g:;\"'".split(""),o=["Left","Right","Up","Down","Space","Backspace","Esc","Home","End","PageUp","PageDown","Enter"],p=[].concat(k,l,m,["<",">"]),q=[].concat(k,l,m,["-",'"',".",":"]),y={},C=function(){function f(f,g,h){function k(c){var d=++b%a,g=e[d];g&&g.clear(),e[d]=f.setBookmark(c)}var i=b%a,j=e[i];if(j){var l=j.find();l&&!W(l,g)&&k(g)}else k(g);k(h),c=b,d=b-a+1,0>d&&(d=0)}function g(f,g){b+=g,b>c?b=c:d>b&&(b=d);var h=e[(a+b)%a];if(h&&!h.find()){var j,i=g>0?1:-1,k=f.getCursor();do if(b+=i,h=e[(a+b)%a],h&&(j=h.find())&&!W(k,j))break;while(c>b&&b>d)}return h}var a=100,b=-1,c=0,d=0,e=new Array(a);return{cachedCursor:void 0,add:f,move:g}},D=function(a){return a?{changes:a.changes,expectCursorActivityForChange:a.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};E.prototype={exitMacroRecordMode:function(){var a=G.macroModeState;a.onRecordingDone(),a.onRecordingDone=void 0,a.isRecording=!1},enterMacroRecordMode:function(a,b){var c=G.registerController.getRegister(b);c&&(c.clear(),this.latestRegister=b,this.onRecordingDone=a.openDialog("(recording)["+b+"]",null,{bottom:!0}),this.isRecording=!0)}};var G,I={buildKeyMap:function(){},getRegisterController:function(){return G.registerController},resetVimGlobalState_:H,getVimGlobalState_:function(){return G},maybeInitVimState_:F,InsertModeKey:$b,map:function(a,b,c){Qb.map(a,b,c)},setOption:A,getOption:B,defineOption:z,defineEx:function(a,b,c){if(0!==a.indexOf(b))throw new Error('(Vim.defineEx) "'+b+'" is not a prefix of "'+a+'", command not registered');Pb[a]=c,Qb.commandMap_[b]={name:a,shortName:b,type:"api"}},handleKey:function(c,d){var e,f=F(c),g=G.macroModeState;if(g.isRecording&&"q"==d)return g.exitMacroRecordMode(),f.inputState=new J,void 0;if(""==d)return f.inputState=new J,f.visualMode&&bb(c),void 0;if(f.visualMode||W(c.getCursor("head"),c.getCursor("anchor"))||(f.visualMode=!0,f.visualLine=!1,a.signal(c,"vim-mode-change",{mode:"visual"}),c.on("mousedown",bb)),("0"!=d||"0"==d&&0===f.inputState.getRepeat())&&(e=M.matchCommand(d,b,f)),!e)return u(d)&&f.inputState.pushRepeatDigit(d),g.isRecording&&Vb(g,d),void 0;if("keyToKey"==e.type)for(var h=0;h0||this.motionRepeat.length>0)&&(a=1,this.prefixRepeat.length>0&&(a*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(a*=parseInt(this.motionRepeat.join(""),10))),a},K.prototype={setText:function(a,b){this.keyBuffer=[a||""],this.linewise=!!b},pushText:function(a,b){b&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(a)},pushInsertModeChanges:function(a){this.insertModeChanges.push(D(a))},pushSearchQuery:function(a){this.searchQueries.push(a)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},L.prototype={pushText:function(a,b,c,d){d&&"\n"==c.charAt(0)&&(c=c.slice(1)+"\n"),d&&"\n"!==c.charAt(c.length-1)&&(c+="\n");var e=this.isValidRegister(a)?this.getRegister(a):null;if(!e){switch(b){case"yank":this.registers["0"]=new K(c,d);break;case"delete":case"change":-1==c.indexOf("\n")?this.registers["-"]=new K(c,d):(this.shiftNumericRegisters_(),this.registers["1"]=new K(c,d))}return this.unnamedRegister.setText(c,d),void 0}var f=v(a);f?e.pushText(c,d):e.setText(c,d),this.unnamedRegister.setText(e.toString(),d)},getRegister:function(a){return this.isValidRegister(a)?(a=a.toLowerCase(),this.registers[a]||(this.registers[a]=new K),this.registers[a]):this.unnamedRegister},isValidRegister:function(a){return a&&x(a,q)},shiftNumericRegisters_:function(){for(var a=9;a>=2;a--)this.registers[a]=this.getRegister(""+(a-1))}};var M={matchCommand:function(a,b,c){function j(b){return e.length1))switch(g){case"":g="\n";break;case"":g=" ";break;default:continue}f.push(i)}}if(f.length){if(1==f.length)return j(f[0]);for(var l,k=c.visualMode?"visual":"normal",h=0;h",onKeyDown:f}):Eb(b,{onClose:e,prefix:":",onKeyDown:f})},evalInput:function(a,b){var n,o,d=b.inputState,e=d.motion,f=d.motionArgs||{},g=d.operator,h=d.operatorArgs||{},i=d.registerName,j=V(a.getCursor("head")),k=V(a.getCursor("anchor")),l=V(j),m=V(l);if(g&&this.recordLastEdit(b,d),o=void 0!==d.repeatOverride?d.repeatOverride:d.getRepeat(),o>0&&f.explicitRepeat?f.repeatIsExplicit=!0:(f.noRepeat||!f.explicitRepeat&&0===o)&&(o=1,f.repeatIsExplicit=!1),d.selectedCharacter&&(f.selectedCharacter=h.selectedCharacter=d.selectedCharacter),f.repeat=o,b.inputState=new J,e){var p=N[e](a,f,b);if(b.lastMotion=N[e],!p)return;if(f.toJumplist){var q=G.jumpList,r=q.cachedCursor;r?(gb(a,r,p),delete q.cachedCursor):gb(a,m,p)}if(p instanceof Array?(l=p[0],n=p[1]):n=p,n||(n=c(l.line,l.ch)),b.visualMode){if(X(k,j)&&(W(k,n)||X(n,k))?k.ch+=1:X(j,k)&&(W(k,n)||X(k,n))&&(k.ch-=1),j=n,k=p instanceof Array?l:k,b.visualLine)if(X(k,j)){k.ch=0;var s=a.lastLine();j.line>s&&(j.line=s),j.ch=Z(a,j.line)}else j.ch=0,k.ch=Z(a,k.line);a.setSelection(k,j),pb(a,b,"<",X(k,j)?k:j),pb(a,b,">",X(k,j)?j:k)}else g||(n=Q(a,n),a.setCursor(n.line,n.ch))}if(g){var t=!1;if(b.lastMotion=null,h.repeat=o,b.visualMode&&(l=k,n=j,f.inclusive=!0),X(n,l)){var u=l;l=n,n=u,t=!0}!f.inclusive||b.visualMode&&t||n.ch++;var v=f.linewise||b.visualMode&&b.visualLine;v?db(a,l,n):f.forward&&cb(a,l,n),h.registerName=i,h.linewise=v,O[g](a,h,b,l,n,m),b.visualMode&&bb(a)}},recordLastEdit:function(a,b,c){var d=G.macroModeState;d.isPlaying||(a.lastEditInputState=b,a.lastEditActionCommand=c,d.lastInsertModeChanges.changes=[],d.lastInsertModeChanges.expectCursorActivityForChange=!1)}},N={moveToTopLine:function(a,b){var d=Mb(a).top+b.repeat-1;return c(d,eb(a.getLine(d)))},moveToMiddleLine:function(a){var b=Mb(a),d=Math.floor(.5*(b.top+b.bottom));return c(d,eb(a.getLine(d)))},moveToBottomLine:function(a,b){var d=Mb(a).bottom-b.repeat+1;return c(d,eb(a.getLine(d)))},expandToLine:function(a,b){var d=a.getCursor();return c(d.line+b.repeat-1,1/0)},findNext:function(a,b){var c=ub(a),d=c.getQuery();if(d){var e=!b.forward;return e=c.isReversed()?!e:e,Ib(a,d),Jb(a,e,d,b.repeat)}},goToMark:function(a,b,c){var d=c.marks[b.selectedCharacter];if(d){var e=d.find();return b.linewise?{line:e.line,ch:eb(a.getLine(e.line))}:e}return null},moveToOtherHighlightedEnd:function(a){var b=V(a.getCursor("head")),c=V(a.getCursor("anchor"));return X(c,b)?b.ch+=1:X(b,c)&&(c.ch-=1),[b,c]},jumpToMark:function(a,b,d){for(var e=a.getCursor(),f=0;fh&&e.line==i||h>j&&e.line==j?void 0:(b.toFirstChar&&(f=eb(a.getLine(h)),d.lastHPos=f),d.lastHSPos=a.charCoords(c(h,f),"div").left,c(h,f))},moveByDisplayLines:function(a,b,d){var e=a.getCursor();switch(d.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:d.lastHSPos=a.charCoords(e,"div").left}var f=b.repeat,g=a.findPosV(e,b.forward?f:-f,"line",d.lastHSPos);if(g.hitSide)if(b.forward)var h=a.charCoords(g,"div"),i={top:h.top+8,left:d.lastHSPos},g=a.coordsChar(i,"div");else{var j=a.charCoords(c(a.firstLine(),0),"div");j.left=d.lastHSPos,g=a.coordsChar(j,"div")}return d.lastHPos=g.ch,g},moveByPage:function(a,b){var c=a.getCursor(),d=b.repeat;a.moveV(b.forward?d:-d,"page");var e=a.getCursor();return a.setCursor(c),e},moveByParagraph:function(a,b){for(var d=a.getCursor().line,e=b.repeat,f=b.forward?1:-1,g=0;e>g&&!(!b.forward&&d===a.firstLine()||b.forward&&d==a.lastLine());g++)for(d+=f;d!==a.firstLine()&&d!=a.lastLine()&&a.getLine(d);)d+=f;return c(d,0)},moveByScroll:function(a,b,c){var d=a.getScrollInfo(),e=null,f=b.repeat;f||(f=d.clientHeight/(2*a.defaultTextHeight()));var g=a.charCoords(a.getCursor(),"local");b.repeat=f;var e=N.moveByDisplayLines(a,b,c);if(!e)return null;var h=a.charCoords(e,"local");return a.scrollTo(null,d.top+h.top-g.top),e},moveByWords:function(a,b){return mb(a,b.repeat,!!b.forward,!!b.wordEnd,!!b.bigWord)},moveTillCharacter:function(a,b){var c=b.repeat,d=nb(a,c,b.forward,b.selectedCharacter),e=b.forward?-1:1;return hb(e,b),d?(d.ch+=e,d):null},moveToCharacter:function(a,b){var c=b.repeat;return hb(0,b),nb(a,c,b.forward,b.selectedCharacter)||a.getCursor()},moveToSymbol:function(a,b){var c=b.repeat;return kb(a,c,b.forward,b.selectedCharacter)||a.getCursor()},moveToColumn:function(a,b,c){var d=b.repeat;return c.lastHPos=d-1,c.lastHSPos=a.charCoords(a.getCursor(),"div").left,ob(a,d)},moveToEol:function(a,b,d){var e=a.getCursor();d.lastHPos=1/0;var f=c(e.line+b.repeat-1,1/0),g=a.clipPos(f);return g.ch--,d.lastHSPos=a.charCoords(g,"div").left,f},moveToFirstNonWhiteSpaceCharacter:function(a){var b=a.getCursor();return c(b.line,eb(a.getLine(b.line)))},moveToMatchedSymbol:function(a){var g,b=a.getCursor(),d=b.line,e=b.ch,f=a.getLine(d);do if(g=f.charAt(e++),g&&t(g)){var h=["string","comment"],i=a.getTokenTypeAt(c(d,e));if(h.indexOf(i)<0)break}while(g);if(g){var j=a.findMatchingBracket(c(d,e-1));return j.to}return b},moveToStartOfLine:function(a){var b=a.getCursor();return c(b.line,0)},moveToLineOrEdgeOfDocument:function(a,b){var d=b.forward?a.lastLine():a.firstLine();return b.repeatIsExplicit&&(d=b.repeat-a.getOption("firstLineNumber")),c(d,eb(a.getLine(d)))},textObjectManipulation:function(a,b){var c={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},d={"'":!0,'"':!0},e=b.selectedCharacter;"b"==e?e="(":"B"==e&&(e="{");var g,f=!b.textObjectInner;if(c[e])g=rb(a,e,f);else if(d[e])g=sb(a,e,f);else if("W"===e)g=fb(a,f,!0,!0);else{if("w"!==e)return null;g=fb(a,f,!0,!1)}return[g.start,g.end]},repeatLastCharacterSearch:function(a,b){var c=G.lastChararacterSearch,d=b.repeat,e=b.forward===c.forward,f=(c.increment?1:0)*(e?-1:1);a.moveH(-f,"char"),b.inclusive=e?!0:!1;var g=nb(a,d,e,c.selectedCharacter);return g?(g.ch+=f,g):(a.moveH(f,"char"),a.getCursor())}},O={change:function(a,b,c,d,e){if(G.registerController.pushText(b.registerName,"change",a.getRange(d,e),b.linewise),b.linewise){var f=e.line>a.lastLine()?"":"\n";a.replaceRange(f,d,e),a.indentLine(d.line,"smart"),d.ch=null}else{var g=a.getRange(d,e);if(!w(g)){var h=/\s+$/.exec(g);h&&(e=S(e,0,-h[0].length))}a.replaceRange("",d,e)}P.enterInsertMode(a,{},a.state.vim),a.setCursor(d)},"delete":function(a,b,c,d,e){b.linewise&&e.line>a.lastLine()&&d.line>a.firstLine()&&(d.line--,d.ch=Z(a,d.line)),G.registerController.pushText(b.registerName,"delete",a.getRange(d,e),b.linewise),a.replaceRange("",d,e),b.linewise?a.setCursor(N.moveToFirstNonWhiteSpaceCharacter(a)):a.setCursor(d)},indent:function(a,b,c,d,e){var f=d.line,g=e.line,h=c.visualMode?b.repeat:1;b.linewise&&g--;for(var i=f;g>=i;i++)for(var j=0;h>j;j++)a.indentLine(i,b.indentRight);a.setCursor(d),a.setCursor(N.moveToFirstNonWhiteSpaceCharacter(a))},swapcase:function(a,b,c,d,e,f){for(var g=a.getRange(d,e),h="",i=0;ij.top?(i.line+=(h-j.top)/e,i.line=Math.ceil(i.line),a.setCursor(i),j=a.charCoords(i,"local"),a.scrollTo(null,j.top)):a.scrollTo(null,h);else{var k=h+a.getScrollInfo().clientHeight;k",X(g,h)?h:g)},reselectLastSelection:function(b,c,d){if(d.lastSelection){var e=d.lastSelection;b.setSelection(e.curStart,e.curEnd),e.visualLine?(d.visualMode=!0,d.visualLine=!0):(d.visualMode=!0,d.visualLine=!1),a.signal(b,"vim-mode-change",{mode:"visual",subMode:d.visualLine?"linewise":""})}},joinLines:function(a,b,d){var e,f;if(d.visualMode)e=a.getCursor("anchor"),f=a.getCursor("head"),f.ch=Z(a,f.line)-1;else{var g=Math.max(b.repeat,2);e=a.getCursor(),f=Q(a,c(e.line+g-1,1/0))}var h=0;a.action(function(){for(var b=e.line;bc)return"";if(a.options.indentWithTabs){var d=Math.floor(c/a.options.tabSize);return Array(d+1).join(" ")}return Array(c+1).join(" ")});f+=k?"\n":""}if(b.repeat>1)var f=Array(b.repeat+1).join(f);var m=e.linewise;m?b.after?(f="\n"+f.slice(0,f.length-1),d.ch=Z(a,d.line)):d.ch=0:d.ch+=b.after?1:0,a.replaceRange(f,d);var n,o;m&&b.after?n=c(d.line+1,eb(a.getLine(d.line+1))):m&&!b.after?n=c(d.line,eb(a.getLine(d.line))):!m&&b.after?(o=a.indexFromPos(d),n=a.posFromIndex(o+f.length-1)):(o=a.indexFromPos(d),n=a.posFromIndex(o+f.length)),a.setCursor(n)}},undo:function(b,c){b.action(function(){U(b,a.commands.undo,c.repeat)(),b.setCursor(b.getCursor("anchor"))})},redo:function(b,c){U(b,a.commands.redo,c.repeat)()},setRegister:function(a,b,c){c.inputState.registerName=b.selectedCharacter},setMark:function(a,b,c){var d=b.selectedCharacter;pb(a,c,d,a.getCursor())},replace:function(b,d,e){var h,i,f=d.selectedCharacter,g=b.getCursor();if(e.visualMode)g=b.getCursor("start"),i=b.getCursor("end"),i=b.clipPos(c(i.line,i.ch+1));else{var j=b.getLine(g.line);h=g.ch+d.repeat,h>j.length&&(h=j.length),i=c(g.line,h)}if("\n"==f)e.visualMode||b.replaceRange("",g,i),(a.commands.newlineAndIndentContinueComment||a.commands.newlineAndIndent)(b);else{var k=b.getRange(g,i);k=k.replace(/[^\n]/g,f),b.replaceRange(k,g,i),e.visualMode?(b.setCursor(g),bb(b)):b.setCursor(S(i,0,-1))}},incrementNumberToken:function(a,b){for(var g,h,i,j,k,d=a.getCursor(),e=a.getLine(d.line),f=/-?\d+/g;null!==(g=f.exec(e))&&(k=g[0],h=g.index,i=h+k.length,!(d.ch=1)return!0}else a.nextCh===a.reverseSymb&&a.depth--;return!1}},section:{init:function(a){a.curMoveThrough=!0,a.symb=(a.forward?"]":"[")===a.symb?"{":"}"},isComplete:function(a){return 0===a.index&&a.nextCh===a.symb}},comment:{isComplete:function(a){var b="*"===a.lastCh&&"/"===a.nextCh;return a.lastCh=a.nextCh,b}},method:{init:function(a){a.symb="m"===a.symb?"{":"}",a.reverseSymb="{"===a.symb?"}":"{"},isComplete:function(a){return a.nextCh===a.symb?!0:!1}},preprocess:{init:function(a){a.index=0},isComplete:function(a){if("#"===a.nextCh){var b=a.lineText.match(/#(\w+)/)[1];if("endif"===b){if(a.forward&&0===a.depth)return!0;a.depth++}else if("if"===b){if(!a.forward&&0===a.depth)return!0;a.depth--}if("else"===b&&0===a.depth)return!0}return!1}}};z("pcre",!0,"boolean"),tb.prototype={getQuery:function(){return G.query},setQuery:function(a){G.query=a},getOverlay:function(){return this.searchOverlay},setOverlay:function(a){this.searchOverlay=a},isReversed:function(){return G.isReversed},setReversed:function(a){G.isReversed=a}};var Db="(Javascript regexp)",Nb=[{name:"map"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"set"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s"},{name:"nohlsearch",shortName:"noh"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0}];d.ExCommandDispatcher=function(){this.buildCommandMap_()},d.ExCommandDispatcher.prototype={processCommand:function(b,c){var d=b.state.vim,e=G.registerController.getRegister(":"),f=e.toString();d.visualMode&&bb(b);var g=new a.StringStream(c);e.setText(c);var h={};h.input=c;try{this.parseInput_(b,g,h)}catch(i){throw Bb(b,i),i}var j;if(h.commandName){var k=this.matchCommand_(h.commandName);if(k){if(j=k.name,k.excludeFromCommandHistory&&e.setText(f),this.parseCommandArgs_(g,h,k),"exToKey"==k.type){for(var l=0;l0;b--){var c=a.substring(0,b);if(this.commandMap_[c]){var d=this.commandMap_[c];if(0===d.name.indexOf(a))return d}}return null},buildCommandMap_:function(){this.commandMap_={};for(var a=0;a
";if(c){var f;c=c.join("");for(var h=0;h"}}else for(var f in d){var g=d[f].toString();g.length&&(e+='"'+f+" "+g+"
")}Bb(a,e)},sort:function(b,d){function i(){if(d.argString){var b=new a.StringStream(d.argString);if(b.eat("!")&&(e=!0),b.eol())return;if(!b.eatSpace())return"Invalid arguments";var c=b.match(/[a-z]+/);if(c){c=c[0],f=-1!=c.indexOf("i"),g=-1!=c.indexOf("u");var i=-1!=c.indexOf("d")&&1,j=-1!=c.indexOf("x")&&1,k=-1!=c.indexOf("o")&&1;if(i+j+k>1)return"Invalid arguments";h=i&&"decimal"||j&&"hex"||k&&"octal"}b.eatSpace()&&b.match(/\/.*\//)}}function u(a,b){if(e){var c;c=a,a=b,b=c}f&&(a=a.toLowerCase(),b=b.toLowerCase());var d=h&&p.exec(a),g=h&&p.exec(b);return d?(d=parseInt((d[1]+d[2]).toLowerCase(),q),g=parseInt((g[1]+g[2]).toLowerCase(),q),d-g):b>a?-1:1}var e,f,g,h,j=i();if(j)return Bb(b,j+": "+d.argString),void 0;var k=d.line||b.firstLine(),l=d.lineEnd||d.line||b.lastLine();if(k!=l){var m=c(k,0),n=c(l,Z(b,l)),o=b.getRange(m,n).split("\n"),p="decimal"==h?/(-?)([\d]+)/:"hex"==h?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==h?/([0-7]+)/:null,q="decimal"==h?10:"hex"==h?16:"octal"==h?8:null,r=[],s=[];if(h)for(var t=0;t=k)return Bb(b,"Invalid argument: "+c.argString.substring(f)),void 0;for(var l=0;k-j>=l;l++){var m=String.fromCharCode(j+l);delete d.marks[m]}}else delete d.marks[g]}}},Qb=new d.ExCommandDispatcher;return a.keyMap.vim=Sb(),a.keyMap["vim-insert"]={Esc:Tb,"Ctrl-[":Tb,"Ctrl-C":Tb,"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(b){var c=a.commands.newlineAndIndentContinueComment||a.commands.newlineAndIndent;c(b)},fallthrough:["default"]},a.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"]},H(),I};a.Vim=d()});