- md5
- 3da524b0500982b6a4208112219aae53
- sha1
- 268fe64c36099ff76fa36e187fedb0867b79afca
- sha256
- 0455246b374c0b368e84fbbda42bc9c95eafb9308ccf9c1807b381e3b766f921
(function(a){if(typeof exports=="object"&&typeof module=="object"){module.exports=a()}else{if(typeof define=="function"&&define.amd){return define([],a)}else{this.CodeMirror=a()}}})(function(){var cn=/gecko\/\d/i.test(navigator.userAgent);var ey=/MSIE \d/.test(navigator.userAgent);var bH=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);var dz=ey||bH;var l=dz&&(ey?document.documentMode||6:bH[1]);var cU=/WebKit\//.test(navigator.userAgent);var dB=cU&&/Qt\/\d+\.\d+/.test(navigator.userAgent);var c6=/Chrome\//.test(navigator.userAgent);var dQ=/Opera\//.test(navigator.userAgent);var aB=/Apple Computer/.test(navigator.vendor);var a7=/KHTML\//.test(navigator.userAgent);var c1=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);var fi=/PhantomJS/.test(navigator.userAgent);var eP=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent);var d3=eP||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);var b5=eP||/Mac/.test(navigator.platform);var aM=/win/i.test(navigator.platform);var aU=dQ&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);if(aU){aU=Number(aU[1])}if(aU&&aU>=15){dQ=false;cU=true}var bO=b5&&(dB||dQ&&(aU==null||aU<12.11));var fS=cn||(dz&&l>=9);var fV=false,a3=false;function J(f2,f3){if(!(this instanceof J)){return new J(f2,f3)}this.options=f3=f3||{};aK(eR,f3,false);cc(f3);var f5=f3.value;if(typeof f5=="string"){f5=new at(f5,f3.mode)}this.doc=f5;var f4=this.display=new ew(f2,f5);f4.wrapper.CodeMirror=this;dZ(this);cK(this);if(f3.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}if(f3.autofocus&&!d3){en(this)}this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,focused:false,suppressEdits:false,pasteIncoming:false,cutIncoming:false,draggingText:false,highlight:new f0()};if(dz&&l<11){setTimeout(ct(fc,this,true),20)}fD(this);be();var f1=this;cI(this,function(){f1.curOp.forceUpdate=true;dY(f1,f5);if((f3.autofocus&&!d3)||dC()==f4.input){setTimeout(ct(cy,f1),20)}else{aR(f1)}for(var f7 in ba){if(ba.hasOwnProperty(f7)){ba[f7](f1,f3[f7],ca)}}dT(f1);for(var f6=0;f6<a4.length;++f6){a4[f6](f1)}})}function ew(f1,f3){var f4=this;var f2=f4.input=fK("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");if(cU){f2.style.width="1000px"}else{f2.setAttribute("wrap","off")}if(eP){f2.style.border="1px solid black"}f2.setAttribute("autocorrect","off");f2.setAttribute("autocapitalize","off");f2.setAttribute("spellcheck","false");f4.inputDiv=fK("div",[f2],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");f4.scrollbarH=fK("div",[fK("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");f4.scrollbarV=fK("div",[fK("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");f4.scrollbarFiller=fK("div",null,"CodeMirror-scrollbar-filler");f4.gutterFiller=fK("div",null,"CodeMirror-gutter-filler");f4.lineDiv=fK("div",null,"CodeMirror-code");f4.selectionDiv=fK("div",null,null,"position: relative; z-index: 1");f4.cursorDiv=fK("div",null,"CodeMirror-cursors");f4.measure=fK("div",null,"CodeMirror-measure");f4.lineMeasure=fK("div",null,"CodeMirror-measure");f4.lineSpace=fK("div",[f4.measure,f4.lineMeasure,f4.selectionDiv,f4.cursorDiv,f4.lineDiv],null,"position: relative; outline: none");f4.mover=fK("div",[fK("div",[f4.lineSpace],"CodeMirror-lines")],null,"position: relative");f4.sizer=fK("div",[f4.mover],"CodeMirror-sizer");f4.heightForcer=fK("div",null,null,"position: absolute; height: "+bg+"px; width: 1px;");f4.gutters=fK("div",null,"CodeMirror-gutters");f4.lineGutter=null;f4.scroller=fK("div",[f4.sizer,f4.heightForcer,f4.gutters],"CodeMirror-scroll");f4.scroller.setAttribute("tabIndex","-1");f4.wrapper=fK("div",[f4.inputDiv,f4.scrollbarH,f4.scrollbarV,f4.scrollbarFiller,f4.gutterFiller,f4.scroller],"CodeMirror");if(dz&&l<8){f4.gutters.style.zIndex=-1;f4.scroller.style.paddingRight=0}if(eP){f2.style.width="0px"}if(!cU){f4.scroller.draggable=true}if(a7){f4.inputDiv.style.height="1px";f4.inputDiv.style.position="absolute"}if(dz&&l<8){f4.scrollbarH.style.minHeight=f4.scrollbarV.style.minWidth="18px"}if(f1.appendChild){f1.appendChild(f4.wrapper)}else{f1(f4.wrapper)}f4.viewFrom=f4.viewTo=f3.first;f4.view=[];f4.externalMeasured=null;f4.viewOffset=0;f4.lastSizeC=0;f4.updateLineNumbers=null;f4.lineNumWidth=f4.lineNumInnerWidth=f4.lineNumChars=null;f4.prevInput="";f4.alignWidgets=false;f4.pollingFast=false;f4.poll=new f0();f4.cachedCharWidth=f4.cachedTextHeight=f4.cachedPaddingH=null;f4.inaccurateSelection=false;f4.maxLine=null;f4.maxLineLength=0;f4.maxLineChanged=false;f4.wheelDX=f4.wheelDY=f4.wheelStartX=f4.wheelStartY=null;f4.shift=false;f4.selForContextMenu=null}function bp(f1){f1.doc.mode=J.getMode(f1.options,f1.doc.modeOption);d8(f1)}function d8(f1){f1.doc.iter(function(f2){if(f2.stateAfter){f2.stateAfter=null}if(f2.styles){f2.styles=null}});f1.doc.frontier=f1.doc.first;d2(f1,100);f1.state.modeGen++;if(f1.curOp){ag(f1)}}function eu(f1){if(f1.options.lineWrapping){fo(f1.display.wrapper,"CodeMirror-wrap");f1.display.sizer.style.minWidth=""}else{f(f1.display.wrapper,"CodeMirror-wrap");g(f1)}Y(f1);ag(f1);aj(f1);setTimeout(function(){eM(f1)},100)}function a9(f1){var f3=aT(f1.display),f2=f1.options.lineWrapping;var f4=f2&&Math.max(5,f1.display.scroller.clientWidth/dt(f1.display)-3);return function(f6){if(fk(f1.doc,f6)){return 0}var f5=0;if(f6.widgets){for(var f7=0;f7<f6.widgets.length;f7++){if(f6.widgets[f7].height){f5+=f6.widgets[f7].height}}}if(f2){return f5+(Math.ceil(f6.text.length/f4)||1)*f3}else{return f5+f3}}}function Y(f1){var f3=f1.doc,f2=a9(f1);f3.iter(function(f4){var f5=f2(f4);if(f5!=f4.height){fO(f4,f5)}})}function fY(f1){var f3=eX[f1.options.keyMap],f2=f3.style;f1.display.wrapper.className=f1.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(f2?" cm-keymap-"+f2:"")}function cK(f1){f1.display.wrapper.className=f1.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+f1.options.theme.replace(/(^|\s)\s*/g," cm-s-");aj(f1)}function dl(f1){dZ(f1);ag(f1);setTimeout(function(){es(f1)},20)}function dZ(f1){var f2=f1.display.gutters,f6=f1.options.gutters;dP(f2);for(var f3=0;f3<f6.length;++f3){var f4=f6[f3];var f5=f2.appendChild(fK("div",null,"CodeMirror-gutter "+f4));if(f4=="CodeMirror-linenumbers"){f1.display.lineGutter=f5;f5.style.width=(f1.display.lineNumWidth||1)+"px"}}f2.style.display=f3?"":"none";cY(f1)}function cY(f1){var f2=f1.display.gutters.offsetWidth;f1.display.sizer.style.marginLeft=f2+"px";f1.display.scrollbarH.style.left=f1.options.fixedGutter?f2+"px":0}function d9(f3){if(f3.height==0){return 0}var f2=f3.text.length,f1,f5=f3;while(f1=eC(f5)){var f4=f1.find(0,true);f5=f4.from.line;f2+=f4.from.ch-f4.to.ch}f5=f3;while(f1=ei(f5)){var f4=f1.find(0,true);f2-=f5.text.length-f4.from.ch;f5=f4.to.line;f2+=f5.text.length-f4.to.ch}return f2}function g(f1){var f3=f1.display,f2=f1.doc;f3.maxLine=e2(f2,f2.first);f3.maxLineLength=d9(f3.maxLine);f3.maxLineChanged=true;f2.iter(function(f5){var f4=d9(f5);if(f4>f3.maxLineLength){f3.maxLineLength=f4;f3.maxLine=f5}})}function cc(f1){var f2=db(f1.gutters,"CodeMirror-linenumbers");if(f2==-1&&f1.lineNumbers){f1.gutters=f1.gutters.concat(["CodeMirror-linenumbers"])}else{if(f2>-1&&!f1.lineNumbers){f1.gutters=f1.gutters.slice(0);f1.gutters.splice(f2,1)}}}function cM(f1){return f1.display.scroller.clientHeight-f1.display.wrapper.clientHeight<bg-3}function dq(f2){var f1=f2.display.scroller;return{clientHeight:f1.clientHeight,barHeight:f2.display.scrollbarV.clientHeight,scrollWidth:f1.scrollWidth,clientWidth:f1.clientWidth,hScrollbarTakesSpace:cM(f2),barWidth:f2.display.scrollbarH.clientWidth,docHeight:Math.round(f2.doc.height+bG(f2.display))}}function eM(f8,f1){if(!f1){f1=dq(f8)}var f5=f8.display,f2=k(f5.measure);var f9=f1.docHeight+bg;var f3=f1.scrollWidth>f1.clientWidth;if(f3&&f1.scrollWidth<=f1.clientWidth+1&&f2>0&&!f1.hScrollbarTakesSpace){f3=false}var f4=f9>f1.clientHeight;if(f4){f5.scrollbarV.style.display="block";f5.scrollbarV.style.bottom=f3?f2+"px":"0";f5.scrollbarV.firstChild.style.height=Math.max(0,f9-f1.clientHeight+(f1.barHeight||f5.scrollbarV.clientHeight))+"px"}else{f5.scrollbarV.style.display="";f5.scrollbarV.firstChild.style.height="0"}if(f3){f5.scrollbarH.style.display="block";f5.scrollbarH.style.right=f4?f2+"px":"0";f5.scrollbarH.firstChild.style.width=(f1.scrollWidth-f1.clientWidth+(f1.barWidth||f5.scrollbarH.clientWidth))+"px"}else{f5.scrollbarH.style.display="";f5.scrollbarH.firstChild.style.width="0"}if(f3&&f4){f5.scrollbarFiller.style.display="block";f5.scrollbarFiller.style.height=f5.scrollbarFiller.style.width=f2+"px"}else{f5.scrollbarFiller.style.display=""}if(f3&&f8.options.coverGutterNextToScrollbar&&f8.options.fixedGutter){f5.gutterFiller.style.display="block";f5.gutterFiller.style.height=f2+"px";f5.gutterFiller.style.width=f5.gutters.offsetWidth+"px"}else{f5.gutterFiller.style.display=""}if(!f8.state.checkedOverlayScrollbar&&f1.clientHeight>0){if(f2===0){var f7=b5&&!c1?"12px":"18px";f5.scrollbarV.style.minWidth=f5.scrollbarH.style.minHeight=f7;var f6=function(ga){if(M(ga)!=f5.scrollbarV&&M(ga)!=f5.scrollbarH){cW(f8,eg)(ga)}};bV(f5.scrollbarV,"mousedown",f6);bV(f5.scrollbarH,"mousedown",f6)}f8.state.checkedOverlayScrollbar=true}}function b4(f4,f8,f3){var f5=f3&&f3.top!=null?Math.max(0,f3.top):f4.scroller.scrollTop;f5=Math.floor(f5-eV(f4));var f1=f3&&f3.bottom!=null?f3.bottom:f5+f4.wrapper.clientHeight;var f6=bE(f8,f5),f7=bE(f8,f1);if(f3&&f3.ensure){var f2=f3.ensure.from.line,f9=f3.ensure.to.line;if(f2<f6){return{from:f2,to:bE(f8,bK(e2(f8,f2))+f4.wrapper.clientHeight)}}if(Math.min(f9,f8.lastLine())>=f7){return{from:bE(f8,bK(e2(f8,f9))-f4.wrapper.clientHeight),to:f9}}}return{from:f6,to:Math.max(f7,f6+1)}}function es(f9){var f7=f9.display,f8=f7.view;if(!f7.alignWidgets&&(!f7.gutters.firstChild||!f9.options.fixedGutter)){return}var f5=dL(f7)-f7.scroller.scrollLeft+f9.doc.scrollLeft;var f1=f7.gutters.offsetWidth,f2=f5+"px";for(var f4=0;f4<f8.length;f4++){if(!f8[f4].hidden){if(f9.options.fixedGutter&&f8[f4].gutter){f8[f4].gutter.style.left=f2}var f6=f8[f4].alignable;if(f6){for(var f3=0;f3<f6.length;f3++){f6[f3].style.left=f2}}}}if(f9.options.fixedGutter){f7.gutters.style.left=(f5+f1)+"px"}}function dT(f1){if(!f1.options.lineNumbers){return false}var f6=f1.doc,f2=ef(f1.options,f6.first+f6.size-1),f5=f1.display;if(f2.length!=f5.lineNumChars){var f7=f5.measure.appendChild(fK("div",[fK("div",f2)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var f3=f7.firstChild.offsetWidth,f4=f7.offsetWidth-f3;f5.lineGutter.style.width="";f5.lineNumInnerWidth=Math.max(f3,f5.lineGutter.offsetWidth-f4);f5.lineNumWidth=f5.lineNumInnerWidth+f4;f5.lineNumChars=f5.lineNumInnerWidth?f2.length:-1;f5.lineGutter.style.width=f5.lineNumWidth+"px";cY(f1);return true}return false}function ef(f1,f2){return String(f1.lineNumberFormatter(f2+f1.firstLineNumber))}function dL(f1){return f1.scroller.getBoundingClientRect().left-f1.sizer.getBoundingClientRect().left}function aG(f2,f1,f3){var f4=f2.display;this.viewport=f1;this.visible=b4(f4,f2.doc,f1);this.editorIsHidden=!f4.wrapper.offsetWidth;this.wrapperHeight=f4.wrapper.clientHeight;this.oldViewFrom=f4.viewFrom;this.oldViewTo=f4.viewTo;this.oldScrollerWidth=f4.scroller.clientWidth;this.force=f3;this.dims=e0(f2)}function D(ga,f4){var f5=ga.display,f9=ga.doc;if(f4.editorIsHidden){ek(ga);return false}if(!f4.force&&f4.visible.from>=f5.viewFrom&&f4.visible.to<=f5.viewTo&&(f5.updateLineNumbers==null||f5.updateLineNumbers>=f5.viewTo)&&c5(ga)==0){return false}if(dT(ga)){ek(ga);f4.dims=e0(ga)}var f3=f9.first+f9.size;var f7=Math.max(f4.visible.from-ga.options.viewportMargin,f9.first);var f8=Math.min(f3,f4.visible.to+ga.options.viewportMargin);if(f5.viewFrom<f7&&f7-f5.viewFrom<20){f7=Math.max(f9.first,f5.viewFrom)}if(f5.viewTo>f8&&f5.viewTo-f8<20){f8=Math.min(f3,f5.viewTo)}if(a3){f7=aS(ga.doc,f7);f8=dR(ga.doc,f8)}var f2=f7!=f5.viewFrom||f8!=f5.viewTo||f5.lastSizeC!=f4.wrapperHeight;cN(ga,f7,f8);f5.viewOffset=bK(e2(ga.doc,f5.viewFrom));ga.display.mover.style.top=f5.viewOffset+"px";var f1=c5(ga);if(!f2&&f1==0&&!f4.force&&(f5.updateLineNumbers==null||f5.updateLineNumbers>=f5.viewTo)){return false}var f6=dC();if(f1>4){f5.lineDiv.style.display="none"}cl(ga,f5.updateLineNumbers,f4.dims);if(f1>4){f5.lineDiv.style.display=""}if(f6&&dC()!=f6&&f6.offsetHeight){f6.focus()}dP(f5.cursorDiv);dP(f5.selectionDiv);if(f2){f5.lastSizeC=f4.wrapperHeight;d2(ga,400)}f5.updateLineNumbers=null;return true}function ci(f2,f6){var f4=f6.force,f1=f6.viewport;for(var f5=true;;f5=false){if(f5&&f2.options.lineWrapping&&f6.oldScrollerWidth!=f2.display.scroller.clientWidth){f4=true}else{f4=false;if(f1&&f1.top!=null){f1={top:Math.min(f2.doc.height+bG(f2.display)-bg-f2.display.scroller.clientHeight,f1.top)}}f6.visible=b4(f2.display,f2.doc,f1);if(f6.visible.from>=f2.display.viewFrom&&f6.visible.to<=f2.display.viewTo){break}}if(!D(f2,f6)){break}a5(f2);var f3=dq(f2);bA(f2);dp(f2,f3);eM(f2,f3)}ad(f2,"update",f2);if(f2.display.viewFrom!=f6.oldViewFrom||f2.display.viewTo!=f6.oldViewTo){ad(f2,"viewportChange",f2,f2.display.viewFrom,f2.display.viewTo)}}function dH(f2,f1){var f4=new aG(f2,f1);if(D(f2,f4)){a5(f2);ci(f2,f4);var f3=dq(f2);bA(f2);dp(f2,f3);eM(f2,f3)}}function dp(f1,f2){f1.display.sizer.style.minHeight=f1.display.heightForcer.style.top=f2.docHeight+"px";f1.display.gutters.style.height=Math.max(f2.docHeight,f2.clientHeight-bg)+"px"}function fN(f1,f2){if(f1.display.sizer.offsetWidth+f1.display.gutters.offsetWidth<f1.display.scroller.clientWidth-1){f1.display.sizer.style.minHeight=f1.display.heightForcer.style.top="0px";f1.display.gutters.style.height=f2.docHeight+"px"}}function a5(f8){var f6=f8.display;var f2=f6.lineDiv.offsetTop;for(var f3=0;f3<f6.view.length;f3++){var f9=f6.view[f3],ga;if(f9.hidden){continue}if(dz&&l<8){var f5=f9.node.offsetTop+f9.node.offsetHeight;ga=f5-f2;f2=f5}else{var f4=f9.node.getBoundingClientRect();ga=f4.bottom-f4.top}var f7=f9.line.height-ga;if(ga<2){ga=aT(f6)}if(f7>0.001||f7<-0.001){fO(f9.line,ga);b9(f9.line);if(f9.rest){for(var f1=0;f1<f9.rest.length;f1++){b9(f9.rest[f1])}}}}}function b9(f1){if(f1.widgets){for(var f2=0;f2<f1.widgets.length;++f2){f1.widgets[f2].height=f1.widgets[f2].node.offsetHeight}}}function e0(f1){var f5=f1.display,f4={},f3={};for(var f6=f5.gutters.firstChild,f2=0;f6;f6=f6.nextSibling,++f2){f4[f1.options.gutters[f2]]=f6.offsetLeft;f3[f1.options.gutters[f2]]=f6.offsetWidth}return{fixedPos:dL(f5),gutterTotalWidth:f5.gutters.offsetWidth,gutterLeft:f4,gutterWidth:f3,wrapperWidth:f5.wrapper.clientWidth}}function cl(gc,f3,gb){var f8=gc.display,ge=gc.options.lineNumbers;var f1=f8.lineDiv,gd=f1.firstChild;function f7(gg){var gf=gg.nextSibling;if(cU&&b5&&gc.display.currentWheelTarget==gg){gg.style.display="none"}else{gg.parentNode.removeChild(gg)}return gf}var f9=f8.view,f6=f8.viewFrom;for(var f4=0;f4<f9.length;f4++){var f5=f9[f4];if(f5.hidden){}else{if(!f5.node){var f2=aD(gc,f5,f6,gb);f1.insertBefore(f2,gd)}else{while(gd!=f5.node){gd=f7(gd)}var ga=ge&&f3!=null&&f3<=f6&&f5.lineNumber;if(f5.changes){if(db(f5.changes,"gutter")>-1){ga=false}aa(gc,f5,f6,gb)}if(ga){dP(f5.lineNumber);f5.lineNumber.appendChild(document.createTextNode(ef(gc.options,f6)))}gd=f5.node.nextSibling}}f6+=f5.size}while(gd){gd=f7(gd)}}function aa(f1,f3,f5,f6){for(var f2=0;f2<f3.changes.length;f2++){var f4=f3.changes[f2];if(f4=="text"){e8(f1,f3)}else{if(f4=="gutter"){c9(f1,f3,f5,f6)}else{if(f4=="class"){dw(f3)}else{if(f4=="widget"){an(f3,f6)}}}}}f3.changes=null}function fw(f1){if(f1.node==f1.text){f1.node=fK("div",null,null,"position: relative");if(f1.text.parentNode){f1.text.parentNode.replaceChild(f1.node,f1.text)}f1.node.appendChild(f1.text);if(dz&&l<8){f1.node.style.zIndex=2}}return f1.node}function eh(f2){var f1=f2.bgClass?f2.bgClass+" "+(f2.line.bgClass||""):f2.line.bgClass;if(f1){f1+=" CodeMirror-linebackground"}if(f2.background){if(f1){f2.background.className=f1}else{f2.background.parentNode.removeChild(f2.background);f2.background=null}}else{if(f1){var f3=fw(f2);f2.background=f3.insertBefore(fK("div",null,f1),f3.firstChild)}}}function dJ(f1,f2){var f3=f1.display.externalMeasured;if(f3&&f3.line==f2.line){f1.display.externalMeasured=null;f2.measure=f3.measure;return f3.built}return eF(f1,f2)}function e8(f1,f4){var f2=f4.text.className;var f3=dJ(f1,f4);if(f4.text==f4.node){f4.node=f3.pre}f4.text.parentNode.replaceChild(f3.pre,f4.text);f4.text=f3.pre;if(f3.bgClass!=f4.bgClass||f3.textClass!=f4.textClass){f4.bgClass=f3.bgClass;f4.textClass=f3.textClass;dw(f4)}else{if(f2){f4.text.className=f2}}}function dw(f2){eh(f2);if(f2.line.wrapClass){fw(f2).className=f2.line.wrapClass}else{if(f2.node!=f2.text){f2.node.className=""}}var f1=f2.textClass?f2.textClass+" "+(f2.line.textClass||""):f2.line.textClass;f2.text.className=f1||""}function c9(f9,f7,f6,f8){if(f7.gutter){f7.node.removeChild(f7.gutter);f7.gutter=null}var f4=f7.line.gutterMarkers;if(f9.options.lineNumbers||f4){var f2=fw(f7);var f5=f7.gutter=f2.insertBefore(fK("div",null,"CodeMirror-gutter-wrapper","position: absolute; left: "+(f9.options.fixedGutter?f8.fixedPos:-f8.gutterTotalWidth)+"px"),f7.text);if(f9.options.lineNumbers&&(!f4||!f4["CodeMirror-linenumbers"])){f7.lineNumber=f5.appendChild(fK("div",ef(f9.options,f6),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+f8.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+f9.display.lineNumInnerWidth+"px"))}if(f4){for(var f3=0;f3<f9.options.gutters.length;++f3){var f1=f9.options.gutters[f3],ga=f4.hasOwnProperty(f1)&&f4[f1];if(ga){f5.appendChild(fK("div",[ga],"CodeMirror-gutter-elt","left: "+f8.gutterLeft[f1]+"px; width: "+f8.gutterWidth[f1]+"px"))}}}}}function an(f1,f4){if(f1.alignable){f1.alignable=null}for(var f3=f1.node.firstChild,f2;f3;f3=f2){var f2=f3.nextSibling;if(f3.className=="CodeMirror-linewidget"){f1.node.removeChild(f3)}}fh(f1,f4)}function aD(f1,f3,f4,f5){var f2=dJ(f1,f3);f3.text=f3.node=f2.pre;if(f2.bgClass){f3.bgClass=f2.bgClass}if(f2.textClass){f3.textClass=f2.textClass}dw(f3);c9(f1,f3,f4,f5);fh(f3,f5);return f3.node}function fh(f2,f3){fP(f2.line,f2,f3,true);if(f2.rest){for(var f1=0;f1<f2.rest.length;f1++){fP(f2.rest[f1],f2,f3,false)}}}function fP(f9,f6,f8,f4){if(!f9.widgets){return}var f1=fw(f6);for(var f3=0,f7=f9.widgets;f3<f7.length;++f3){var f5=f7[f3],f2=fK("div",[f5.node],"CodeMirror-linewidget");if(!f5.handleMouseEvents){f2.ignoreEvents=true}bD(f5,f2,f6,f8);if(f4&&f5.above){f1.insertBefore(f2,f6.gutter||f6.text)}else{f1.appendChild(f2)}ad(f5,"redraw")}}function bD(f4,f3,f1,f5){if(f4.noHScroll){(f1.alignable||(f1.alignable=[])).push(f3);var f2=f5.wrapperWidth;f3.style.left=f5.fixedPos+"px";if(!f4.coverGutter){f2-=f5.gutterTotalWidth;f3.style.paddingLeft=f5.gutterTotalWidth+"px"}f3.style.width=f2+"px"}if(f4.coverGutter){f3.style.zIndex=5;f3.style.position="relative";if(!f4.noHScroll){f3.style.marginLeft=-f5.gutterTotalWidth+"px"}}}var X=J.Pos=function(f1,f2){if(!(this instanceof X)){return new X(f1,f2)}this.line=f1;this.ch=f2};var cd=J.cmpPos=function(f2,f1){return f2.line-f1.line||f2.ch-f1.ch};function ch(f1){return X(f1.line,f1.ch)}function bv(f2,f1){return cd(f2,f1)<0?f1:f2}function aq(f2,f1){return cd(f2,f1)<0?f2:f1}function fL(f1,f2){this.ranges=f1;this.primIndex=f2}fL.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(f1){if(f1==this){return true}if(f1.primIndex!=this.primIndex||f1.ranges.length!=this.ranges.length){return false}for(var f3=0;f3<this.ranges.length;f3++){var f2=this.ranges[f3],f4=f1.ranges[f3];if(cd(f2.anchor,f4.anchor)!=0||cd(f2.head,f4.head)!=0){return false}}return true},deepCopy:function(){for(var f1=[],f2=0;f2<this.ranges.length;f2++){f1[f2]=new dM(ch(this.ranges[f2].anchor),ch(this.ranges[f2].head))}return new fL(f1,this.primIndex)},somethingSelected:function(){for(var f1=0;f1<this.ranges.length;f1++){if(!this.ranges[f1].empty()){return true}}return false},contains:function(f4,f1){if(!f1){f1=f4}for(var f3=0;f3<this.ranges.length;f3++){var f2=this.ranges[f3];if(cd(f1,f2.from())>=0&&cd(f4,f2.to())<=0){return f3}}return -1}};function dM(f1,f2){this.anchor=f1;this.head=f2}dM.prototype={from:function(){return aq(this.anchor,this.head)},to:function(){return bv(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};function cu(f1,f8){var f3=f1[f8];f1.sort(function(gb,ga){return cd(gb.from(),ga.from())});f8=db(f1,f3);for(var f5=1;f5<f1.length;f5++){var f9=f1[f5],f2=f1[f5-1];if(cd(f2.to(),f9.from())>=0){var f6=aq(f2.from(),f9.from()),f7=bv(f2.to(),f9.to());var f4=f2.empty()?f9.from()==f9.head:f2.from()==f2.head;if(f5<=f8){--f8}f1.splice(--f5,2,new dM(f4?f7:f6,f4?f6:f7))}}return new fL(f1,f8)}function eG(f1,f2){return new fL([new dM(f1,f2||f1)],0)}function cZ(f1,f2){return Math.max(f1.first,Math.min(f2,f1.first+f1.size-1))}function fx(f2,f3){if(f3.line<f2.first){return X(f2.first,0)}var f1=f2.first+f2.size-1;if(f3.line>f1){return X(f1,e2(f2,f1).text.length)}return fg(f3,e2(f2,f3.line).text.length)}function fg(f3,f2){var f1=f3.ch;if(f1==null||f1>f2){return X(f3.line,f2)}else{if(f1<0){return X(f3.line,0)}else{return f3}}}function b7(f2,f1){return f1>=f2.first&&f1<f2.first+f2.size}function dN(f3,f4){for(var f1=[],f2=0;f2<f4.length;f2++){f1[f2]=fx(f3,f4[f2])}return f1}function fj(f6,f2,f5,f1){if(f6.cm&&f6.cm.display.shift||f6.extend){var f4=f2.anchor;if(f1){var f3=cd(f5,f4)<0;if(f3!=(cd(f1,f4)<0)){f4=f5;f5=f1}else{if(f3!=(cd(f5,f1)<0)){f5=f1}}}return new dM(f4,f5)}else{return new dM(f1||f5,f5)}}function fH(f4,f3,f1,f2){bS(f4,new fL([fj(f4,f4.sel.primary(),f3,f1)],0),f2)}function aw(f6,f5,f3){for(var f2=[],f4=0;f4<f6.sel.ranges.length;f4++){f2[f4]=fj(f6,f6.sel.ranges[f4],f5[f4],null)}var f1=cu(f2,f6.sel.primIndex);bS(f6,f1,f3)}function e(f5,f4,f2,f3){var f1=f5.sel.ranges.slice(0);f1[f4]=f2;bS(f5,cu(f1,f5.sel.primIndex),f3)}function H(f4,f2,f3,f1){bS(f4,eG(f2,f3),f1)}function c(f3,f1){var f2={ranges:f1.ranges,update:function(f4){this.ranges=[];for(var f5=0;f5<f4.length;f5++){this.ranges[f5]=new dM(fx(f3,f4[f5].anchor),fx(f3,f4[f5].head))}}};aC(f3,"beforeSelectionChange",f3,f2);if(f3.cm){aC(f3.cm,"beforeSelectionChange",f3.cm,f2)}if(f2.ranges!=f1.ranges){return cu(f2.ranges,f2.ranges.length-1)}else{return f1}}function eU(f5,f4,f2){var f1=f5.history.done,f3=fv(f1);if(f3&&f3.ranges){f1[f1.length-1]=f4;ec(f5,f4,f2)}else{bS(f5,f4,f2)}}function bS(f3,f2,f1){ec(f3,f2,f1);fU(f3,f3.sel,f3.cm?f3.cm.curOp.id:NaN,f1)}function ec(f4,f3,f2){if(e5(f4,"beforeSelectionChange")||f4.cm&&e5(f4.cm,"beforeSelectionChange")){f3=c(f4,f3)}var f1=f2&&f2.bias||(cd(f3.primary().head,f4.sel.primary().head)<0?-1:1);c3(f4,o(f4,f3,f1,true));if(!(f2&&f2.scroll===false)&&f4.cm){fu(f4.cm)}}function c3(f2,f1){if(f1.equals(f2.sel)){return}f2.sel=f1;if(f2.cm){f2.cm.curOp.updateInput=f2.cm.curOp.selectionChanged=true;W(f2.cm)}ad(f2,"cursorActivity",f2)}function el(f1){c3(f1,o(f1,f1.sel,null,false),Z)}function o(f9,f1,f6,f7){var f3;for(var f4=0;f4<f1.ranges.length;f4++){var f5=f1.ranges[f4];var f8=bT(f9,f5.anchor,f6,f7);var f2=bT(f9,f5.head,f6,f7);if(f3||f8!=f5.anchor||f2!=f5.head){if(!f3){f3=f1.ranges.slice(0,f4)}f3[f4]=new dM(f8,f2)}}return f3?cu(f3,f1.primIndex):f1}function bT(ga,f9,f6,f7){var gb=false,f3=f9;var f4=f6||1;ga.cantEdit=false;search:for(;;){var gc=e2(ga,f3.line);if(gc.markedSpans){for(var f5=0;f5<gc.markedSpans.length;++f5){var f1=gc.markedSpans[f5],f2=f1.marker;if((f1.from==null||(f2.inclusiveLeft?f1.from<=f3.ch:f1.from<f3.ch))&&(f1.to==null||(f2.inclusiveRight?f1.to>=f3.ch:f1.to>f3.ch))){if(f7){aC(f2,"beforeCursorEnter");if(f2.explicitlyCleared){if(!gc.markedSpans){break}else{--f5;continue}}}if(!f2.atomic){continue}var f8=f2.find(f4<0?-1:1);if(cd(f8,f3)==0){f8.ch+=f4;if(f8.ch<0){if(f8.line>ga.first){f8=fx(ga,X(f8.line-1))}else{f8=null}}else{if(f8.ch>gc.text.length){if(f8.line<ga.first+ga.size-1){f8=X(f8.line+1,0)}else{f8=null}}}if(!f8){if(gb){if(!f7){return bT(ga,f9,f6,true)}ga.cantEdit=true;return X(ga.first,0)}gb=true;f8=f9;f4=-f4}}f3=f8;continue search}}}return f3}}function bj(gb){var f7=gb.display,ga=gb.doc,gc={};var f9=gc.cursors=document.createDocumentFragment();var f3=gc.selection=document.createDocumentFragment();for(var f5=0;f5<ga.sel.ranges.length;f5++){var f6=ga.sel.ranges[f5];var f4=f6.empty();if(f4||gb.options.showCursorWhenSelecting){B(gb,f6,f9)}if(!f4){bB(gb,f6,f3)}}if(gb.options.moveInputWithCursor){var f8=dI(gb,ga.sel.primary().head,"div");var f1=f7.wrapper.getBoundingClientRect(),f2=f7.lineDiv.getBoundingClientRect();gc.teTop=Math.max(0,Math.min(f7.wrapper.clientHeight-10,f8.top+f2.top-f1.top));gc.teLeft=Math.max(0,Math.min(f7.wrapper.clientWidth-10,f8.left+f2.left-f1.left))}return gc}function ak(f1,f2){bP(f1.display.cursorDiv,f2.cursors);bP(f1.display.selectionDiv,f2.selection);if(f2.teTop!=null){f1.display.inputDiv.style.top=f2.teTop+"px";f1.display.inputDiv.style.left=f2.teLeft+"px"}}function bA(f1){ak(f1,bj(f1))}function B(f1,f4,f3){var f6=dI(f1,f4.head,"div",null,null,!f1.options.singleCursorHeightPerLine);var f5=f3.appendChild(fK("div","\u00a0","CodeMirror-cursor"));f5.style.left=f6.left+"px";f5.style.top=f6.top+"px";f5.style.height=Math.max(0,f6.bottom-f6.top)*f1.options.cursorHeight+"px";if(f6.other){var f2=f3.appendChild(fK("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor"));f2.style.display="";f2.style.left=f6.other.left+"px";f2.style.top=f6.other.top+"px";f2.style.height=(f6.other.bottom-f6.other.top)*0.85+"px"}}function bB(f5,gb,f6){var ge=f5.display,gi=f5.doc;var f1=document.createDocumentFragment();var ga=eS(f5.display),f4=ga.left,gf=ge.lineSpace.offsetWidth-ga.right;function gc(gm,gl,gk,gj){if(gl<0){gl=0}gl=Math.round(gl);gj=Math.round(gj);f1.appendChild(fK("div",null,"CodeMirror-selected","position: absolute; left: "+gm+"px; top: "+gl+"px; width: "+(gk==null?gf-gm:gk)+"px; height: "+(gj-gl)+"px"))}function f2(gk,gm,gp){var gl=e2(gi,gk);var gn=gl.text.length;var gq,gj;function go(gs,gr){return cF(f5,X(gk,gs),"div",gl,gr)}dS(a(gl),gm||0,gp==null?gn:gp,function(gy,gx,gr){var gu=go(gy,"left"),gv,gw,gt;if(gy==gx){gv=gu;gw=gt=gu.left}else{gv=go(gx-1,"right");if(gr=="rtl"){var gs=gu;gu=gv;gv=gs}gw=gu.left;gt=gv.right}if(gm==null&&gy==0){gw=f4}if(gv.top-gu.top>3){gc(gw,gu.top,null,gu.bottom);gw=f4;if(gu.bottom<gv.top){gc(gw,gu.bottom,null,gv.top)}}if(gp==null&&gx==gn){gt=gf}if(!gq||gu.top<gq.top||gu.top==gq.top&&gu.left<gq.left){gq=gu}if(!gj||gv.bottom>gj.bottom||gv.bottom==gj.bottom&&gv.right>gj.right){gj=gv}if(gw<f4+1){gw=f4}gc(gw,gv.top,gt-gw,gv.bottom)});return{start:gq,end:gj}}var gh=gb.from(),gg=gb.to();if(gh.line==gg.line){f2(gh.line,gh.ch,gg.ch)}else{var f3=e2(gi,gh.line),f8=e2(gi,gg.line);var f7=z(f3)==z(f8);var f9=f2(gh.line,gh.ch,f7?f3.text.length+1:null).end;var gd=f2(gg.line,f7?0:null,gg.ch).start;if(f7){if(f9.top<gd.top-2){gc(f9.right,f9.top,null,f9.bottom);gc(f4,gd.top,gd.left,gd.bottom)}else{gc(f9.right,f9.top,gd.left-f9.right,f9.bottom)}}if(f9.bottom<gd.top){gc(f4,f9.bottom,null,gd.top)}}f6.appendChild(f1)}function p(f1){if(!f1.state.focused){return}var f3=f1.display;clearInterval(f3.blinker);var f2=true;f3.cursorDiv.style.visibility="";if(f1.options.cursorBlinkRate>0){f3.blinker=setInterval(function(){f3.cursorDiv.style.visibility=(f2=!f2)?"":"hidden"},f1.options.cursorBlinkRate)}else{if(f1.options.cursorBlinkRate<0){f3.cursorDiv.style.visibility="hidden"}}}function d2(f1,f2){if(f1.doc.mode.startState&&f1.doc.frontier<f1.display.viewTo){f1.state.highlight.set(f2,ct(cL,f1))}}function cL(f1){var f5=f1.doc;if(f5.frontier<f5.first){f5.frontier=f5.first}if(f5.frontier>=f1.display.viewTo){return}var f3=+new Date+f1.options.workTime;var f4=b1(f5.mode,dr(f1,f5.frontier));var f2=[];f5.iter(f5.frontier,Math.min(f5.first+f5.size,f1.display.viewTo+500),function(f6){if(f5.frontier>=f1.display.viewFrom){var f9=f6.styles;var gb=fn(f1,f6,f4,true);f6.styles=gb.styles;var f8=f6.styleClasses,ga=gb.classes;if(ga){f6.styleClasses=ga}else{if(f8){f6.styleClasses=null}}var gc=!f9||f9.length!=f6.styles.length||f8!=ga&&(!f8||!ga||f8.bgClass!=ga.bgClass||f8.textClass!=ga.textClass);for(var f7=0;!gc&&f7<f9.length;++f7){gc=f9[f7]!=f6.styles[f7]}if(gc){f2.push(f5.frontier)}f6.stateAfter=b1(f5.mode,f4)}else{dm(f1,f6.text,f4);f6.stateAfter=f5.frontier%5==0?b1(f5.mode,f4):null}++f5.frontier;if(+new Date>f3){d2(f1,f1.options.workDelay);return true}});if(f2.length){cI(f1,function(){for(var f6=0;f6<f2.length;f6++){S(f1,f2[f6],"text")}})}}function cw(f7,f1,f4){var f2,f5,f6=f7.doc;var f3=f4?-1:f1-(f7.doc.mode.innerMode?1000:100);for(var ga=f1;ga>f3;--ga){if(ga<=f6.first){return f6.first}var f9=e2(f6,ga-1);if(f9.stateAfter&&(!f4||ga<=f6.frontier)){return ga}var f8=bR(f9.text,null,f7.options.tabSize);if(f5==null||f2>f8){f5=ga-1;f2=f8}}return f5}function dr(f1,f7,f2){var f5=f1.doc,f4=f1.display;if(!f5.mode.startState){return true}var f6=cw(f1,f7,f2),f3=f6>f5.first&&e2(f5,f6-1).stateAfter;if(!f3){f3=bY(f5.mode)}else{f3=b1(f5.mode,f3)}f5.iter(f6,f7,function(f8){dm(f1,f8.text,f3);var f9=f6==f7-1||f6%5==0||f6>=f4.viewFrom&&f6<f4.viewTo;f8.stateAfter=f9?b1(f5.mode,f3):null;++f6});if(f2){f5.frontier=f6}return f3}function eV(f1){return f1.lineSpace.offsetTop}function bG(f1){return f1.mover.offsetHeight-f1.lineSpace.offsetHeight}function eS(f4){if(f4.cachedPaddingH){return f4.cachedPaddingH}var f3=bP(f4.measure,fK("pre","x"));var f1=window.getComputedStyle?window.getComputedStyle(f3):f3.currentStyle;var f2={left:parseInt(f1.paddingLeft),right:parseInt(f1.paddingRight)};if(!isNaN(f2.left)&&!isNaN(f2.right)){f4.cachedPaddingH=f2}return f2}function cg(f8,f4,f7){var f3=f8.options.lineWrapping;var f5=f3&&f8.display.scroller.clientWidth;if(!f4.measure.heights||f3&&f4.measure.width!=f5){var f6=f4.measure.heights=[];if(f3){f4.measure.width=f5;var ga=f4.text.firstChild.getClientRects();for(var f1=0;f1<ga.length-1;f1++){var f9=ga[f1],f2=ga[f1+1];if(Math.abs(f9.bottom-f2.bottom)>2){f6.push((f9.bottom+f2.top)/2-f7.top)}}}f6.push(f7.bottom-f7.top)}}function cr(f3,f1,f4){if(f3.line==f1){return{map:f3.measure.map,cache:f3.measure.cache}}for(var f2=0;f2<f3.rest.length;f2++){if(f3.rest[f2]==f1){return{map:f3.measure.maps[f2],cache:f3.measure.caches[f2]}}}for(var f2=0;f2<f3.rest.length;f2++){if(bL(f3.rest[f2])>f4){return{map:f3.measure.maps[f2],cache:f3.measure.caches[f2],before:true}}}}function cV(f1,f3){f3=z(f3);var f5=bL(f3);var f2=f1.display.externalMeasured=new bt(f1.doc,f3,f5);f2.lineN=f5;var f4=f2.built=eF(f1,f2);f2.text=f4.pre;bP(f1.display.lineMeasure,f4.pre);return f2}function d4(f1,f2,f4,f3){return E(f1,a0(f1,f2),f4,f3)}function eY(f1,f3){if(f3>=f1.display.viewFrom&&f3<f1.display.viewTo){return f1.display.view[dh(f1,f3)]}var f2=f1.display.externalMeasured;if(f2&&f3>=f2.lineN&&f3<f2.lineN+f2.size){return f2}}function a0(f1,f3){var f4=bL(f3);var f2=eY(f1,f4);if(f2&&!f2.text){f2=null}else{if(f2&&f2.changes){aa(f1,f2,f4,e0(f1))}}if(!f2){f2=cV(f1,f3)}var f5=cr(f2,f3,f4);return{line:f3,view:f2,rect:null,map:f5.map,cache:f5.cache,before:f5.before,hasHeights:false}}function E(f1,f7,f5,f2,f4){if(f7.before){f5=-1}var f3=f5+(f2||""),f6;if(f7.cache.hasOwnProperty(f3)){f6=f7.cache[f3]}else{if(!f7.rect){f7.rect=f7.view.text.getBoundingClientRect()}if(!f7.hasHeights){cg(f1,f7.view,f7.rect);f7.hasHeights=true}f6=j(f1,f7,f5,f2);if(!f6.bogus){f7.cache[f3]=f6}}return{left:f6.left,right:f6.right,top:f4?f6.rtop:f6.top,bottom:f4?f6.rbottom:f6.bottom}}var eo={left:0,right:0,top:0,bottom:0};function j(f8,gi,ga,f6){var gm=gi.map;var gf,f5,f4,f1;for(var gh=0;gh<gm.length;gh+=3){var gk=gm[gh],gg=gm[gh+1];if(ga<gk){f5=0;f4=1;f1="left"}else{if(ga<gg){f5=ga-gk;f4=f5+1}else{if(gh==gm.length-3||ga==gg&&gm[gh+3]>ga){f4=gg-gk;f5=f4-1;if(ga>=gg){f1="right"}}}}if(f5!=null){gf=gm[gh+2];if(gk==gg&&f6==(gf.insertLeft?"left":"right")){f1=f6}if(f6=="left"&&f5==0){while(gh&&gm[gh-2]==gm[gh-3]&&gm[gh-1].insertLeft){gf=gm[(gh-=3)+2];f1="left"}}if(f6=="right"&&f5==gg-gk){while(gh<gm.length-3&&gm[gh+3]==gm[gh+4]&&!gm[gh+5].insertLeft){gf=gm[(gh+=3)+2];f1="right"}}break}}var f2;if(gf.nodeType==3){for(var gh=0;gh<4;gh++){while(f5&&fd(gi.line.text.charAt(gk+f5))){--f5}while(gk+f4<gg&&fd(gi.line.text.charAt(gk+f4))){++f4}if(dz&&l<9&&f5==0&&f4==gg-gk){f2=gf.parentNode.getBoundingClientRect()}else{if(dz&&f8.options.lineWrapping){var f3=ck(gf,f5,f4).getClientRects();if(f3.length){f2=f3[f6=="right"?f3.length-1:0]}else{f2=eo}}else{f2=ck(gf,f5,f4).getBoundingClientRect()||eo}}if(f2.left||f2.right||f5==0){break}f4=f5;f5=f5-1;f1="right"}if(dz&&l<11){f2=eB(f8.display.measure,f2)}}else{if(f5>0){f1=f6="right"}var f3;if(f8.options.lineWrapping&&(f3=gf.getClientRects()).length>1){f2=f3[f6=="right"?f3.length-1:0]}else{f2=gf.getBoundingClientRect()}}if(dz&&l<9&&!f5&&(!f2||!f2.left&&!f2.right)){var f7=gf.parentNode.getClientRects()[0];if(f7){f2={left:f7.left,right:f7.left+dt(f8.display),top:f7.top,bottom:f7.bottom}}else{f2=eo}}var gd=f2.top-gi.rect.top,gb=f2.bottom-gi.rect.top;var gl=(gd+gb)/2;var gj=gi.view.measure.heights;for(var gh=0;gh<gj.length-1;gh++){if(gl<gj[gh]){break}}var ge=gh?gj[gh-1]:0,gc=gj[gh];var f9={left:(f1=="right"?f2.right:f2.left)-gi.rect.left,right:(f1=="left"?f2.left:f2.right)-gi.rect.left,top:ge,bottom:gc};if(!f2.left&&!f2.right){f9.bogus=true}if(!f8.options.singleCursorHeightPerLine){f9.rtop=gd;f9.rbottom=gb}return f9}function eB(f3,f4){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!aI(f3)){return f4}var f2=screen.logicalXDPI/screen.deviceXDPI;var f1=screen.logicalYDPI/screen.deviceYDPI;return{left:f4.left*f2,right:f4.right*f2,top:f4.top*f1,bottom:f4.bottom*f1}}function au(f2){if(f2.measure){f2.measure.cache={};f2.measure.heights=null;if(f2.rest){for(var f1=0;f1<f2.rest.length;f1++){f2.measure.caches[f1]={}}}}}function aL(f1){f1.display.externalMeasure=null;dP(f1.display.lineMeasure);for(var f2=0;f2<f1.display.view.length;f2++){au(f1.display.view[f2])}}function aj(f1){aL(f1);f1.display.cachedCharWidth=f1.display.cachedTextHeight=f1.display.cachedPaddingH=null;if(!f1.options.lineWrapping){f1.display.maxLineChanged=true}f1.display.lineNumChars=null}function cs(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function cq(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function eE(f7,f4,f6,f2){if(f4.widgets){for(var f3=0;f3<f4.widgets.length;++f3){if(f4.widgets[f3].above){var f9=cS(f4.widgets[f3]);f6.top+=f9;f6.bottom+=f9}}}if(f2=="line"){return f6}if(!f2){f2="local"}var f5=bK(f4);if(f2=="local"){f5+=eV(f7.display)}else{f5-=f7.display.viewOffset}if(f2=="page"||f2=="window"){var f1=f7.display.lineSpace.getBoundingClientRect();f5+=f1.top+(f2=="window"?0:cq());var f8=f1.left+(f2=="window"?0:cs());f6.left+=f8;f6.right+=f8}f6.top+=f5;f6.bottom+=f5;return f6}function fX(f2,f5,f3){if(f3=="div"){return f5}var f7=f5.left,f6=f5.top;if(f3=="page"){f7-=cs();f6-=cq()}else{if(f3=="local"||!f3){var f4=f2.display.sizer.getBoundingClientRect();f7+=f4.left;f6+=f4.top}}var f1=f2.display.lineSpace.getBoundingClientRect();return{left:f7-f1.left,top:f6-f1.top}}function cF(f1,f5,f4,f3,f2){if(!f3){f3=e2(f1.doc,f5.line)}return eE(f1,f3,d4(f1,f3,f5.ch,f2),f4)}function dI(ga,f9,f3,f7,gc,f8){f7=f7||e2(ga.doc,f9.line);if(!gc){gc=a0(ga,f7)}function f5(gf,ge){var gd=E(ga,gc,gf,ge?"right":"left",f8);if(ge){gd.left=gd.right}else{gd.right=gd.left}return eE(ga,f7,gd,f3)}function gb(gg,gd){var ge=f6[gd],gf=ge.level%2;if(gg==dn(ge)&&gd&&ge.level<f6[gd-1].level){ge=f6[--gd];gg=fW(ge)-(ge.level%2?0:1);gf=true}else{if(gg==fW(ge)&&gd<f6.length-1&&ge.level<f6[gd+1].level){ge=f6[++gd];gg=dn(ge)-ge.level%2;gf=false}}if(gf&&gg==ge.to&&gg>ge.from){return f5(gg-1)}return f5(gg,gf)}var f6=a(f7),f1=f9.ch;if(!f6){return f5(f1)}var f2=aE(f6,f1);var f4=gb(f1,f2);if(eQ!=null){f4.other=gb(f1,eQ)}return f4}function dx(f1,f5){var f4=0,f5=fx(f1.doc,f5);if(!f1.options.lineWrapping){f4=dt(f1.display)*f5.ch}var f2=e2(f1.doc,f5.line);var f3=bK(f2)+eV(f1.display);return{left:f4,right:f4,top:f3,bottom:f3+f2.height}}function fJ(f1,f2,f3,f5){var f4=X(f1,f2);f4.xRel=f5;if(f3){f4.outside=true}return f4}function fC(f8,f5,f4){var f7=f8.doc;f4+=f8.display.viewOffset;if(f4<0){return fJ(f7.first,0,true,-1)}var f3=bE(f7,f4),f9=f7.first+f7.size-1;if(f3>f9){return fJ(f7.first+f7.size-1,e2(f7,f9).text.length,true,1)}if(f5<0){f5=0}var f2=e2(f7,f3);for(;;){var ga=cT(f8,f2,f3,f5,f4);var f6=ei(f2);var f1=f6&&f6.find(0,true);if(f6&&(ga.ch>f1.from.ch||ga.ch==f1.from.ch&&ga.xRel>0)){f3=bL(f2=f1.to.line)}else{return ga}}}function cT(gb,f3,ge,gd,gc){var ga=gc-bK(f3);var f7=false,gk=2*gb.display.wrapper.clientWidth;var gh=a0(gb,f3);function go(gq){var gr=dI(gb,X(ge,gq),"line",f3,gh);f7=true;if(ga>gr.bottom){return gr.left-gk}else{if(ga<gr.top){return gr.left+gk}else{f7=false}}return gr.left}var gg=a(f3),gj=f3.text.length;var gl=cB(f3),f4=cO(f3);var gi=go(gl),f1=f7,f2=go(f4),f6=f7;if(gd>f2){return fJ(ge,f4,f6,1)}for(;;){if(gg?f4==gl||f4==v(f3,gl,1):f4-gl<=1){var gf=gd<gi||gd-gi<=f2-gd?gl:f4;var gn=gd-(gf==gl?gi:f2);while(fd(f3.text.charAt(gf))){++gf}var f9=fJ(ge,gf,gf==gl?f1:f6,gn<-1?-1:gn>1?1:0);return f9}var f8=Math.ceil(gj/2),gp=gl+f8;if(gg){gp=gl;for(var gm=0;gm<f8;++gm){gp=v(f3,gp,1)}}var f5=go(gp);if(f5>gd){f4=gp;f2=f5;if(f6=f7){f2+=1000}gj=f8}else{gl=gp;gi=f5;f1=f7;gj-=f8}}}var aF;function aT(f3){if(f3.cachedTextHeight!=null){return f3.cachedTextHeight}if(aF==null){aF=fK("pre");for(var f2=0;f2<49;++f2){aF.appendChild(document.createTextNode("x"));aF.appendChild(fK("br"))}aF.appendChild(document.createTextNode("x"))}bP(f3.measure,aF);var f1=aF.offsetHeight/50;if(f1>3){f3.cachedTextHeight=f1}dP(f3.measure);return f1||1}function dt(f5){if(f5.cachedCharWidth!=null){return f5.cachedCharWidth}var f1=fK("span","xxxxxxxxxx");var f4=fK("pre",[f1]);bP(f5.measure,f4);var f3=f1.getBoundingClientRect(),f2=(f3.right-f3.left)/10;if(f2>2){f5.cachedCharWidth=f2}return f2||10}var bn=null;var dW=0;function cE(f1){f1.curOp={cm:f1,viewChanged:false,startHeight:f1.doc.height,forceUpdate:false,updateInput:null,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++dW};if(bn){bn.ops.push(f1.curOp)}else{f1.curOp.ownsGroup=bn={ops:[f1.curOp],delayedCallbacks:[]}}}function cP(f4){var f3=f4.delayedCallbacks,f2=0;do{for(;f2<f3.length;f2++){f3[f2]()}for(var f1=0;f1<f4.ops.length;f1++){var f5=f4.ops[f1];if(f5.cursorActivityHandlers){while(f5.cursorActivityCalled<f5.cursorActivityHandlers.length){f5.cursorActivityHandlers[f5.cursorActivityCalled++](f5.cm)}}}}while(f2<f3.length)}function al(f1){var f4=f1.curOp,f3=f4.ownsGroup;if(!f3){return}try{cP(f3)}finally{bn=null;for(var f2=0;f2<f3.ops.length;f2++){f3.ops[f2].cm.curOp=null}cG(f3)}}function cG(f3){var f2=f3.ops;for(var f1=0;f1<f2.length;f1++){b3(f2[f1])}for(var f1=0;f1<f2.length;f1++){ap(f2[f1])}for(var f1=0;f1<f2.length;f1++){b0(f2[f1])}for(var f1=0;f1<f2.length;f1++){ao(f2[f1])}for(var f1=0;f1<f2.length;f1++){eO(f2[f1])}}function b3(f3){var f1=f3.cm,f2=f1.display;if(f3.updateMaxLine){g(f1)}f3.mustUpdate=f3.viewChanged||f3.forceUpdate||f3.scrollTop!=null||f3.scrollToPos&&(f3.scrollToPos.from.line<f2.viewFrom||f3.scrollToPos.to.line>=f2.viewTo)||f2.maxLineChanged&&f1.options.lineWrapping;f3.update=f3.mustUpdate&&new aG(f1,f3.mustUpdate&&{top:f3.scrollTop,ensure:f3.scrollToPos},f3.forceUpdate)}function ap(f1){f1.updatedDisplay=f1.mustUpdate&&D(f1.cm,f1.update)}function b0(f3){var f1=f3.cm,f2=f1.display;if(f3.updatedDisplay){a5(f1)}f3.barMeasure=dq(f1);if(f2.maxLineChanged&&!f1.options.lineWrapping){f3.adjustWidthTo=d4(f1,f2.maxLine,f2.maxLine.text.length).left+3;f3.maxScrollLeft=Math.max(0,f2.sizer.offsetLeft+f3.adjustWidthTo+bg-f2.scroller.clientWidth)}if(f3.updatedDisplay||f3.selectionChanged){f3.newSelectionNodes=bj(f1)}}function ao(f2){var f1=f2.cm;if(f2.adjustWidthTo!=null){f1.display.sizer.style.minWidth=f2.adjustWidthTo+"px";if(f2.maxScrollLeft<f1.doc.scrollLeft){bC(f1,Math.min(f1.display.scroller.scrollLeft,f2.maxScrollLeft),true)}f1.display.maxLineChanged=false}if(f2.newSelectionNodes){ak(f1,f2.newSelectionNodes)}if(f2.updatedDisplay){dp(f1,f2.barMeasure)}if(f2.updatedDisplay||f2.startHeight!=f1.doc.height){eM(f1,f2.barMeasure)}if(f2.selectionChanged){p(f1)}if(f1.state.focused&&f2.updateInput){fc(f1,f2.typing)}}function eO(f4){var ga=f4.cm,f6=ga.display,f9=ga.doc;if(f4.adjustWidthTo!=null&&Math.abs(f4.barMeasure.scrollWidth-ga.display.scroller.scrollWidth)>1){eM(ga)}if(f4.updatedDisplay){ci(ga,f4.update)}if(f6.wheelStartX!=null&&(f4.scrollTop!=null||f4.scrollLeft!=null||f4.scrollToPos)){f6.wheelStartX=f6.wheelStartY=null}if(f4.scrollTop!=null&&(f6.scroller.scrollTop!=f4.scrollTop||f4.forceScroll)){var f7=Math.max(0,Math.min(f6.scroller.scrollHeight-f6.scroller.clientHeight,f4.scrollTop));f6.scroller.scrollTop=f6.scrollbarV.scrollTop=f9.scrollTop=f7}if(f4.scrollLeft!=null&&(f6.scroller.scrollLeft!=f4.scrollLeft||f4.forceScroll)){var f2=Math.max(0,Math.min(f6.scroller.scrollWidth-f6.scroller.clientWidth,f4.scrollLeft));f6.scroller.scrollLeft=f6.scrollbarH.scrollLeft=f9.scrollLeft=f2;es(ga)}if(f4.scrollToPos){var f8=F(ga,fx(f9,f4.scrollToPos.from),fx(f9,f4.scrollToPos.to),f4.scrollToPos.margin);if(f4.scrollToPos.isCursor&&ga.state.focused){dU(ga,f8)}}var f5=f4.maybeHiddenMarkers,f1=f4.maybeUnhiddenMarkers;if(f5){for(var f3=0;f3<f5.length;++f3){if(!f5[f3].lines.length){aC(f5[f3],"hide")}}}if(f1){for(var f3=0;f3<f1.length;++f3){if(f1[f3].lines.length){aC(f1[f3],"unhide")}}}if(f6.wrapper.offsetHeight){f9.scrollTop=ga.display.scroller.scrollTop}if(f4.updatedDisplay&&cU){if(ga.options.lineWrapping){fN(ga,f4.barMeasure)}if(f4.barMeasure.scrollWidth>f4.barMeasure.clientWidth&&f4.barMeasure.scrollWidth<f4.barMeasure.clientWidth+1&&!cM(ga)){eM(ga)}}if(f4.changeObjs){aC(ga,"changes",ga,f4.changeObjs)}}function cI(f1,f2){if(f1.curOp){return f2()}cE(f1);try{return f2()}finally{al(f1)}}function cW(f1,f2){return function(){if(f1.curOp){return f2.apply(f1,arguments)}cE(f1);try{return f2.apply(f1,arguments)}finally{al(f1)}}}function c2(f1){return function(){if(this.curOp){return f1.apply(this,arguments)}cE(this);try{return f1.apply(this,arguments)}finally{al(this)}}}function cA(f1){return function(){var f2=this.cm;if(!f2||f2.curOp){return f1.apply(this,arguments)}cE(f2);try{return f1.apply(this,arguments)}finally{al(f2)}}}function bt(f3,f1,f2){this.line=f1;this.rest=h(f1);this.size=this.rest?bL(fv(this.rest))-f2+1:1;this.node=this.text=null;this.hidden=fk(f3,f1)}function eJ(f1,f7,f6){var f5=[],f3;for(var f4=f7;f4<f6;f4=f3){var f2=new bt(f1.doc,e2(f1.doc,f4),f4);f3=f4+f2.size;f5.push(f2)}return f5}function ag(f8,f6,f7,f9){if(f6==null){f6=f8.doc.first}if(f7==null){f7=f8.doc.first+f8.doc.size}if(!f9){f9=0}var f3=f8.display;if(f9&&f7<f3.viewTo&&(f3.updateLineNumbers==null||f3.updateLineNumbers>f6)){f3.updateLineNumbers=f6}f8.curOp.viewChanged=true;if(f6>=f3.viewTo){if(a3&&aS(f8.doc,f6)<f3.viewTo){ek(f8)}}else{if(f7<=f3.viewFrom){if(a3&&dR(f8.doc,f7+f9)>f3.viewFrom){ek(f8)}else{f3.viewFrom+=f9;f3.viewTo+=f9}}else{if(f6<=f3.viewFrom&&f7>=f3.viewTo){ek(f8)}else{if(f6<=f3.viewFrom){var f5=c8(f8,f7,f7+f9,1);if(f5){f3.view=f3.view.slice(f5.index);f3.viewFrom=f5.lineN;f3.viewTo+=f9}else{ek(f8)}}else{if(f7>=f3.viewTo){var f5=c8(f8,f6,f6,-1);if(f5){f3.view=f3.view.slice(0,f5.index);f3.viewTo=f5.lineN}else{ek(f8)}}else{var f4=c8(f8,f6,f6,-1);var f2=c8(f8,f7,f7+f9,1);if(f4&&f2){f3.view=f3.view.slice(0,f4.index).concat(eJ(f8,f4.lineN,f2.lineN)).concat(f3.view.slice(f2.index));f3.viewTo+=f9}else{ek(f8)}}}}}}var f1=f3.externalMeasured;if(f1){if(f7<f1.lineN){f1.lineN+=f9}else{if(f6<f1.lineN+f1.size){f3.externalMeasured=null}}}}function S(f2,f3,f6){f2.curOp.viewChanged=true;var f7=f2.display,f5=f2.display.externalMeasured;if(f5&&f3>=f5.lineN&&f3<f5.lineN+f5.size){f7.externalMeasured=null}if(f3<f7.viewFrom||f3>=f7.viewTo){return}var f4=f7.view[dh(f2,f3)];if(f4.node==null){return}var f1=f4.changes||(f4.changes=[]);if(db(f1,f6)==-1){f1.push(f6)}}function ek(f1){f1.display.viewFrom=f1.display.viewTo=f1.doc.first;f1.display.view=[];f1.display.viewOffset=0}function dh(f1,f4){if(f4>=f1.display.viewTo){return null}f4-=f1.display.viewFrom;if(f4<0){return null}var f2=f1.display.view;for(var f3=0;f3<f2.length;f3++){f4-=f2[f3].size;if(f4<0){return f3}}}function c8(f9,f3,f5,f2){var f6=dh(f9,f3),f8,f7=f9.display.view;if(!a3||f5==f9.doc.first+f9.doc.size){return{index:f6,lineN:f5}}for(var f4=0,f1=f9.display.viewFrom;f4<f6;f4++){f1+=f7[f4].size}if(f1!=f3){if(f2>0){if(f6==f7.length-1){return null}f8=(f1+f7[f6].size)-f3;f6++}else{f8=f1-f3}f3+=f8;f5+=f8}while(aS(f9.doc,f5)!=f5){if(f6==(f2<0?0:f7.length-1)){return null}f5+=f2*f7[f6-(f2<0?1:0)].size;f6+=f2}return{index:f6,lineN:f5}}function cN(f1,f5,f4){var f3=f1.display,f2=f3.view;if(f2.length==0||f5>=f3.viewTo||f4<=f3.viewFrom){f3.view=eJ(f1,f5,f4);f3.viewFrom=f5}else{if(f3.viewFrom>f5){f3.view=eJ(f1,f5,f3.viewFrom).concat(f3.view)}else{if(f3.viewFrom<f5){f3.view=f3.view.slice(dh(f1,f5))}}f3.viewFrom=f5;if(f3.viewTo<f4){f3.view=f3.view.concat(eJ(f1,f3.viewTo,f4))}else{if(f3.viewTo>f4){f3.view=f3.view.slice(0,dh(f1,f4))}}}f3.viewTo=f4}function c5(f1){var f2=f1.display.view,f5=0;for(var f4=0;f4<f2.length;f4++){var f3=f2[f4];if(!f3.hidden&&(!f3.node||f3.changes)){++f5}}return f5}function bk(f1){if(f1.display.pollingFast){return}f1.display.poll.set(f1.options.pollInterval,function(){cf(f1);if(f1.state.focused){bk(f1)}})}function C(f1){var f2=false;f1.display.pollingFast=true;function f3(){var f4=cf(f1);if(!f4&&!f2){f2=true;f1.display.poll.set(60,f3)}else{f1.display.pollingFast=false;bk(f1)}}f1.display.poll.set(20,f3)}var bi=null;function cf(f5){var f6=f5.display.input,f9=f5.display.prevInput,gk=f5.doc;if(!f5.state.focused||(bq(f6)&&!f9)||ai(f5)||f5.options.disableInput){return false}if(f5.state.pasteIncoming&&f5.state.fakedLastChar){f6.value=f6.value.substring(0,f6.value.length-1);f5.state.fakedLastChar=false}var f8=f6.value;if(f8==f9&&!f5.somethingSelected()){return false}if(dz&&l>=9&&f5.display.inputHasSelection===f8||b5&&/[\uf700-\uf7ff]/.test(f8)){fc(f5);return false}var gg=!f5.curOp;if(gg){cE(f5)}f5.display.shift=false;if(f8.charCodeAt(0)==8203&&gk.sel==f5.display.selForContextMenu&&!f9){f9="\u200b"}var gf=0,gc=Math.min(f9.length,f8.length);while(gf<gc&&f9.charCodeAt(gf)==f8.charCodeAt(gf)){++gf}var f2=f8.slice(gf),ga=aW(f2);var gj=null;if(f5.state.pasteIncoming&&gk.sel.ranges.length>1){if(bi&&bi.join("\n")==f2){gj=gk.sel.ranges.length%bi.length==0&&bQ(bi,aW)}else{if(ga.length==gk.sel.ranges.length){gj=bQ(ga,function(gl){return[gl]})}}}for(var gh=gk.sel.ranges.length-1;gh>=0;gh--){var gb=gk.sel.ranges[gh];var gd=gb.from(),f1=gb.to();if(gf<f9.length){gd=X(gd.line,gd.ch-(f9.length-gf))}else{if(f5.state.overwrite&&gb.empty()&&!f5.state.pasteIncoming){f1=X(f1.line,Math.min(e2(gk,f1.line).text.length,f1.ch+fv(ga).length))}}var f4=f5.curOp.updateInput;var gi={from:gd,to:f1,text:gj?gj[gh%gj.length]:ga,origin:f5.state.pasteIncoming?"paste":f5.state.cutIncoming?"cut":"+input"};bb(f5.doc,gi);ad(f5,"inputRead",f5,gi);if(f2&&!f5.state.pasteIncoming&&f5.options.electricChars&&f5.options.smartIndent&&gb.head.ch<100&&(!gh||gk.sel.ranges[gh-1].head.line!=gb.head.line)){var f7=f5.getModeAt(gb.head);var f3=cR(gi);if(f7.electricChars){for(var ge=0;ge<f7.electricChars.length;ge++){if(f2.indexOf(f7.electricChars.charAt(ge))>-1){ac(f5,f3.line,"smart");break}}}else{if(f7.electricInput){if(f7.electricInput.test(e2(gk,f3.line).text.slice(0,f3.ch))){ac(f5,f3.line,"smart")}}}}}fu(f5);f5.curOp.updateInput=f4;f5.curOp.typing=true;if(f8.length>1000||f8.indexOf("\n")>-1){f6.value=f5.display.prevInput=""}else{f5.display.prevInput=f8}if(gg){al(f5)}f5.state.pasteIncoming=f5.state.cutIncoming=false;return true}function fc(f1,f5){var f2,f4,f7=f1.doc;if(f1.somethingSelected()){f1.display.prevInput="";var f3=f7.sel.primary();f2=c4&&(f3.to().line-f3.from().line>100||(f4=f1.getSelection()).length>1000);var f6=f2?"-":f4||f1.getSelection();f1.display.input.value=f6;if(f1.state.focused){dA(f1.display.input)}if(dz&&l>=9){f1.display.inputHasSelection=f6}}else{if(!f5){f1.display.prevInput=f1.display.input.value="";if(dz&&l>=9){f1.display.inputHasSelection=null}}}f1.display.inaccurateSelection=f2}function en(f1){if(f1.options.readOnly!="nocursor"&&(!d3||dC()!=f1.display.input)){f1.display.input.focus()}}function s(f1){if(!f1.state.focused){en(f1);cy(f1)}}function ai(f1){return f1.options.readOnly||f1.doc.cantEdit}function fD(f1){var f3=f1.display;bV(f3.scroller,"mousedown",cW(f1,eg));if(dz&&l<11){bV(f3.scroller,"dblclick",cW(f1,function(f7){if(aO(f1,f7)){return}var f8=cm(f1,f7);if(!f8||m(f1,f7)||a6(f1.display,f7)){return}cC(f7);var f6=f1.findWordAt(f8);fH(f1.doc,f6.anchor,f6.head)}))}else{bV(f3.scroller,"dblclick",function(f6){aO(f1,f6)||cC(f6)})}bV(f3.lineSpace,"selectstart",function(f6){if(!a6(f3,f6)){cC(f6)}});if(!fS){bV(f3.scroller,"contextmenu",function(f6){ay(f1,f6)})}bV(f3.scroller,"scroll",function(){if(f3.scroller.clientHeight){O(f1,f3.scroller.scrollTop);bC(f1,f3.scroller.scrollLeft,true);aC(f1,"scroll",f1)}});bV(f3.scrollbarV,"scroll",function(){if(f3.scroller.clientHeight){O(f1,f3.scrollbarV.scrollTop)}});bV(f3.scrollbarH,"scroll",function(){if(f3.scroller.clientHeight){bC(f1,f3.scrollbarH.scrollLeft)}});bV(f3.scroller,"mousewheel",function(f6){b(f1,f6)});bV(f3.scroller,"DOMMouseScroll",function(f6){b(f1,f6)});function f5(){if(f1.state.focused){setTimeout(ct(en,f1),0)}}bV(f3.scrollbarH,"mousedown",f5);bV(f3.scrollbarV,"mousedown",f5);bV(f3.wrapper,"scroll",function(){f3.wrapper.scrollTop=f3.wrapper.scrollLeft=0});bV(f3.input,"keyup",function(f6){bd.call(f1,f6)});bV(f3.input,"input",function(){if(dz&&l>=9&&f1.display.inputHasSelection){f1.display.inputHasSelection=null}C(f1)});bV(f3.input,"keydown",cW(f1,q));bV(f3.input,"keypress",cW(f1,cv));bV(f3.input,"focus",ct(cy,f1));bV(f3.input,"blur",ct(aR,f1));function f2(f6){if(!aO(f1,f6)){ee(f6)}}if(f1.options.dragDrop){bV(f3.scroller,"dragstart",function(f6){R(f1,f6)});bV(f3.scroller,"dragenter",f2);bV(f3.scroller,"dragover",f2);bV(f3.scroller,"drop",cW(f1,bf))}bV(f3.scroller,"paste",function(f6){if(a6(f3,f6)){return}f1.state.pasteIncoming=true;en(f1);C(f1)});bV(f3.input,"paste",function(){if(cU&&!f1.state.fakedLastChar&&!(new Date-f1.state.lastMiddleDown<200)){var f7=f3.input.selectionStart,f6=f3.input.selectionEnd;f3.input.value+="$";f3.input.selectionEnd=f6;f3.input.selectionStart=f7;f1.state.fakedLastChar=true}f1.state.pasteIncoming=true;C(f1)});function f4(ga){if(f1.somethingSelected()){bi=f1.getSelections();if(f3.inaccurateSelection){f3.prevInput="";f3.inaccurateSelection=false;f3.input.value=bi.join("\n");dA(f3.input)}}else{var gb=[],f7=[];for(var f8=0;f8<f1.doc.sel.ranges.length;f8++){var f6=f1.doc.sel.ranges[f8].head.line;var f9={anchor:X(f6,0),head:X(f6+1,0)};f7.push(f9);gb.push(f1.getRange(f9.anchor,f9.head))}if(ga.type=="cut"){f1.setSelections(f7,null,Z)}else{f3.prevInput="";f3.input.value=gb.join("\n");dA(f3.input)}bi=gb}if(ga.type=="cut"){f1.state.cutIncoming=true}}bV(f3.input,"cut",f4);bV(f3.input,"copy",f4);if(a7){bV(f3.sizer,"mouseup",function(){if(dC()==f3.input){f3.input.blur()}en(f1)})}}function aQ(f1){var f2=f1.display;f2.cachedCharWidth=f2.cachedTextHeight=f2.cachedPaddingH=null;f1.setSize()}function a6(f2,f1){for(var f3=M(f1);f3!=f2.wrapper;f3=f3.parentNode){if(!f3||f3.ignoreEvents||f3.parentNode==f2.sizer&&f3!=f2.mover){return true}}}function cm(gb,f5,f2,f3){var f7=gb.display;if(!f2){var f6=M(f5);if(f6==f7.scrollbarH||f6==f7.scrollbarV||f6==f7.scrollbarFiller||f6==f7.gutterFiller){return null}}var ga,f8,f1=f7.lineSpace.getBoundingClientRect();try{ga=f5.clientX-f1.left;f8=f5.clientY-f1.top}catch(f5){return null}var f9=fC(gb,ga,f8),gc;if(f3&&f9.xRel==1&&(gc=e2(gb.doc,f9.line).text).length==f9.ch){var f4=bR(gc,gc.length,gb.options.tabSize)-gc.length;f9=X(f9.line,Math.max(0,Math.round((ga-eS(gb.display).left)/dt(gb.display))-f4))}return f9}function eg(f3){if(aO(this,f3)){return}var f1=this,f2=f1.display;f2.shift=f3.shiftKey;if(a6(f2,f3)){if(!cU){f2.scroller.draggable=false;setTimeout(function(){f2.scroller.draggable=true},100)}return}if(m(f1,f3)){return}var f4=cm(f1,f3);window.focus();switch(fB(f3)){case 1:if(f4){ax(f1,f3,f4)}else{if(M(f3)==f2.scroller){cC(f3)}}break;case 2:if(cU){f1.state.lastMiddleDown=+new Date}if(f4){fH(f1.doc,f4)}setTimeout(ct(en,f1),20);cC(f3);break;case 3:if(fS){ay(f1,f3)}break}}var de,c7;function ax(f2,f6,f7){setTimeout(ct(s,f2),0);var f3=+new Date,f4;if(c7&&c7.time>f3-400&&cd(c7.pos,f7)==0){f4="triple"}else{if(de&&de.time>f3-400&&cd(de.pos,f7)==0){f4="double";c7={time:f3,pos:f7}}else{f4="single";de={time:f3,pos:f7}}}var f5=f2.doc.sel,f1=b5?f6.metaKey:f6.ctrlKey;if(f2.options.dragDrop&&ez&&!ai(f2)&&f4=="single"&&f5.contains(f7)>-1&&f5.somethingSelected()){aZ(f2,f6,f7,f1)}else{n(f2,f6,f7,f4,f1)}}function aZ(f3,f5,f6,f2){var f4=f3.display;var f1=cW(f3,function(f7){if(cU){f4.scroller.draggable=false}f3.state.draggingText=false;d0(document,"mouseup",f1);d0(f4.scroller,"drop",f1);if(Math.abs(f5.clientX-f7.clientX)+Math.abs(f5.clientY-f7.clientY)<10){cC(f7);if(!f2){fH(f3.doc,f6)}en(f3);if(dz&&l==9){setTimeout(function(){document.body.focus();en(f3)},20)}}});if(cU){f4.scroller.draggable=true}f3.state.draggingText=f1;if(f4.scroller.dragDrop){f4.scroller.dragDrop()}bV(document,"mouseup",f1);bV(f4.scroller,"drop",f1)}function n(f4,gi,f3,f1,f6){var gf=f4.display,gk=f4.doc;cC(gi);var f2,gj,f5=gk.sel;if(f6&&!gi.shiftKey){gj=gk.sel.contains(f3);if(gj>-1){f2=gk.sel.ranges[gj]}else{f2=new dM(f3,f3)}}else{f2=gk.sel.primary()}if(gi.altKey){f1="rect";if(!f6){f2=new dM(f3,f3)}f3=cm(f4,gi,true,true);gj=-1}else{if(f1=="double"){var gg=f4.findWordAt(f3);if(f4.display.shift||gk.extend){f2=fj(gk,f2,gg.anchor,gg.head)}else{f2=gg}}else{if(f1=="triple"){var f9=new dM(X(f3.line,0),fx(gk,X(f3.line+1,0)));if(f4.display.shift||gk.extend){f2=fj(gk,f2,f9.anchor,f9.head)}else{f2=f9}}else{f2=fj(gk,f2,f3)}}}if(!f6){gj=0;bS(gk,new fL([f2],0),N);f5=gk.sel}else{if(gj>-1){e(gk,gj,f2,N)}else{gj=gk.sel.ranges.length;bS(gk,cu(gk.sel.ranges.concat([f2]),gj),{scroll:false,origin:"*mouse"})}}var ge=f3;function gd(gv){if(cd(ge,gv)==0){return}ge=gv;if(f1=="rect"){var gm=[],gs=f4.options.tabSize;var gl=bR(e2(gk,f3.line).text,f3.ch,gs);var gy=bR(e2(gk,gv.line).text,gv.ch,gs);var gn=Math.min(gl,gy),gw=Math.max(gl,gy);for(var gz=Math.min(f3.line,gv.line),gp=Math.min(f4.lastLine(),Math.max(f3.line,gv.line));gz<=gp;gz++){var gx=e2(gk,gz).text,go=ed(gx,gn,gs);if(gn==gw){gm.push(new dM(X(gz,go),X(gz,go)))}else{if(gx.length>go){gm.push(new dM(X(gz,go),X(gz,ed(gx,gw,gs))))}}}if(!gm.length){gm.push(new dM(f3,f3))}bS(gk,cu(f5.ranges.slice(0,gj).concat(gm),gj),{origin:"*mouse",scroll:false});f4.scrollIntoView(gv)}else{var gt=f2;var gq=gt.anchor,gu=gv;if(f1!="single"){if(f1=="double"){var gr=f4.findWordAt(gv)}else{var gr=new dM(X(gv.line,0),fx(gk,X(gv.line+1,0)))}if(cd(gr.anchor,gq)>0){gu=gr.head;gq=aq(gt.from(),gr.anchor)}else{gu=gr.anchor;gq=bv(gt.to(),gr.head)}}var gm=f5.ranges.slice(0);gm[gj]=new dM(fx(gk,gq),gu);bS(gk,cu(gm,gj),N)}}var gb=gf.wrapper.getBoundingClientRect();var f7=0;function gh(gn){var gl=++f7;var gp=cm(f4,gn,true,f1=="rect");if(!gp){return}if(cd(gp,ge)!=0){s(f4);gd(gp);var go=b4(gf,gk);if(gp.line>=go.to||gp.line<go.from){setTimeout(cW(f4,function(){if(f7==gl){gh(gn)}}),150)}}else{var gm=gn.clientY<gb.top?-20:gn.clientY>gb.bottom?20:0;if(gm){setTimeout(cW(f4,function(){if(f7!=gl){return}gf.scroller.scrollTop+=gm;gh(gn)}),50)}}}function ga(gl){f7=Infinity;cC(gl);en(f4);d0(document,"mousemove",gc);d0(document,"mouseup",f8);gk.history.lastSelOrigin=null}var gc=cW(f4,function(gl){if(!fB(gl)){ga(gl)}else{gh(gl)}});var f8=cW(f4,ga);bV(document,"mousemove",gc);bV(document,"mouseup",f8)}function fZ(gc,f8,ga,gb,f4){try{var f2=f8.clientX,f1=f8.clientY}catch(f8){return false}if(f2>=Math.floor(gc.display.gutters.getBoundingClientRect().right)){return false}if(gb){cC(f8)}var f9=gc.display;var f7=f9.lineDiv.getBoundingClientRect();if(f1>f7.bottom||!e5(gc,ga)){return bJ(f8)}f1-=f7.top-f9.viewOffset;for(var f5=0;f5<gc.options.gutters.length;++f5){var f6=f9.gutters.childNodes[f5];if(f6&&f6.getBoundingClientRect().right>=f2){var gd=bE(gc.doc,f1);var f3=gc.options.gutters[f5];f4(gc,ga,gc,gd,f3,f8);return bJ(f8)}}}function m(f1,f2){return fZ(f1,f2,"gutterClick",true,ad)}var af=0;function bf(f7){var f9=this;if(aO(f9,f7)||a6(f9.display,f7)){return}cC(f7);if(dz){af=+new Date}var f8=cm(f9,f7,true),f1=f7.dataTransfer.files;if(!f8||ai(f9)){return}if(f1&&f1.length&&window.FileReader&&window.File){var f3=f1.length,ga=Array(f3),f2=0;var f5=function(gd,gc){var gb=new FileReader;gb.onload=cW(f9,function(){ga[gc]=gb.result;if(++f2==f3){f8=fx(f9.doc,f8);var ge={from:f8,to:f8,text:aW(ga.join("\n")),origin:"paste"};bb(f9.doc,ge);eU(f9.doc,eG(f8,cR(ge)))}});gb.readAsText(gd)};for(var f6=0;f6<f3;++f6){f5(f1[f6],f6)}}else{if(f9.state.draggingText&&f9.doc.sel.contains(f8)>-1){f9.state.draggingText(f7);setTimeout(ct(en,f9),20);return}try{var ga=f7.dataTransfer.getData("Text");if(ga){if(f9.state.draggingText&&!(b5?f7.metaKey:f7.ctrlKey)){var f4=f9.listSelections()}ec(f9.doc,eG(f8,f8));if(f4){for(var f6=0;f6<f4.length;++f6){aX(f9.doc,"",f4[f6].anchor,f4[f6].head,"drag")}}f9.replaceSelection(ga,"around","paste");en(f9)}}catch(f7){}}}function R(f1,f3){if(dz&&(!f1.state.draggingText||+new Date-af<100)){ee(f3);return}if(aO(f1,f3)||a6(f1.display,f3)){return}f3.dataTransfer.setData("Text",f1.getSelection());if(f3.dataTransfer.setDragImage&&!aB){var f2=fK("img",null,null,"position: fixed; left: 0; top: 0;");f2.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(dQ){f2.width=f2.height=1;f1.display.wrapper.appendChild(f2);f2._top=f2.offsetTop}f3.dataTransfer.setDragImage(f2,0,0);if(dQ){f2.parentNode.removeChild(f2)}}}function O(f1,f2){if(Math.abs(f1.doc.scrollTop-f2)<2){return}f1.doc.scrollTop=f2;if(!cn){dH(f1,{top:f2})}if(f1.display.scroller.scrollTop!=f2){f1.display.scroller.scrollTop=f2}if(f1.display.scrollbarV.scrollTop!=f2){f1.display.scrollbarV.scrollTop=f2}if(cn){dH(f1)}d2(f1,100)}function bC(f1,f3,f2){if(f2?f3==f1.doc.scrollLeft:Math.abs(f1.doc.scrollLeft-f3)<2){return}f3=Math.min(f3,f1.display.scroller.scrollWidth-f1.display.scroller.clientWidth);f1.doc.scrollLeft=f3;es(f1);if(f1.display.scroller.scrollLeft!=f3){f1.display.scroller.scrollLeft=f3}if(f1.display.scrollbarH.scrollLeft!=f3){f1.display.scrollbarH.scrollLeft=f3}}var e9=0,ce=null;if(dz){ce=-0.53}else{if(cn){ce=15}else{if(c6){ce=-0.7}else{if(aB){ce=-1/3}}}}function b(f9,f3){var gc=f3.wheelDeltaX,gb=f3.wheelDeltaY;if(gc==null&&f3.detail&&f3.axis==f3.HORIZONTAL_AXIS){gc=f3.detail}if(gb==null&&f3.detail&&f3.axis==f3.VERTICAL_AXIS){gb=f3.detail}else{if(gb==null){gb=f3.wheelDelta}}var f5=f9.display,f8=f5.scroller;if(!(gc&&f8.scrollWidth>f8.clientWidth||gb&&f8.scrollHeight>f8.clientHeight)){return}if(gb&&b5&&cU){outer:for(var ga=f3.target,f7=f5.view;ga!=f8;ga=ga.parentNode){for(var f2=0;f2<f7.length;f2++){if(f7[f2].node==ga){f9.display.currentWheelTarget=ga;break outer}}}}if(gc&&!cn&&!dQ&&ce!=null){if(gb){O(f9,Math.max(0,Math.min(f8.scrollTop+gb*ce,f8.scrollHeight-f8.clientHeight)))}bC(f9,Math.max(0,Math.min(f8.scrollLeft+gc*ce,f8.scrollWidth-f8.clientWidth)));cC(f3);f5.wheelStartX=null;return}if(gb&&ce!=null){var f1=gb*ce;var f6=f9.doc.scrollTop,f4=f6+f5.wrapper.clientHeight;if(f1<0){f6=Math.max(0,f6+f1-50)}else{f4=Math.min(f9.doc.height,f4+f1+50)}dH(f9,{top:f6,bottom:f4})}if(e9<20){if(f5.wheelStartX==null){f5.wheelStartX=f8.scrollLeft;f5.wheelStartY=f8.scrollTop;f5.wheelDX=gc;f5.wheelDY=gb;setTimeout(function(){if(f5.wheelStartX==null){return}var gd=f8.scrollLeft-f5.wheelStartX;var gf=f8.scrollTop-f5.wheelStartY;var ge=(gf&&f5.wheelDY&&gf/f5.wheelDY)||(gd&&f5.wheelDX&&gd/f5.wheelDX);f5.wheelStartX=f5.wheelStartY=null;if(!ge){return}ce=(ce*e9+ge)/(e9+1);++e9},200)}else{f5.wheelDX+=gc;f5.wheelDY+=gb}}}function fE(f2,f5,f1){if(typeof f5=="string"){f5=er[f5];if(!f5){return false}}if(f2.display.pollingFast&&cf(f2)){f2.display.pollingFast=false}var f4=f2.display.shift,f3=false;try{if(ai(f2)){f2.state.suppressEdits=true}if(f1){f2.display.shift=false}f3=f5(f2)!=b8}finally{f2.display.shift=f4;f2.state.suppressEdits=false}return f3}function dj(f1){var f2=f1.state.keyMaps.slice(0);if(f1.options.extraKeys){f2.push(f1.options.extraKeys)}f2.push(f1.options.keyMap);return f2}var ar;function e6(f1,f7){var f2=fI(f1.options.keyMap),f5=f2.auto;clearTimeout(ar);if(f5&&!eq(f7)){ar=setTimeout(function(){if(fI(f1.options.keyMap)==f2){f1.options.keyMap=(f5.call?f5.call(null,f1):f5);fY(f1)}},50)}var f4=ff(f7,true),f6=false;if(!f4){return false}var f3=dj(f1);if(f7.shiftKey){f6=i("Shift-"+f4,f3,function(f8){return fE(f1,f8,true)})||i(f4,f3,function(f8){if(typeof f8=="string"?/^go[A-Z]/.test(f8):f8.motion){return fE(f1,f8)}})}else{f6=i(f4,f3,function(f8){return fE(f1,f8)})}if(f6){cC(f7);p(f1);ad(f1,"keyHandled",f1,f4,f7)}return f6}function d6(f1,f4,f2){var f3=i("'"+f2+"'",dj(f1),function(f5){return fE(f1,f5,true)});if(f3){cC(f4);p(f1);ad(f1,"keyHandled",f1,"'"+f2+"'",f4)}return f3}var dd=null;function q(f4){var f1=this;s(f1);if(aO(f1,f4)){return}if(dz&&l<11&&f4.keyCode==27){f4.returnValue=false}var f2=f4.keyCode;f1.display.shift=f2==16||f4.shiftKey;var f3=e6(f1,f4);if(dQ){dd=f3?f2:null;if(!f3&&f2==88&&!c4&&(b5?f4.metaKey:f4.ctrlKey)){f1.replaceSelection("",null,"cut")}}if(f2==18&&!/\bCodeMirror-crosshair\b/.test(f1.display.lineDiv.className)){av(f1)}}function av(f2){var f3=f2.display.lineDiv;fo(f3,"CodeMirror-crosshair");function f1(f4){if(f4.keyCode==18||!f4.altKey){f(f3,"CodeMirror-crosshair");d0(document,"keyup",f1);d0(document,"mouseover",f1)}}bV(document,"keyup",f1);bV(document,"mouseover",f1)}function bd(f1){if(f1.keyCode==16){this.doc.sel.shift=false}aO(this,f1)}function cv(f5){var f1=this;if(aO(f1,f5)||f5.ctrlKey&&!f5.altKey||b5&&f5.metaKey){return}var f4=f5.keyCode,f2=f5.charCode;if(dQ&&f4==dd){dd=null;cC(f5);return}if(((dQ&&(!f5.which||f5.which<10))||a7)&&e6(f1,f5)){return}var f3=String.fromCharCode(f2==null?f4:f2);if(d6(f1,f5,f3)){return}if(dz&&l>=9){f1.display.inputHasSelection=null}C(f1)}function cy(f1){if(f1.options.readOnly=="nocursor"){return}if(!f1.state.focused){aC(f1,"focus",f1);f1.state.focused=true;fo(f1.display.wrapper,"CodeMirror-focused");if(!f1.curOp&&f1.display.selForContextMenu!=f1.doc.sel){fc(f1);if(cU){setTimeout(ct(fc,f1,true),0)}}}bk(f1);p(f1)}function aR(f1){if(f1.state.focused){aC(f1,"blur",f1);f1.state.focused=false;f(f1.display.wrapper,"CodeMirror-focused")}clearInterval(f1.display.blinker);setTimeout(function(){if(!f1.state.focused){f1.display.shift=false}},150)}function ay(ga,f5){if(aO(ga,f5,"contextmenu")){return}var f7=ga.display;if(a6(f7,f5)||da(ga,f5)){return}var f9=cm(ga,f5),f1=f7.scroller.scrollTop;if(!f9||dQ){return}var f4=ga.options.resetSelectionOnContextMenu;if(f4&&ga.doc.sel.contains(f9)==-1){cW(ga,bS)(ga.doc,eG(f9),Z)}var f6=f7.input.style.cssText;f7.inputDiv.style.position="absolute";f7.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(f5.clientY-5)+"px; left: "+(f5.clientX-5)+"px; z-index: 1000; background: "+(dz?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(cU){var gb=window.scrollY}en(ga);if(cU){window.scrollTo(null,gb)}fc(ga);if(!ga.somethingSelected()){f7.input.value=f7.prevInput=" "}f7.selForContextMenu=ga.doc.sel;clearTimeout(f7.detectingSelectAll);function f3(){if(f7.input.selectionStart!=null){var gc=ga.somethingSelected();var gd=f7.input.value="\u200b"+(gc?f7.input.value:"");f7.prevInput=gc?"":"\u200b";f7.input.selectionStart=1;f7.input.selectionEnd=gd.length;f7.selForContextMenu=ga.doc.sel}}function f8(){f7.inputDiv.style.position="relative";f7.input.style.cssText=f6;if(dz&&l<9){f7.scrollbarV.scrollTop=f7.scroller.scrollTop=f1}bk(ga);if(f7.input.selectionStart!=null){if(!dz||(dz&&l<9)){f3()}var gc=0,gd=function(){if(f7.selForContextMenu==ga.doc.sel&&f7.input.selectionStart==0){cW(ga,er.selectAll)(ga)}else{if(gc++<10){f7.detectingSelectAll=setTimeout(gd,500)}else{fc(ga)}}};f7.detectingSelectAll=setTimeout(gd,200)}}if(dz&&l>=9){f3()}if(fS){ee(f5);var f2=function(){d0(window,"mouseup",f2);setTimeout(f8,20)};bV(window,"mouseup",f2)}else{setTimeout(f8,50)}}function da(f1,f2){if(!e5(f1,"gutterContextMenu")){return false}return fZ(f1,f2,"gutterContextMenu",false,aC)}var cR=J.changeEnd=function(f1){if(!f1.text){return f1.to}return X(f1.from.line+f1.text.length-1,fv(f1.text).length+(f1.text.length==1?f1.from.ch:0))};function bX(f4,f3){if(cd(f4,f3.from)<0){return f4}if(cd(f4,f3.to)<=0){return cR(f3)}var f1=f4.line+f3.text.length-(f3.to.line-f3.from.line)-1,f2=f4.ch;if(f4.line==f3.to.line){f2+=cR(f3).ch-f3.to.ch}return X(f1,f2)}function e7(f4,f5){var f2=[];for(var f3=0;f3<f4.sel.ranges.length;f3++){var f1=f4.sel.ranges[f3];f2.push(new dM(bX(f1.anchor,f5),bX(f1.head,f5)))}return cu(f2,f4.sel.primIndex)}function bs(f3,f2,f1){if(f3.line==f2.line){return X(f1.line,f3.ch-f2.ch+f1.ch)}else{return X(f1.line+(f3.line-f2.line),f3.ch)}}function ae(gb,f8,f2){var f3=[];var f1=X(gb.first,0),gc=f1;for(var f5=0;f5<f8.length;f5++){var f7=f8[f5];var ga=bs(f7.from,f1,gc);var f9=bs(cR(f7),f1,gc);f1=f7.to;gc=f9;if(f2=="around"){var f6=gb.sel.ranges[f5],f4=cd(f6.head,f6.anchor)<0;f3[f5]=new dM(f4?f9:ga,f4?ga:f9)}else{f3[f5]=new dM(ga,ga)}}return new fL(f3,gb.sel.primIndex)}function dF(f2,f4,f3){var f1={canceled:false,from:f4.from,to:f4.to,text:f4.text,origin:f4.origin,cancel:function(){this.canceled=true}};if(f3){f1.update=function(f8,f7,f6,f5){if(f8){this.from=fx(f2,f8)}if(f7){this.to=fx(f2,f7)}if(f6){this.text=f6}if(f5!==undefined){this.origin=f5}}}aC(f2,"beforeChange",f2,f1);if(f2.cm){aC(f2.cm,"beforeChange",f2.cm,f1)}if(f1.canceled){return null}return{from:f1.from,to:f1.to,text:f1.text,origin:f1.origin}}function bb(f4,f5,f3){if(f4.cm){if(!f4.cm.curOp){return cW(f4.cm,bb)(f4,f5,f3)}if(f4.cm.state.suppressEdits){return}}if(e5(f4,"beforeChange")||f4.cm&&e5(f4.cm,"beforeChange")){f5=dF(f4,f5,true);if(!f5){return}}var f2=fV&&!f3&&cD(f4,f5.from,f5.to);if(f2){for(var f1=f2.length-1;f1>=0;--f1){L(f4,{from:f2[f1].from,to:f2[f1].to,text:f1?[""]:f5.text})}}else{L(f4,f5)}}function L(f3,f4){if(f4.text.length==1&&f4.text[0]==""&&cd(f4.from,f4.to)==0){return}var f2=e7(f3,f4);fA(f3,f4,f2,f3.cm?f3.cm.curOp.id:NaN);d1(f3,f4,f2,d7(f3,f4));var f1=[];dV(f3,function(f6,f5){if(!f5&&db(f1,f6.history)==-1){du(f6.history,f4);f1.push(f6.history)}d1(f6,f4,null,d7(f6,f4))})}function b6(gc,ga,ge){if(gc.cm&&gc.cm.state.suppressEdits){return}var f9=gc.history,f3,f5=gc.sel;var f1=ga=="undo"?f9.done:f9.undone,gd=ga=="undo"?f9.undone:f9.done;for(var f6=0;f6<f1.length;f6++){f3=f1[f6];if(ge?f3.ranges&&!f3.equals(gc.sel):!f3.ranges){break}}if(f6==f1.length){return}f9.lastOrigin=f9.lastSelOrigin=null;for(;;){f3=f1.pop();if(f3.ranges){cJ(f3,gd);if(ge&&!f3.equals(gc.sel)){bS(gc,f3,{clearRedo:false});return}f5=f3}else{break}}var f8=[];cJ(f5,gd);gd.push({changes:f8,generation:f9.generation});f9.generation=f3.generation||++f9.maxGeneration;var f4=e5(gc,"beforeChange")||gc.cm&&e5(gc.cm,"beforeChange");for(var f6=f3.changes.length-1;f6>=0;--f6){var gb=f3.changes[f6];gb.origin=ga;if(f4&&!dF(gc,gb,false)){f1.length=0;return}f8.push(dk(gc,gb));var f2=f6?e7(gc,gb):fv(f1);d1(gc,gb,f2,dX(gc,gb));if(!f6&&gc.cm){gc.cm.scrollIntoView({from:gb.from,to:cR(gb)})}var f7=[];dV(gc,function(gg,gf){if(!gf&&db(f7,gg.history)==-1){du(gg.history,gb);f7.push(gg.history)}d1(gg,gb,null,dX(gg,gb))})}}function fa(f2,f4){if(f4==0){return}f2.first+=f4;f2.sel=new fL(bQ(f2.sel.ranges,function(f5){return new dM(X(f5.anchor.line+f4,f5.anchor.ch),X(f5.head.line+f4,f5.head.ch))}),f2.sel.primIndex);if(f2.cm){ag(f2.cm,f2.first,f2.first-f4,f4);for(var f3=f2.cm.display,f1=f3.viewFrom;f1<f3.viewTo;f1++){S(f2.cm,f1,"gutter")}}}function d1(f5,f6,f4,f2){if(f5.cm&&!f5.cm.curOp){return cW(f5.cm,d1)(f5,f6,f4,f2)}if(f6.to.line<f5.first){fa(f5,f6.text.length-1-(f6.to.line-f6.from.line));return}if(f6.from.line>f5.lastLine()){return}if(f6.from.line<f5.first){var f1=f6.text.length-1-(f5.first-f6.from.line);fa(f5,f1);f6={from:X(f5.first,0),to:X(f6.to.line+f1,f6.to.ch),text:[fv(f6.text)],origin:f6.origin}}var f3=f5.lastLine();if(f6.to.line>f3){f6={from:f6.from,to:X(f3,e2(f5,f3).text.length),text:[f6.text[0]],origin:f6.origin}}f6.removed=fM(f5,f6.from,f6.to);if(!f4){f4=e7(f5,f6)}if(f5.cm){aH(f5.cm,f6,f2)}else{fm(f5,f6,f2)}ec(f5,f4,Z)}function aH(gc,f8,f6){var gb=gc.doc,f7=gc.display,f9=f8.from,ga=f8.to;var f1=false,f5=f9.line;if(!gc.options.lineWrapping){f5=bL(z(e2(gb,f9.line)));gb.iter(f5,ga.line+1,function(ge){if(ge==f7.maxLine){f1=true;return true}})}if(gb.sel.contains(f8.from,f8.to)>-1){W(gc)}fm(gb,f8,f6,a9(gc));if(!gc.options.lineWrapping){gb.iter(f5,f9.line+f8.text.length,function(gf){var ge=d9(gf);if(ge>f7.maxLineLength){f7.maxLine=gf;f7.maxLineLength=ge;f7.maxLineChanged=true;f1=false}});if(f1){gc.curOp.updateMaxLine=true}}gb.frontier=Math.min(gb.frontier,f9.line);d2(gc,400);var gd=f8.text.length-(ga.line-f9.line)-1;if(f9.line==ga.line&&f8.text.length==1&&!dG(gc.doc,f8)){S(gc,f9.line,"text")}else{ag(gc,f9.line,ga.line+1,gd)}var f3=e5(gc,"changes"),f4=e5(gc,"change");if(f4||f3){var f2={from:f9,to:ga,text:f8.text,removed:f8.removed,origin:f8.origin};if(f4){ad(gc,"change",gc,f2)}if(f3){(gc.curOp.changeObjs||(gc.curOp.changeObjs=[])).push(f2)}}gc.display.selForContextMenu=null}function aX(f4,f3,f6,f5,f1){if(!f5){f5=f6}if(cd(f5,f6)<0){var f2=f5;f5=f6;f6=f2}if(typeof f3=="string"){f3=aW(f3)}bb(f4,{from:f6,to:f5,text:f3,origin:f1})}function dU(f2,f5){var f6=f2.display,f3=f6.sizer.getBoundingClientRect(),f1=null;if(f5.top+f3.top<0){f1=true}else{if(f5.bottom+f3.top>(window.innerHeight||document.documentElement.clientHeight)){f1=false}}if(f1!=null&&!fi){var f4=fK("div","\u200b",null,"position: absolute; top: "+(f5.top-f6.viewOffset-eV(f2.display))+"px; height: "+(f5.bottom-f5.top+bg)+"px; left: "+f5.left+"px; width: 2px;");f2.display.lineSpace.appendChild(f4);f4.scrollIntoView(f1);f2.display.lineSpace.removeChild(f4)}}function F(ga,f8,f5,f4){if(f4==null){f4=0}for(;;){var f6=false,f9=dI(ga,f8);var f1=!f5||f5==f8?f9:dI(ga,f5);var f3=I(ga,Math.min(f9.left,f1.left),Math.min(f9.top,f1.top)-f4,Math.max(f9.left,f1.left),Math.max(f9.bottom,f1.bottom)+f4);var f7=ga.doc.scrollTop,f2=ga.doc.scrollLeft;if(f3.scrollTop!=null){O(ga,f3.scrollTop);if(Math.abs(ga.doc.scrollTop-f7)>1){f6=true}}if(f3.scrollLeft!=null){bC(ga,f3.scrollLeft);if(Math.abs(ga.doc.scrollLeft-f2)>1){f6=true}}if(!f6){return f9}}}function G(f1,f3,f5,f2,f4){var f6=I(f1,f3,f5,f2,f4);if(f6.scrollTop!=null){O(f1,f6.scrollTop)}if(f6.scrollLeft!=null){bC(f1,f6.scrollLeft)}}function I(gd,f4,gc,f2,gb){var f9=gd.display,f7=aT(gd.display);if(gc<0){gc=0}var f5=gd.curOp&&gd.curOp.scrollTop!=null?gd.curOp.scrollTop:f9.scroller.scrollTop;var gf=f9.scroller.clientHeight-bg,gh={};if(gb-gc>gf){gb=gc+gf}var f3=gd.doc.height+bG(f9);var f1=gc<f7,f8=gb>f3-f7;if(gc<f5){gh.scrollTop=f1?0:gc}else{if(gb>f5+gf){var ga=Math.min(gc,(f8?f3:gb)-gf);if(ga!=f5){gh.scrollTop=ga}}}var gg=gd.curOp&&gd.curOp.scrollLeft!=null?gd.curOp.scrollLeft:f9.scroller.scrollLeft;var ge=f9.scroller.clientWidth-bg-f9.gutters.offsetWidth;var f6=f2-f4>ge;if(f6){f2=gc+gf}if(f4<10){gh.scrollLeft=0}else{if(f4<gg){gh.scrollLeft=Math.max(0,f4-(f6?0:10))}else{if(f2>ge+gg-3){gh.scrollLeft=f2+(f6?0:10)-ge}}}return gh}function cH(f1,f3,f2){if(f3!=null||f2!=null){fq(f1)}if(f3!=null){f1.curOp.scrollLeft=(f1.curOp.scrollLeft==null?f1.doc.scrollLeft:f1.curOp.scrollLeft)+f3}if(f2!=null){f1.curOp.scrollTop=(f1.curOp.scrollTop==null?f1.doc.scrollTop:f1.curOp.scrollTop)+f2}}function fu(f1){fq(f1);var f2=f1.getCursor(),f4=f2,f3=f2;if(!f1.options.lineWrapping){f4=f2.ch?X(f2.line,f2.ch-1):f2;f3=X(f2.line,f2.ch+1)}f1.curOp.scrollToPos={from:f4,to:f3,margin:f1.options.cursorScrollMargin,isCursor:true}}function fq(f1){var f3=f1.curOp.scrollToPos;if(f3){f1.curOp.scrollToPos=null;var f5=dx(f1,f3.from),f4=dx(f1,f3.to);var f2=I(f1,Math.min(f5.left,f4.left),Math.min(f5.top,f4.top)-f3.margin,Math.max(f5.right,f4.right),Math.max(f5.bottom,f4.bottom)+f3.margin);f1.scrollTo(f2.scrollLeft,f2.scrollTop)}}function ac(ge,f4,gd,f3){var gc=ge.doc,f2;if(gd==null){gd="add"}if(gd=="smart"){if(!gc.mode.indent){gd="prev"}else{f2=dr(ge,f4)}}var f8=ge.options.tabSize;var gf=e2(gc,f4),f7=bR(gf.text,null,f8);if(gf.stateAfter){gf.stateAfter=null}var f1=gf.text.match(/^\s*/)[0],ga;if(!f3&&!/\S/.test(gf.text)){ga=0;gd="not"}else{if(gd=="smart"){ga=gc.mode.indent(f2,gf.text.slice(f1.length),gf.text);if(ga==b8||ga>150){if(!f3){return}gd="prev"}}}if(gd=="prev"){if(f4>gc.first){ga=bR(e2(gc,f4-1).text,null,f8)}else{ga=0}}else{if(gd=="add"){ga=f7+ge.options.indentUnit}else{if(gd=="subtract"){ga=f7-ge.options.indentUnit}else{if(typeof gd=="number"){ga=f7+gd}}}}ga=Math.max(0,ga);var gb="",f9=0;if(ge.options.indentWithTabs){for(var f5=Math.floor(ga/f8);f5;--f5){f9+=f8;gb+="\t"}}if(f9<ga){gb+=co(ga-f9)}if(gb!=f1){aX(gc,gb,X(f4,0),X(f4,f1.length),"+input")}else{for(var f5=0;f5<gc.sel.ranges.length;f5++){var f6=gc.sel.ranges[f5];if(f6.head.line==f4&&f6.head.ch<f1.length){var f9=X(f4,f1.length);e(gc,f5,new dM(f9,f9));break}}}gf.stateAfter=null}function em(f4,f3,f1,f6){var f5=f3,f2=f3;if(typeof f3=="number"){f2=e2(f4,cZ(f4,f3))}else{f5=bL(f3)}if(f5==null){return null}if(f6(f2,f5)&&f4.cm){S(f4.cm,f5,f1)}return f2}function eL(f1,f7){var f2=f1.doc.sel.ranges,f5=[];for(var f4=0;f4<f2.length;f4++){var f3=f7(f2[f4]);while(f5.length&&cd(f3.from,fv(f5).to)<=0){var f6=f5.pop();if(cd(f6.from,f3.from)<0){f3.from=f6.from;break}}f5.push(f3)}cI(f1,function(){for(var f8=f5.length-1;f8>=0;f8--){aX(f1.doc,"",f5[f8].from,f5[f8].to,"+delete")}fu(f1)})}function bu(gj,f5,gd,gc,f7){var ga=f5.line,gb=f5.ch,gi=gd;var f2=e2(gj,ga);var gg=true;function gh(){var gk=ga+gd;if(gk<gj.first||gk>=gj.first+gj.size){return(gg=false)}ga=gk;return f2=e2(gj,gk)}function gf(gl){var gk=(f7?v:ah)(f2,gb,gd,true);if(gk==null){if(!gl&&gh()){if(f7){gb=(gd<0?cO:cB)(f2)}else{gb=gd<0?f2.text.length:0}}else{return(gg=false)}}else{gb=gk}return true}if(gc=="char"){gf()}else{if(gc=="column"){gf(true)}else{if(gc=="word"||gc=="group"){var ge=null,f8=gc=="group";var f1=gj.cm&&gj.cm.getHelper(f5,"wordChars");for(var f6=true;;f6=false){if(gd<0&&!gf(!f6)){break}var f3=f2.text.charAt(gb)||"\n";var f4=cx(f3,f1)?"w":f8&&f3=="\n"?"n":!f8||/\s/.test(f3)?null:"p";if(f8&&!f6&&!f4){f4="s"}if(ge&&ge!=f4){if(gd<0){gd=1;gf()}break}if(f4){ge=f4}if(gd>0&&!gf(!f6)){break}}}}}var f9=bT(gj,X(ga,gb),gi,true);if(!gg){f9.hitSide=true}return f9}function bo(f9,f4,f1,f8){var f7=f9.doc,f6=f4.left,f5;if(f8=="page"){var f3=Math.min(f9.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);f5=f4.top+f1*(f3-(f1<0?1.5:0.5)*aT(f9.display))}else{if(f8=="line"){f5=f1>0?f4.bottom+3:f4.top-3}}for(;;){var f2=fC(f9,f6,f5);if(!f2.outside){break}if(f1<0?f5<=0:f5>=f7.height){f2.hitSide=true;break}f5+=f1*5}return f2}J.prototype={constructor:J,focus:function(){window.focus();en(this);C(this)},setOption:function(f3,f4){var f2=this.options,f1=f2[f3];if(f2[f3]==f4&&f3!="mode"){return}f2[f3]=f4;if(ba.hasOwnProperty(f3)){cW(this,ba[f3])(this,f4,f1)}},getOption:function(f1){return this.options[f1]},getDoc:function(){return this.doc},addKeyMap:function(f2,f1){this.state.keyMaps[f1?"push":"unshift"](f2)},removeKeyMap:function(f2){var f3=this.state.keyMaps;for(var f1=0;f1<f3.length;++f1){if(f3[f1]==f2||(typeof f3[f1]!="string"&&f3[f1].name==f2)){f3.splice(f1,1);return true}}},addOverlay:c2(function(f1,f2){var f3=f1.token?f1:J.getMode(this.options,f1);if(f3.startState){throw new Error("Overlays may not be stateful.")}this.state.overlays.push({mode:f3,modeSpec:f1,opaque:f2&&f2.opaque});this.state.modeGen++;ag(this)}),removeOverlay:c2(function(f1){var f3=this.state.overlays;for(var f2=0;f2<f3.length;++f2){var f4=f3[f2].modeSpec;if(f4==f1||typeof f1=="string"&&f4.name==f1){f3.splice(f2,1);this.state.modeGen++;ag(this);return}}}),indentLine:c2(function(f3,f1,f2){if(typeof f1!="string"&&typeof f1!="number"){if(f1==null){f1=this.options.smartIndent?"smart":"prev"}else{f1=f1?"add":"subtract"}}if(b7(this.doc,f3)){ac(this,f3,f1,f2)}}),indentSelection:c2(function(ga){var f1=this.doc.sel.ranges,f4=-1;for(var f6=0;f6<f1.length;f6++){var f7=f1[f6];if(!f7.empty()){var f8=f7.from(),f9=f7.to();var f2=Math.max(f4,f8.line);f4=Math.min(this.lastLine(),f9.line-(f9.ch?0:1))+1;for(var f5=f2;f5<f4;++f5){ac(this,f5,ga)}var f3=this.doc.sel.ranges;if(f8.ch==0&&f1.length==f3.length&&f3[f6].from().ch>0){e(this.doc,f6,new dM(f8,f3[f6].to()),Z)}}else{if(f7.head.line>f4){ac(this,f7.head.line,ga,true);f4=f7.head.line;if(f6==this.doc.sel.primIndex){fu(this)}}}}}),getTokenAt:function(f8,f2){var f5=this.doc;f8=fx(f5,f8);var f4=dr(this,f8.line,f2),f7=this.doc.mode;var f1=e2(f5,f8.line);var f6=new eH(f1.text,this.options.tabSize);while(f6.pos<f8.ch&&!f6.eol()){f6.start=f6.pos;var f3=ep(f7,f6,f4)}return{start:f6.start,end:f6.pos,string:f6.current(),type:f3||null,state:f4}},getTokenTypeAt:function(f8){f8=fx(this.doc,f8);var f4=c0(this,e2(this.doc,f8.line));var f6=0,f7=(f4.length-1)/2,f3=f8.ch;var f2;if(f3==0){f2=f4[2]}else{for(;;){var f1=(f6+f7)>>1;if((f1?f4[f1*2-1]:0)>=f3){f7=f1}else{if(f4[f1*2+1]<f3){f6=f1+1}else{f2=f4[f1*2+2];break}}}}var f5=f2?f2.indexOf("cm-overlay "):-1;return f5<0?f2:f5==0?null:f2.slice(0,f5-1)},getModeAt:function(f2){var f1=this.doc.mode;if(!f1.innerMode){return f1}return J.innerMode(f1,this.getTokenAt(f2).state).mode},getHelper:function(f2,f1){return this.getHelpers(f2,f1)[0]},getHelpers:function(f8,f3){var f4=[];if(!fb.hasOwnProperty(f3)){return fb}var f1=fb[f3],f7=this.getModeAt(f8);if(typeof f7[f3]=="string"){if(f1[f7[f3]]){f4.push(f1[f7[f3]])}}else{if(f7[f3]){for(var f2=0;f2<f7[f3].length;f2++){var f6=f1[f7[f3][f2]];if(f6){f4.push(f6)}}}else{if(f7.helperType&&f1[f7.helperType]){f4.push(f1[f7.helperType])}else{if(f1[f7.name]){f4.push(f1[f7.name])}}}}for(var f2=0;f2<f1._global.length;f2++){var f5=f1._global[f2];if(f5.pred(f7,this)&&db(f4,f5.val)==-1){f4.push(f5.val)}}return f4},getStateAfter:function(f2,f1){var f3=this.doc;f2=cZ(f3,f2==null?f3.first+f3.size-1:f2);return dr(this,f2+1,f1)},cursorCoords:function(f4,f2){var f3,f1=this.doc.sel.primary();if(f4==null){f3=f1.head}else{if(typeof f4=="object"){f3=fx(this.doc,f4)}else{f3=f4?f1.from():f1.to()}}return dI(this,f3,f2||"page")},charCoords:function(f2,f1){return cF(this,fx(this.doc,f2),f1||"page")},coordsChar:function(f1,f2){f1=fX(this,f1,f2||"page");return fC(this,f1.left,f1.top)},lineAtHeight:function(f1,f2){f1=fX(this,{top:f1,left:0},f2||"page").top;return bE(this.doc,f1+this.display.viewOffset)},heightAtLine:function(f2,f5){var f1=false,f4=this.doc.first+this.doc.size-1;if(f2<this.doc.first){f2=this.doc.first}else{if(f2>f4){f2=f4;f1=true}}var f3=e2(this.doc,f2);return eE(this,f3,{top:0,left:0},f5||"page").top+(f1?this.doc.height-bK(f3):0)},defaultTextHeight:function(){return aT(this.display)},defaultCharWidth:function(){return dt(this.display)},setGutterMarker:c2(function(f1,f2,f3){return em(this.doc,f1,"gutter",function(f4){var f5=f4.gutterMarkers||(f4.gutterMarkers={});f5[f2]=f3;if(!f3&&eI(f5)){f4.gutterMarkers=null}return true})}),clearGutter:c2(function(f3){var f1=this,f4=f1.doc,f2=f4.first;f4.iter(function(f5){if(f5.gutterMarkers&&f5.gutterMarkers[f3]){f5.gutterMarkers[f3]=null;S(f1,f2,"gutter");if(eI(f5.gutterMarkers)){f5.gutterMarkers=null}}++f2})}),addLineWidget:c2(function(f3,f2,f1){return bF(this,f3,f2,f1)}),removeLineWidget:function(f1){f1.clear()},lineInfo:function(f1){if(typeof f1=="number"){if(!b7(this.doc,f1)){return null}var f2=f1;f1=e2(this.doc,f1);if(!f1){return null}}else{var f2=bL(f1);if(f2==null){return null}}return{line:f2,handle:f1,text:f1.text,gutterMarkers:f1.gutterMarkers,textClass:f1.textClass,bgClass:f1.bgClass,wrapClass:f1.wrapClass,widgets:f1.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(f6,f3,f8,f4,ga){var f5=this.display;f6=dI(this,fx(this.doc,f6));var f7=f6.bottom,f2=f6.left;f3.style.position="absolute";f5.sizer.appendChild(f3);if(f4=="over"){f7=f6.top}else{if(f4=="above"||f4=="near"){var f1=Math.max(f5.wrapper.clientHeight,this.doc.height),f9=Math.max(f5.sizer.clientWidth,f5.lineSpace.clientWidth);if((f4=="above"||f6.bottom+f3.offsetHeight>f1)&&f6.top>f3.offsetHeight){f7=f6.top-f3.offsetHeight}else{if(f6.bottom+f3.offsetHeight<=f1){f7=f6.bottom}}if(f2+f3.offsetWidth>f9){f2=f9-f3.offsetWidth}}}f3.style.top=f7+"px";f3.style.left=f3.style.right="";if(ga=="right"){f2=f5.sizer.clientWidth-f3.offsetWidth;f3.style.right="0px"}else{if(ga=="left"){f2=0}else{if(ga=="middle"){f2=(f5.sizer.clientWidth-f3.offsetWidth)/2}}f3.style.left=f2+"px"}if(f8){G(this,f2,f7,f2+f3.offsetWidth,f7+f3.offsetHeight)}},triggerOnKeyDown:c2(q),triggerOnKeyPress:c2(cv),triggerOnKeyUp:bd,execCommand:function(f1){if(er.hasOwnProperty(f1)){return er[f1](this)}},findPosH:function(f7,f4,f5,f2){var f1=1;if(f4<0){f1=-1;f4=-f4}for(var f3=0,f6=fx(this.doc,f7);f3<f4;++f3){f6=bu(this.doc,f6,f1,f5,f2);if(f6.hitSide){break}}return f6},moveH:c2(function(f2,f3){var f1=this;f1.extendSelectionsBy(function(f4){if(f1.display.shift||f1.doc.extend||f4.empty()){return bu(f1.doc,f4.head,f2,f3,f1.options.rtlMoveVisually)}else{return f2<0?f4.from():f4.to()}},cQ)}),deleteH:c2(function(f1,f2){var f3=this.doc.sel,f4=this.doc;if(f3.somethingSelected()){f4.replaceSelection("",null,"+delete")}else{eL(this,function(f6){var f5=bu(f4,f6.head,f1,f2,false);return f1<0?{from:f5,to:f6.head}:{from:f6.head,to:f5}})}}),findPosV:function(f6,f3,f7,f9){var f1=1,f5=f9;if(f3<0){f1=-1;f3=-f3}for(var f2=0,f8=fx(this.doc,f6);f2<f3;++f2){var f4=dI(this,f8,"div");if(f5==null){f5=f4.left}else{f4.left=f5}f8=bo(this,f4,f1,f7);if(f8.hitSide){break}}return f8},moveV:c2(function(f2,f4){var f1=this,f6=this.doc,f5=[];var f7=!f1.display.shift&&!f6.extend&&f6.sel.somethingSelected();f6.extendSelectionsBy(function(f8){if(f7){return f2<0?f8.from():f8.to()}var ga=dI(f1,f8.head,"div");if(f8.goalColumn!=null){ga.left=f8.goalColumn}f5.push(ga.left);var f9=bo(f1,ga,f2,f4);if(f4=="page"&&f8==f6.sel.primary()){cH(f1,null,cF(f1,f9,"div").top-ga.top)}return f9},cQ);if(f5.length){for(var f3=0;f3<f6.sel.ranges.length;f3++){f6.sel.ranges[f3].goalColumn=f5[f3]}}}),findWordAt:function(f8){var f6=this.doc,f4=e2(f6,f8.line).text;var f7=f8.ch,f3=f8.ch;if(f4){var f5=this.getHelper(f8,"wordChars");if((f8.xRel<0||f3==f4.length)&&f7){--f7}else{++f3}var f2=f4.charAt(f7);var f1=cx(f2,f5)?function(f9){return cx(f9,f5)}:/\s/.test(f2)?function(f9){return/\s/.test(f9)}:function(f9){return !/\s/.test(f9)&&!cx(f9)};while(f7>0&&f1(f4.charAt(f7-1))){--f7}while(f3<f4.length&&f1(f4.charAt(f3))){++f3}}return new dM(X(f8.line,f7),X(f8.line,f3))},toggleOverwrite:function(f1){if(f1!=null&&f1==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){fo(this.display.cursorDiv,"CodeMirror-overwrite")}else{f(this.display.cursorDiv,"CodeMirror-overwrite")}aC(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return dC()==this.display.input},scrollTo:c2(function(f1,f2){if(f1!=null||f2!=null){fq(this)}if(f1!=null){this.curOp.scrollLeft=f1}if(f2!=null){this.curOp.scrollTop=f2}}),getScrollInfo:function(){var f1=this.display.scroller,f2=bg;return{left:f1.scrollLeft,top:f1.scrollTop,height:f1.scrollHeight-f2,width:f1.scrollWidth-f2,clientHeight:f1.clientHeight-f2,clientWidth:f1.clientWidth-f2}},scrollIntoView:c2(function(f2,f3){if(f2==null){f2={from:this.doc.sel.primary().head,to:null};if(f3==null){f3=this.options.cursorScrollMargin}}else{if(typeof f2=="number"){f2={from:X(f2,0),to:null}}else{if(f2.from==null){f2={from:f2,to:null}}}}if(!f2.to){f2.to=f2.from}f2.margin=f3||0;if(f2.from.line!=null){fq(this);this.curOp.scrollToPos=f2}else{var f1=I(this,Math.min(f2.from.left,f2.to.left),Math.min(f2.from.top,f2.to.top)-f2.margin,Math.max(f2.from.right,f2.to.right),Math.max(f2.from.bottom,f2.to.bottom)+f2.margin);this.scrollTo(f1.scrollLeft,f1.scrollTop)}}),setSize:c2(function(f4,f2){var f1=this;function f3(f6){return typeof f6=="number"||/^\d+$/.test(String(f6))?f6+"px":f6}if(f4!=null){f1.display.wrapper.style.width=f3(f4)}if(f2!=null){f1.display.wrapper.style.height=f3(f2)}if(f1.options.lineWrapping){aL(this)}var f5=f1.display.viewFrom;f1.doc.iter(f5,f1.display.viewTo,function(f6){if(f6.widgets){for(var f7=0;f7<f6.widgets.length;f7++){if(f6.widgets[f7].noHScroll){S(f1,f5,"widget");break}}}++f5});f1.curOp.forceUpdate=true;aC(f1,"refresh",this)}),operation:function(f1){return cI(this,f1)},refresh:c2(function(){var f1=this.display.cachedTextHeight;ag(this);this.curOp.forceUpdate=true;aj(this);this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop);cY(this);if(f1==null||Math.abs(f1-aT(this.display))>0.5){Y(this)}aC(this,"refresh",this)}),swapDoc:c2(function(f2){var f1=this.doc;f1.cm=null;dY(this,f2);aj(this);fc(this);this.scrollTo(f2.scrollLeft,f2.scrollTop);this.curOp.forceScroll=true;ad(this,"swapDoc",this,f1);return f1}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};bw(J);var eR=J.defaults={};var ba=J.optionHandlers={};function t(f1,f4,f3,f2){J.defaults[f1]=f4;if(f3){ba[f1]=f2?function(f5,f7,f6){if(f6!=ca){f3(f5,f7,f6)}}:f3}}var ca=J.Init={toString:function(){return"CodeMirror.Init"}};t("value","",function(f1,f2){f1.setValue(f2)},true);t("mode",null,function(f1,f2){f1.doc.modeOption=f2;bp(f1)},true);t("indentUnit",2,bp,true);t("indentWithTabs",false);t("smartIndent",true);t("tabSize",4,function(f1){d8(f1);aj(f1);ag(f1)},true);t("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(f1,f2){f1.options.specialChars=new RegExp(f2.source+(f2.test("\t")?"":"|\t"),"g");f1.refresh()},true);t("specialCharPlaceholder",eZ,function(f1){f1.refresh()},true);t("electricChars",true);t("rtlMoveVisually",!aM);t("wholeLineUpdateBefore",true);t("theme","default",function(f1){cK(f1);dl(f1)},true);t("keyMap","default",fY);t("extraKeys",null);t("lineWrapping",false,eu,true);t("gutters",[],function(f1){cc(f1.options);dl(f1)},true);t("fixedGutter",true,function(f1,f2){f1.display.gutters.style.left=f2?dL(f1.display)+"px":"0";f1.refresh()},true);t("coverGutterNextToScrollbar",false,eM,true);t("lineNumbers",false,function(f1){cc(f1.options);dl(f1)},true);t("firstLineNumber",1,dl,true);t("lineNumberFormatter",function(f1){return f1},dl,true);t("showCursorWhenSelecting",false,bA,true);t("resetSelectionOnContextMenu",true);t("readOnly",false,function(f1,f2){if(f2=="nocursor"){aR(f1);f1.display.input.blur();f1.display.disabled=true}else{f1.display.disabled=false;if(!f2){fc(f1)}}});t("disableInput",false,function(f1,f2){if(!f2){fc(f1)}},true);t("dragDrop",true);t("cursorBlinkRate",530);t("cursorScrollMargin",0);t("cursorHeight",1,bA,true);t("singleCursorHeightPerLine",true,bA,true);t("workTime",100);t("workDelay",100);t("flattenSpans",true,d8,true);t("addModeClass",false,d8,true);t("pollInterval",100);t("undoDepth",200,function(f1,f2){f1.doc.history.undoDepth=f2});t("historyEventDelay",1250);t("viewportMargin",10,function(f1){f1.refresh()},true);t("maxHighlightLength",10000,d8,true);t("moveInputWithCursor",true,function(f1,f2){if(!f2){f1.display.inputDiv.style.top=f1.display.inputDiv.style.left=0}});t("tabindex",null,function(f1,f2){f1.display.input.tabIndex=f2||""});t("autofocus",null);var di=J.modes={},aP=J.mimeModes={};J.defineMode=function(f1,f3){if(!J.defaults.mode&&f1!="null"){J.defaults.mode=f1}if(arguments.length>2){f3.dependencies=[];for(var f2=2;f2<arguments.length;++f2){f3.dependencies.push(arguments[f2])}}di[f1]=f3};J.defineMIME=function(f2,f1){aP[f2]=f1};J.resolveMode=function(f1){if(typeof f1=="string"&&aP.hasOwnProperty(f1)){f1=aP[f1]}else{if(f1&&typeof f1.name=="string"&&aP.hasOwnProperty(f1.name)){var f2=aP[f1.name];if(typeof f2=="string"){f2={name:f2}}f1=cj(f2,f1);f1.name=f2.name}else{if(typeof f1=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(f1)){return J.resolveMode("application/xml")}}}if(typeof f1=="string"){return{name:f1}}else{return f1||{name:"null"}}};J.getMode=function(f2,f1){var f1=J.resolveMode(f1);var f4=di[f1.name];if(!f4){return J.getMode(f2,"text/plain")}var f5=f4(f2,f1);if(df.hasOwnProperty(f1.name)){var f3=df[f1.name];for(var f6 in f3){if(!f3.hasOwnProperty(f6)){continue}if(f5.hasOwnProperty(f6)){f5["_"+f6]=f5[f6]}f5[f6]=f3[f6]}}f5.name=f1.name;if(f1.helperType){f5.helperType=f1.helperType}if(f1.modeProps){for(var f6 in f1.modeProps){f5[f6]=f1.modeProps[f6]}}return f5};J.defineMode("null",function(){return{token:function(f1){f1.skipToEnd()}}});J.defineMIME("text/plain","null");var df=J.modeExtensions={};J.extendMode=function(f3,f2){var f1=df.hasOwnProperty(f3)?df[f3]:(df[f3]={});aK(f2,f1)};J.defineExtension=function(f1,f2){J.prototype[f1]=f2};J.defineDocExtension=function(f1,f2){at.prototype[f1]=f2};J.defineOption=t;var a4=[];J.defineInitHook=function(f1){a4.push(f1)};var fb=J.helpers={};J.registerHelper=function(f2,f1,f3){if(!fb.hasOwnProperty(f2)){fb[f2]=J[f2]={_global:[]}}fb[f2][f1]=f3};J.registerGlobalHelper=function(f3,f2,f1,f4){J.registerHelper(f3,f2,f4);fb[f3]._global.push({pred:f1,val:f4})};var b1=J.copyState=function(f4,f1){if(f1===true){return f1}if(f4.copyState){return f4.copyState(f1)}var f3={};for(var f5 in f1){var f2=f1[f5];if(f2 instanceof Array){f2=f2.concat([])}f3[f5]=f2}return f3};var bY=J.startState=function(f3,f2,f1){return f3.startState?f3.startState(f2,f1):true};J.innerMode=function(f3,f1){while(f3.innerMode){var f2=f3.innerMode(f1);if(!f2||f2.mode==f3){break}f1=f2.state;f3=f2.mode}return f2||{mode:f3,state:f1}};var er=J.commands={selectAll:function(f1){f1.setSelection(X(f1.firstLine(),0),X(f1.lastLine()),Z)},singleSelection:function(f1){f1.setSelection(f1.getCursor("anchor"),f1.getCursor("head"),Z)},killLine:function(f1){eL(f1,function(f3){if(f3.empty()){var f2=e2(f1.doc,f3.head.line).text.length;if(f3.head.ch==f2&&f3.head.line<f1.lastLine()){return{from:f3.head,to:X(f3.head.line+1,0)}}else{return{from:f3.head,to:X(f3.head.line,f2)}}}else{return{from:f3.from(),to:f3.to()}}})},deleteLine:function(f1){eL(f1,function(f2){return{from:X(f2.from().line,0),to:fx(f1.doc,X(f2.to().line+1,0))}})},delLineLeft:function(f1){eL(f1,function(f2){return{from:X(f2.from().line,0),to:f2.from()}})},delWrappedLineLeft:function(f1){eL(f1,function(f2){var f4=f1.charCoords(f2.head,"div").top+5;var f3=f1.coordsChar({left:0,top:f4},"div");return{from:f3,to:f2.from()}})},delWrappedLineRight:function(f1){eL(f1,function(f2){var f4=f1.charCoords(f2.head,"div").top+5;var f3=f1.coordsChar({left:f1.display.lineDiv.offsetWidth+100,top:f4},"div");return{from:f2.from(),to:f3}})},undo:function(f1){f1.undo()},redo:function(f1){f1.redo()},undoSelection:function(f1){f1.undoSelection()},redoSelection:function(f1){f1.redoSelection()},goDocStart:function(f1){f1.extendSelection(X(f1.firstLine(),0))},goDocEnd:function(f1){f1.extendSelection(X(f1.lastLine()))},goLineStart:function(f1){f1.extendSelectionsBy(function(f2){return br(f1,f2.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(f1){f1.extendSelectionsBy(function(f2){return dy(f1,f2.head)},{origin:"+move",bias:1})},goLineEnd:function(f1){f1.extendSelectionsBy(function(f2){return dD(f1,f2.head.line)},{origin:"+move",bias:-1})},goLineRight:function(f1){f1.extendSelectionsBy(function(f2){var f3=f1.charCoords(f2.head,"div").top+5;return f1.coordsChar({left:f1.display.lineDiv.offsetWidth+100,top:f3},"div")},cQ)},goLineLeft:function(f1){f1.extendSelectionsBy(function(f2){var f3=f1.charCoords(f2.head,"div").top+5;return f1.coordsChar({left:0,top:f3},"div")},cQ)},goLineLeftSmart:function(f1){f1.extendSelectionsBy(function(f2){var f3=f1.charCoords(f2.head,"div").top+5;var f4=f1.coordsChar({left:0,top:f3},"div");if(f4.ch<f1.getLine(f4.line).search(/\S/)){return dy(f1,f2.head)}return f4},cQ)},goLineUp:function(f1){f1.moveV(-1,"line")},goLineDown:function(f1){f1.moveV(1,"line")},goPageUp:function(f1){f1.moveV(-1,"page")},goPageDown:function(f1){f1.moveV(1,"page")},goCharLeft:function(f1){f1.moveH(-1,"char")},goCharRight:function(f1){f1.moveH(1,"char")},goColumnLeft:function(f1){f1.moveH(-1,"column")},goColumnRight:function(f1){f1.moveH(1,"column")},goWordLeft:function(f1){f1.moveH(-1,"word")},goGroupRight:function(f1){f1.moveH(1,"group")},goGroupLeft:function(f1){f1.moveH(-1,"group")},goWordRight:function(f1){f1.moveH(1,"word")},delCharBefore:function(f1){f1.deleteH(-1,"char")},delCharAfter:function(f1){f1.deleteH(1,"char")},delWordBefore:function(f1){f1.deleteH(-1,"word")},delWordAfter:function(f1){f1.deleteH(1,"word")},delGroupBefore:function(f1){f1.deleteH(-1,"group")},delGroupAfter:function(f1){f1.deleteH(1,"group")},indentAuto:function(f1){f1.indentSelection("smart")},indentMore:function(f1){f1.indentSelection("add")},indentLess:function(f1){f1.indentSelection("subtract")},insertTab:function(f1){f1.replaceSelection("\t")},insertSoftTab:function(f1){var f3=[],f2=f1.listSelections(),f6=f1.options.tabSize;for(var f5=0;f5<f2.length;f5++){var f7=f2[f5].from();var f4=bR(f1.getLine(f7.line),f7.ch,f6);f3.push(new Array(f6-f4%f6+1).join(" "))}f1.replaceSelections(f3)},defaultTab:function(f1){if(f1.somethingSelected()){f1.indentSelection("add")}else{f1.execCommand("insertTab")}},transposeChars:function(f1){cI(f1,function(){var f4=f1.listSelections(),f3=[];for(var f5=0;f5<f4.length;f5++){var f7=f4[f5].head,f2=e2(f1.doc,f7.line).text;if(f2){if(f7.ch==f2.length){f7=new X(f7.line,f7.ch-1)}if(f7.ch>0){f7=new X(f7.line,f7.ch+1);f1.replaceRange(f2.charAt(f7.ch-1)+f2.charAt(f7.ch-2),X(f7.line,f7.ch-2),f7,"+transpose")}else{if(f7.line>f1.doc.first){var f6=e2(f1.doc,f7.line-1).text;if(f6){f1.replaceRange(f2.charAt(0)+"\n"+f6.charAt(f6.length-1),X(f7.line-1,f6.length-1),X(f7.line,1),"+transpose")}}}}f3.push(new dM(f7,f7))}f1.setSelections(f3)})},newlineAndIndent:function(f1){cI(f1,function(){var f2=f1.listSelections().length;for(var f4=0;f4<f2;f4++){var f3=f1.listSelections()[f4];f1.replaceRange("\n",f3.anchor,f3.head,"+input");f1.indentLine(f3.from().line+1,null,true);fu(f1)}})},toggleOverwrite:function(f1){f1.toggleOverwrite()}};var eX=J.keyMap={};eX.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"};eX.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"};eX.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection",fallthrough:["basic","emacsy"]};eX.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"};eX["default"]=b5?eX.macDefault:eX.pcDefault;function fI(f1){if(typeof f1=="string"){return eX[f1]}else{return f1}}var i=J.lookupKey=function(f2,f6,f4){function f5(gb){gb=fI(gb);var ga=gb[f2];if(ga===false){return"stop"}if(ga!=null&&f4(ga)){return true}if(gb.nofallthrough){return"stop"}var f9=gb.fallthrough;if(f9==null){return false}if(Object.prototype.toString.call(f9)!="[object Array]"){return f5(f9)}for(var f8=0;f8<f9.length;++f8){var f7=f5(f9[f8]);if(f7){return f7}}return false}for(var f3=0;f3<f6.length;++f3){var f1=f5(f6[f3]);if(f1){return f1!="stop"}}};var eq=J.isModifierKey=function(f2){var f1=e3[f2.keyCode];return f1=="Ctrl"||f1=="Alt"||f1=="Shift"||f1=="Mod"};var ff=J.keyName=function(f2,f3){if(dQ&&f2.keyCode==34&&f2["char"]){return false}var f1=e3[f2.keyCode];if(f1==null||f2.altGraphKey){return false}if(f2.altKey){f1="Alt-"+f1}if(bO?f2.metaKey:f2.ctrlKey){f1="Ctrl-"+f1}if(bO?f2.ctrlKey:f2.metaKey){f1="Cmd-"+f1}if(!f3&&f2.shiftKey){f1="Shift-"+f1}return f1};J.fromTextArea=function(f8,f9){if(!f9){f9={}}f9.value=f8.value;if(!f9.tabindex&&f8.tabindex){f9.tabindex=f8.tabindex}if(!f9.placeholder&&f8.placeholder){f9.placeholder=f8.placeholder}if(f9.autofocus==null){var f1=dC();f9.autofocus=f1==f8||f8.getAttribute("autofocus")!=null&&f1==document.body}function f5(){f8.value=f7.getValue()}if(f8.form){bV(f8.form,"submit",f5);if(!f9.leaveSubmitMethodAlone){var f2=f8.form,f6=f2.submit;try{var f4=f2.submit=function(){f5();f2.submit=f6;f2.submit();f2.submit=f4}}catch(f3){}}}f8.style.display="none";var f7=J(function(ga){f8.parentNode.insertBefore(ga,f8.nextSibling)},f9);f7.save=f5;f7.getTextArea=function(){return f8};f7.toTextArea=function(){f5();f8.parentNode.removeChild(f7.getWrapperElement());f8.style.display="";if(f8.form){d0(f8.form,"submit",f5);if(typeof f8.form.submit=="function"){f8.form.submit=f6}}};return f7};var eH=J.StringStream=function(f1,f2){this.pos=this.start=0;this.string=f1;this.tabSize=f2||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0};eH.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}},eat:function(f1){var f3=this.string.charAt(this.pos);if(typeof f1=="string"){var f2=f3==f1}else{var f2=f3&&(f1.test?f1.test(f3):f1(f3))}if(f2){++this.pos;return f3}},eatWhile:function(f1){var f2=this.pos;while(this.eat(f1)){}return this.pos>f2},eatSpace:function(){var f1=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>f1},skipToEnd:function(){this.pos=this.string.length},skipTo:function(f1){var f2=this.string.indexOf(f1,this.pos);if(f2>-1){this.pos=f2;return true}},backUp:function(f1){this.pos-=f1},column:function(){if(this.lastColumnPos<this.start){this.lastColumnValue=bR(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?bR(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return bR(this.string,null,this.tabSize)-(this.lineStart?bR(this.string,this.lineStart,this.tabSize):0)},match:function(f5,f2,f1){if(typeof f5=="string"){var f6=function(f7){return f1?f7.toLowerCase():f7};var f4=this.string.substr(this.pos,f5.length);if(f6(f4)==f6(f5)){if(f2!==false){this.pos+=f5.length}return true}}else{var f3=this.string.slice(this.pos).match(f5);if(f3&&f3.index>0){return null}if(f3&&f2!==false){this.pos+=f3[0].length}return f3}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(f2,f1){this.lineStart+=f2;try{return f1()}finally{this.lineStart-=f2}}};var Q=J.TextMarker=function(f2,f1){this.lines=[];this.type=f1;this.doc=f2};bw(Q);Q.prototype.clear=function(){if(this.explicitlyCleared){return}var f8=this.doc.cm,f2=f8&&!f8.curOp;if(f2){cE(f8)}if(e5(this,"clear")){var f9=this.find();if(f9){ad(this,"clear",f9.from,f9.to)}}var f3=null,f6=null;for(var f4=0;f4<this.lines.length;++f4){var ga=this.lines[f4];var f7=eW(ga.markedSpans,this);if(f8&&!this.collapsed){S(f8,bL(ga),"text")}else{if(f8){if(f7.to!=null){f6=bL(ga)}if(f7.from!=null){f3=bL(ga)}}}ga.markedSpans=ev(ga.markedSpans,f7);if(f7.from==null&&this.collapsed&&!fk(this.doc,ga)&&f8){fO(ga,aT(f8.display))}}if(f8&&this.collapsed&&!f8.options.lineWrapping){for(var f4=0;f4<this.lines.length;++f4){var f1=z(this.lines[f4]),f5=d9(f1);if(f5>f8.display.maxLineLength){f8.display.maxLine=f1;f8.display.maxLineLength=f5;f8.display.maxLineChanged=true}}}if(f3!=null&&f8&&this.collapsed){ag(f8,f3,f6+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(f8){el(f8.doc)}}if(f8){ad(f8,"markerCleared",f8,this)}if(f2){al(f8)}if(this.parent){this.parent.clear()}};Q.prototype.find=function(f4,f2){if(f4==null&&this.type=="bookmark"){f4=1}var f7,f6;for(var f3=0;f3<this.lines.length;++f3){var f1=this.lines[f3];var f5=eW(f1.markedSpans,this);if(f5.from!=null){f7=X(f2?f1:bL(f1),f5.from);if(f4==-1){return f7}}if(f5.to!=null){f6=X(f2?f1:bL(f1),f5.to);if(f4==1){return f6}}}return f7&&{from:f7,to:f6}};Q.prototype.changed=function(){var f3=this.find(-1,true),f2=this,f1=this.doc.cm;if(!f3||!f1){return}cI(f1,function(){var f5=f3.line,f6=bL(f3.line);var f4=eY(f1,f6);if(f4){au(f4);f1.curOp.selectionChanged=f1.curOp.forceUpdate=true}f1.curOp.updateMaxLine=true;if(!fk(f2.doc,f5)&&f2.height!=null){var f8=f2.height;f2.height=null;var f7=cS(f2)-f8;if(f7){fO(f5,f5.height+f7)}}})};Q.prototype.attachLine=function(f1){if(!this.lines.length&&this.doc.cm){var f2=this.doc.cm.curOp;if(!f2.maybeHiddenMarkers||db(f2.maybeHiddenMarkers,this)==-1){(f2.maybeUnhiddenMarkers||(f2.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(f1)};Q.prototype.detachLine=function(f1){this.lines.splice(db(this.lines,f1),1);if(!this.lines.length&&this.doc.cm){var f2=this.doc.cm.curOp;(f2.maybeHiddenMarkers||(f2.maybeHiddenMarkers=[])).push(this)}};var a1=0;function et(f9,f7,f8,gb,f5){if(gb&&gb.shared){return P(f9,f7,f8,gb,f5)}if(f9.cm&&!f9.cm.curOp){return cW(f9.cm,et)(f9,f7,f8,gb,f5)}var f4=new Q(f9,f5),ga=cd(f7,f8);if(gb){aK(gb,f4,false)}if(ga>0||ga==0&&f4.clearWhenEmpty!==false){return f4}if(f4.replacedWith){f4.collapsed=true;f4.widgetNode=fK("span",[f4.replacedWith],"CodeMirror-widget");if(!gb.handleMouseEvents){f4.widgetNode.ignoreEvents=true}if(gb.insertLeft){f4.widgetNode.insertLeft=true}}if(f4.collapsed){if(A(f9,f7.line,f7,f8,f4)||f7.line!=f8.line&&A(f9,f8.line,f7,f8,f4)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}a3=true}if(f4.addToHistory){fA(f9,{from:f7,to:f8,origin:"markText"},f9.sel,NaN)}var f2=f7.line,f6=f9.cm,f1;f9.iter(f2,f8.line+1,function(gc){if(f6&&f4.collapsed&&!f6.options.lineWrapping&&z(gc)==f6.display.maxLine){f1=true}if(f4.collapsed&&f2!=f7.line){fO(gc,0)}cb(gc,new d5(f4,f2==f7.line?f7.ch:null,f2==f8.line?f8.ch:null));++f2});if(f4.collapsed){f9.iter(f7.line,f8.line+1,function(gc){if(fk(f9,gc)){fO(gc,0)}})}if(f4.clearOnEnter){bV(f4,"beforeCursorEnter",function(){f4.clear()})}if(f4.readOnly){fV=true;if(f9.history.done.length||f9.history.undone.length){f9.clearHistory()}}if(f4.collapsed){f4.id=++a1;f4.atomic=true}if(f6){if(f1){f6.curOp.updateMaxLine=true}if(f4.collapsed){ag(f6,f7.line,f8.line+1)}else{if(f4.className||f4.title||f4.startStyle||f4.endStyle){for(var f3=f7.line;f3<=f8.line;f3++){S(f6,f3,"text")}}}if(f4.atomic){el(f6.doc)}ad(f6,"markerAdded",f6,f4)}return f4}var y=J.SharedTextMarker=function(f3,f2){this.markers=f3;this.primary=f2;for(var f1=0;f1<f3.length;++f1){f3[f1].parent=this}};bw(y);y.prototype.clear=function(){if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var f1=0;f1<this.markers.length;++f1){this.markers[f1].clear()}ad(this,"clear")};y.prototype.find=function(f2,f1){return this.primary.find(f2,f1)};function P(f5,f8,f7,f1,f3){f1=aK(f1);f1.shared=false;var f6=[et(f5,f8,f7,f1,f3)],f2=f6[0];var f4=f1.widgetNode;dV(f5,function(ga){if(f4){f1.widgetNode=f4.cloneNode(true)}f6.push(et(ga,fx(ga,f8),fx(ga,f7),f1,f3));for(var f9=0;f9<ga.linked.length;++f9){if(ga.linked[f9].isParent){return}}f2=fv(f6)});return new y(f6,f2)}function eD(f1){return f1.findMarks(X(f1.first,0),f1.clipPos(X(f1.lastLine())),function(f2){return f2.parent})}function dv(f6,f7){for(var f4=0;f4<f7.length;f4++){var f2=f7[f4],f8=f2.find();var f1=f6.clipPos(f8.from),f5=f6.clipPos(f8.to);if(cd(f1,f5)){var f3=et(f6,f1,f5,f2.primary,f2.primary.type);f2.markers.push(f3);f3.parent=f2}}}function eb(f4){for(var f3=0;f3<f4.length;f3++){var f1=f4[f3],f6=[f1.primary.doc];dV(f1.primary.doc,function(f7){f6.push(f7)});for(var f2=0;f2<f1.markers.length;f2++){var f5=f1.markers[f2];if(db(f6,f5.doc)==-1){f5.parent=null;f1.markers.splice(f2--,1)}}}}function d5(f1,f3,f2){this.marker=f1;this.from=f3;this.to=f2}function eW(f3,f1){if(f3){for(var f2=0;f2<f3.length;++f2){var f4=f3[f2];if(f4.marker==f1){return f4}}}}function ev(f2,f3){for(var f4,f1=0;f1<f2.length;++f1){if(f2[f1]!=f3){(f4||(f4=[])).push(f2[f1])}}return f4}function cb(f1,f2){f1.markedSpans=f1.markedSpans?f1.markedSpans.concat([f2]):[f2];f2.marker.attachLine(f1)}function aN(f2,f3,f7){if(f2){for(var f5=0,f8;f5<f2.length;++f5){var f9=f2[f5],f6=f9.marker;var f1=f9.from==null||(f6.inclusiveLeft?f9.from<=f3:f9.from<f3);if(f1||f9.from==f3&&f6.type=="bookmark"&&(!f7||!f9.marker.insertLeft)){var f4=f9.to==null||(f6.inclusiveRight?f9.to>=f3:f9.to>f3);(f8||(f8=[])).push(new d5(f6,f9.from,f4?null:f9.to))}}}return f8}function aA(f2,f4,f7){if(f2){for(var f5=0,f8;f5<f2.length;++f5){var f9=f2[f5],f6=f9.marker;var f3=f9.to==null||(f6.inclusiveRight?f9.to>=f4:f9.to>f4);if(f3||f9.from==f4&&f6.type=="bookmark"&&(!f7||f9.marker.insertLeft)){var f1=f9.from==null||(f6.inclusiveLeft?f9.from<=f4:f9.from<f4);(f8||(f8=[])).push(new d5(f6,f1?null:f9.from-f4,f9.to==null?null:f9.to-f4))}}}return f8}function d7(gd,ga){var f9=b7(gd,ga.from.line)&&e2(gd,ga.from.line).markedSpans;var gg=b7(gd,ga.to.line)&&e2(gd,ga.to.line).markedSpans;if(!f9&&!gg){return null}var f2=ga.from.ch,f5=ga.to.ch,f8=cd(ga.from,ga.to)==0;var f7=aN(f9,f2,f8);var gf=aA(gg,f5,f8);var ge=ga.text.length==1,f3=fv(ga.text).length+(ge?f2:0);if(f7){for(var f4=0;f4<f7.length;++f4){var gc=f7[f4];if(gc.to==null){var gh=eW(gf,gc.marker);if(!gh){gc.to=f2}else{if(ge){gc.to=gh.to==null?null:gh.to+f3}}}}}if(gf){for(var f4=0;f4<gf.length;++f4){var gc=gf[f4];if(gc.to!=null){gc.to+=f3}if(gc.from==null){var gh=eW(f7,gc.marker);if(!gh){gc.from=f3;if(ge){(f7||(f7=[])).push(gc)}}}else{gc.from+=f3;if(ge){(f7||(f7=[])).push(gc)}}}}if(f7){f7=r(f7)}if(gf&&gf!=f7){gf=r(gf)}var f6=[f7];if(!ge){var gb=ga.text.length-2,f1;if(gb>0&&f7){for(var f4=0;f4<f7.length;++f4){if(f7[f4].to==null){(f1||(f1=[])).push(new d5(f7[f4].marker,null,null))}}}for(var f4=0;f4<gb;++f4){f6.push(f1)}f6.push(gf)}return f6}function r(f2){for(var f1=0;f1<f2.length;++f1){var f3=f2[f1];if(f3.from!=null&&f3.from==f3.to&&f3.marker.clearWhenEmpty!==false){f2.splice(f1--,1)}}if(!f2.length){return null}return f2}function dX(f9,f7){var f1=b2(f9,f7);var ga=d7(f9,f7);if(!f1){return ga}if(!ga){return f1}for(var f4=0;f4<f1.length;++f4){var f5=f1[f4],f6=ga[f4];if(f5&&f6){spans:for(var f3=0;f3<f6.length;++f3){var f8=f6[f3];for(var f2=0;f2<f5.length;++f2){if(f5[f2].marker==f8.marker){continue spans}}f5.push(f8)}}else{if(f6){f1[f4]=f6}}}return f1}function cD(gd,gb,gc){var f5=null;gd.iter(gb.line,gc.line+1,function(ge){if(ge.markedSpans){for(var gf=0;gf<ge.markedSpans.length;++gf){var gg=ge.markedSpans[gf].marker;if(gg.readOnly&&(!f5||db(f5,gg)==-1)){(f5||(f5=[])).push(gg)}}}});if(!f5){return null}var f6=[{from:gb,to:gc}];for(var f7=0;f7<f5.length;++f7){var f8=f5[f7],f3=f8.find(0);for(var f4=0;f4<f6.length;++f4){var f2=f6[f4];if(cd(f2.to,f3.from)<0||cd(f2.from,f3.to)>0){continue}var ga=[f4,1],f1=cd(f2.from,f3.from),f9=cd(f2.to,f3.to);if(f1<0||!f8.inclusiveLeft&&!f1){ga.push({from:f2.from,to:f3.from})}if(f9>0||!f8.inclusiveRight&&!f9){ga.push({from:f3.to,to:f2.to})}f6.splice.apply(f6,ga);f4+=ga.length-1}}return f6}function fR(f1){var f3=f1.markedSpans;if(!f3){return}for(var f2=0;f2<f3.length;++f2){f3[f2].marker.detachLine(f1)}f1.markedSpans=null}function cX(f1,f3){if(!f3){return}for(var f2=0;f2<f3.length;++f2){f3[f2].marker.attachLine(f1)}f1.markedSpans=f3}function w(f1){return f1.inclusiveLeft?-1:0}function bU(f1){return f1.inclusiveRight?1:0}function dE(f4,f2){var f6=f4.lines.length-f2.lines.length;if(f6!=0){return f6}var f3=f4.find(),f7=f2.find();var f1=cd(f3.from,f7.from)||w(f4)-w(f2);if(f1){return -f1}var f5=cd(f3.to,f7.to)||bU(f4)-bU(f2);if(f5){return f5}return f2.id-f4.id}function a2(f2,f6){var f1=a3&&f2.markedSpans,f5;if(f1){for(var f4,f3=0;f3<f1.length;++f3){f4=f1[f3];if(f4.marker.collapsed&&(f6?f4.from:f4.to)==null&&(!f5||dE(f5,f4.marker)<0)){f5=f4.marker}}}return f5}function eC(f1){return a2(f1,true)}function ei(f1){return a2(f1,false)}function A(f9,f3,f7,f8,f5){var gc=e2(f9,f3);var f1=a3&&gc.markedSpans;if(f1){for(var f4=0;f4<f1.length;++f4){var f2=f1[f4];if(!f2.marker.collapsed){continue}var gb=f2.marker.find(0);var ga=cd(gb.from,f7)||w(f2.marker)-w(f5);var f6=cd(gb.to,f8)||bU(f2.marker)-bU(f5);if(ga>=0&&f6<=0||ga<=0&&f6>=0){continue}if(ga<=0&&(cd(gb.to,f7)>0||(f2.marker.inclusiveRight&&f5.inclusiveLeft))||ga>=0&&(cd(gb.from,f8)<0||(f2.marker.inclusiveLeft&&f5.inclusiveRight))){return true}}}}function z(f2){var f1;while(f1=eC(f2)){f2=f1.find(-1,true).line}return f2}function h(f3){var f1,f2;while(f1=ei(f3)){f3=f1.find(1,true).line;(f2||(f2=[])).push(f3)}return f2}function aS(f4,f2){var f1=e2(f4,f2),f3=z(f1);if(f1==f3){return f2}return bL(f3)}function dR(f4,f3){if(f3>f4.lastLine()){return f3}var f2=e2(f4,f3),f1;if(!fk(f4,f2)){return f3}while(f1=ei(f2)){f2=f1.find(1,true).line}return bL(f2)+1}function fk(f5,f2){var f1=a3&&f2.markedSpans;if(f1){for(var f4,f3=0;f3<f1.length;++f3){f4=f1[f3];if(!f4.marker.collapsed){continue}if(f4.from==null){return true}if(f4.marker.widgetNode){continue}if(f4.from==0&&f4.marker.inclusiveLeft&&U(f5,f2,f4)){return true}}}}function U(f6,f2,f4){if(f4.to==null){var f1=f4.marker.find(1,true);return U(f6,f1.line,eW(f1.line.markedSpans,f4.marker))}if(f4.marker.inclusiveRight&&f4.to==f2.text.length){return true}for(var f5,f3=0;f3<f2.markedSpans.length;++f3){f5=f2.markedSpans[f3];if(f5.marker.collapsed&&!f5.marker.widgetNode&&f5.from==f4.to&&(f5.to==null||f5.to!=f4.from)&&(f5.marker.inclusiveLeft||f4.marker.inclusiveRight)&&U(f6,f2,f5)){return true}}}var ds=J.LineWidget=function(f1,f4,f2){if(f2){for(var f3 in f2){if(f2.hasOwnProperty(f3)){this[f3]=f2[f3]}}}this.cm=f1;this.node=f4};bw(ds);function dO(f1,f2,f3){if(bK(f2)<((f1.curOp&&f1.curOp.scrollTop)||f1.doc.scrollTop)){cH(f1,null,f3)}}ds.prototype.clear=function(){var f2=this.cm,f4=this.line.widgets,f3=this.line,f6=bL(f3);if(f6==null||!f4){return}for(var f5=0;f5<f4.length;++f5){if(f4[f5]==this){f4.splice(f5--,1)}}if(!f4.length){f3.widgets=null}var f1=cS(this);cI(f2,function(){dO(f2,f3,-f1);S(f2,f6,"widget");fO(f3,Math.max(0,f3.height-f1))})};ds.prototype.changed=function(){var f2=this.height,f1=this.cm,f3=this.line;this.height=null;var f4=cS(this)-f2;if(!f4){return}cI(f1,function(){f1.curOp.forceUpdate=true;dO(f1,f3,f4);fO(f3,f3.height+f4)})};function cS(f2){if(f2.height!=null){return f2.height}if(!fT(document.body,f2.node)){var f1="position: relative;";if(f2.coverGutter){f1+="margin-left: -"+f2.cm.getGutterElement().offsetWidth+"px;"}bP(f2.cm.display.measure,fK("div",[f2.node],null,f1))}return f2.height=f2.node.offsetHeight}function bF(f1,f5,f3,f2){var f4=new ds(f1,f3,f2);if(f4.noHScroll){f1.display.alignWidgets=true}em(f1.doc,f5,"widget",function(f7){var f8=f7.widgets||(f7.widgets=[]);if(f4.insertAt==null){f8.push(f4)}else{f8.splice(Math.min(f8.length-1,Math.max(0,f4.insertAt)),0,f4)}f4.line=f7;if(!fk(f1.doc,f7)){var f6=bK(f7)<f1.doc.scrollTop;fO(f7,f7.height+cS(f4));if(f6){cH(f1,null,f4.height)}f1.curOp.forceUpdate=true}return true});return f4}var fQ=J.Line=function(f3,f2,f1){this.text=f3;cX(this,f2);this.height=f1?f1(this):1};bw(fQ);fQ.prototype.lineNo=function(){return bL(this)};function ea(f2,f5,f3,f1){f2.text=f5;if(f2.stateAfter){f2.stateAfter=null}if(f2.styles){f2.styles=null}if(f2.order!=null){f2.order=null}fR(f2);cX(f2,f3);var f4=f1?f1(f2):1;if(f4!=f2.height){fO(f2,f4)}}function bz(f1){f1.parent=null;fR(f1)}function dc(f3,f2){if(f3){for(;;){var f1=f3.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!f1){break}f3=f3.slice(0,f1.index)+f3.slice(f1.index+f1[0].length);var f4=f1[1]?"bgClass":"textClass";if(f2[f4]==null){f2[f4]=f1[2]}else{if(!(new RegExp("(?:^|s)"+f1[2]+"(?:$|s)")).test(f2[f4])){f2[f4]+=" "+f1[2]}}}}return f3}function fe(f3,f2){if(f3.blankLine){return f3.blankLine(f2)}if(!f3.innerMode){return}var f1=J.innerMode(f3,f2);if(f1.mode.blankLine){return f1.mode.blankLine(f1.state)}}function ep(f5,f4,f3){for(var f1=0;f1<10;f1++){var f2=f5.token(f4,f3);if(f4.pos>f4.start){return f2}}throw new Error("Mode "+f5.name+" failed to advance stream.")}function x(gb,gd,f6,f2,f7,f4,f5){var f3=f6.flattenSpans;if(f3==null){f3=gb.options.flattenSpans}var f9=0,f8=null;var gc=new eH(gd,gb.options.tabSize),f1;if(gd==""){dc(fe(f6,f2),f4)}while(!gc.eol()){if(gc.pos>gb.options.maxHighlightLength){f3=false;if(f5){dm(gb,gd,f2,gc.pos)}gc.pos=gd.length;f1=null}else{f1=dc(ep(f6,gc,f2),f4)}if(gb.options.addModeClass){var ge=J.innerMode(f6,f2).mode.name;if(ge){f1="m-"+(f1?ge+" "+f1:ge)}}if(!f3||f8!=f1){if(f9<gc.start){f7(gc.start,f8)}f9=gc.start;f8=f1}gc.start=gc.pos}while(f9<gc.pos){var ga=Math.min(gc.pos,f9+50000);f7(ga,f8);f9=ga}}function fn(f8,ga,f1,f5){var f9=[f8.state.modeGen],f4={};x(f8,ga.text,f8.doc.mode,f1,function(gb,gc){f9.push(gb,gc)},f4,f5);for(var f2=0;f2<f8.state.overlays.length;++f2){var f6=f8.state.overlays[f2],f7=1,f3=0;x(f8,ga.text,f6.mode,true,function(gb,gd){var gf=f7;while(f3<gb){var gc=f9[f7];if(gc>gb){f9.splice(f7,1,gb,f9[f7+1],gc)}f7+=2;f3=Math.min(gb,gc)}if(!gd){return}if(f6.opaque){f9.splice(gf,f7-gf,gb,"cm-overlay "+gd);f7=gf+2}else{for(;gf<f7;gf+=2){var ge=f9[gf+1];f9[gf+1]=(ge?ge+" ":"")+"cm-overlay "+gd}}},f4)}return{styles:f9,classes:f4.bgClass||f4.textClass?f4:null}}function c0(f2,f3){if(!f3.styles||f3.styles[0]!=f2.state.modeGen){var f1=fn(f2,f3,f3.stateAfter=dr(f2,bL(f3)));f3.styles=f1.styles;if(f1.classes){f3.styleClasses=f1.classes}else{if(f3.styleClasses){f3.styleClasses=null}}}return f3.styles}function dm(f1,f6,f3,f2){var f5=f1.doc.mode;var f4=new eH(f6,f1.options.tabSize);f4.start=f4.pos=f2||0;if(f6==""){fe(f5,f3)}while(!f4.eol()&&f4.pos<=f1.options.maxHighlightLength){ep(f5,f4,f3);f4.start=f4.pos}}var dK={},bZ={};function eK(f3,f2){if(!f3||/^\s*$/.test(f3)){return null}var f1=f2.addModeClass?bZ:dK;return f1[f3]||(f1[f3]=f3.replace(/\S+/g,"cm-$&"))}function eF(f2,f6){var f7=fK("span",null,null,cU?"padding-right: .1px":null);var f4={pre:fK("pre",[f7]),content:f7,col:0,pos:0,cm:f2};f6.measure={};for(var f5=0;f5<=(f6.rest?f6.rest.length:0);f5++){var f3=f5?f6.rest[f5-1]:f6.line,f1;f4.pos=0;f4.addToken=u;if((dz||cU)&&f2.getOption("lineWrapping")){f4.addToken=ft(f4.addToken)}if(bM(f2.display.measure)&&(f1=a(f3))){f4.addToken=V(f4.addToken,f1)}f4.map=[];bm(f3,f4,c0(f2,f3));if(f3.styleClasses){if(f3.styleClasses.bgClass){f4.bgClass=fF(f3.styleClasses.bgClass,f4.bgClass||"")}if(f3.styleClasses.textClass){f4.textClass=fF(f3.styleClasses.textClass,f4.textClass||"")}}if(f4.map.length==0){f4.map.push(0,0,f4.content.appendChild(bl(f2.display.measure)))}if(f5==0){f6.measure.map=f4.map;f6.measure.cache={}}else{(f6.measure.maps||(f6.measure.maps=[])).push(f4.map);(f6.measure.caches||(f6.measure.caches=[])).push({})}}aC(f2,"renderLine",f2,f6.line,f4.pre);if(f4.pre.className){f4.textClass=fF(f4.pre.className,f4.textClass||"")}return f4}function eZ(f2){var f1=fK("span","\u2022","cm-invalidchar");f1.title="\\u"+f2.charCodeAt(0).toString(16);return f1}function u(f6,gg,f1,f4,gh,gf){if(!gg){return}var gb=f6.cm.options.specialChars,ga=false;if(!gb.test(gg)){f6.col+=gg.length;var f9=document.createTextNode(gg);f6.map.push(f6.pos,f6.pos+gg.length,f9);if(dz&&l<9){ga=true}f6.pos+=gg.length}else{var f9=document.createDocumentFragment(),gd=0;while(true){gb.lastIndex=gd;var f2=gb.exec(gg);var f8=f2?f2.index-gd:gg.length-gd;if(f8){var f5=document.createTextNode(gg.slice(gd,gd+f8));if(dz&&l<9){f9.appendChild(fK("span",[f5]))}else{f9.appendChild(f5)}f6.map.push(f6.pos,f6.pos+f8,f5);f6.col+=f8;f6.pos+=f8}if(!f2){break}gd+=f8+1;if(f2[0]=="\t"){var f7=f6.cm.options.tabSize,gc=f7-f6.col%f7;var f5=f9.appendChild(fK("span",co(gc),"cm-tab"));f6.col+=gc}else{var f5=f6.cm.options.specialCharPlaceholder(f2[0]);if(dz&&l<9){f9.appendChild(fK("span",[f5]))}else{f9.appendChild(f5)}f6.col+=1}f6.map.push(f6.pos,f6.pos+1,f5);f6.pos++}}if(f1||f4||gh||ga){var ge=f1||"";if(f4){ge+=f4}if(gh){ge+=gh}var f3=fK("span",[f9],ge);if(gf){f3.title=gf}return f6.content.appendChild(f3)}f6.content.appendChild(f9)}function ft(f1){function f2(f3){var f4=" ";for(var f5=0;f5<f3.length-2;++f5){f4+=f5%2?" ":"\u00a0"}f4+=" ";return f4}return function(f4,f8,f5,f3,f7,f6){f1(f4,f8.replace(/ {3,}/g,f2),f5,f3,f7,f6)}}function V(f2,f1){return function(f9,gb,f3,f7,gc,ga){f3=f3?f3+" cm-force-border":"cm-force-border";var f4=f9.pos,f6=f4+gb.length;for(;;){for(var f8=0;f8<f1.length;f8++){var f5=f1[f8];if(f5.to>f4&&f5.from<=f4){break}}if(f5.to>=f6){return f2(f9,gb,f3,f7,gc,ga)}f2(f9,gb.slice(0,f5.to-f4),f3,f7,null,ga);f7=null;gb=gb.slice(f5.to-f4);f4=f5.to}}}function ab(f2,f4,f1,f3){var f5=!f3&&f1.widgetNode;if(f5){f2.map.push(f2.pos,f2.pos+f4,f5);f2.content.appendChild(f5)}f2.pos+=f4}function bm(ga,gg,f9){var f6=ga.markedSpans,f8=ga.text,ge=0;if(!f6){for(var gj=1;gj<f9.length;gj+=2){gg.addToken(gg,f8.slice(ge,ge=f9[gj]),eK(f9[gj+1],gg.cm.options))}return}var gk=f8.length,f5=0,gj=1,gc="",gl;var gn=0,f1,gm,gd,go,f3;for(;;){if(gn==f5){f1=gm=gd=go="";f3=null;gn=Infinity;var f7=[];for(var gh=0;gh<f6.length;++gh){var gi=f6[gh],gf=gi.marker;if(gi.from<=f5&&(gi.to==null||gi.to>f5)){if(gi.to!=null&&gn>gi.to){gn=gi.to;gm=""}if(gf.className){f1+=" "+gf.className}if(gf.startStyle&&gi.from==f5){gd+=" "+gf.startStyle}if(gf.endStyle&&gi.to==gn){gm+=" "+gf.endStyle}if(gf.title&&!go){go=gf.title}if(gf.collapsed&&(!f3||dE(f3.marker,gf)<0)){f3=gi}}else{if(gi.from>f5&&gn>gi.from){gn=gi.from}}if(gf.type=="bookmark"&&gi.from==f5&&gf.widgetNode){f7.push(gf)}}if(f3&&(f3.from||0)==f5){ab(gg,(f3.to==null?gk+1:f3.to)-f5,f3.marker,f3.from==null);if(f3.to==null){return}}if(!f3&&f7.length){for(var gh=0;gh<f7.length;++gh){ab(gg,0,f7[gh])}}}if(f5>=gk){break}var gb=Math.min(gk,gn);while(true){if(gc){var f2=f5+gc.length;if(!f3){var f4=f2>gb?gc.slice(0,gb-f5):gc;gg.addToken(gg,f4,gl?gl+f1:f1,gd,f5+f4.length==gn?gm:"",go)}if(f2>=gb){gc=gc.slice(gb-f5);f5=gb;break}f5=f2;gd=""}gc=f8.slice(ge,ge=f9[gj++]);gl=eK(f9[gj++],gg.cm.options)}}}function dG(f1,f2){return f2.from.ch==0&&f2.to.ch==0&&fv(f2.text)==""&&(!f1.cm||f1.cm.options.wholeLineUpdateBefore)}function fm(ge,f9,f1,f5){function gf(gh){return f1?f1[gh]:null}function f2(gh,gj,gi){ea(gh,gj,gi,f5);ad(gh,"change",gh,f9)}var gc=f9.from,gd=f9.to,gg=f9.text;var ga=e2(ge,gc.line),gb=e2(ge,gd.line);var f8=fv(gg),f4=gf(gg.length-1),f7=gd.line-gc.line;if(dG(ge,f9)){for(var f3=0,f6=[];f3<gg.length-1;++f3){f6.push(new fQ(gg[f3],gf(f3),f5))}f2(gb,gb.text,f4);if(f7){ge.remove(gc.line,f7)}if(f6.length){ge.insert(gc.line,f6)}}else{if(ga==gb){if(gg.length==1){f2(ga,ga.text.slice(0,gc.ch)+f8+ga.text.slice(gd.ch),f4)}else{for(var f6=[],f3=1;f3<gg.length-1;++f3){f6.push(new fQ(gg[f3],gf(f3),f5))}f6.push(new fQ(f8+ga.text.slice(gd.ch),f4,f5));f2(ga,ga.text.slice(0,gc.ch)+gg[0],gf(0));ge.insert(gc.line+1,f6)}}else{if(gg.length==1){f2(ga,ga.text.slice(0,gc.ch)+gg[0]+gb.text.slice(gd.ch),gf(0));ge.remove(gc.line+1,f7)}else{f2(ga,ga.text.slice(0,gc.ch)+gg[0],gf(0));f2(gb,f8+gb.text.slice(gd.ch),f4);for(var f3=1,f6=[];f3<gg.length-1;++f3){f6.push(new fQ(gg[f3],gf(f3),f5))}if(f7>1){ge.remove(gc.line+1,f7-1)}ge.insert(gc.line+1,f6)}}}ad(ge,"change",ge,f9)}function eN(f2){this.lines=f2;this.parent=null;for(var f3=0,f1=0;f3<f2.length;++f3){f2[f3].parent=this;f1+=f2[f3].height}this.height=f1}eN.prototype={chunkSize:function(){return this.lines.length},removeInner:function(f1,f5){for(var f3=f1,f4=f1+f5;f3<f4;++f3){var f2=this.lines[f3];this.height-=f2.height;bz(f2);ad(f2,"delete")}this.lines.splice(f1,f5)},collapse:function(f1){f1.push.apply(f1,this.lines)},insertInner:function(f2,f3,f1){this.height+=f1;this.lines=this.lines.slice(0,f2).concat(f3).concat(this.lines.slice(f2));for(var f4=0;f4<f3.length;++f4){f3[f4].parent=this}},iterN:function(f1,f4,f3){for(var f2=f1+f4;f1<f2;++f1){if(f3(this.lines[f1])){return true}}}};function fl(f4){this.children=f4;var f3=0,f1=0;for(var f2=0;f2<f4.length;++f2){var f5=f4[f2];f3+=f5.chunkSize();f1+=f5.height;f5.parent=this}this.size=f3;this.height=f1;this.parent=null}fl.prototype={chunkSize:function(){return this.size},removeInner:function(f1,f8){this.size-=f8;for(var f3=0;f3<this.children.length;++f3){var f7=this.children[f3],f5=f7.chunkSize();if(f1<f5){var f4=Math.min(f8,f5-f1),f6=f7.height;f7.removeInner(f1,f4);this.height-=f6-f7.height;if(f5==f4){this.children.splice(f3--,1);f7.parent=null}if((f8-=f4)==0){break}f1=0}else{f1-=f5}}if(this.size-f8<25&&(this.children.length>1||!(this.children[0] instanceof eN))){var f2=[];this.collapse(f2);this.children=[new eN(f2)];this.children[0].parent=this}},collapse:function(f1){for(var f2=0;f2<this.children.length;++f2){this.children[f2].collapse(f1)}},insertInner:function(f2,f3,f1){this.size+=f3.length;this.height+=f1;for(var f6=0;f6<this.children.length;++f6){var f8=this.children[f6],f7=f8.chunkSize();if(f2<=f7){f8.insertInner(f2,f3,f1);if(f8.lines&&f8.lines.length>50){while(f8.lines.length>50){var f5=f8.lines.splice(f8.lines.length-25,25);var f4=new eN(f5);f8.height-=f4.height;this.children.splice(f6+1,0,f4);f4.parent=this}this.maybeSpill()}break}f2-=f7}},maybeSpill:function(){if(this.children.length<=10){return}var f4=this;do{var f2=f4.children.splice(f4.children.length-5,5);var f3=new fl(f2);if(!f4.parent){var f5=new fl(f4.children);f5.parent=f4;f4.children=[f5,f3];f4=f5}else{f4.size-=f3.size;f4.height-=f3.height;var f1=db(f4.parent.children,f4);f4.parent.children.splice(f1+1,0,f3)}f3.parent=f4.parent}while(f4.children.length>10);f4.parent.maybeSpill()},iterN:function(f1,f7,f6){for(var f2=0;f2<this.children.length;++f2){var f5=this.children[f2],f4=f5.chunkSize();if(f1<f4){var f3=Math.min(f7,f4-f1);if(f5.iterN(f1,f3,f6)){return true}if((f7-=f3)==0){break}f1=0}else{f1-=f4}}}};var cp=0;var at=J.Doc=function(f3,f2,f1){if(!(this instanceof at)){return new at(f3,f2,f1)}if(f1==null){f1=0}fl.call(this,[new eN([new fQ("",null)])]);this.first=f1;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.frontier=f1;var f4=X(f1,0);this.sel=eG(f4);this.history=new fG(null);this.id=++cp;this.modeOption=f2;if(typeof f3=="string"){f3=aW(f3)}fm(this,{from:f4,to:f4,text:f3});bS(this,eG(f4),Z)};at.prototype=cj(fl.prototype,{constructor:at,iter:function(f3,f2,f1){if(f1){this.iterN(f3-this.first,f2-f3,f1)}else{this.iterN(this.first,this.first+this.size,f3)}},insert:function(f2,f3){var f1=0;for(var f4=0;f4<f3.length;++f4){f1+=f3[f4].height}this.insertInner(f2-this.first,f3,f1)},remove:function(f1,f2){this.removeInner(f1-this.first,f2)},getValue:function(f2){var f1=aY(this,this.first,this.first+this.size);if(f2===false){return f1}return f1.join(f2||"\n")},setValue:cA(function(f2){var f3=X(this.first,0),f1=this.first+this.size-1;bb(this,{from:f3,to:X(f1,e2(this,f1).text.length),text:aW(f2),origin:"setValue"},true);bS(this,eG(f3))}),replaceRange:function(f2,f4,f3,f1){f4=fx(this,f4);f3=f3?fx(this,f3):f4;aX(this,f2,f4,f3,f1)},getRange:function(f4,f3,f2){var f1=fM(this,fx(this,f4),fx(this,f3));if(f2===false){return f1}return f1.join(f2||"\n")},getLine:function(f2){var f1=this.getLineHandle(f2);return f1&&f1.text},getLineHandle:function(f1){if(b7(this,f1)){return e2(this,f1)}},getLineNumber:function(f1){return bL(f1)},getLineHandleVisualStart:function(f1){if(typeof f1=="number"){f1=e2(this,f1)}return z(f1)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(f1){return fx(this,f1)},getCursor:function(f3){var f1=this.sel.primary(),f2;if(f3==null||f3=="head"){f2=f1.head}else{if(f3=="anchor"){f2=f1.anchor}else{if(f3=="end"||f3=="to"||f3===false){f2=f1.to()}else{f2=f1.from()}}}return f2},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:cA(function(f1,f3,f2){H(this,fx(this,typeof f1=="number"?X(f1,f3||0):f1),null,f2)}),setSelection:cA(function(f2,f3,f1){H(this,fx(this,f2),fx(this,f3||f2),f1)}),extendSelection:cA(function(f3,f1,f2){fH(this,fx(this,f3),f1&&fx(this,f1),f2)}),extendSelections:cA(function(f2,f1){aw(this,dN(this,f2,f1))}),extendSelectionsBy:cA(function(f2,f1){aw(this,bQ(this.sel.ranges,f2),f1)}),setSelections:cA(function(f1,f5,f3){if(!f1.length){return}for(var f4=0,f2=[];f4<f1.length;f4++){f2[f4]=new dM(fx(this,f1[f4].anchor),fx(this,f1[f4].head))}if(f5==null){f5=Math.min(f1.length-1,this.sel.primIndex)}bS(this,cu(f2,f5),f3)}),addSelection:cA(function(f3,f4,f2){var f1=this.sel.ranges.slice(0);f1.push(new dM(fx(this,f3),fx(this,f4||f3)));bS(this,cu(f1,f1.length-1),f2)}),getSelection:function(f5){var f2=this.sel.ranges,f1;for(var f3=0;f3<f2.length;f3++){var f4=fM(this,f2[f3].from(),f2[f3].to());f1=f1?f1.concat(f4):f4}if(f5===false){return f1}else{return f1.join(f5||"\n")}},getSelections:function(f5){var f4=[],f1=this.sel.ranges;for(var f2=0;f2<f1.length;f2++){var f3=fM(this,f1[f2].from(),f1[f2].to());if(f5!==false){f3=f3.join(f5||"\n")}f4[f2]=f3}return f4},replaceSelection:function(f3,f5,f1){var f4=[];for(var f2=0;f2<this.sel.ranges.length;f2++){f4[f2]=f3}this.replaceSelections(f4,f5,f1||"+input")},replaceSelections:cA(function(f6,f8,f3){var f5=[],f7=this.sel;for(var f4=0;f4<f7.ranges.length;f4++){var f2=f7.ranges[f4];f5[f4]={from:f2.from(),to:f2.to(),text:aW(f6[f4]),origin:f3}}var f1=f8&&f8!="end"&&ae(this,f5,f8);for(var f4=f5.length-1;f4>=0;f4--){bb(this,f5[f4])}if(f1){eU(this,f1)}else{if(this.cm){fu(this.cm)}}}),undo:cA(function(){b6(this,"undo")}),redo:cA(function(){b6(this,"redo")}),undoSelection:cA(function(){b6(this,"undo",true)}),redoSelection:cA(function(){b6(this,"redo",true)}),setExtending:function(f1){this.extend=f1},getExtending:function(){return this.extend},historySize:function(){var f4=this.history,f1=0,f3=0;for(var f2=0;f2<f4.done.length;f2++){if(!f4.done[f2].ranges){++f1}}for(var f2=0;f2<f4.undone.length;f2++){if(!f4.undone[f2].ranges){++f3}}return{undo:f1,redo:f3}},clearHistory:function(){this.history=new fG(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(f1){if(f1){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(f1){return this.history.generation==(f1||this.cleanGeneration)},getHistory:function(){return{done:bN(this.history.done),undone:bN(this.history.undone)}},setHistory:function(f2){var f1=this.history=new fG(this.history.maxGeneration);f1.done=bN(f2.done.slice(0),null,true);f1.undone=bN(f2.undone.slice(0),null,true)},addLineClass:cA(function(f3,f2,f1){return em(this,f3,"class",function(f4){var f5=f2=="text"?"textClass":f2=="background"?"bgClass":"wrapClass";if(!f4[f5]){f4[f5]=f1}else{if(new RegExp("(?:^|\\s)"+f1+"(?:$|\\s)").test(f4[f5])){return false}else{f4[f5]+=" "+f1}}return true})}),removeLineClass:cA(function(f3,f2,f1){return em(this,f3,"class",function(f5){var f8=f2=="text"?"textClass":f2=="background"?"bgClass":"wrapClass";var f7=f5[f8];if(!f7){return false}else{if(f1==null){f5[f8]=null}else{var f6=f7.match(new RegExp("(?:^|\\s+)"+f1+"(?:$|\\s+)"));if(!f6){return false}var f4=f6.index+f6[0].length;f5[f8]=f7.slice(0,f6.index)+(!f6.index||f4==f7.length?"":" ")+f7.slice(f4)||null}}return true})}),markText:function(f3,f2,f1){return et(this,fx(this,f3),fx(this,f2),f1,"range")},setBookmark:function(f3,f1){var f2={replacedWith:f1&&(f1.nodeType==null?f1.widget:f1),insertLeft:f1&&f1.insertLeft,clearWhenEmpty:false,shared:f1&&f1.shared};f3=fx(this,f3);return et(this,f3,f3,f2,"bookmark")},findMarksAt:function(f5){f5=fx(this,f5);var f4=[],f2=e2(this,f5.line).markedSpans;if(f2){for(var f1=0;f1<f2.length;++f1){var f3=f2[f1];if((f3.from==null||f3.from<=f5.ch)&&(f3.to==null||f3.to>=f5.ch)){f4.push(f3.marker.parent||f3.marker)}}}return f4},findMarks:function(f5,f4,f1){f5=fx(this,f5);f4=fx(this,f4);var f2=[],f3=f5.line;this.iter(f5.line,f4.line+1,function(f6){var f8=f6.markedSpans;if(f8){for(var f7=0;f7<f8.length;f7++){var f9=f8[f7];if(!(f3==f5.line&&f5.ch>f9.to||f9.from==null&&f3!=f5.line||f3==f4.line&&f9.from>f4.ch)&&(!f1||f1(f9.marker))){f2.push(f9.marker.parent||f9.marker)}}}++f3});return f2},getAllMarks:function(){var f1=[];this.iter(function(f3){var f2=f3.markedSpans;if(f2){for(var f4=0;f4<f2.length;++f4){if(f2[f4].from!=null){f1.push(f2[f4].marker)}}}});return f1},posFromIndex:function(f2){var f1,f3=this.first;this.iter(function(f4){var f5=f4.text.length+1;if(f5>f2){f1=f2;return true}f2-=f5;++f3});return fx(this,X(f3,f1))},indexFromPos:function(f2){f2=fx(this,f2);var f1=f2.ch;if(f2.line<this.first||f2.ch<0){return 0}this.iter(this.first,f2.line,function(f3){f1+=f3.text.length+1});return f1},copy:function(f1){var f2=new at(aY(this,this.first,this.first+this.size),this.modeOption,this.first);f2.scrollTop=this.scrollTop;f2.scrollLeft=this.scrollLeft;f2.sel=this.sel;f2.extend=false;if(f1){f2.history.undoDepth=this.history.undoDepth;f2.setHistory(this.getHistory())}return f2},linkedDoc:function(f1){if(!f1){f1={}}var f4=this.first,f3=this.first+this.size;if(f1.from!=null&&f1.from>f4){f4=f1.from}if(f1.to!=null&&f1.to<f3){f3=f1.to}var f2=new at(aY(this,f4,f3),f1.mode||this.modeOption,f4);if(f1.sharedHist){f2.history=this.history}(this.linked||(this.linked=[])).push({doc:f2,sharedHist:f1.sharedHist});f2.linked=[{doc:this,isParent:true,sharedHist:f1.sharedHist}];dv(f2,eD(this));return f2},unlinkDoc:function(f2){if(f2 instanceof J){f2=f2.doc}if(this.linked){for(var f3=0;f3<this.linked.length;++f3){var f4=this.linked[f3];if(f4.doc!=f2){continue}this.linked.splice(f3,1);f2.unlinkDoc(this);eb(eD(this));break}}if(f2.history==this.history){var f1=[f2.id];dV(f2,function(f5){f1.push(f5.id)},true);f2.history=new fG(null);f2.history.done=bN(this.history.done,f1);f2.history.undone=bN(this.history.undone,f1)}},iterLinkedDocs:function(f1){dV(this,f1)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});at.prototype.eachLine=at.prototype.iter;var d="iter insert remove copy getEditor".split(" ");for(var bI in at.prototype){if(at.prototype.hasOwnProperty(bI)&&db(d,bI)<0){J.prototype[bI]=(function(f1){return function(){return f1.apply(this.doc,arguments)}})(at.prototype[bI])}}bw(at);function dV(f4,f3,f2){function f1(ga,f8,f6){if(ga.linked){for(var f7=0;f7<ga.linked.length;++f7){var f5=ga.linked[f7];if(f5.doc==f8){continue}var f9=f6&&f5.sharedHist;if(f2&&!f9){continue}f3(f5.doc,f9);f1(f5.doc,ga,f9)}}}f1(f4,null,true)}function dY(f1,f2){if(f2.cm){throw new Error("This document is already in use.")}f1.doc=f2;f2.cm=f1;Y(f1);bp(f1);if(!f1.options.lineWrapping){g(f1)}f1.options.mode=f2.modeOption;ag(f1)}function e2(f4,f6){f6-=f4.first;if(f6<0||f6>=f4.size){throw new Error("There is no line "+(f6+f4.first)+" in the document.")}for(var f1=f4;!f1.lines;){for(var f2=0;;++f2){var f5=f1.children[f2],f3=f5.chunkSize();if(f6<f3){f1=f5;break}f6-=f3}}return f1.lines[f6]}function fM(f3,f5,f1){var f2=[],f4=f5.line;f3.iter(f5.line,f1.line+1,function(f6){var f7=f6.text;if(f4==f1.line){f7=f7.slice(0,f1.ch)}if(f4==f5.line){f7=f7.slice(f5.ch)}f2.push(f7);++f4});return f2}function aY(f2,f4,f3){var f1=[];f2.iter(f4,f3,function(f5){f1.push(f5.text)});return f1}function fO(f2,f1){var f3=f1-f2.height;if(f3){for(var f4=f2;f4;f4=f4.parent){f4.height+=f3}}}function bL(f1){if(f1.parent==null){return null}var f5=f1.parent,f4=db(f5.lines,f1);for(var f2=f5.parent;f2;f5=f2,f2=f2.parent){for(var f3=0;;++f3){if(f2.children[f3]==f5){break}f4+=f2.children[f3].chunkSize()}}return f4+f5.first}function bE(f3,f6){var f8=f3.first;outer:do{for(var f4=0;f4<f3.children.length;++f4){var f7=f3.children[f4],f5=f7.height;if(f6<f5){f3=f7;continue outer}f6-=f5;f8+=f7.chunkSize()}return f8}while(!f3.lines);for(var f4=0;f4<f3.lines.length;++f4){var f2=f3.lines[f4],f1=f2.height;if(f6<f1){break}f6-=f1}return f8+f4}function bK(f3){f3=z(f3);var f5=0,f2=f3.parent;for(var f4=0;f4<f2.lines.length;++f4){var f1=f2.lines[f4];if(f1==f3){break}else{f5+=f1.height}}for(var f6=f2.parent;f6;f2=f6,f6=f2.parent){for(var f4=0;f4<f6.children.length;++f4){var f7=f6.children[f4];if(f7==f2){break}else{f5+=f7.height}}}return f5}function a(f2){var f1=f2.order;if(f1==null){f1=f2.order=bc(f2.text)}return f1}function fG(f1){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=f1||1}function dk(f1,f3){var f2={from:ch(f3.from),to:cR(f3),text:fM(f1,f3.from,f3.to)};bW(f1,f2,f3.from.line,f3.to.line+1);dV(f1,function(f4){bW(f4,f2,f3.from.line,f3.to.line+1)},true);return f2}function fp(f2){while(f2.length){var f1=fv(f2);if(f1.ranges){f2.pop()}else{break}}}function eA(f2,f1){if(f1){fp(f2.done);return fv(f2.done)}else{if(f2.done.length&&!fv(f2.done).ranges){return fv(f2.done)}else{if(f2.done.length>1&&!f2.done[f2.done.length-2].ranges){f2.done.pop();return fv(f2.done)}}}}function fA(f7,f5,f1,f4){var f3=f7.history;f3.undone.length=0;var f2=+new Date,f8;if((f3.lastOp==f4||f3.lastOrigin==f5.origin&&f5.origin&&((f5.origin.charAt(0)=="+"&&f7.cm&&f3.lastModTime>f2-f7.cm.options.historyEventDelay)||f5.origin.charAt(0)=="*"))&&(f8=eA(f3,f3.lastOp==f4))){var f9=fv(f8.changes);if(cd(f5.from,f5.to)==0&&cd(f5.from,f9.to)==0){f9.to=cR(f5)}else{f8.changes.push(dk(f7,f5))}}else{var f6=fv(f3.done);if(!f6||!f6.ranges){cJ(f7.sel,f3.done)}f8={changes:[dk(f7,f5)],generation:f3.generation};f3.done.push(f8);while(f3.done.length>f3.undoDepth){f3.done.shift();if(!f3.done[0].ranges){f3.done.shift()}}}f3.done.push(f1);f3.generation=++f3.maxGeneration;f3.lastModTime=f3.lastSelTime=f2;f3.lastOp=f3.lastSelOp=f4;f3.lastOrigin=f3.lastSelOrigin=f5.origin;if(!f9){aC(f7,"historyAdded")}}function by(f5,f1,f3,f4){var f2=f1.charAt(0);return f2=="*"||f2=="+"&&f3.ranges.length==f4.ranges.length&&f3.somethingSelected()==f4.somethingSelected()&&new Date-f5.history.lastSelTime<=(f5.cm?f5.cm.options.historyEventDelay:500)}function fU(f6,f4,f1,f3){var f5=f6.history,f2=f3&&f3.origin;if(f1==f5.lastSelOp||(f2&&f5.lastSelOrigin==f2&&(f5.lastModTime==f5.lastSelTime&&f5.lastOrigin==f2||by(f6,f2,fv(f5.done),f4)))){f5.done[f5.done.length-1]=f4}else{cJ(f4,f5.done)}f5.lastSelTime=+new Date;f5.lastSelOrigin=f2;f5.lastSelOp=f1;if(f3&&f3.clearRedo!==false){fp(f5.undone)}}function cJ(f2,f1){var f3=fv(f1);if(!(f3&&f3.ranges&&f3.equals(f2))){f1.push(f2)}}function bW(f2,f6,f5,f4){var f1=f6["spans_"+f2.id],f3=0;f2.iter(Math.max(f2.first,f5),Math.min(f2.first+f2.size,f4),function(f7){if(f7.markedSpans){(f1||(f1=f6["spans_"+f2.id]={}))[f3]=f7.markedSpans}++f3})}function bh(f3){if(!f3){return null}for(var f2=0,f1;f2<f3.length;++f2){if(f3[f2].marker.explicitlyCleared){if(!f1){f1=f3.slice(0,f2)}}else{if(f1){f1.push(f3[f2])}}}return !f1?f3:f1.length?f1:null}function b2(f4,f5){var f3=f5["spans_"+f4.id];if(!f3){return null}for(var f2=0,f1=[];f2<f5.text.length;++f2){f1.push(bh(f3[f2]))}return f1}function bN(gc,f4,gb){for(var f7=0,f2=[];f7<gc.length;++f7){var f3=gc[f7];if(f3.ranges){f2.push(gb?fL.prototype.deepCopy.call(f3):f3);continue}var f9=f3.changes,ga=[];f2.push({changes:ga});for(var f6=0;f6<f9.length;++f6){var f8=f9[f6],f5;ga.push({from:f8.from,to:f8.to,text:f8.text});if(f4){for(var f1 in f8){if(f5=f1.match(/^spans_(\d+)$/)){if(db(f4,Number(f5[1]))>-1){fv(ga)[f1]=f8[f1];delete f8[f1]}}}}}}return f2}function K(f4,f3,f2,f1){if(f2<f4.line){f4.line+=f1}else{if(f3<f4.line){f4.line=f3;f4.ch=0}}}function e4(f4,f6,f7,f8){for(var f3=0;f3<f4.length;++f3){var f1=f4[f3],f5=true;if(f1.ranges){if(!f1.copied){f1=f4[f3]=f1.deepCopy();f1.copied=true}for(var f2=0;f2<f1.ranges.length;f2++){K(f1.ranges[f2].anchor,f6,f7,f8);K(f1.ranges[f2].head,f6,f7,f8)}continue}for(var f2=0;f2<f1.changes.length;++f2){var f9=f1.changes[f2];if(f7<f9.from.line){f9.from=X(f9.from.line+f8,f9.from.ch);f9.to=X(f9.to.line+f8,f9.to.ch)}else{if(f6<=f9.to.line){f5=false;break}}}if(!f5){f4.splice(0,f3+1);f3=0}}}function du(f2,f5){var f4=f5.from.line,f3=f5.to.line,f1=f5.text.length-(f3-f4)-1;e4(f2.done,f4,f3,f1);e4(f2.undone,f4,f3,f1)}var cC=J.e_preventDefault=function(f1){if(f1.preventDefault){f1.preventDefault()}else{f1.returnValue=false}};var dg=J.e_stopPropagation=function(f1){if(f1.stopPropagation){f1.stopPropagation()}else{f1.cancelBubble=true}};function bJ(f1){return f1.defaultPrevented!=null?f1.defaultPrevented:f1.returnValue==false}var ee=J.e_stop=function(f1){cC(f1);dg(f1)};function M(f1){return f1.target||f1.srcElement}function fB(f2){var f1=f2.which;if(f1==null){if(f2.button&1){f1=1}else{if(f2.button&2){f1=3}else{if(f2.button&4){f1=2}}}}if(b5&&f2.ctrlKey&&f1==1){f1=3}return f1}var bV=J.on=function(f4,f2,f3){if(f4.addEventListener){f4.addEventListener(f2,f3,false)}else{if(f4.attachEvent){f4.attachEvent("on"+f2,f3)}else{var f5=f4._handlers||(f4._handlers={});var f1=f5[f2]||(f5[f2]=[]);f1.push(f3)}}};var d0=J.off=function(f5,f3,f4){if(f5.removeEventListener){f5.removeEventListener(f3,f4,false)}else{if(f5.detachEvent){f5.detachEvent("on"+f3,f4)}else{var f1=f5._handlers&&f5._handlers[f3];if(!f1){return}for(var f2=0;f2<f1.length;++f2){if(f1[f2]==f4){f1.splice(f2,1);break}}}}};var aC=J.signal=function(f5,f4){var f1=f5._handlers&&f5._handlers[f4];if(!f1){return}var f2=Array.prototype.slice.call(arguments,2);for(var f3=0;f3<f1.length;++f3){f1[f3].apply(null,f2)}};var bx=null;function ad(f7,f5){var f1=f7._handlers&&f7._handlers[f5];if(!f1){return}var f3=Array.prototype.slice.call(arguments,2),f6;if(bn){f6=bn.delayedCallbacks}else{if(bx){f6=bx}else{f6=bx=[];setTimeout(aJ,0)}}function f2(f8){return function(){f8.apply(null,f3)}}for(var f4=0;f4<f1.length;++f4){f6.push(f2(f1[f4]))}}function aJ(){var f1=bx;bx=null;for(var f2=0;f2<f1.length;++f2){f1[f2]()}}function aO(f1,f3,f2){aC(f1,f2||f3.type,f1,f3);return bJ(f3)||f3.codemirrorIgnore}function W(f2){var f1=f2._handlers&&f2._handlers.cursorActivity;if(!f1){return}var f4=f2.curOp.cursorActivityHandlers||(f2.curOp.cursorActivityHandlers=[]);for(var f3=0;f3<f1.length;++f3){if(db(f4,f1[f3])==-1){f4.push(f1[f3])}}}function e5(f3,f2){var f1=f3._handlers&&f3._handlers[f2];return f1&&f1.length>0}function bw(f1){f1.prototype.on=function(f2,f3){bV(this,f2,f3)};f1.prototype.off=function(f2,f3){d0(this,f2,f3)}}var bg=30;var b8=J.Pass={toString:function(){return"CodeMirror.Pass"}};var Z={scroll:false},N={origin:"*mouse"},cQ={origin:"+move"};function f0(){this.id=null}f0.prototype.set=function(f1,f2){clearTimeout(this.id);this.id=setTimeout(f2,f1)};var bR=J.countColumn=function(f4,f2,f6,f7,f3){if(f2==null){f2=f4.search(/[^\s\u00a0]/);if(f2==-1){f2=f4.length}}for(var f5=f7||0,f8=f3||0;;){var f1=f4.indexOf("\t",f5);if(f1<0||f1>=f2){return f8+(f2-f5)}f8+=f1-f5;f8+=f6-(f8%f6);f5=f1+1}};function ed(f5,f4,f6){for(var f7=0,f3=0;;){var f2=f5.indexOf("\t",f7);if(f2==-1){f2=f5.length}var f1=f2-f7;if(f2==f5.length||f3+f1>=f4){return f7+Math.min(f1,f4-f3)}f3+=f2-f7;f3+=f6-(f3%f6);f7=f2+1;if(f3>=f4){return f7}}}var aV=[""];function co(f1){while(aV.length<=f1){aV.push(fv(aV)+" ")}return aV[f1]}function fv(f1){return f1[f1.length-1]}var dA=function(f1){f1.select()};if(eP){dA=function(f1){f1.selectionStart=0;f1.selectionEnd=f1.value.length}}else{if(dz){dA=function(f2){try{f2.select()}catch(f1){}}}}function db(f3,f1){for(var f2=0;f2<f3.length;++f2){if(f3[f2]==f1){return f2}}return -1}if([].indexOf){db=function(f2,f1){return f2.indexOf(f1)}}function bQ(f4,f3){var f1=[];for(var f2=0;f2<f4.length;f2++){f1[f2]=f3(f4[f2],f2)}return f1}if([].map){bQ=function(f2,f1){return f2.map(f1)}}function cj(f4,f1){var f3;if(Object.create){f3=Object.create(f4)}else{var f2=function(){};f2.prototype=f4;f3=new f2()}if(f1){aK(f1,f3)}return f3}function aK(f3,f2,f1){if(!f2){f2={}}for(var f4 in f3){if(f3.hasOwnProperty(f4)&&(f1!==false||!f2.hasOwnProperty(f4))){f2[f4]=f3[f4]}}return f2}function ct(f2){var f1=Array.prototype.slice.call(arguments,1);return function(){return f2.apply(null,f1)}}var a8=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;var fr=J.isWordChar=function(f1){return/\w/.test(f1)||f1>"\x80"&&(f1.toUpperCase()!=f1.toLowerCase()||a8.test(f1))};function cx(f1,f2){if(!f2){return fr(f1)}if(f2.source.indexOf("\\w")>-1&&fr(f1)){return true}return f2.test(f1)}function eI(f1){for(var f2 in f1){if(f1.hasOwnProperty(f2)&&f1[f2]){return false}}return true}var ex=/[\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]/;function fd(f1){return f1.charCodeAt(0)>=768&&ex.test(f1)}function fK(f1,f5,f4,f3){var f6=document.createElement(f1);if(f4){f6.className=f4}if(f3){f6.style.cssText=f3}if(typeof f5=="string"){f6.appendChild(document.createTextNode(f5))}else{if(f5){for(var f2=0;f2<f5.length;++f2){f6.appendChild(f5[f2])}}}return f6}var ck;if(document.createRange){ck=function(f3,f4,f1){var f2=document.createRange();f2.setEnd(f3,f1);f2.setStart(f3,f4);return f2}}else{ck=function(f3,f4,f1){var f2=document.body.createTextRange();f2.moveToElementText(f3.parentNode);f2.collapse(true);f2.moveEnd("character",f1);f2.moveStart("character",f4);return f2}}function dP(f2){for(var f1=f2.childNodes.length;f1>0;--f1){f2.removeChild(f2.firstChild)}return f2}function bP(f1,f2){return dP(f1).appendChild(f2)}function fT(f1,f2){if(f1.contains){return f1.contains(f2)}while(f2=f2.parentNode){if(f2==f1){return true}}}function dC(){return document.activeElement}if(dz&&l<11){dC=function(){try{return document.activeElement}catch(f1){return document.body}}}function T(f1){return new RegExp("\\b"+f1+"\\b\\s*")}function f(f2,f1){var f3=T(f1);if(f3.test(f2.className)){f2.className=f2.className.replace(f3,"")}}function fo(f2,f1){if(!T(f1).test(f2.className)){f2.className+=" "+f1}}function fF(f3,f1){var f2=f3.split(" ");for(var f4=0;f4<f2.length;f4++){if(f2[f4]&&!T(f2[f4]).test(f1)){f1+=" "+f2[f4]}}return f1}function az(f4){if(!document.body.getElementsByClassName){return}var f3=document.body.getElementsByClassName("CodeMirror");for(var f2=0;f2<f3.length;f2++){var f1=f3[f2].CodeMirror;if(f1){f4(f1)}}}var cz=false;function be(){if(cz){return}fs();cz=true}function fs(){var f1;bV(window,"resize",function(){if(f1==null){f1=setTimeout(function(){f1=null;ej=null;az(aQ)},100)}});bV(window,"blur",function(){az(aR)})}var ez=function(){if(dz&&l<9){return false}var f1=fK("div");return"draggable" in f1||"dragDrop" in f1}();var ej;function k(f1){if(ej!=null){return ej}var f2=fK("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");bP(f1,f2);if(f2.offsetWidth){ej=f2.offsetHeight-f2.clientHeight}return ej||0}var fz;function bl(f1){if(fz==null){var f2=fK("span","\u200b");bP(f1,fK("span",[f2,document.createTextNode("x")]));if(f1.firstChild.offsetHeight!=0){fz=f2.offsetWidth<=1&&f2.offsetHeight>2&&!(dz&&l<8)}}if(fz){return fK("span","\u200b")}else{return fK("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")}}var fy;function bM(f4){if(fy!=null){return fy}var f1=bP(f4,document.createTextNode("A\u062eA"));var f3=ck(f1,0,1).getBoundingClientRect();if(!f3||f3.left==f3.right){return false}var f2=ck(f1,1,2).getBoundingClientRect();return fy=(f2.right-f3.right<3)}var aW=J.splitLines="\n\nb".split(/\n/).length!=3?function(f6){var f7=0,f1=[],f5=f6.length;while(f7<=f5){var f4=f6.indexOf("\n",f7);if(f4==-1){f4=f6.length}var f3=f6.slice(f7,f6.charAt(f4-1)=="\r"?f4-1:f4);var f2=f3.indexOf("\r");if(f2!=-1){f1.push(f3.slice(0,f2));f7+=f2+1}else{f1.push(f3);f7=f4+1}}return f1}:function(f1){return f1.split(/\r\n?|\n/)};var bq=window.getSelection?function(f2){try{return f2.selectionStart!=f2.selectionEnd}catch(f1){return false}}:function(f3){try{var f1=f3.ownerDocument.selection.createRange()}catch(f2){}if(!f1||f1.parentElement()!=f3){return false}return f1.compareEndPoints("StartToEnd",f1)!=0};var c4=(function(){var f1=fK("div");if("oncopy" in f1){return true}f1.setAttribute("oncopy","return;");return typeof f1.oncopy=="function"})();var eT=null;function aI(f2){if(eT!=null){return eT}var f3=bP(f2,fK("span","x"));var f4=f3.getBoundingClientRect();var f1=ck(f3,0,1).getBoundingClientRect();return eT=Math.abs(f4.left-f1.left)>1}var e3={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"};J.keyNames=e3;(function(){for(var f1=0;f1<10;f1++){e3[f1+48]=e3[f1+96]=String(f1)}for(var f1=65;f1<=90;f1++){e3[f1]=String.fromCharCode(f1)}for(var f1=1;f1<=12;f1++){e3[f1+111]=e3[f1+63235]="F"+f1}})();function dS(f1,f7,f6,f5){if(!f1){return f5(f7,f6,"ltr")}var f4=false;for(var f3=0;f3<f1.length;++f3){var f2=f1[f3];if(f2.from<f6&&f2.to>f7||f7==f6&&f2.to==f7){f5(Math.max(f2.from,f7),Math.min(f2.to,f6),f2.level==1?"rtl":"ltr");f4=true}}if(!f4){f5(f7,f6,"ltr")}}function dn(f1){return f1.level%2?f1.to:f1.from}function fW(f1){return f1.level%2?f1.from:f1.to}function cB(f2){var f1=a(f2);return f1?dn(f1[0]):0}function cO(f2){var f1=a(f2);if(!f1){return f2.text.length}return fW(fv(f1))}function br(f2,f5){var f3=e2(f2.doc,f5);var f6=z(f3);if(f6!=f3){f5=bL(f6)}var f1=a(f6);var f4=!f1?0:f1[0].level%2?cO(f6):cB(f6);return X(f5,f4)}function dD(f3,f6){var f2,f4=e2(f3.doc,f6);while(f2=ei(f4)){f4=f2.find(1,true).line;f6=null}var f1=a(f4);var f5=!f1?f4.text.length:f1[0].level%2?cB(f4):cO(f4);return X(f6==null?bL(f4):f6,f5)}function dy(f2,f7){var f6=br(f2,f7.line);var f3=e2(f2.doc,f6.line);var f1=a(f3);if(!f1||f1[0].level==0){var f5=Math.max(0,f3.text.search(/\S/));var f4=f7.line==f6.line&&f7.ch<=f5&&f7.ch;return X(f6.line,f4?0:f5)}return f6}function am(f2,f3,f1){var f4=f2[0].level;if(f3==f4){return true}if(f1==f4){return false}return f3<f1}var eQ;function aE(f1,f5){eQ=null;for(var f2=0,f3;f2<f1.length;++f2){var f4=f1[f2];if(f4.from<f5&&f4.to>f5){return f2}if((f4.from==f5||f4.to==f5)){if(f3==null){f3=f2}else{if(am(f1,f4.level,f1[f3].level)){if(f4.from!=f4.to){eQ=f3}return f2}else{if(f4.from!=f4.to){eQ=f2}return f3}}}}return f3}function e1(f1,f4,f2,f3){if(!f3){return f4+f2}do{f4+=f2}while(f4>0&&fd(f1.text.charAt(f4)));return f4}function v(f1,f8,f3,f4){var f5=a(f1);if(!f5){return ah(f1,f8,f3,f4)}var f7=aE(f5,f8),f2=f5[f7];var f6=e1(f1,f8,f2.level%2?-f3:f3,f4);for(;;){if(f6>f2.from&&f6<f2.to){return f6}if(f6==f2.from||f6==f2.to){if(aE(f5,f6)==f7){return f6}f2=f5[f7+=f3];return(f3>0)==f2.level%2?f2.to:f2.from}else{f2=f5[f7+=f3];if(!f2){return null}if((f3>0)==f2.level%2){f6=e1(f1,f2.to,-1,f4)}else{f6=e1(f1,f2.from,1,f4)}}}}function ah(f1,f5,f2,f3){var f4=f5+f2;if(f3){while(f4>0&&fd(f1.text.charAt(f4))){f4+=f2}}return f4<0||f4>f1.text.length?null:f4}var bc=(function(){var f7="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var f5="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm";function f4(gb){if(gb<=247){return f7.charAt(gb)}else{if(1424<=gb&&gb<=1524){return"R"}else{if(1536<=gb&&gb<=1773){return f5.charAt(gb-1536)}else{if(1774<=gb&&gb<=2220){return"r"}else{if(8192<=gb&&gb<=8203){return"w"}else{if(gb==8204){return"b"}else{return"L"}}}}}}}var f1=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var ga=/[stwN]/,f3=/[LRr]/,f2=/[Lb1n]/,f6=/[1n]/;var f9="L";function f8(gd,gc,gb){this.level=gd;this.from=gc;this.to=gb}return function(gl){if(!f1.test(gl)){return false}var gr=gl.length,gh=[];for(var gq=0,gd;gq<gr;++gq){gh.push(gd=f4(gl.charCodeAt(gq)))}for(var gq=0,gk=f9;gq<gr;++gq){var gd=gh[gq];if(gd=="m"){gh[gq]=gk}else{gk=gd}}for(var gq=0,gb=f9;gq<gr;++gq){var gd=gh[gq];if(gd=="1"&&gb=="r"){gh[gq]="n"}else{if(f3.test(gd)){gb=gd;if(gd=="r"){gh[gq]="R"}}}}for(var gq=1,gk=gh[0];gq<gr-1;++gq){var gd=gh[gq];if(gd=="+"&&gk=="1"&&gh[gq+1]=="1"){gh[gq]="1"}else{if(gd==","&&gk==gh[gq+1]&&(gk=="1"||gk=="n")){gh[gq]=gk}}gk=gd}for(var gq=0;gq<gr;++gq){var gd=gh[gq];if(gd==","){gh[gq]="N"}else{if(gd=="%"){for(var ge=gq+1;ge<gr&&gh[ge]=="%";++ge){}var gs=(gq&&gh[gq-1]=="!")||(ge<gr&&gh[ge]=="1")?"1":"N";for(var go=gq;go<ge;++go){gh[go]=gs}gq=ge-1}}}for(var gq=0,gb=f9;gq<gr;++gq){var gd=gh[gq];if(gb=="L"&&gd=="1"){gh[gq]="L"}else{if(f3.test(gd)){gb=gd}}}for(var gq=0;gq<gr;++gq){if(ga.test(gh[gq])){for(var ge=gq+1;ge<gr&&ga.test(gh[ge]);++ge){}var gi=(gq?gh[gq-1]:f9)=="L";var gc=(ge<gr?gh[ge]:f9)=="L";var gs=gi||gc?"L":"R";for(var go=gq;go<ge;++go){gh[go]=gs}gq=ge-1}}var gp=[],gm;for(var gq=0;gq<gr;){if(f2.test(gh[gq])){var gf=gq;for(++gq;gq<gr&&f2.test(gh[gq]);++gq){}gp.push(new f8(0,gf,gq))}else{var gg=gq,gj=gp.length;for(++gq;gq<gr&&gh[gq]!="L";++gq){}for(var go=gg;go<gq;){if(f6.test(gh[go])){if(gg<go){gp.splice(gj,0,new f8(1,gg,go))}var gn=go;for(++go;go<gq&&f6.test(gh[go]);++go){}gp.splice(gj,0,new f8(2,gn,go));gg=go}else{++go}}if(gg<gq){gp.splice(gj,0,new f8(1,gg,gq))}}}if(gp[0].level==1&&(gm=gl.match(/^\s+/))){gp[0].from=gm[0].length;gp.unshift(new f8(0,0,gm[0].length))}if(fv(gp).level==1&&(gm=gl.match(/\s+$/))){fv(gp).to-=gm[0].length;gp.push(new f8(0,gr-gm[0].length,gr))}if(gp[0].level!=fv(gp).level){gp.push(new f8(gp[0].level,gr,gr))}return gp}})();J.version="4.6.0";return J});
No other release has this exact content. See every version of this file.