text: /*! Editor.md v1.5.0 | addons.min.js | Open source online markdown editor. | MIT License | By: Pandao | https://github.com/pandao/editor.md | 2015-06-09 */
  ;!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){a.defineOption("showTrailingSpace",!1,function(c,b,d){d==a.Init&&(d=!1),d&&!b?c.removeOverlay("trailingspace"):!d&&b&&c.addOverlay({token:function(h){for(var g=h.string.length,f=g;f&&/\s/.test(h.string.charAt(f-1));--f){}return f>h.pos?(h.pos=f,null):(h.pos=g,"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(c){function b(h,f,d){var j,g=h.getWrapperElement();return j=g.appendChild(document.createElement("div")),d?j.className="CodeMirror-dialog CodeMirror-dialog-bottom":j.className="CodeMirror-dialog CodeMirror-dialog-top","string"==typeof f?j.innerHTML=f:j.appendChild(f),j}function a(f,d){f.state.currentNotificationClose&&f.state.currentNotificationClose(),f.state.currentNotificationClose=d}c.defineExtension("openDialog",function(f,e,g){function p(d){if("string"==typeof d){j.value=d}else{if(m){return}m=!0,i.parentNode.removeChild(i),k.focus(),g.onClose&&g.onClose(i)}}g||(g={}),a(this,null);var q,i=b(this,f,g.bottom),m=!1,k=this,j=i.getElementsByTagName("input")[0];return j?(g.value&&(j.value=g.value,j.select()),g.onInput&&c.on(j,"input",function(d){g.onInput(d,j.value,p)}),g.onKeyUp&&c.on(j,"keyup",function(d){g.onKeyUp(d,j.value,p)}),c.on(j,"keydown",function(d){g&&g.onKeyDown&&g.onKeyDown(d,j.value,p)||((27==d.keyCode||g.closeOnEnter!==!1&&13==d.keyCode)&&(j.blur(),c.e_stop(d),p()),13==d.keyCode&&e(j.value,d))}),g.closeOnBlur!==!1&&c.on(j,"blur",p),j.focus()):(q=i.getElementsByTagName("button")[0])&&(c.on(q,"click",function(){p(),k.focus()}),g.closeOnBlur!==!1&&c.on(q,"blur",p),q.focus()),p}),c.defineExtension("openConfirm",function(g,e,i){function t(){q||(q=!0,w.parentNode.removeChild(w),p.focus())}a(this,null);var w=b(this,g,i&&i.bottom),j=w.getElementsByTagName("button"),q=!1,p=this,k=1;j[0].focus();for(var v=0;v<j.length;++v){var m=j[v];!function(d){c.on(m,"click",function(f){c.e_preventDefault(f),t(),d&&d(p)})}(e[v]),c.on(m,"blur",function(){--k,setTimeout(function(){0>=k&&t()},200)}),c.on(m,"focus",function(){++k})}}),c.defineExtension("openNotification",function(h,g){function j(){d||(d=!0,clearTimeout(e),f.parentNode.removeChild(f))}a(this,j);var e,f=b(this,h,g&&g.bottom),d=!1,i=g&&"undefined"!=typeof g.duration?g.duration:5000;return c.on(f,"click",function(k){c.e_preventDefault(k),j()}),i&&(e=setTimeout(j,i)),j})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(c){function b(k,h,j,o){if(this.atOccurrence=!1,this.doc=k,null==o&&"string"==typeof h&&(o=!1),j=j?k.clipPos(j):d(0,0),this.pos={from:j,to:j},"string"!=typeof h){h.global||(h=new RegExp(h.source,h.ignoreCase?"ig":"g")),this.matches=function(q,u){if(q){h.lastIndex=0;for(var x,p,t=k.getLine(u.line).slice(0,u.ch),e=0;;){h.lastIndex=e;var w=h.exec(t);if(!w){break}if(x=w,p=x.index,e=x.index+(x[0].length||1),e==t.length){break}}var v=x&&x[0].length||0;v||(0==p&&0==t.length?x=void 0:p!=k.getLine(u.line).length&&v++)}else{h.lastIndex=u.ch;var t=k.getLine(u.line),x=h.exec(t),v=x&&x[0].length||0,p=x&&x.index;p+v==t.length||v||(v=1)}return x&&v?{from:d(u.line,p),to:d(u.line,p+v),match:x}:void 0}}else{var g=h;o&&(h=h.toLowerCase());var i=o?function(l){return l.toLowerCase()}:function(l){return l},f=h.split("\n");if(1==f.length){h.length?this.matches=function(p,t){if(p){var e=k.getLine(t.line).slice(0,t.ch),s=i(e),q=s.lastIndexOf(h);if(q>-1){return q=a(e,s,q),{from:d(t.line,q),to:d(t.line,q+g.length)}}}else{var e=k.getLine(t.line).slice(t.ch),s=i(e),q=s.indexOf(h);if(q>-1){return q=a(e,s,q)+t.ch,{from:d(t.line,q),to:d(t.line,q+g.length)}}}}:this.matches=function(){}}else{var m=g.split("\n");this.matches=function(y,p){var e=f.length-1;if(y){if(p.line-(f.length-1)<k.firstLine()){return}if(i(k.getLine(p.line).slice(0,m[e].length))!=f[f.length-1]){return}for(var l=d(p.line,m[e].length),w=p.line-1,v=e-1;v>=1;--v,--w){if(f[v]!=i(k.getLine(w))){return}}var q=k.getLine(w),x=q.length-m[0].length;if(i(q.slice(x))!=f[0]){return}return{from:d(w,x),to:l}}if(!(p.line+(f.length-1)>k.lastLine())){var q=k.getLine(p.line),x=q.length-m[0].length;if(i(q.slice(x))==f[0]){for(var s=d(p.line,x),w=p.line+1,v=1;e>v;++v,++w){if(f[v]!=i(k.getLine(w))){return}}if(i(k.getLine(w).slice(0,m[e].length))==f[e]){return{from:s,to:d(w,m[e].length)}}}}}}}}function a(j,g,f){if(j.length==g.length){return f}for(var k=Math.min(f,j.length);;){var h=j.slice(0,k).toLowerCase().length;if(f>h){++k}else{if(!(h>f)){return k}--k}}}var d=c.Pos;b.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(j){function g(l){var i=d(l,0);return f.pos={from:i,to:i},f.atOccurrence=!1,!1}for(var f=this,h=this.doc.clipPos(j?this.pos.from:this.pos.to);;){if(this.pos=this.matches(j,h)){return this.atOccurrence=!0,this.pos.match||!0}if(j){if(!h.line){return g(0)}h=d(h.line-1,this.doc.getLine(h.line-1).length)}else{var k=this.doc.lineCount();if(h.line==k-1){return g(k)}h=d(h.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(f){if(this.atOccurrence){var e=c.splitLines(f);this.doc.replaceRange(e,this.pos.from,this.pos.to),this.pos.to=d(this.pos.from.line+e.length-1,e[e.length-1].length+(1==e.length?this.pos.from.ch:0))}}},c.defineExtension("getSearchCursor",function(g,f,h){return new b(this.doc,g,f,h)}),c.defineDocExtension("getSearchCursor",function(g,f,h){return new b(this,g,f,h)}),c.defineExtension("selectMatches",function(f,e){for(var h,g=[],j=this.getSearchCursor(f,this.getCursor("from"),e);(h=j.findNext())&&!(c.cmpPos(j.to(),this.getCursor("to"))>0);){g.push({anchor:j.from(),head:j.to()})}g.length&&this.setSelections(g,0)})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],a):a(CodeMirror)}(function(B){function G(c,a){return"string"==typeof c?c=new RegExp(c.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),a?"gi":"g"):c.global||(c=new RegExp(c.source,c.ignoreCase?"gi":"g")),{token:function(e){c.lastIndex=e.pos;var d=c.exec(e.string);return d&&d.index==e.pos?(e.pos+=d[0].length,"searching"):void (d?e.pos=d.index:e.skipToEnd())}}}function x(){this.posFrom=this.posTo=this.query=null,this.overlay=null}function k(a){return a.state.search||(a.state.search=new x)}function b(a){return"string"==typeof a&&a==a.toLowerCase()}function q(d,c,a){return d.getSearchCursor(c,a,b(c))}function E(f,c,a,g,d){f.openDialog?f.openDialog(c,d,{value:g}):d(prompt(a,g))}function H(d,c,a,f){d.openConfirm?d.openConfirm(c,f):confirm(a)&&f[0]()}function w(d){var c=d.match(/^\/(.*)\/([a-z]*)$/);if(c){try{d=new RegExp(c[1],-1==c[2].indexOf("i")?"":"i")}catch(a){}}return("string"==typeof d?""==d:d.test(""))&&(d=/x^/),d}function D(c,a){var d=k(c);return d.query?C(c,a):void E(c,A,"Search for:",c.getSelection(),function(e){c.operation(function(){e&&!d.query&&(d.query=w(e),c.removeOverlay(d.overlay,b(d.query)),d.overlay=G(d.query,b(d.query)),c.addOverlay(d.overlay),c.showMatchesOnScrollbar&&(d.annotate&&(d.annotate.clear(),d.annotate=null),d.annotate=c.showMatchesOnScrollbar(d.query,b(d.query))),d.posFrom=d.posTo=c.getCursor(),C(c,a))})})}function C(c,a){c.operation(function(){var e=k(c),d=q(c,e.query,a?e.posFrom:e.posTo);(d.find(a)||(d=q(c,e.query,a?B.Pos(c.lastLine()):B.Pos(c.firstLine(),0)),d.find(a)))&&(c.setSelection(d.from(),d.to()),c.scrollIntoView({from:d.from(),to:d.to()}),e.posFrom=d.from(),e.posTo=d.to())})}function y(a){a.operation(function(){var c=k(a);c.query&&(c.query=null,a.removeOverlay(c.overlay),c.annotate&&(c.annotate.clear(),c.annotate=null))})}function F(c,a){c.getOption("readOnly")||E(c,z,"Replace:",c.getSelection(),function(d){d&&(d=w(d),E(c,j,"Replace with:","",function(h){if(a){c.operation(function(){for(var i=q(c,d);i.findNext();){if("string"!=typeof d){var l=c.getRange(i.from(),i.to()).match(d);i.replace(h.replace(/\$(\d)/g,function(n,m){return l[m]}))}else{i.replace(h)}}})}else{y(c);var g=q(c,d,c.getCursor()),f=function(){var i,l=g.from();!(i=g.findNext())&&(g=q(c,d),!(i=g.findNext())||l&&g.from().line==l.line&&g.from().ch==l.ch)||(c.setSelection(g.from(),g.to()),c.scrollIntoView({from:g.from(),to:g.to()}),H(c,v,"Replace?",[function(){e(i)},f]))},e=function(i){g.replace("string"==typeof d?h:h.replace(/\$(\d)/g,function(m,l){return i[l]})),f()};f()}}))})}var A='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',z='Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',j='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',v="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";B.commands.find=function(a){y(a),D(a)},B.commands.findNext=D,B.commands.findPrev=function(a){D(a,!0)},B.commands.clearSearch=y,B.commands.replace=F,B.commands.replaceAll=function(a){F(a,!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(b){function a(f,d){function c(h){clearTimeout(g.doRedraw),g.doRedraw=setTimeout(function(){g.redraw()},h)}this.cm=f,this.options=d,this.buttonHeight=d.scrollButtonHeight||f.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=f.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var g=this;f.on("refresh",this.resizeHandler=function(){clearTimeout(g.doUpdate),g.doUpdate=setTimeout(function(){g.computeScale()&&c(20)},100)}),f.on("markerAdded",this.resizeHandler),f.on("markerCleared",this.resizeHandler),d.listenForChanges!==!1&&f.on("change",this.changeHandler=function(){c(250)})}b.defineExtension("annotateScrollbar",function(c){return"string"==typeof c&&(c={className:c}),new a(this,c)}),b.defineOption("scrollButtonHeight",0),a.prototype.computeScale=function(){var d=this.cm,c=(d.getWrapperElement().clientHeight-d.display.barHeight-2*this.buttonHeight)/d.heightAtLine(d.lastLine()+1,"local");return c!=this.hScale?(this.hScale=c,!0):void 0},a.prototype.update=function(c){this.annotations=c,this.redraw()},a.prototype.redraw=function(q){q!==!1&&this.computeScale();var x=this.cm,m=this.hScale,g=document.createDocumentFragment(),f=this.annotations;if(x.display.barWidth){for(var j,w=0;w<f.length;w++){for(var y=f[w],k=j||x.charCoords(y.from,"local").top*m,v=x.charCoords(y.to,"local").bottom*m;w<f.length-1&&(j=x.charCoords(f[w+1].from,"local").top*m,!(j>v+0.9));){y=f[++w],v=x.charCoords(y.to,"local").bottom*m}if(v!=k){var u=Math.max(v-k,3),p=g.appendChild(document.createElement("div"));p.style.cssText="position: absolute; right: 0px; width: "+Math.max(x.display.barWidth-1,2)+"px; top: "+(k+this.buttonHeight)+"px; height: "+u+"px",p.className=this.options.className}}}this.div.textContent="",this.div.appendChild(g)},a.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),this.div.parentNode.removeChild(this.div)}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],a):a(CodeMirror)}(function(c){function b(k,h,g,l){this.cm=k;var j={listenForChanges:!1};for(var m in l){j[m]=l[m]}j.className||(j.className="CodeMirror-search-match"),this.annotation=k.annotateScrollbar(j),this.query=h,this.caseFold=g,this.gap={from:k.firstLine(),to:k.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var f=this;k.on("change",this.changeHandler=function(n,i){f.onChange(i)})}function a(h,g,f){return g>=h?h:Math.max(g,h+f)}c.defineExtension("showMatchesOnScrollbar",function(g,f,h){return"string"==typeof h&&(h={className:h}),h||(h={}),new b(this,g,f,h)});var d=1000;b.prototype.findMatches=function(){if(this.gap){for(var f=0;f<this.matches.length;f++){var e=this.matches[f];if(e.from.line>=this.gap.to){break}e.to.line>=this.gap.from&&this.matches.splice(f--,1)}for(var g=this.cm.getSearchCursor(this.query,c.Pos(this.gap.from,0),this.caseFold);g.findNext();){var e={from:g.from(),to:g.to()};if(e.from.line>=this.gap.to){break}if(this.matches.splice(f++,0,e),this.matches.length>d){break}}this.gap=null}},b.prototype.onChange=function(m){var f=m.from.line,e=c.changeEnd(m).line,g=e-m.to.line;if(this.gap?(this.gap.from=Math.min(a(this.gap.from,f,g),m.from.line),this.gap.to=Math.max(a(this.gap.to,f,g),m.from.line)):this.gap={from:m.from.line,to:e+1},g){for(var k=0;k<this.matches.length;k++){var p=this.matches[k],h=a(p.from.line,f,g);h!=p.from.line&&(p.from=c.Pos(h,p.from.ch));var j=a(p.to.line,f,g);j!=p.to.line&&(p.to=c.Pos(j,p.to.ch))}}clearTimeout(this.update);var i=this;this.update=setTimeout(function(){i.updateAfterChange()},250)},b.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},b.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(d){function b(h){h.state.placeholder&&(h.state.placeholder.parentNode.removeChild(h.state.placeholder),h.state.placeholder=null)}function a(j){b(j);var h=j.state.placeholder=document.createElement("pre");h.style.cssText="height: 0; overflow: visible",h.className="CodeMirror-placeholder",h.appendChild(document.createTextNode(j.getOption("placeholder"))),j.display.lineSpace.insertBefore(h,j.display.lineSpace.firstChild)}function f(h){g(h)&&a(h)}function c(i){var j=i.getWrapperElement(),h=g(i);j.className=j.className.replace(" CodeMirror-empty","")+(h?" CodeMirror-empty":""),h?a(i):b(i)}function g(h){return 1===h.lineCount()&&""===h.getLine(0)}d.defineOption("placeholder","",function(j,m,h){var k=h&&h!=d.Init;if(m&&!k){j.on("blur",f),j.on("change",c),c(j)}else{if(!m&&k){j.off("blur",f),j.off("change",c),b(j);var e=j.getWrapperElement();e.className=e.className.replace(" CodeMirror-empty","")}}m&&!j.hasFocus()&&f(j)})}),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(h){function d(I){if(I.getOption("disableInput")){return h.Pass}for(var s=I.listSelections(),e=[],q=0;q<s.length;q++){if(!s[q].empty()){return h.Pass}var C=s[q].head,B=I.getTokenAt(C),x=h.innerMode(I.getMode(),B.state),H=x.state;if("xml"!=x.mode.name||!H.tagName){return h.Pass}var A=I.getOption("autoCloseTags"),z="html"==x.mode.configuration,a="object"==typeof A&&A.dontCloseTags||z&&b,n="object"==typeof A&&A.indentTags||z&&f,G=H.tagName;B.end>C.ch&&(G=G.slice(0,G.length-B.end+C.ch));var F=G.toLowerCase();if(!G||"string"==B.type&&(B.end!=C.ch||!/[\"\']/.test(B.string.charAt(B.string.length-1))||1==B.string.length)||"tag"==B.type&&"closeTag"==H.type||B.string.indexOf("/")==B.string.length-1||a&&g(a,F)>-1||k(I,G,C,H,!0)){return h.Pass}var E=n&&g(n,F)>-1;e[q]={indent:E,text:">"+(E?"\n\n":"")+"</"+G+">",newPos:E?h.Pos(C.line+1,0):h.Pos(C.line,C.ch+1)}}for(var q=s.length-1;q>=0;q--){var D=e[q];I.replaceRange(D.text,s[q].head,s[q].anchor,"+insert");var r=I.listSelections().slice(0);r[q]={head:D.newPos,anchor:D.newPos},I.setSelections(r),D.indent&&(I.indentLine(D.newPos.line,null,!0),I.indentLine(D.newPos.line+1,null,!0))}}function c(x,p){for(var m=x.listSelections(),e=[],w=p?"/":"</",y=0;y<m.length;y++){if(!m[y].empty()){return h.Pass}var n=m[y].head,v=x.getTokenAt(n),u=h.innerMode(x.getMode(),v.state),q=u.state;if(p&&("string"==v.type||"<"!=v.string.charAt(0)||v.start!=n.ch-1)){return h.Pass}if("xml"!=u.mode.name){if("htmlmixed"==x.getMode().name&&"javascript"==u.mode.name){e[y]=w+"script>"}else{if("htmlmixed"!=x.getMode().name||"css"!=u.mode.name){return h.Pass}e[y]=w+"style>"}}else{if(!q.context||!q.context.tagName||k(x,q.context.tagName,n,q)){return h.Pass}e[y]=w+q.context.tagName+">"}}x.replaceSelections(e),m=x.listSelections();for(var y=0;y<m.length;y++){(y==m.length-1||m[y].head.line<m[y+1].head.line)&&x.indentLine(m[y].head.line)}}function j(a){return a.getOption("disableInput")?h.Pass:c(a,!0)}function g(m,l){if(m.indexOf){return m.indexOf(l)}for(var a=0,n=m.length;n>a;++a){if(m[a]==l){return a}}return -1}function k(z,u,m,e,p){if(!h.scanForClosingTag){return !1}var y=Math.min(z.lastLine()+1,m.line+500),A=h.scanForClosingTag(z,m,null,y);if(!A||A.tag!=u){return !1}for(var q=e.context,x=p?1:0;q&&q.tagName==u;q=q.prev){++x}m=A.to;for(var w=1;x>w;w++){var v=h.scanForClosingTag(z,m,null,y);if(!v||v.tag!=u){return !1}m=v.to}return !0}h.defineOption("autoCloseTags",!1,function(l,m,o){if(o!=h.Init&&o&&l.removeKeyMap("autoCloseTags"),m){var e={name:"autoCloseTags"};("object"!=typeof m||m.whenClosing)&&(e["'/'"]=function(a){return j(a)}),("object"!=typeof m||m.whenOpening)&&(e["'>'"]=function(a){return d(a)}),l.addKeyMap(e)}});var b=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],f=["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"];h.commands.closeTag=function(a){return c(a)}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(d){function b(q,e,g,o){function v(l){var h=i(q,e);if(!h||h.to.line-h.from.line<m){return null}for(var r=q.findMarksAt(h.from),s=0;s<r.length;++s){if(r[s].__isFold&&"fold"!==o){if(!l){return null}h.cleared=!0,r[s].clear()}}return h}if(g&&g.call){var i=g;g=null}else{var i=f(q,g,"rangeFinder")}"number"==typeof e&&(e=d.Pos(e,0));var m=f(q,g,"minFoldSize"),k=v(!0);if(f(q,g,"scanUp")){for(;!k&&e.line>q.firstLine();){e=d.Pos(e.line-1,0),k=v(!1)}}if(k&&!k.cleared&&"unfold"!==o){var j=a(q,g);d.on(j,"mousedown",function(h){p.clear(),d.e_preventDefault(h)});var p=q.markText(k.from,k.to,{replacedWith:j,clearOnEnter:!0,__isFold:!0});p.on("clear",function(h,l){d.signal(q,"unfold",q,h,l)}),d.signal(q,"fold",q,k.from,k.to)}}function a(k,h){var g=f(k,h,"widget");if("string"==typeof g){var j=document.createTextNode(g);g=document.createElement("span"),g.appendChild(j),g.className="CodeMirror-foldmarker"}return g}function f(j,h,g){if(h&&void 0!==h[g]){return h[g]}var k=j.options.foldOptions;return k&&void 0!==k[g]?k[g]:c[g]}d.newFoldFunction=function(h,g){return function(i,e){b(i,e,{rangeFinder:h,widget:g})}},d.defineExtension("foldCode",function(h,g,j){b(this,h,g,j)}),d.defineExtension("isFolded",function(j){for(var h=this.findMarksAt(j),g=0;g<h.length;++g){if(h[g].__isFold){return !0}}}),d.commands.toggleFold=function(g){g.foldCode(g.getCursor())},d.commands.fold=function(g){g.foldCode(g.getCursor(),null,"fold")},d.commands.unfold=function(g){g.foldCode(g.getCursor(),null,"unfold")},d.commands.foldAll=function(e){e.operation(function(){for(var g=e.firstLine(),h=e.lastLine();h>=g;g++){e.foldCode(d.Pos(g,0),null,"fold")}})},d.commands.unfoldAll=function(e){e.operation(function(){for(var g=e.firstLine(),h=e.lastLine();h>=g;g++){e.foldCode(d.Pos(g,0),null,"unfold")}})},d.registerHelper("fold","combine",function(){var g=Array.prototype.slice.call(arguments,0);return function(h,e){for(var k=0;k<g.length;++k){var j=g[k](h,e);if(j){return j}}}}),d.registerHelper("fold","auto",function(k,h){for(var g=k.getHelpers(h,"fold"),l=0;l<g.length;l++){var j=g[l](k,h);if(j){return j}}});var c={rangeFinder:d.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};d.defineOption("foldOptions",null),d.defineExtension("foldOption",function(h,g){return f(this,h,g)})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],a):a(CodeMirror)}(function(p){function w(a){this.options=a,this.from=this.to=0}function k(a){return a===!0&&(a={}),null==a.gutter&&(a.gutter="CodeMirror-foldgutter"),null==a.indicatorOpen&&(a.indicatorOpen="CodeMirror-foldgutter-open"),null==a.indicatorFolded&&(a.indicatorFolded="CodeMirror-foldgutter-folded"),a}function f(d,c){for(var a=d.findMarksAt(m(c)),h=0;h<a.length;++h){if(a[h].__isFold&&a[h].find().from.line==c){return !0}}}function b(c){if("string"==typeof c){var a=document.createElement("div");return a.className=c+" CodeMirror-guttermarker-subtle",a}return c.cloneNode(!0)}function g(y,o,h){var z=y.state.foldGutter.options,d=o,r=y.foldOption(z,"minFoldSize"),c=y.foldOption(z,"rangeFinder");y.eachLine(o,h,function(e){var a=null;if(f(y,d)){a=b(z.indicatorFolded)}else{var n=m(d,0),l=c&&c(y,n);l&&l.to.line-l.from.line>=r&&(a=b(z.indicatorOpen))}y.setGutterMarker(e,z.gutter,a),++d})}function v(d){var c=d.getViewport(),a=d.state.foldGutter;a&&(d.operation(function(){g(d,c.from,c.to)}),a.from=c.from,a.to=c.to)}function x(h,c,a){var l=h.state.foldGutter;if(l){var d=l.options;a==d.gutter&&h.foldCode(m(c,0),d.rangeFinder)}}function j(d){var c=d.state.foldGutter;if(c){var a=c.options;c.from=c.to=0,clearTimeout(c.changeUpdate),c.changeUpdate=setTimeout(function(){v(d)},a.foldOnChangeTimeSpan||600)}}function u(d){var c=d.state.foldGutter;if(c){var a=c.options;clearTimeout(c.changeUpdate),c.changeUpdate=setTimeout(function(){var e=d.getViewport();c.from==c.to||e.from-c.to>20||c.from-e.to>20?v(d):d.operation(function(){e.from<c.from&&(g(d,e.from,c.from),c.from=e.from),e.to>c.to&&(g(d,c.to,e.to),c.to=e.to)})},a.updateViewportTimeSpan||400)}}function q(d,c){var a=d.state.foldGutter;if(a){var h=c.line;h>=a.from&&h<a.to&&g(d,h,h+1)}}p.defineOption("foldGutter",!1,function(c,a,d){d&&d!=p.Init&&(c.clearGutter(c.state.foldGutter.options.gutter),c.state.foldGutter=null,c.off("gutterClick",x),c.off("change",j),c.off("viewportChange",u),c.off("fold",q),c.off("unfold",q),c.off("swapDoc",v)),a&&(c.state.foldGutter=new w(k(a)),v(c),c.on("gutterClick",x),c.on("change",j),c.on("viewportChange",u),c.on("fold",q),c.on("unfold",q),c.on("swapDoc",v))});var m=p.Pos}),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){a.registerHelper("fold","indent",function(u,j){var e=u.getOption("tabSize"),b=u.getLine(j.line);if(/\S/.test(b)){for(var f=function(c){return a.countColumn(c,null,e)},q=f(b),v=null,g=j.line+1,p=u.lastLine();p>=g;++g){var m=u.getLine(g),k=f(m);if(k>q){v=g}else{if(/\S/.test(m)){break}}}return v?{from:a.Pos(j.line,b.length),to:a.Pos(v,u.getLine(v).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){a.registerHelper("fold","brace",function(k,D){function z(g){for(var f=D.ch,d=0;;){var h=0>=f?-1:q.lastIndexOf(g,f-1);if(-1!=h){if(1==d&&h<D.ch){break}if(A=k.getTokenTypeAt(a.Pos(J,h+1)),!/^(comment|string)/.test(A)){return h+1}f=h-1}else{if(1==d){break}d=1,f=q.length}}}var x,A,J=D.line,q=k.getLine(J),C="{",I="}",x=z("{");if(null==x&&(C="[",I="]",x=z("[")),null!=x){var H,E,j=1,G=k.lastLine();a:for(var F=J;G>=F;++F){for(var y=k.getLine(F),B=F==J?x:0;;){var e=y.indexOf(C,B),b=y.indexOf(I,B);if(0>e&&(e=y.length),0>b&&(b=y.length),B=Math.min(e,b),B==y.length){break}if(k.getTokenTypeAt(a.Pos(F,B+1))==A){if(B==e){++j}else{if(!--j){H=F,E=B;break a}}}++B}}if(null!=H&&(J!=H||E!=x)){return{from:a.Pos(J,x),to:a.Pos(H,E)}}}}),a.registerHelper("fold","import",function(d,c){function g(k){if(k<d.firstLine()||k>d.lastLine()){return null}var p=d.getTokenAt(a.Pos(k,1));if(/\S/.test(p.string)||(p=d.getTokenAt(a.Pos(k,p.end+1))),"keyword"!=p.type||"import"!=p.string){return null}for(var m=k,q=Math.min(d.lastLine(),k+10);q>=m;++m){var j=d.getLine(m),l=j.indexOf(";");if(-1!=l){return{startCh:p.end,end:a.Pos(m,l)}}}}var f,c=c.line,h=g(c);if(!h||g(c-1)||(f=g(c-2))&&f.end.line==c-1){return null}for(var b=h.end;;){var e=g(b.line+1);if(null==e){break}b=e.end}return{from:d.clipPos(a.Pos(c,h.startCh+1)),to:b}}),a.registerHelper("fold","include",function(d,c){function f(h){if(h<d.firstLine()||h>d.lastLine()){return null}var j=d.getTokenAt(a.Pos(h,1));return/\S/.test(j.string)||(j=d.getTokenAt(a.Pos(h,j.end+1))),"meta"==j.type&&"#include"==j.string.slice(0,8)?j.start+8:void 0}var c=c.line,e=f(c);if(null==e||null!=f(c-1)){return null}for(var g=c;;){var b=f(g+1);if(null==b){break}++g}return{from:a.Pos(c,e+1),to:d.clipPos(a.Pos(g))}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(z){function E(c,a){return c.line-a.line||c.ch-a.ch}function v(d,c,a,f){this.line=c,this.ch=a,this.cm=d,this.text=d.getLine(c),this.min=f?f.from:d.firstLine(),this.max=f?f.to-1:d.lastLine()}function k(d,c){var a=d.cm.getTokenTypeAt(D(d.line,c));return a&&/\btag\b/.test(a)}function b(a){return a.line>=a.max?void 0:(a.ch=0,a.text=a.cm.getLine(++a.line),!0)}function m(a){return a.line<=a.min?void 0:(a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0)}function C(d){for(;;){var c=d.text.indexOf(">",d.ch);if(-1==c){if(b(d)){continue}return}if(k(d,c+1)){var a=d.text.lastIndexOf("/",c),f=a>-1&&!/\S/.test(d.text.slice(a+1,c));return d.ch=c+1,f?"selfClose":"regular"}d.ch=c+1}}function F(d){for(;;){var c=d.ch?d.text.lastIndexOf("<",d.ch-1):-1;if(-1==c){if(m(d)){continue}return}if(k(d,c+1)){j.lastIndex=c,d.ch=c;var a=j.exec(d.text);if(a&&a.index==c){return a}}else{d.ch=c}}}function q(c){for(;;){j.lastIndex=c.ch;var a=j.exec(c.text);if(!a){if(b(c)){continue}return}if(k(c,a.index+1)){return c.ch=a.index+a[0].length,a}c.ch=a.index+1}}function B(f){for(;;){var c=f.ch?f.text.lastIndexOf(">",f.ch-1):-1;if(-1==c){if(m(f)){continue}return}if(k(f,c+1)){var a=f.text.lastIndexOf("/",c),d=a>-1&&!/\S/.test(f.text.slice(a+1,c));return f.ch=c+1,d?"selfClose":"regular"}f.ch=c}}function A(h,d){for(var a=[];;){var l,g=q(h),u=h.line,f=h.ch-(g?g[0].length:0);if(!g||!(l=C(h))){return}if("selfClose"!=l){if(g[1]){for(var p=a.length-1;p>=0;--p){if(a[p]==g[2]){a.length=p;break}}if(0>p&&(!d||d==g[2])){return{tag:g[2],from:D(u,f),to:D(h.line,h.ch)}}}else{a.push(g[2])}}}}function w(p,g){for(var f=[];;){var s=B(p);if(!s){return}if("selfClose"!=s){var h=p.line,u=p.ch,d=F(p);if(!d){return}if(d[1]){f.push(d[2])}else{for(var c=f.length-1;c>=0;--c){if(f[c]==d[2]){f.length=c;break}}if(0>c&&(!g||g==d[2])){return{tag:d[2],from:D(p.line,p.ch),to:D(h,u)}}}}else{F(p)}}}var D=z.Pos,y="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",x=y+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",j=new RegExp("<(/?)(["+y+"]["+x+"]*)","g");z.registerHelper("fold","xml",function(f,a){for(var g=new v(f,a.line,0);;){var d,h=q(g);if(!h||g.line!=a.line||!(d=C(g))){return}if(!h[1]&&"selfClose"!=d){var a=D(g.line,g.ch),c=A(g,h[2]);return c&&{from:a,to:c.from}}}}),z.findMatchingTag=function(p,s,h){var u=new v(p,s.line,s.ch,h);if(-1!=u.text.indexOf(">")||-1!=u.text.indexOf("<")){var a=C(u),t=a&&D(u.line,u.ch),i=a&&F(u);if(a&&i&&!(E(u,s)>0)){var d={from:D(u.line,u.ch),to:t,tag:i[2]};return"selfClose"==a?{open:d,close:null,at:"open"}:i[1]?{open:w(u,i[2]),close:d,at:"close"}:(u=new v(p,t.line,t.ch,h),{open:d,close:A(u,i[2]),at:"open"})}}},z.findEnclosingTag=function(h,d,i){for(var g=new v(h,d.line,d.ch,i);;){var l=w(g);if(!l){break}var c=new v(h,d.line,d.ch,i),f=A(c,l.tag);if(f){return{open:l,close:f}}}},z.scanForClosingTag=function(d,a,f,c){var g=new v(d,a.line,a.ch,c?{from:0,to:c}:null);return A(g,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){a.registerHelper("fold","markdown",function(u,j){function e(c){var d=u.getTokenTypeAt(a.Pos(c,0));return d&&/\bheader\b/.test(d)}function b(l,d,c){var h=d&&d.match(/^#+/);return h&&e(l)?h[0].length:(h=c&&c.match(/^[=\-]+\s*$/),h&&e(l+1)?"="==c[0]?1:2:f)}var f=100,q=u.getLine(j.line),v=u.getLine(j.line+1),g=b(j.line,q,v);if(g===f){return void 0}for(var p=u.lastLine(),m=j.line,k=u.getLine(m+2);p>m&&!(b(m+1,v,k)<=g);){++m,v=k,k=u.getLine(m+2)}return{from:a.Pos(j.line,q.length),to:a.Pos(m,u.getLine(m).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){a.registerGlobalHelper("fold","comment",function(b){return b.blockCommentStart&&b.blockCommentEnd},function(x,G){var C=x.getModeAt(G),A=C.blockCommentStart,D=C.blockCommentEnd;if(A&&D){for(var N,z=G.line,F=x.getLine(z),L=G.ch,K=0;;){var H=0>=L?-1:F.lastIndexOf(A,L-1);if(-1!=H){if(1==K&&H<G.ch){return}if(/comment/.test(x.getTokenTypeAt(a.Pos(z,H+1)))){N=H+A.length;break}L=H-1}else{if(1==K){return}K=1,L=F.length}}var q,J,I=1,B=x.lastLine();a:for(var E=z;B>=E;++E){for(var k=x.getLine(E),j=E==z?N:0;;){var M=k.indexOf(A,j),e=k.indexOf(D,j);if(0>M&&(M=k.length),0>e&&(e=k.length),j=Math.min(M,e),j==k.length){break}if(j==M){++I}else{if(!--I){q=E,J=j;break a}}++j}}if(null!=q&&(z!=q||J!=N)){return{from:a.Pos(z,N),to:a.Pos(q,J)}}}})}),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){a.overlayMode=function(c,b,d){return{startState:function(){return{base:a.startState(c),overlay:a.startState(b),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(e){return{base:a.copyState(c,e.base),overlay:a.copyState(b,e.overlay),basePos:e.basePos,baseCur:null,overlayPos:e.overlayPos,overlayCur:null}},token:function(g,f){return(g!=f.streamSeen||Math.min(f.basePos,f.overlayPos)<g.start)&&(f.streamSeen=g,f.basePos=f.overlayPos=g.start),g.start==f.basePos&&(f.baseCur=c.token(g,f.base),f.basePos=g.pos),g.start==f.overlayPos&&(g.pos=g.start,f.overlayCur=b.token(g,f.overlay),f.overlayPos=g.pos),g.pos=Math.min(f.basePos,f.overlayPos),null==f.overlayCur?f.baseCur:null!=f.baseCur&&f.overlay.combineTokens||d&&null==f.overlay.combineTokens?f.baseCur+" "+f.overlayCur:f.overlayCur},indent:c.indent&&function(g,f){return c.indent(g.base,f)},electricChars:c.electricChars,innerMode:function(f){return{state:f.base,mode:c}},blankLine:function(f){c.blankLine&&c.blankLine(f.base),b.blankLine&&b.blankLine(f.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(g){function d(i){for(var a=0;a<i.state.activeLines.length;a++){i.removeLineClass(i.state.activeLines[a],"wrap",j),i.removeLineClass(i.state.activeLines[a],"background",b)}}function c(l,k){if(l.length!=k.length){return !1}for(var a=0;a<l.length;a++){if(l[a]!=k[a]){return !1}}return !0}function h(m,n){for(var k=[],i=0;i<n.length;i++){var a=n[i];if(a.empty()){var p=m.getLineHandleVisualStart(a.head.line);k[k.length-1]!=p&&k.push(p)}}c(m.state.activeLines,k)||m.operation(function(){d(m);for(var e=0;e<k.length;e++){m.addLineClass(k[e],"wrap",j),m.addLineClass(k[e],"background",b)}m.state.activeLines=k})}function f(i,a){h(i,a.ranges)}var j="CodeMirror-activeline",b="CodeMirror-activeline-background";g.defineOption("styleActiveLine",!1,function(k,m,e){var l=e&&e!=g.Init;m&&!l?(k.state.activeLines=[],h(k,k.listSelections()),k.on("beforeSelectionChange",f)):!m&&l&&(k.off("beforeSelectionChange",f),d(k),delete k.state.activeLines)})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(j){function p(l,c){var a=l.getRange(k(c.line,c.ch-1),k(c.line,c.ch+1));return 2==a.length?a:null}function h(l,e,w){var v=l.getLine(e.line),x=l.getTokenAt(e);if(/\bstring2?\b/.test(x.type)){return !1}var c=new j.StringStream(v.slice(0,e.ch)+w+v.slice(e.ch),4);for(c.pos=c.start=x.start;;){var u=l.getMode().token(c,x.state);if(c.pos>=e.ch+1){return/\bstring2?\b/.test(u)}c.start=c.pos}}function d(l,i){for(var t={name:"autoCloseBrackets",Backspace:function(u){if(u.getOption("disableInput")){return j.Pass}for(var w=u.listSelections(),x=0;x<w.length;x++){if(!w[x].empty()){return j.Pass}var o=p(u,w[x].head);if(!o||l.indexOf(o)%2!=0){return j.Pass}}for(var x=w.length-1;x>=0;x--){var v=w[x].head;u.replaceRange("",k(v.line,v.ch-1),k(v.line,v.ch+1))}}},c="",e=0;e<l.length;e+=2){(function(a,n){c+=n,t["'"+a+"'"]=function(A){if(A.getOption("disableInput")){return j.Pass}for(var v,z,r=A.listSelections(),o=0;o<r.length;o++){var x,w=r[o],y=w.head,z=A.getRange(y,k(y.line,y.ch+1));if(w.empty()){if(a==n&&z==n){x=A.getRange(y,k(y.line,y.ch+3))==a+a+a?"skipThree":"skip"}else{if(a==n&&y.ch>1&&i.indexOf(a)>=0&&A.getRange(k(y.line,y.ch-2),y)==a+a&&(y.ch<=2||A.getRange(k(y.line,y.ch-3),k(y.line,y.ch-2))!=a)){x="addFour"}else{if('"'==a||"'"==a){if(j.isWordChar(z)||!h(A,y,a)){return j.Pass}x="both"}else{if(!(A.getLine(y.line).length==y.ch||c.indexOf(z)>=0||g.test(z))){return j.Pass}x="both"}}}}else{x="surround"}if(v){if(v!=x){return j.Pass}}else{v=x}}A.operation(function(){if("skip"==v){A.execCommand("goCharRight")}else{if("skipThree"==v){for(var u=0;3>u;u++){A.execCommand("goCharRight")}}else{if("surround"==v){for(var s=A.getSelections(),u=0;u<s.length;u++){s[u]=a+s[u]+n}A.replaceSelections(s,"around")}else{"both"==v?(A.replaceSelection(a+n,null),A.execCommand("goCharLeft")):"addFour"==v&&(A.replaceSelection(a+a+a+a,"before"),A.execCommand("goCharRight"))}}}})},a!=n&&(t["'"+n+"'"]=function(s){for(var o=s.listSelections(),u=0;u<o.length;u++){var v=o[u];if(!v.empty()||s.getRange(v.head,k(v.head.line,v.head.ch+1))!=n){return j.Pass}}s.execCommand("goCharRight")})})(l.charAt(e),l.charAt(e+1))}return t}function b(a){return function(i){if(i.getOption("disableInput")){return j.Pass}for(var e=i.listSelections(),l=0;l<e.length;l++){if(!e[l].empty()){return j.Pass}var c=p(i,e[l].head);if(!c||a.indexOf(c)%2!=0){return j.Pass}}i.operation(function(){i.replaceSelection("\n\n",null),i.execCommand("goCharLeft"),e=i.listSelections();for(var o=0;o<e.length;o++){var n=e[o].head.line;i.indentLine(n,null,!0),i.indentLine(n+1,null,!0)}})}}var f="()[]{}''\"\"",m="'\"",q="[]{}",g=/\s/,k=j.Pos;j.defineOption("autoCloseBrackets",!1,function(o,n,a){if(a!=j.Init&&a&&o.removeKeyMap("autoCloseBrackets"),n){var v=f,s=m,r=q;"string"==typeof n?v=n:"object"==typeof n&&(null!=n.pairs&&(v=n.pairs),null!=n.triples&&(s=n.triples),null!=n.explode&&(r=n.explode));var e=d(v,s);r&&(e.Enter=b(r)),o.addKeyMap(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(c){function b(f){var d=f.getWrapperElement();f.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:d.style.width,height:d.style.height},d.style.width="",d.style.height="auto",d.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",f.refresh()}function a(g){var f=g.getWrapperElement();f.className=f.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var d=g.state.fullScreenRestore;f.style.width=d.width,f.style.height=d.height,window.scrollTo(d.scrollLeft,d.scrollTop),g.refresh()}c.defineOption("fullScreen",!1,function(e,d,f){f==c.Init&&(f=!1),!f!=!d&&(d?b(e):a(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(k){function u(a){"object"==typeof a&&(this.minChars=a.minChars,this.style=a.style,this.showToken=a.showToken,this.delay=a.delay,this.wordsOnly=a.wordsOnly),null==this.style&&(this.style=h),null==this.minChars&&(this.minChars=v),null==this.delay&&(this.delay=p),null==this.wordsOnly&&(this.wordsOnly=m),this.overlay=this.timeout=null}function j(c){var a=c.state.matchHighlighter;clearTimeout(a.timeout),a.timeout=setTimeout(function(){f(c)},a.delay)}function f(a){a.operation(function(){var B=a.state.matchHighlighter;if(B.overlay&&(a.removeOverlay(B.overlay),B.overlay=null),!a.somethingSelected()&&B.showToken){for(var x=B.showToken===!0?/[\w$]/:B.showToken,e=a.getCursor(),r=a.getLine(e.line),C=e.ch,w=C;C&&x.test(r.charAt(C-1));){--C}for(;w<r.length&&x.test(r.charAt(w));){++w}return void (w>C&&a.addOverlay(B.overlay=q(r.slice(C,w),x,B.style)))}var A=a.getCursor("from"),z=a.getCursor("to");if(A.line==z.line&&(!B.wordsOnly||b(a,A,z))){var y=a.getRange(A,z).replace(/^\s+|\s+$/g,"");y.length>=B.minChars&&a.addOverlay(B.overlay=q(y,!1,B.style))}})}function b(l,c,a){var s=l.getRange(c,a);if(null!==s.match(/^\w+$/)){if(c.ch>0){var d={line:c.line,ch:c.ch-1},w=l.getRange(d,c);if(null===w.match(/\W/)){return !1}}if(a.ch<l.getLine(c.line).length){var d={line:a.line,ch:a.ch+1},w=l.getRange(a,d);if(null===w.match(/\W/)){return !1}}return !0}return !1}function g(c,a){return !(c.start&&a.test(c.string.charAt(c.start-1))||c.pos!=c.string.length&&a.test(c.string.charAt(c.pos)))}function q(d,c,a){return{token:function(e){return !e.match(d)||c&&!g(e,c)?(e.next(),void (e.skipTo(d.charAt(0))||e.skipToEnd())):a}}}var v=2,h="matchhighlight",p=100,m=!1;k.defineOption("highlightSelectionMatches",!1,function(e,i,c){if(c&&c!=k.Init){var d=e.state.matchHighlighter.overlay;d&&e.removeOverlay(d),clearTimeout(e.state.matchHighlighter.timeout),e.state.matchHighlighter=null,e.off("cursorActivity",j)}i&&(e.state.matchHighlighter=new u(i),f(e),e.on("cursorActivity",j))})});