var pe=(L,k)=>()=>(k||L((k={exports:{}}).exports,k),k.exports);var ve=pe((me,ue)=>{(function(){function L(t){var e=N;N[t]||(N[t]={}),e=N[t],(!e.define||!e.define.packaged)&&(S.original=e.define,e.define=S,e.define.packaged=!0),(!e.require||!e.require.packaged)&&(d.original=e.require,e.require=d,e.require.packaged=!0)}var k="ace",N=function(){return this}();!N&&typeof window<"u"&&(N=window);var S=function(t,e,i){if(typeof t!="string"){S.original&&S.original.apply(this,arguments);return}arguments.length==2&&(i=e),S.modules[t]||(S.payloads[t]=i,S.modules[t]=null)};S.modules={},S.payloads={};var x=function(t,e,i){if(typeof e=="string"){var n=a(t,e);if(n!=null)return i&&i(),n}else if(Object.prototype.toString.call(e)==="[object Array]"){for(var o=[],l=0,g=e.length;l=0?parseFloat((d.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((d.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),k.isOldIE=k.isIE&&k.isIE<9,k.isGecko=k.isMozilla=d.match(/ Gecko\/\d+/),k.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",k.isWebKit=parseFloat(d.split("WebKit/")[1])||void 0,k.isChrome=parseFloat(d.split(" Chrome/")[1])||void 0,k.isEdge=parseFloat(d.split(" Edge/")[1])||void 0,k.isAIR=d.indexOf("AdobeAIR")>=0,k.isAndroid=d.indexOf("Android")>=0,k.isChromeOS=d.indexOf(" CrOS ")>=0,k.isIOS=/iPad|iPhone|iPod/.test(d)&&!window.MSStream,k.isIOS&&(k.isMac=!0),k.isMobile=k.isIOS||k.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(L,k,N){var S=L("./useragent"),x="http://www.w3.org/1999/xhtml";if(k.buildDom=function c(a,t,e){if(typeof a=="string"&&a){var i=document.createTextNode(a);return t&&t.appendChild(i),i}if(!Array.isArray(a))return a&&a.appendChild&&t&&t.appendChild(a),a;if(typeof a[0]!="string"||!a[0]){for(var n=[],o=0;o"u"&&(k.importCssString=function(){}),k.computedStyle=function(c,a){return window.getComputedStyle(c,"")||{}},k.setStyle=function(c,a,t){c[a]!==t&&(c[a]=t)},k.HAS_CSS_ANIMATION=!1,k.HAS_CSS_TRANSFORMS=!1,k.HI_DPI=S.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,typeof document<"u"){var d=document.createElement("div");k.HI_DPI&&d.style.transform!==void 0&&(k.HAS_CSS_TRANSFORMS=!0),!S.isEdge&&typeof d.style.animationName<"u"&&(k.HAS_CSS_ANIMATION=!0),d=null}k.HAS_CSS_TRANSFORMS?k.translate=function(c,a,t){c.style.transform="translate("+Math.round(a)+"px, "+Math.round(t)+"px)"}:k.translate=function(c,a,t){c.style.top=Math.round(t)+"px",c.style.left=Math.round(a)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(L,k,N){k.inherits=function(S,x){S.super_=x,S.prototype=Object.create(x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}})},k.mixin=function(S,x){for(var d in x)S[d]=x[d];return S},k.implement=function(S,x){k.mixin(S,x)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(L,k,N){var S=L("./oop"),x=function(){var d={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},c,a;for(a in d.FUNCTION_KEYS)c=d.FUNCTION_KEYS[a].toLowerCase(),d[c]=parseInt(a,10);for(a in d.PRINTABLE_KEYS)c=d.PRINTABLE_KEYS[a].toLowerCase(),d[c]=parseInt(a,10);return S.mixin(d,d.MODIFIER_KEYS),S.mixin(d,d.PRINTABLE_KEYS),S.mixin(d,d.FUNCTION_KEYS),d.enter=d.return,d.escape=d.esc,d.del=d.delete,d[173]="-",function(){for(var t=["cmd","ctrl","alt","shift"],e=Math.pow(2,t.length);e--;)d.KEY_MODS[e]=t.filter(function(i){return e&d.KEY_MODS[i]}).join("-")+"-"}(),d.KEY_MODS[0]="",d.KEY_MODS[-1]="input-",d}();S.mixin(k,x),k.keyCodeToString=function(d){var c=x[d];return typeof c!="string"&&(c=String.fromCharCode(d)),c.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(L,k,N){function S(){o=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){o={passive:!1}}})}catch(y){}}function x(){return o==null&&S(),o}function d(y,p,r){this.elem=y,this.type=p,this.callback=r}function c(y,p,r){var h=v(p);if(!e.isMac&&i){if(p.getModifierState&&(p.getModifierState("OS")||p.getModifierState("Win"))&&(h|=8),i.altGr){if((3&h)==3)return;i.altGr=0}if(r===18||r===17){var w="location"in p?p.location:p.keyLocation;if(r===17&&w===1)i[r]==1&&(n=p.timeStamp);else if(r===18&&h===3&&w===2){var u=p.timeStamp-n;u<50&&(i.altGr=!0)}}}if(r in t.MODIFIER_KEYS&&(r=-1),!h&&r===13){var w="location"in p?p.location:p.keyLocation;if(w===3&&(y(p,h,-r),p.defaultPrevented))return}if(e.isChromeOS&&h&8){if(y(p,h,r),p.defaultPrevented)return;h&=-9}return h||r in t.FUNCTION_KEYS||r in t.PRINTABLE_KEYS?y(p,h,r):!1}function a(){i=Object.create(null)}var t=L("./keys"),e=L("./useragent"),i=null,n=0,o;d.prototype.destroy=function(){g(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var l=k.addListener=function(y,p,r,h){y.addEventListener(p,r,x()),h&&h.$toDestroy.push(new d(y,p,r))},g=k.removeListener=function(y,p,r){y.removeEventListener(p,r,x())};k.stopEvent=function(y){return k.stopPropagation(y),k.preventDefault(y),!1},k.stopPropagation=function(y){y.stopPropagation&&y.stopPropagation()},k.preventDefault=function(y){y.preventDefault&&y.preventDefault()},k.getButton=function(y){return y.type=="dblclick"?0:y.type=="contextmenu"||e.isMac&&y.ctrlKey&&!y.altKey&&!y.shiftKey?2:y.button},k.capture=function(y,p,r){function h(u){p&&p(u),r&&r(u),g(w,"mousemove",p),g(w,"mouseup",h),g(w,"dragstart",h)}var w=y&&y.ownerDocument||document;return l(w,"mousemove",p),l(w,"mouseup",h),l(w,"dragstart",h),h},k.addMouseWheelListener=function(y,p,r){"onmousewheel"in y?l(y,"mousewheel",function(h){var w=8;h.wheelDeltaX!==void 0?(h.wheelX=-h.wheelDeltaX/w,h.wheelY=-h.wheelDeltaY/w):(h.wheelX=0,h.wheelY=-h.wheelDelta/w),p(h)},r):"onwheel"in y?l(y,"wheel",function(h){var w=.35;switch(h.deltaMode){case h.DOM_DELTA_PIXEL:h.wheelX=h.deltaX*w||0,h.wheelY=h.deltaY*w||0;break;case h.DOM_DELTA_LINE:case h.DOM_DELTA_PAGE:h.wheelX=(h.deltaX||0)*5,h.wheelY=(h.deltaY||0)*5}p(h)},r):l(y,"DOMMouseScroll",function(h){h.axis&&h.axis==h.HORIZONTAL_AXIS?(h.wheelX=(h.detail||0)*5,h.wheelY=0):(h.wheelX=0,h.wheelY=(h.detail||0)*5),p(h)},r)},k.addMultiMouseDownListener=function(y,p,r,h,w){function u(A){if(k.getButton(A)!==0?f=0:A.detail>1?(f++,f>4&&(f=1)):f=1,e.isIE){var R=Math.abs(A.clientX-s)>5||Math.abs(A.clientY-m)>5;(!b||R)&&(f=1),b&&clearTimeout(b),b=setTimeout(function(){b=null},p[f-1]||600),f==1&&(s=A.clientX,m=A.clientY)}if(A._clicks=f,r[h]("mousedown",A),f>4)f=0;else if(f>1)return r[h](C[f],A)}var f=0,s,m,b,C={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(y)||(y=[y]),y.forEach(function(A){l(A,"mousedown",u,w)})};var v=function(y){return 0|(y.ctrlKey?1:0)|(y.altKey?2:0)|(y.shiftKey?4:0)|(y.metaKey?8:0)};if(k.getModifierString=function(y){return t.KEY_MODS[v(y)]},k.addCommandKeyListener=function(y,p,r){if(e.isOldGecko||e.isOpera&&!("KeyboardEvent"in window)){var h=null;l(y,"keydown",function(u){h=u.keyCode},r),l(y,"keypress",function(u){return c(p,u,h)},r)}else{var w=null;l(y,"keydown",function(u){i[u.keyCode]=(i[u.keyCode]||0)+1;var f=c(p,u,u.keyCode);return w=u.defaultPrevented,f},r),l(y,"keypress",function(u){w&&(u.ctrlKey||u.altKey||u.shiftKey||u.metaKey)&&(k.stopEvent(u),w=null)},r),l(y,"keyup",function(u){i[u.keyCode]=null},r),i||(a(),l(window,"focus",a))}},typeof window=="object"&&window.postMessage&&!e.isOldIE){var $=1;k.nextTick=function(y,p){p=p||window;var r="zero-timeout-message-"+$++,h=function(w){w.data==r&&(k.stopPropagation(w),g(p,"message",h),y())};l(p,"message",h),p.postMessage(r,"*")}}k.$idleBlocked=!1,k.onIdle=function(y,p){return setTimeout(function r(){k.$idleBlocked?setTimeout(r,100):y()},p)},k.$idleBlockId=null,k.blockIdle=function(y){k.$idleBlockId&&clearTimeout(k.$idleBlockId),k.$idleBlocked=!0,k.$idleBlockId=setTimeout(function(){k.$idleBlocked=!1},y||100)},k.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),k.nextFrame?k.nextFrame=k.nextFrame.bind(window):k.nextFrame=function(y){setTimeout(y,17)}}),ace.define("ace/range",["require","exports","module"],function(L,k,N){var S=function(d,c){return d.row-c.row||d.column-c.column},x=function(d,c,a,t){this.start={row:d,column:c},this.end={row:a,column:t}};(function(){this.isEqual=function(d){return this.start.row===d.start.row&&this.end.row===d.end.row&&this.start.column===d.start.column&&this.end.column===d.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(d,c){return this.compare(d,c)==0},this.compareRange=function(d){var c,a=d.end,t=d.start;return c=this.compare(a.row,a.column),c==1?(c=this.compare(t.row,t.column),c==1?2:c==0?1:0):c==-1?-2:(c=this.compare(t.row,t.column),c==-1?-1:c==1?42:0)},this.comparePoint=function(d){return this.compare(d.row,d.column)},this.containsRange=function(d){return this.comparePoint(d.start)==0&&this.comparePoint(d.end)==0},this.intersects=function(d){var c=this.compareRange(d);return c==-1||c==0||c==1},this.isEnd=function(d,c){return this.end.row==d&&this.end.column==c},this.isStart=function(d,c){return this.start.row==d&&this.start.column==c},this.setStart=function(d,c){typeof d=="object"?(this.start.column=d.column,this.start.row=d.row):(this.start.row=d,this.start.column=c)},this.setEnd=function(d,c){typeof d=="object"?(this.end.column=d.column,this.end.row=d.row):(this.end.row=d,this.end.column=c)},this.inside=function(d,c){return this.compare(d,c)==0?!(this.isEnd(d,c)||this.isStart(d,c)):!1},this.insideStart=function(d,c){return this.compare(d,c)==0?!this.isEnd(d,c):!1},this.insideEnd=function(d,c){return this.compare(d,c)==0?!this.isStart(d,c):!1},this.compare=function(d,c){return!this.isMultiLine()&&d===this.start.row?cthis.end.column?1:0:dthis.end.row?1:this.start.row===d?c>=this.start.column?0:-1:this.end.row===d?c<=this.end.column?0:1:0},this.compareStart=function(d,c){return this.start.row==d&&this.start.column==c?-1:this.compare(d,c)},this.compareEnd=function(d,c){return this.end.row==d&&this.end.column==c?1:this.compare(d,c)},this.compareInside=function(d,c){return this.end.row==d&&this.end.column==c?1:this.start.row==d&&this.start.column==c?-1:this.compare(d,c)},this.clipRows=function(d,c){if(this.end.row>c)var a={row:c+1,column:0};else if(this.end.rowc)var t={row:c+1,column:0};else if(this.start.row0;)c&1&&(a+=d),(c>>=1)&&(d+=d);return a};var S=/^\s\s*/,x=/\s\s*$/;k.stringTrimLeft=function(d){return d.replace(S,"")},k.stringTrimRight=function(d){return d.replace(x,"")},k.copyObject=function(d){var c={};for(var a in d)c[a]=d[a];return c},k.copyArray=function(d){for(var c=[],a=0,t=d.length;aDate.now()-50?!0:S=!1},cancel:function(){S=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(L,k,N){var S=L("../lib/event"),x=L("../lib/useragent"),d=L("../lib/dom"),c=L("../lib/lang"),a=L("../clipboard"),t=x.isChrome<18,e=x.isIE,i=x.isChrome>63,n=400,o=L("../lib/keys"),l=o.KEY_MODS,g=x.isIOS,v=g?/\s/:/\n/,$=x.isMobile,y=function(p,r){function h(){I=!0,s.blur(),s.focus(),I=!1}function w(H){H.keyCode==27&&s.value.lengthM&&T[J]=="\n"?Y=o.end:te<_&&T[te-1]==" "?(Y=o.left,ae=l.option):te<_||te==_&&M!=_&&te==J?Y=o.left:J>M&&T.slice(0,J).split("\n").length>2?Y=o.down:J>M&&T[J-1]==" "?(Y=o.right,ae=l.option):(J>M||J==M&&M!=_&&te==J)&&(Y=o.right),te!==J&&(ae|=l.shift),Y){var ce=U.onCommandKey({},ae,Y);if(!ce&&U.commands){Y=o.keyCodeToString(Y);var fe=U.commands.findKeyCommand(ae,Y);fe&&U.execCommand(fe)}_=te,M=J,F("")}}};document.addEventListener("selectionchange",ee),U.on("destroy",function(){document.removeEventListener("selectionchange",ee)})}var s=d.createElement("textarea");s.className="ace_text-input",s.setAttribute("wrap","off"),s.setAttribute("autocorrect","off"),s.setAttribute("autocapitalize","off"),s.setAttribute("spellcheck",!1),s.style.opacity="0",p.insertBefore(s,p.firstChild);var m=!1,b=!1,C=!1,A=!1,R="";$||(s.style.fontSize="1px");var E=!1,I=!1,T="",_=0,M=0,O=0;try{var D=document.activeElement===s}catch(H){}S.addListener(s,"blur",function(H){I||(r.onBlur(H),D=!1)},r),S.addListener(s,"focus",function(H){if(!I){if(D=!0,x.isEdge)try{if(!document.hasFocus())return}catch(U){}r.onFocus(H),x.isEdge?setTimeout(F):F()}},r),this.$focusScroll=!1,this.focus=function(){if(R||i||this.$focusScroll=="browser")return s.focus({preventScroll:!0});var H=s.style.top;s.style.position="fixed",s.style.top="0px";try{var U=s.getBoundingClientRect().top!=0}catch(Q){return}var G=[];if(U)for(var X=s.parentElement;X&&X.nodeType==1;)G.push(X),X.setAttribute("ace_nocontext",!0),!X.parentElement&&X.getRootNode?X=X.getRootNode().host:X=X.parentElement;s.focus({preventScroll:!0}),U&&G.forEach(function(Q){Q.removeAttribute("ace_nocontext")}),setTimeout(function(){s.style.position="",s.style.top=="0px"&&(s.style.top=H)},0)},this.blur=function(){s.blur()},this.isFocused=function(){return D},r.on("beforeEndOperation",function(){var H=r.curOp,U=H&&H.command&&H.command.name;if(U!="insertstring"){var G=U&&(H.docChanged||H.selectionChanged);C&&G&&(T=s.value="",he()),F()}});var F=g?function(H){if(!(!D||m&&!H||A)){H||(H="");var U="\n ab"+H+"cde fg\n";U!=s.value&&(s.value=T=U);var G=4,X=4+(H.length||(r.selection.isEmpty()?0:1));(_!=G||M!=X)&&s.setSelectionRange(G,X),_=G,M=X}}:function(){if(!(C||A)&&!(!D&&!z)){C=!0;var H=0,U=0,G="";if(r.session){var X=r.selection,Q=X.getRange(),ee=X.cursor.row;if(H=Q.start.column,U=Q.end.column,G=r.session.getLine(ee),Q.start.row!=ee){var ne=r.session.getLine(ee-1);H=Q.start.rowee+1?te.length:U,U+=G.length+1,G=G+"\n"+te}else $&&ee>0&&(G="\n"+G,U+=1,H+=1);G.length>n&&(H=T.length&&H.value===T&&T&&H.selectionEnd!==M},B=function(H){C||(m?m=!1:W(s)?(r.selectAll(),F()):$&&s.selectionStart!=_&&F())},P=null;this.setInputHandler=function(H){P=H},this.getInputHandler=function(){return P};var z=!1,V=function(H,U){if(z&&(z=!1),b)return F(),H&&r.onPaste(H),b=!1,"";for(var G=s.selectionStart,X=s.selectionEnd,Q=_,ee=T.length-M,ne=H,te=H.length-G,J=H.length-X,Y=0;Q>0&&T[Y]==H[Y];)Y++,Q--;for(ne=ne.slice(Y),Y=1;ee>0&&T.length-Y>_-1&&T[T.length-Y]==H[H.length-Y];)Y++,ee--;te-=Y-1,J-=Y-1;var ae=ne.length-Y+1;if(ae<0&&(Q=-ae,ae=0),ne=ne.slice(0,ae),!U&&!ne&&!te&&!Q&&!ee&&!J)return"";A=!0;var ce=!1;return x.isAndroid&&ne==". "&&(ne=" ",ce=!0),ne&&!Q&&!ee&&!te&&!J||E?r.onTextInput(ne):r.onTextInput(ne,{extendLeft:Q,extendRight:ee,restoreStart:te,restoreEnd:J}),A=!1,T=H,_=G,M=X,O=J,ce?"\n":ne},j=function(H){if(C)return re();if(H&&H.inputType){if(H.inputType=="historyUndo")return r.execCommand("undo");if(H.inputType=="historyRedo")return r.execCommand("redo")}var U=s.value,G=V(U,!0);(U.length>n+100||v.test(G)||$&&_<1&&_==M)&&F()},K=function(H,U,G){var X=H.clipboardData||window.clipboardData;if(!(!X||t)){var Q=e||G?"Text":"text/plain";try{return U?X.setData(Q,U)!==!1:X.getData(Q)}catch(ee){if(!G)return K(ee,U,!0)}}},q=function(H,U){var G=r.getCopyText();if(!G)return S.preventDefault(H);K(H,G)?(g&&(F(G),m=G,setTimeout(function(){m=!1},10)),U?r.onCut():r.onCopy(),S.preventDefault(H)):(m=!0,s.value=G,s.select(),setTimeout(function(){m=!1,F(),U?r.onCut():r.onCopy()}))},ie=function(H){q(H,!0)},oe=function(H){q(H,!1)},se=function(H){var U=K(H);a.pasteCancelled()||(typeof U=="string"?(U&&r.onPaste(U,H),x.isIE&&setTimeout(F),S.preventDefault(H)):(s.value="",b=!0))};S.addCommandKeyListener(s,r.onCommandKey.bind(r),r),S.addListener(s,"select",B,r),S.addListener(s,"input",j,r),S.addListener(s,"cut",ie,r),S.addListener(s,"copy",oe,r),S.addListener(s,"paste",se,r),(!("oncut"in s)||!("oncopy"in s)||!("onpaste"in s))&&S.addListener(p,"keydown",function(H){if(!(x.isMac&&!H.metaKey||!H.ctrlKey))switch(H.keyCode){case 67:oe(H);break;case 86:se(H);break;case 88:ie(H)}},r);var Z=function(H){if(!(C||!r.onCompositionStart||r.$readOnly)&&(C={},!E)){H.data&&(C.useTextareaForIME=!1),setTimeout(re,0),r._signal("compositionStart"),r.on("mousedown",h);var U=r.getSelectionRange();U.end.row=U.start.row,U.end.column=U.start.column,C.markerRange=U,C.selectionStart=_,r.onCompositionStart(C),C.useTextareaForIME?(T=s.value="",_=0,M=0):(s.msGetInputContext&&(C.context=s.msGetInputContext()),s.getInputContext&&(C.context=s.getInputContext()))}},re=function(){if(!(!C||!r.onCompositionUpdate||r.$readOnly)){if(E)return h();if(C.useTextareaForIME)r.onCompositionUpdate(s.value);else{var H=s.value;V(H),C.markerRange&&(C.context&&(C.markerRange.start.column=C.selectionStart=C.context.compositionStartOffset),C.markerRange.end.column=C.markerRange.start.column+M-C.selectionStart+O)}}},he=function(H){!r.onCompositionEnd||r.$readOnly||(C=!1,r.onCompositionEnd(),r.off("mousedown",h),H&&j())},le=c.delayedCall(re,50).schedule.bind(null,null);S.addListener(s,"compositionstart",Z,r),S.addListener(s,"compositionupdate",re,r),S.addListener(s,"keyup",w,r),S.addListener(s,"keydown",le,r),S.addListener(s,"compositionend",he,r),this.getElement=function(){return s},this.setCommandMode=function(H){E=H,s.readOnly=!1},this.setReadOnly=function(H){E||(s.readOnly=H)},this.setCopyWithEmptySelection=function(H){},this.onContextMenu=function(H){z=!0,F(),r._emit("nativecontextmenu",{target:r,domEvent:H}),this.moveToMouse(H,!0)},this.moveToMouse=function(H,U){R||(R=s.style.cssText),s.style.cssText=(U?"z-index:100000;":"")+(x.isIE?"opacity:0.1;":"")+"text-indent: -"+(_+M)*r.renderer.characterWidth*.5+"px;";var G=r.container.getBoundingClientRect(),X=d.computedStyle(r.container),Q=G.top+(parseInt(X.borderTopWidth)||0),ee=G.left+(parseInt(G.borderLeftWidth)||0),ne=G.bottom-Q-s.clientHeight-2,te=function(J){d.translate(s,J.clientX-ee-2,Math.min(J.clientY-Q-2,ne))};te(H),H.type=="mousedown"&&(r.renderer.$isMousePressed=!0,clearTimeout(de),x.isWin&&S.capture(r.container,te,u))},this.onContextMenuClose=u;var de,ge=function(H){r.textInput.onContextMenu(H),u()};S.addListener(s,"mouseup",ge,r),S.addListener(s,"mousedown",function(H){H.preventDefault(),u()},r),S.addListener(r.renderer.scroller,"contextmenu",ge,r),S.addListener(s,"contextmenu",ge,r),g&&f(p,r,s)};k.TextInput=y,k.$setUserAgentForTests=function(p,r){$=p,g=r}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(L,k,N){function S(e){e.$clickSelection=null;var i=e.editor;i.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),i.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),i.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),i.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),i.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));var n=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];n.forEach(function(o){e[o]=this[o]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function x(e,i,n,o){return Math.sqrt(Math.pow(n-e,2)+Math.pow(o-i,2))}function d(e,i){if(e.start.row==e.end.row)var n=2*i.column-e.start.column-e.end.column;else if(e.start.row==e.end.row-1&&!e.start.column&&!e.end.column)var n=i.column-4;else var n=2*i.row-e.start.row-e.end.row;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var c=L("../lib/useragent"),a=0,t=550;(function(){this.onMouseDown=function(e){var i=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var o=this.editor,l=e.getButton();if(l!==0){var g=o.getSelectionRange(),v=g.isEmpty();(v||l==1)&&o.selection.moveToPosition(n),l==2&&(o.textInput.onContextMenu(e.domEvent),c.isMozilla||e.preventDefault());return}if(this.mousedownEvent.time=Date.now(),i&&!o.isFocused()&&(o.focus(),this.$focusTimeout&&!this.$clickSelection&&!o.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(e);return}return this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()},this.startSelect=function(e,i){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):i||n.selection.moveToPosition(e),i||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,i=this.editor,n=i.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var o=this.$clickSelection.comparePoint(n);if(o==-1)e=this.$clickSelection.end;else if(o==1)e=this.$clickSelection.start;else{var l=d(this.$clickSelection,n);n=l.cursor,e=l.anchor}i.selection.setSelectionAnchor(e.row,e.column)}i.selection.selectToPosition(n),i.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var i,n=this.editor,o=n.renderer.screenToTextCoordinates(this.x,this.y),l=n.selection[e](o.row,o.column);if(this.$clickSelection){var g=this.$clickSelection.comparePoint(l.start),v=this.$clickSelection.comparePoint(l.end);if(g==-1&&v<=0)i=this.$clickSelection.end,(l.end.row!=o.row||l.end.column!=o.column)&&(o=l.start);else if(v==1&&g>=0)i=this.$clickSelection.start,(l.start.row!=o.row||l.start.column!=o.column)&&(o=l.end);else if(g==-1&&v==1)o=l.end,i=l.start;else{var $=d(this.$clickSelection,o);o=$.cursor,i=$.anchor}n.selection.setSelectionAnchor(i.row,i.column)}n.selection.selectToPosition(o),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=x(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),i=Date.now();(e>a||i-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var i=e.getDocumentPosition(),n=this.editor,o=n.session,l=o.getBracketRange(i);l?(l.isEmpty()&&(l.start.column--,l.end.column++),this.setState("select")):(l=n.selection.getWordRange(i.row,i.column),this.setState("selectByWords")),this.$clickSelection=l,this.select()},this.onTripleClick=function(e){var i=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var o=n.getSelectionRange();o.isMultiLine()&&o.contains(i.row,i.column)?(this.$clickSelection=n.selection.getLineRange(o.start.row),this.$clickSelection.end=n.selection.getLineRange(o.end.row).end):this.$clickSelection=n.selection.getLineRange(i.row),this.select()},this.onQuadClick=function(e){var i=this.editor;i.selectAll(),this.$clickSelection=i.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var i=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,o=e.domEvent.timeStamp,l=o-n.t,g=l?e.wheelX/l:n.vx,v=l?e.wheelY/l:n.vy;l=1&&i.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(y=!0),$<=1&&i.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(y=!0),y)n.allowed=o;else if(o-n.allowedl.session.documentToScreenRow(f.row,f.column))return n()}if(p!=h)if(p=h.text.join("
"),v.setHtml(p),v.show(),l._signal("showGutterTooltip",v),l.on("mousewheel",n),e.$tooltipFollowsMouse)o(y);else{var s=y.domEvent.target,m=s.getBoundingClientRect(),b=v.getElement().style;b.left=m.right+"px",b.top=m.bottom+"px"}}function n(){$&&($=clearTimeout($)),p&&(v.hide(),p=null,l._signal("hideGutterTooltip",v),l.off("mousewheel",n))}function o(r){v.setPosition(r.x,r.y)}var l=e.editor,g=l.renderer.$gutterLayer,v=new x(l.container);e.editor.setDefaultHandler("guttermousedown",function(r){if(!(!l.isFocused()||r.getButton()!=0)){var h=g.getRegion(r);if(h!="foldWidgets"){var w=r.getDocumentPosition().row,u=l.session.selection;if(r.getShiftKey())u.selectTo(w,0);else{if(r.domEvent.detail==2)return l.selectAll(),r.preventDefault();e.$clickSelection=l.selection.getLineRange(w)}return e.setState("selectByLines"),e.captureMouse(r),r.preventDefault()}}});var $,y,p;e.editor.setDefaultHandler("guttermousemove",function(r){var h=r.domEvent.target||r.domEvent.srcElement;if(d.hasCssClass(h,"ace_fold-widget"))return n();p&&e.$tooltipFollowsMouse&&o(r),y=r,!$&&($=setTimeout(function(){$=null,y&&!e.isMousePressed?i():n()},50))}),a.addListener(l.renderer.$gutter,"mouseout",function(r){y=null,!(!p||$)&&($=setTimeout(function(){$=null,n()},50))},l),l.on("changeSession",n)}function x(e){t.call(this,e)}var d=L("../lib/dom"),c=L("../lib/oop"),a=L("../lib/event"),t=L("../tooltip").Tooltip;c.inherits(x,t),(function(){this.setPosition=function(e,i){var n=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight,l=this.getWidth(),g=this.getHeight();e+=15,i+=15,e+l>n&&(e-=e+l-n),i+g>o&&(i-=20+g),t.prototype.setPosition.call(this,e,i)}}).call(x.prototype),k.GutterHandler=S}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(L,k,N){var S=L("../lib/event"),x=L("../lib/useragent"),d=k.MouseEvent=function(c,a){this.domEvent=c,this.editor=a,this.x=this.clientX=c.clientX,this.y=this.clientY=c.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){S.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){S.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var c=this.editor,a=c.getSelectionRange();if(a.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=a.contains(t.row,t.column)}return this.$inSelection},this.getButton=function(){return S.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=x.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(d.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(L,k,N){function S(n){function o(F,W){var B=Date.now(),P=!W||F.row!=W.row,z=!W||F.column!=W.column;if(!M||P||z)h.moveCursorToPosition(F),M=B,O={x:m,y:b};else{var V=x(O.x,O.y,m,b);V>i?M=null:B-M>=e&&(h.renderer.scrollCursorIntoView(),M=null)}}function l(F,W){var B=Date.now(),P=h.renderer.layerConfig.lineHeight,z=h.renderer.layerConfig.characterWidth,V=h.renderer.scroller.getBoundingClientRect(),j={x:{left:m-V.left,right:V.right-m},y:{top:b-V.top,bottom:V.bottom-b}},K=Math.min(j.x.left,j.x.right),q=Math.min(j.y.top,j.y.bottom),ie={row:F.row,column:F.column};K/z<=2&&(ie.column+=j.x.left=t&&h.renderer.scrollCursorIntoView(ie):_=B:_=null}function g(){var F=R;R=h.renderer.screenToTextCoordinates(m,b),o(R,F),l(R,F)}function v(){A=h.selection.toOrientedRange(),s=h.session.addMarker(A,"ace_selection",h.getSelectionStyle()),h.clearSelection(),h.isFocused()&&h.renderer.$cursorLayer.setBlinking(!1),clearInterval(C),g(),C=setInterval(g,20),E=0,c.addListener(document,"mousemove",y)}function $(){clearInterval(C),h.session.removeMarker(s),s=null,h.selection.fromOrientedRange(A),h.isFocused()&&!T&&h.$resetCursorStyle(),A=null,R=null,E=0,_=null,M=null,c.removeListener(document,"mousemove",y)}function y(){D==null&&(D=setTimeout(function(){D!=null&&s&&$()},20))}function p(F){var W=F.types;return!W||Array.prototype.some.call(W,function(B){return B=="text/plain"||B=="Text"})}function r(F){var W=["copy","copymove","all","uninitialized"],B=["move","copymove","linkmove","all","uninitialized"],P=a.isMac?F.altKey:F.ctrlKey,z="uninitialized";try{z=F.dataTransfer.effectAllowed.toLowerCase()}catch(j){}var V="none";return P&&W.indexOf(z)>=0?V="copy":B.indexOf(z)>=0?V="move":W.indexOf(z)>=0&&(V="copy"),V}var h=n.editor,w=d.createElement("img");w.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",a.isOpera&&(w.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");var u=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];u.forEach(function(F){n[F]=this[F]},this),h.on("mousedown",this.onMouseDown.bind(n));var f=h.container,s,m,b,C,A,R,E=0,I,T,_,M,O;this.onDragStart=function(F){if(this.cancelDrag||!f.draggable){var W=this;return setTimeout(function(){W.startSelect(),W.captureMouse(F)},0),F.preventDefault()}A=h.getSelectionRange();var B=F.dataTransfer;B.effectAllowed=h.getReadOnly()?"copy":"copyMove",a.isOpera&&(h.container.appendChild(w),w.scrollTop=0),B.setDragImage&&B.setDragImage(w,0,0),a.isOpera&&h.container.removeChild(w),B.clearData(),B.setData("Text",h.session.getTextRange()),T=!0,this.setState("drag")},this.onDragEnd=function(F){if(f.draggable=!1,T=!1,this.setState(null),!h.getReadOnly()){var W=F.dataTransfer.dropEffect;!I&&W=="move"&&h.session.remove(h.getSelectionRange()),h.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(F){if(!(h.getReadOnly()||!p(F.dataTransfer)))return m=F.clientX,b=F.clientY,s||v(),E++,F.dataTransfer.dropEffect=I=r(F),c.preventDefault(F)},this.onDragOver=function(F){if(!(h.getReadOnly()||!p(F.dataTransfer)))return m=F.clientX,b=F.clientY,s||(v(),E++),D!==null&&(D=null),F.dataTransfer.dropEffect=I=r(F),c.preventDefault(F)},this.onDragLeave=function(F){if(E--,E<=0&&s)return $(),I=null,c.preventDefault(F)},this.onDrop=function(F){if(R){var W=F.dataTransfer;if(T)switch(I){case"move":A.contains(R.row,R.column)?A={start:R,end:R}:A=h.moveText(A,R);break;case"copy":A=h.moveText(A,R,!0)}else{var B=W.getData("Text");A={start:R,end:h.session.insert(R,B)},h.focus(),I=null}return $(),c.preventDefault(F)}},c.addListener(f,"dragstart",this.onDragStart.bind(n),h),c.addListener(f,"dragend",this.onDragEnd.bind(n),h),c.addListener(f,"dragenter",this.onDragEnter.bind(n),h),c.addListener(f,"dragover",this.onDragOver.bind(n),h),c.addListener(f,"dragleave",this.onDragLeave.bind(n),h),c.addListener(f,"drop",this.onDrop.bind(n),h);var D=null}function x(n,o,l,g){return Math.sqrt(Math.pow(l-n,2)+Math.pow(g-o,2))}var d=L("../lib/dom"),c=L("../lib/event"),a=L("../lib/useragent"),t=200,e=200,i=5;(function(){this.dragWait=function(){var n=Date.now()-this.mousedownEvent.time;n>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var n=this.editor.container;n.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(n){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var n=this.editor,o=n.container;o.draggable=!0,n.renderer.$cursorLayer.setBlinking(!1),n.setStyle("ace_dragging");var l=a.isWin?"default":"move";n.renderer.setCursorStyle(l),this.setState("dragReady")},this.onMouseDrag=function(n){var o=this.editor.container;if(a.isIE&&this.state=="dragReady"){var l=x(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);l>3&&o.dragDrop()}if(this.state==="dragWait"){var l=x(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);l>0&&(o.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(n){if(this.$dragEnabled){this.mousedownEvent=n;var o=this.editor,l=n.inSelection(),g=n.getButton(),v=n.domEvent.detail||1;if(v===1&&g===0&&l){if(n.editor.inMultiSelectMode&&(n.getAccelKey()||n.getShiftKey()))return;this.mousedownEvent.time=Date.now();var $=n.domEvent.target||n.domEvent.srcElement;if("unselectable"in $&&($.unselectable="on"),o.getDragDelay()){if(a.isWebKit){this.cancelDrag=!0;var y=o.container;y.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(n,this.onMouseDrag.bind(this)),n.defaultPrevented=!0}}}}).call(S.prototype),k.DragdropHandler=S}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(L,k,N){var S=L("./mouse_event").MouseEvent,x=L("../lib/event"),d=L("../lib/dom");k.addTouchListeners=function(c,a){function t(){var A=window.navigator&&window.navigator.clipboard,R=!1,E=function(){var T=a.getCopyText(),_=a.session.getUndoManager().hasUndo();C.replaceChild(d.buildDom(R?["span",!T&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],T&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],T&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],A&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],_&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),C.firstChild)},I=function(T){var _=T.target.getAttribute("action");if(_=="more"||!R)return R=!R,E();_=="paste"?A.readText().then(function(M){a.execCommand(_,M)}):_&&((_=="cut"||_=="copy")&&(A?A.writeText(a.getCopyText()):document.execCommand("copy")),a.execCommand(_)),C.firstChild.style.display="none",R=!1,_!="openCommandPallete"&&a.focus()};C=d.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(T){g="menu",T.stopPropagation(),T.preventDefault(),a.textInput.focus()},ontouchend:function(T){T.stopPropagation(),T.preventDefault(),I(T)},onclick:I},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],a.container)}function e(){C||t();var A=a.selection.cursor,R=a.renderer.textToScreenCoordinates(A.row,A.column),E=a.renderer.textToScreenCoordinates(0,0).pageX,I=a.renderer.scrollLeft,T=a.container.getBoundingClientRect();C.style.top=R.pageY-T.top-3+"px",R.pageX-T.left=2?a.selection.getLineRange(u.row):a.session.getBracketRange(u);A&&!A.isEmpty()?a.selection.setRange(A):a.selection.selectWord(),g="wait"}function l(){w+=60,h=setInterval(function(){w--<=0&&(clearInterval(h),h=null),Math.abs(s)<.01&&(s=0),Math.abs(m)<.01&&(m=0),w<20&&(s=.9*s),w<20&&(m=.9*m);var A=a.session.getScrollTop();a.renderer.scrollBy(10*s,10*m),A==a.session.getScrollTop()&&(w=0)},10)}var g="scroll",v,$,y,p,r,h,w=0,u,f=0,s=0,m=0,b,C;x.addListener(c,"contextmenu",function(A){if(b){var R=a.textInput.getElement();R.focus()}},a),x.addListener(c,"touchstart",function(A){var R=A.touches;if(r||R.length>1){clearTimeout(r),r=null,y=-1,g="zoom";return}b=a.$mouseHandler.isMousePressed=!0;var E=a.renderer.layerConfig.lineHeight,I=a.renderer.layerConfig.lineHeight,T=A.timeStamp;p=T;var _=R[0],M=_.clientX,O=_.clientY;Math.abs(v-M)+Math.abs($-O)>E&&(y=-1),v=A.clientX=M,$=A.clientY=O,s=m=0;var D=new S(A,a);if(u=D.getDocumentPosition(),T-y<500&&R.length==1&&!w)f++,A.preventDefault(),A.button=0,o();else{f=0;var F=a.selection.cursor,W=a.selection.isEmpty()?F:a.selection.anchor,B=a.renderer.$cursorLayer.getPixelPosition(F,!0),P=a.renderer.$cursorLayer.getPixelPosition(W,!0),z=a.renderer.scroller.getBoundingClientRect(),V=a.renderer.layerConfig.offset,j=a.renderer.scrollLeft,K=function(oe,se){return oe/=I,se=se/E-.75,oe*oe+se*se};if(A.clientXie?"cursor":"anchor"),ie<3.5?g="anchor":q<3.5?g="cursor":g="scroll",r=setTimeout(n,450)}y=T},a),x.addListener(c,"touchend",function(A){b=a.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),g=="zoom"?(g="",w=0):r?(a.selection.moveToPosition(u),w=0,e()):g=="scroll"?(l(),i()):e(),clearTimeout(r),r=null},a),x.addListener(c,"touchmove",function(A){r&&(clearTimeout(r),r=null);var R=A.touches;if(!(R.length>1||g=="zoom")){var E=R[0],I=v-E.clientX,T=$-E.clientY;if(g=="wait"){if(!(I*I+T*T>4))return A.preventDefault();g="cursor"}v=E.clientX,$=E.clientY,A.clientX=E.clientX,A.clientY=E.clientY;var _=A.timeStamp,M=_-p;if(p=_,g=="scroll"){var O=new S(A,a);O.speed=1,O.wheelX=I,O.wheelY=T,10*Math.abs(I)1&&(v=l[l.length-2]);var y=e[o+"Path"];return y==null?y=e.basePath:g=="/"&&(o=g=""),y&&y.slice(-1)!="/"&&(y+="/"),y+o+g+v+this.get("suffix")},k.setModuleUrl=function(n,o){return e.$moduleUrls[n]=o},k.$loading={},k.loadModule=function(n,o){var l,g;Array.isArray(n)&&(g=n[0],n=n[1]);try{l=L(n)}catch($){}if(l&&!k.$loading[n])return o&&o(l);if(k.$loading[n]||(k.$loading[n]=[]),k.$loading[n].push(o),!(k.$loading[n].length>1)){var v=function(){L([n],function($){k._emit("load.module",{name:n,module:$});var y=k.$loading[n];k.$loading[n]=null,y.forEach(function(p){p&&p($)})})};if(!k.get("packaged"))return v();c.loadScript(k.moduleUrl(n,g),v),i()}};var i=function(){!e.basePath&&!e.workerPath&&!e.modePath&&!e.themePath&&!Object.keys(e.$moduleUrls).length&&(i=function(){})};k.init=S,k.version="1.4.12"}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(L,k,N){var S=L("../lib/event"),x=L("../lib/useragent"),d=L("./default_handlers").DefaultHandlers,c=L("./default_gutter_handler").GutterHandler,a=L("./mouse_event").MouseEvent,t=L("./dragdrop_handler").DragdropHandler,e=L("./touch_handler").addTouchListeners,i=L("../config"),n=function(o){var l=this;this.editor=o,new d(this),new c(this),new t(this);var g=function(y){var p=!document.hasFocus||!document.hasFocus()||!o.isFocused()&&document.activeElement==(o.textInput&&o.textInput.getElement());p&&window.focus(),o.focus()},v=o.renderer.getMouseEventTarget();S.addListener(v,"click",this.onMouseEvent.bind(this,"click"),o),S.addListener(v,"mousemove",this.onMouseMove.bind(this,"mousemove"),o),S.addMultiMouseDownListener([v,o.renderer.scrollBarV&&o.renderer.scrollBarV.inner,o.renderer.scrollBarH&&o.renderer.scrollBarH.inner,o.textInput&&o.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",o),S.addMouseWheelListener(o.container,this.onMouseWheel.bind(this,"mousewheel"),o),e(o.container,o);var $=o.renderer.$gutter;S.addListener($,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),o),S.addListener($,"click",this.onMouseEvent.bind(this,"gutterclick"),o),S.addListener($,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),o),S.addListener($,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),o),S.addListener(v,"mousedown",g,o),S.addListener($,"mousedown",g,o),x.isIE&&o.renderer.scrollBarV&&(S.addListener(o.renderer.scrollBarV.element,"mousedown",g,o),S.addListener(o.renderer.scrollBarH.element,"mousedown",g,o)),o.on("mousemove",function(y){if(!(l.state||l.$dragDelay||!l.$dragEnabled)){var p=o.renderer.screenToTextCoordinates(y.x,y.y),r=o.session.selection.getRange(),h=o.renderer;!r.isEmpty()&&r.insideStart(p.row,p.column)?h.setCursorStyle("default"):h.setCursorStyle("")}},o)};(function(){this.onMouseEvent=function(o,l){this.editor._emit(o,new a(l,this.editor))},this.onMouseMove=function(o,l){var g=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!g||!g.length||this.editor._emit(o,new a(l,this.editor))},this.onMouseWheel=function(o,l){var g=new a(l,this.editor);g.speed=this.$scrollSpeed*2,g.wheelX=l.wheelX,g.wheelY=l.wheelY,this.editor._emit(o,g)},this.setState=function(o){this.state=o},this.captureMouse=function(o,l){this.x=o.x,this.y=o.y,this.isMousePressed=!0;var g=this.editor,v=this.editor.renderer;v.$isMousePressed=!0;var $=this,y=function(u){if(u){if(x.isWebKit&&!u.which&&$.releaseMouse)return $.releaseMouse();$.x=u.clientX,$.y=u.clientY,l&&l(u),$.mouseEvent=new a(u,$.editor),$.$mouseMoved=!0}},p=function(u){g.off("beforeEndOperation",h),clearInterval(w),r(),$[$.state+"End"]&&$[$.state+"End"](u),$.state="",$.isMousePressed=v.$isMousePressed=!1,v.$keepTextAreaAtCursor&&v.$moveTextAreaToCursor(),$.$onCaptureMouseMove=$.releaseMouse=null,u&&$.onMouseEvent("mouseup",u),g.endOperation()},r=function(){$[$.state]&&$[$.state](),$.$mouseMoved=!1};if(x.isOldIE&&o.domEvent.type=="dblclick")return setTimeout(function(){p(o)});var h=function(u){$.releaseMouse&&g.curOp.command.name&&g.curOp.selectionChanged&&($[$.state+"End"]&&$[$.state+"End"](),$.state="",$.releaseMouse())};g.on("beforeEndOperation",h),g.startOperation({command:{name:"mouse"}}),$.$onCaptureMouseMove=y,$.releaseMouse=S.capture(this.editor.container,y,p);var w=setInterval(r,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var o=(function(l){l&&l.domEvent&&l.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",o),l&&l.domEvent&&S.stopEvent(l.domEvent))}).bind(this);setTimeout(o,10),this.editor.on("nativecontextmenu",o)},this.destroy=function(){this.releaseMouse&&this.releaseMouse()}}).call(n.prototype),i.defineOptions(n.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:x.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),k.MouseHandler=n}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(L,k,N){function S(d){d.on("click",function(c){var a=c.getDocumentPosition(),t=d.session,e=t.getFoldAt(a.row,a.column,1);e&&(c.getAccelKey()?t.removeFold(e):t.expandFold(e),c.stop());var i=c.domEvent&&c.domEvent.target;i&&x.hasCssClass(i,"ace_inline_button")&&x.hasCssClass(i,"ace_toggle_wrap")&&(t.setOption("wrap",!t.getUseWrapMode()),d.renderer.scrollCursorIntoView())}),d.on("gutterclick",function(c){var a=d.renderer.$gutterLayer.getRegion(c);if(a=="foldWidgets"){var t=c.getDocumentPosition().row,e=d.session;e.foldWidgets&&e.foldWidgets[t]&&d.session.onFoldWidgetClick(t,c),d.isFocused()||d.focus(),c.stop()}}),d.on("gutterdblclick",function(c){var a=d.renderer.$gutterLayer.getRegion(c);if(a=="foldWidgets"){var t=c.getDocumentPosition().row,e=d.session,i=e.getParentFoldRangeData(t,!0),n=i.range||i.firstRange;if(n){t=n.start.row;var o=e.getFoldAt(t,e.getLine(t).length,1);o?e.removeFold(o):(e.addFold("...",n),d.renderer.scrollCursorIntoView({row:n.start.row,column:0}))}c.stop()}})}var x=L("../lib/dom");k.FoldHandler=S}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(L,k,N){var S=L("../lib/keys"),x=L("../lib/event"),d=function(c){this.$editor=c,this.$data={editor:c},this.$handlers=[],this.setDefaultHandler(c.commands)};(function(){this.setDefaultHandler=function(c){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=c,this.addKeyboardHandler(c,0)},this.setKeyboardHandler=function(c){var a=this.$handlers;if(a[a.length-1]!=c){for(;a[a.length-1]&&a[a.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(a[a.length-1]);this.addKeyboardHandler(c,1)}},this.addKeyboardHandler=function(c,a){if(c){typeof c=="function"&&!c.handleKeyboard&&(c.handleKeyboard=c);var t=this.$handlers.indexOf(c);t!=-1&&this.$handlers.splice(t,1),a==null?this.$handlers.push(c):this.$handlers.splice(a,0,c),t==-1&&c.attach&&c.attach(this.$editor)}},this.removeKeyboardHandler=function(c){var a=this.$handlers.indexOf(c);return a==-1?!1:(this.$handlers.splice(a,1),c.detach&&c.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var c=this.$data,a=c.editor;return this.$handlers.map(function(t){return t.getStatusText&&t.getStatusText(a,c)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(c,a,t,e){for(var i,n=!1,o=this.$editor.commands,l=this.$handlers.length;l--&&(i=this.$handlers[l].handleKeyboard(this.$data,c,a,t,e),!(!(!i||!i.command)&&(i.command=="null"?n=!0:n=o.exec(i.command,this.$editor,i.args,e),n&&e&&c!=-1&&i.passEvent!=1&&i.command.passEvent!=1&&x.stopEvent(e),n))););return!n&&c==-1&&(i={command:"insertstring"},n=o.exec("insertstring",this.$editor,a)),n&&this.$editor._signal&&this.$editor._signal("keyboardActivity",i),n},this.onCommandKey=function(c,a,t){var e=S.keyCodeToString(t);return this.$callKeyboardHandlers(a,e,t,c)},this.onTextInput=function(c){return this.$callKeyboardHandlers(-1,c)}}).call(d.prototype),k.KeyBinding=d}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(L,k,N){function S(F,W,B,P){var z=a?l:o,V=null,j=null,K=null,q=0,ie=null,oe=null,se=-1,Z=null,re=null,he=[];if(!P)for(Z=0,P=[];Z0)if(ie==16){for(Z=se;Z-1){for(Z=se;Z=0&&P[le]==s;le--)W[le]=a}}}function x(F,W,B){if(!(t=F){for(V=z+1;V=F;)V++;for(j=z,K=V-1;j=W.length||(V=B[P-1])!=p&&V!=r||(j=W[P+1])!=p&&j!=r?h:(e&&(j=r),j==V?j:h);case b:return V=P>0?B[P-1]:w,V==p&&P+10&&B[P-1]==p)return p;if(e)return h;for(q=P+1,K=W.length;q=1425&&ie<=2303||ie==64286;if(V=W[q],oe&&(V==y||V==f))return y}return P<1||(V=W[P-1])==w?h:B[P-1];case w:return e=!1,i=!0,a;case u:return n=!0,h;case R:case E:case T:case _:case I:e=!1;case M:return h}}function c(F){var W=F.charCodeAt(0),B=W>>8;return B==0?W>191?$:O[W]:B==5?/[\u0591-\u05f4]/.test(F)?y:$:B==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(F)?A:/[\u0660-\u0669\u066b-\u066c]/.test(F)?r:W==1642?C:/[\u06f0-\u06f9]/.test(F)?p:f:B==32&&W<=8287?D[W&255]:B==254&&W>=65136?f:h}var a=0,t=0,e=!1,i=!1,n=!1,o=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],l=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],g=0,v=1,$=0,y=1,p=2,r=3,h=4,w=5,u=6,f=7,s=8,m=9,b=10,C=11,A=12,R=13,E=14,I=15,T=16,_=17,M=18,O=[M,M,M,M,M,M,M,M,M,u,w,u,s,w,M,M,M,M,M,M,M,M,M,M,M,M,M,M,w,w,w,u,s,h,h,C,C,C,h,h,h,h,h,b,m,b,m,m,p,p,p,p,p,p,p,p,p,p,m,h,h,h,h,h,h,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,h,h,h,h,h,h,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,$,h,h,h,h,M,M,M,M,M,M,w,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,m,h,C,C,C,C,h,h,h,h,$,h,h,M,h,h,C,C,p,p,h,$,h,h,h,p,$,h,h,h,h,h],D=[s,s,s,s,s,s,s,s,s,s,s,M,M,M,$,y,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,s,w,R,E,I,T,_,m,C,C,C,C,C,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,m,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,s];k.L=$,k.R=y,k.EN=p,k.ON_R=3,k.AN=4,k.R_H=5,k.B=6,k.RLE=7,k.DOT="·",k.doBidiReorder=function(F,W,B){if(F.length<2)return{};var P=F.split(""),z=new Array(P.length),V=new Array(P.length),j=[];a=B?v:g,S(P,j,P.length,W);for(var K=0;Kf&&W[K]0&&P[K-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(P[K])&&(j[K-1]=j[K]=k.R_H,K++);P[P.length-1]===k.DOT&&(j[P.length-1]=k.B),P[0]==="‫"&&(j[0]=k.RLE);for(var K=0;K=0&&(a=this.session.$docRowCache[e])}return a},this.getSplitIndex=function(){var a=0,t=this.session.$screenRowCache;if(t.length)for(var e,i=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-a>0&&(e=this.session.$getRowCacheIndex(t,this.currentRow-a-1),e===i);)i=e,a++;else a=this.currentRow;return a},this.updateRowLine=function(a,t){a===void 0&&(a=this.getDocumentRow());var e=a===this.session.getLength()-1,i=e?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(a),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var n=this.session.$wrapData[a];n&&(t===void 0&&(t=this.getSplitIndex()),t>0&&n.length?(this.wrapIndent=n.indent,this.wrapOffset=this.wrapIndent*this.charWidths[S.L],this.line=tt?this.session.getOverwrite()?a:a-1:t,i=S.getVisualFromLogicalIdx(e,this.bidiMap),n=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&a<=t&&n[i]%2!==0&&i++;for(var l=0;lt&&n[i]%2===0&&(o+=this.charWidths[n[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},this.getSelections=function(a,t){var e=this.bidiMap,i=e.bidiLevels,n,o=[],l=0,g=Math.min(a,t)-this.wrapIndent,v=Math.max(a,t)-this.wrapIndent,$=!1,y=!1,p=0;this.wrapIndent&&(l+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var r,h=0;h=g&&ri+l/2;){if(i+=l,n===o.length-1){l=0;break}l=this.charWidths[o[++n]]}return n>0&&o[n-1]%2!==0&&o[n]%2===0?(e0&&o[n-1]%2===0&&o[n]%2!==0?t=1+(e>i?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1]):this.isRtlDir&&n===o.length-1&&l===0&&o[n-1]%2===0||!this.isRtlDir&&n===0&&o[n]%2!==0?t=1+this.bidiMap.logicalFromVisual[n]:(n>0&&o[n-1]%2!==0&&l!==0&&n--,t=this.bidiMap.logicalFromVisual[n]),t===0&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(c.prototype),k.BidiHandler=c}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(L,k,N){var S=L("./lib/oop"),x=L("./lib/lang"),d=L("./lib/event_emitter").EventEmitter,c=L("./range").Range,a=function(t){this.session=t,this.doc=t.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var e=this;this.cursor.on("change",function(i){e.$cursorChanged=!0,e.$silent||e._emit("changeCursor"),!e.$isEmpty&&!e.$silent&&e._emit("changeSelection"),!e.$keepDesiredColumnOnChange&&i.old.column!=i.value.column&&(e.$desiredColumn=null)}),this.anchor.on("change",function(){e.$anchorChanged=!0,!e.$isEmpty&&!e.$silent&&e._emit("changeSelection")})};(function(){S.implement(this,d),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(t,e){this.$isEmpty=!1,this.anchor.setPosition(t,e)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var t=this.anchor,e=this.lead;return t.row>e.row||t.row==e.row&&t.column>e.column},this.getRange=function(){var t=this.anchor,e=this.lead;return this.$isEmpty?c.fromPoints(e,e):this.isBackwards()?c.fromPoints(e,t):c.fromPoints(t,e)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(t,e){var i=e?t.end:t.start,n=e?t.start:t.end;this.$setSelection(i.row,i.column,n.row,n.column)},this.$setSelection=function(t,e,i,n){if(!this.$silent){var o=this.$isEmpty,l=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(t,e),this.cursor.setPosition(i,n),this.$isEmpty=!c.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||o!=this.$isEmpty||l)&&this._emit("changeSelection")}},this.$moveSelection=function(t){var e=this.lead;this.$isEmpty&&this.setSelectionAnchor(e.row,e.column),t.call(this)},this.selectTo=function(t,e){this.$moveSelection(function(){this.moveCursorTo(t,e)})},this.selectToPosition=function(t){this.$moveSelection(function(){this.moveCursorToPosition(t)})},this.moveTo=function(t,e){this.clearSelection(),this.moveCursorTo(t,e)},this.moveToPosition=function(t){this.clearSelection(),this.moveCursorToPosition(t)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(t,e){if(typeof e>"u"){var i=t||this.lead;t=i.row,e=i.column}return this.session.getWordRange(t,e)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var t=this.getCursor(),e=this.session.getAWordRange(t.row,t.column);this.setSelectionRange(e)},this.getLineRange=function(t,e){var i=typeof t=="number"?t:this.lead.row,n,o=this.session.getFoldLine(i);return o?(i=o.start.row,n=o.end.row):n=i,e===!0?new c(i,0,n,this.session.getLine(n).length):new c(i,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(t,e,i){var n=t.column,o=t.column+e;return i<0&&(n=t.column-e,o=t.column),this.session.isTabStop(t)&&this.doc.getLine(t.row).slice(n,o).split(" ").length-1==e},this.moveCursorLeft=function(){var t=this.lead.getPosition(),e;if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(t.column===0)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var i=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,i,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var t=this.lead.getPosition(),e;if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(e.column=n)}}this.moveCursorTo(e.row,e.column)},this.moveCursorFileEnd=function(){var t=this.doc.getLength()-1,e=this.doc.getLine(t).length;this.moveCursorTo(t,e)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var t=this.lead.row,e=this.lead.column,i=this.doc.getLine(t),n=i.substring(e);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var o=this.session.getFoldAt(t,e,1);if(o){this.moveCursorTo(o.end.row,o.end.column);return}if(this.session.nonTokenRe.exec(n)&&(e+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,n=i.substring(e)),e>=i.length){this.moveCursorTo(t,i.length),this.moveCursorRight(),t0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(o)&&(e-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,e)},this.$shortWordEndIndex=function(t){var e=0,i,n=/\s/,o=this.session.tokenRe;if(o.lastIndex=0,this.session.tokenRe.exec(t))e=this.session.tokenRe.lastIndex;else{for(;(i=t[e])&&n.test(i);)e++;if(e<1){for(o.lastIndex=0;(i=t[e])&&!o.test(i);)if(o.lastIndex=0,e++,n.test(i)){if(e>2){e--;break}for(;(i=t[e])&&n.test(i);)e++;if(e>2)break}}}return o.lastIndex=0,e},this.moveCursorShortWordRight=function(){var t=this.lead.row,e=this.lead.column,i=this.doc.getLine(t),n=i.substring(e),o=this.session.getFoldAt(t,e,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(e==i.length){var l=this.doc.getLength();do t++,n=this.doc.getLine(t);while(t0&&/^\s*$/.test(n));e=n.length,/\s+$/.test(n)||(n="")}var o=x.stringReverse(n),l=this.$shortWordEndIndex(o);return this.moveCursorTo(t,e-l)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(t,e){var i=this.session.documentToScreenPosition(this.lead.row,this.lead.column),n;if(e===0&&(t!==0&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),t!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var o=this.session.lineWidgets[this.lead.row];t<0?t-=o.rowsAbove||0:t>0&&(t+=o.rowCount-(o.rowsAbove||0))}var l=this.session.screenToDocumentPosition(i.row+t,i.column,n);t!==0&&e===0&&l.row===this.lead.row&&(l.column,this.lead.column),this.moveCursorTo(l.row,l.column+e,e===0)},this.moveCursorToPosition=function(t){this.moveCursorTo(t.row,t.column)},this.moveCursorTo=function(t,e,i){var n=this.session.getFoldAt(t,e,1);n&&(t=n.start.row,e=n.start.column),this.$keepDesiredColumnOnChange=!0;var o=this.session.getLine(t);/[\uDC00-\uDFFF]/.test(o.charAt(e))&&o.charAt(e-1)&&(this.lead.row==t&&this.lead.column==e+1?e-=1:e+=1),this.lead.setPosition(t,e),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},this.moveCursorToScreen=function(t,e,i){var n=this.session.screenToDocumentPosition(t,e);this.moveCursorTo(n.row,n.column,i)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(t){this.setSelectionRange(t,t.cursor==t.start),this.$desiredColumn=t.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(t){var e=this.getRange();return t?(t.start.column=e.start.column,t.start.row=e.start.row,t.end.column=e.end.column,t.end.row=e.end.row):t=e,t.cursor=this.isBackwards()?t.start:t.end,t.desiredColumn=this.$desiredColumn,t},this.getRangeOfMovements=function(t){var e=this.getCursor();try{t(this);var i=this.getCursor();return c.fromPoints(e,i)}catch(n){return c.fromPoints(e,e)}finally{this.moveCursorToPosition(e)}},this.toJSON=function(){if(this.rangeCount)var t=this.ranges.map(function(e){var i=e.clone();return i.isBackwards=e.cursor==e.start,i});else{var t=this.getRange();t.isBackwards=this.isBackwards()}return t},this.fromJSON=function(t){if(t.start==null){if(this.rangeList&&t.length>1){this.toSingleRange(t[0]);for(var e=t.length;e--;){var i=c.fromPoints(t[e].start,t[e].end);t[e].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}t=t[0]}this.rangeList&&this.toSingleRange(t),this.setSelectionRange(t,t.isBackwards)},this.isEqual=function(t){if((t.length||this.rangeCount)&&t.length!=this.rangeCount)return!1;if(!t.length||!this.ranges)return this.getRange().isEqual(t);for(var e=this.ranges.length;e--;)if(!this.ranges[e].isEqual(t[e]))return!1;return!0}}).call(a.prototype),k.Selection=a}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(L,k,N){var S=L("./config"),x=2e3,d=function(c){this.states=c,this.regExps={},this.matchMappings={};for(var a in this.states){for(var t=this.states[a],e=[],i=0,n=this.matchMappings[a]={defaultToken:"text"},o="g",l=[],g=0;g1?v.onMatch=this.$applyToken:v.onMatch=v.token),y>1&&(/\\\d/.test(v.regex)?$=v.regex.replace(/\\([0-9]+)/g,function(p,r){return"\\"+(parseInt(r,10)+i+1)}):(y=1,$=this.removeCapturingGroups(v.regex)),!v.splitRegex&&typeof v.token!="string"&&l.push(v)),n[i]=g,i+=y,e.push($),v.onMatch||(v.onMatch=null)}}e.length||(n[0]=0,e.push("$")),l.forEach(function(p){p.splitRegex=this.createSplitterRegexp(p.regex,o)},this),this.regExps[a]=new RegExp("("+e.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(c){x=c|0},this.$applyToken=function(c){var a=this.splitRegex.exec(c).slice(1),t=this.token.apply(this,a);if(typeof t=="string")return[{type:t,value:c}];for(var e=[],i=0,n=t.length;iv){var u=c.substring(v,w-h.length);y.type==p?y.value+=u:(y.type&&g.push(y),y={type:p,value:u})}for(var f=0;fx){for($>2*c.length&&this.reportError("infinite loop with in ace tokenizer",{startState:a,line:c});v1&&t[0]!==e&&t.unshift("#tmp",e),{tokens:g,state:t.length?t:e}},this.reportError=S.reportError}).call(d.prototype),k.Tokenizer=d}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(L,k,N){var S=L("../lib/lang"),x=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(a,t){if(!t){for(var e in a)this.$rules[e]=a[e];return}for(var e in a){for(var i=a[e],n=0;n=this.$rowTokens.length;){if(this.$row+=1,d||(d=this.$session.getLength()),this.$row>=d)return this.$row=d-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var d=this.$rowTokens,c=this.$tokenIndex,a=d[c].start;if(a!==void 0)return a;for(a=0;c>0;)c-=1,a+=d[c].value.length;return a},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var d=this.$rowTokens[this.$tokenIndex],c=this.getCurrentTokenColumn();return new S(this.$row,c,this.$row,c+d.value.length)}}).call(x.prototype),k.TokenIterator=x}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(L,k,N){var S=L("../../lib/oop"),x=L("../behaviour").Behaviour,d=L("../../token_iterator").TokenIterator,c=L("../../lib/lang"),a=["text","paren.rparen","rparen","paren","punctuation.operator"],t=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],e,i={},n={'"':'"',"'":"'"},o=function(v){var $=-1;if(v.multiSelect&&($=v.selection.index,i.rangeCount!=v.multiSelect.rangeCount&&(i={rangeCount:v.multiSelect.rangeCount})),i[$])return e=i[$];e=i[$]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},l=function(v,$,y,p){var r=v.end.row-v.start.row;return{text:y+$+p,selection:[0,v.start.column+1,r,v.end.column+(r?0:1)]}},g=function(v){this.add("braces","insertion",function($,y,p,r,h){var w=p.getCursorPosition(),u=r.doc.getLine(w.row);if(h=="{"){o(p);var f=p.getSelectionRange(),s=r.doc.getTextRange(f);if(s!==""&&s!=="{"&&p.getWrapBehavioursEnabled())return l(f,s,"{","}");if(g.isSaneInsertion(p,r))return/[\]\}\)]/.test(u[w.column])||p.inMultiSelectMode||v&&v.braces?(g.recordAutoInsert(p,r,"}"),{text:"{}",selection:[1,1]}):(g.recordMaybeInsert(p,r,"{"),{text:"{",selection:[1,1]})}else if(h=="}"){o(p);var m=u.substring(w.column,w.column+1);if(m=="}"){var b=r.$findOpeningBracket("}",{column:w.column+1,row:w.row});if(b!==null&&g.isAutoInsertedClosing(w,u,h))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(h=="\n"||h=="\r\n"){o(p);var C="";g.isMaybeInsertedClosing(w,u)&&(C=c.stringRepeat("}",e.maybeInsertedBrackets),g.clearMaybeInsertedClosing());var m=u.substring(w.column,w.column+1);if(m==="}"){var A=r.findMatchingBracket({row:w.row,column:w.column+1},"}");if(!A)return null;var R=this.$getIndent(r.getLine(A.row))}else{if(!C){g.clearMaybeInsertedClosing();return}var R=this.$getIndent(u)}var E=R+r.getTabString();return{text:"\n"+E+"\n"+R+C,selection:[1,E.length,1,E.length]}}g.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function($,y,p,r,h){var w=r.doc.getTextRange(h);if(!h.isMultiLine()&&w=="{"){o(p);var u=r.doc.getLine(h.start.row),f=u.substring(h.end.column,h.end.column+1);if(f=="}")return h.end.column++,h;e.maybeInsertedBrackets--}}),this.add("parens","insertion",function($,y,p,r,h){if(h=="("){o(p);var w=p.getSelectionRange(),u=r.doc.getTextRange(w);if(u!==""&&p.getWrapBehavioursEnabled())return l(w,u,"(",")");if(g.isSaneInsertion(p,r))return g.recordAutoInsert(p,r,")"),{text:"()",selection:[1,1]}}else if(h==")"){o(p);var f=p.getCursorPosition(),s=r.doc.getLine(f.row),m=s.substring(f.column,f.column+1);if(m==")"){var b=r.$findOpeningBracket(")",{column:f.column+1,row:f.row});if(b!==null&&g.isAutoInsertedClosing(f,s,h))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function($,y,p,r,h){var w=r.doc.getTextRange(h);if(!h.isMultiLine()&&w=="("){o(p);var u=r.doc.getLine(h.start.row),f=u.substring(h.start.column+1,h.start.column+2);if(f==")")return h.end.column++,h}}),this.add("brackets","insertion",function($,y,p,r,h){if(h=="["){o(p);var w=p.getSelectionRange(),u=r.doc.getTextRange(w);if(u!==""&&p.getWrapBehavioursEnabled())return l(w,u,"[","]");if(g.isSaneInsertion(p,r))return g.recordAutoInsert(p,r,"]"),{text:"[]",selection:[1,1]}}else if(h=="]"){o(p);var f=p.getCursorPosition(),s=r.doc.getLine(f.row),m=s.substring(f.column,f.column+1);if(m=="]"){var b=r.$findOpeningBracket("]",{column:f.column+1,row:f.row});if(b!==null&&g.isAutoInsertedClosing(f,s,h))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function($,y,p,r,h){var w=r.doc.getTextRange(h);if(!h.isMultiLine()&&w=="["){o(p);var u=r.doc.getLine(h.start.row),f=u.substring(h.start.column+1,h.start.column+2);if(f=="]")return h.end.column++,h}}),this.add("string_dquotes","insertion",function($,y,p,r,h){var w=r.$mode.$quotes||n;if(h.length==1&&w[h]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(h)!=-1)return;o(p);var u=h,f=p.getSelectionRange(),s=r.doc.getTextRange(f);if(s!==""&&(s.length!=1||!w[s])&&p.getWrapBehavioursEnabled())return l(f,s,u,u);if(!s){var m=p.getCursorPosition(),b=r.doc.getLine(m.row),C=b.substring(m.column-1,m.column),A=b.substring(m.column,m.column+1),R=r.getTokenAt(m.row,m.column),E=r.getTokenAt(m.row,m.column+1);if(C=="\\"&&R&&/escape/.test(R.type))return null;var I=R&&/string|escape/.test(R.type),T=!E||/string|escape/.test(E.type),_;if(A==u)_=I!==T,_&&/string\.end/.test(E.type)&&(_=!1);else{if(I&&!T||I&&T)return null;var M=r.$mode.tokenRe;M.lastIndex=0;var O=M.test(C);M.lastIndex=0;var D=M.test(C);if(O||D||A&&!/[\s;,.})\]\\]/.test(A))return null;var F=b[m.column-2];if(!(C!=u||F!=u&&!M.test(F)))return null;_=!0}return{text:_?u+u:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function($,y,p,r,h){var w=r.$mode.$quotes||n,u=r.doc.getTextRange(h);if(!h.isMultiLine()&&w.hasOwnProperty(u)){o(p);var f=r.doc.getLine(h.start.row),s=f.substring(h.start.column+1,h.start.column+2);if(s==u)return h.end.column++,h}})};g.isSaneInsertion=function(v,$){var y=v.getCursorPosition(),p=new d($,y.row,y.column);if(!this.$matchTokenType(p.getCurrentToken()||"text",a)){if(/[)}\]]/.test(v.session.getLine(y.row)[y.column]))return!0;var r=new d($,y.row,y.column+1);if(!this.$matchTokenType(r.getCurrentToken()||"text",a))return!1}return p.stepForward(),p.getCurrentTokenRow()!==y.row||this.$matchTokenType(p.getCurrentToken()||"text",t)},g.$matchTokenType=function(v,$){return $.indexOf(v.type||v)>-1},g.recordAutoInsert=function(v,$,y){var p=v.getCursorPosition(),r=$.doc.getLine(p.row);this.isAutoInsertedClosing(p,r,e.autoInsertedLineEnd[0])||(e.autoInsertedBrackets=0),e.autoInsertedRow=p.row,e.autoInsertedLineEnd=y+r.substr(p.column),e.autoInsertedBrackets++},g.recordMaybeInsert=function(v,$,y){var p=v.getCursorPosition(),r=$.doc.getLine(p.row);this.isMaybeInsertedClosing(p,r)||(e.maybeInsertedBrackets=0),e.maybeInsertedRow=p.row,e.maybeInsertedLineStart=r.substr(0,p.column)+y,e.maybeInsertedLineEnd=r.substr(p.column),e.maybeInsertedBrackets++},g.isAutoInsertedClosing=function(v,$,y){return e.autoInsertedBrackets>0&&v.row===e.autoInsertedRow&&y===e.autoInsertedLineEnd[0]&&$.substr(v.column)===e.autoInsertedLineEnd},g.isMaybeInsertedClosing=function(v,$){return e.maybeInsertedBrackets>0&&v.row===e.maybeInsertedRow&&$.substr(v.column)===e.maybeInsertedLineEnd&&$.substr(0,v.column)==e.maybeInsertedLineStart},g.popAutoInsertedClosing=function(){e.autoInsertedLineEnd=e.autoInsertedLineEnd.substr(1),e.autoInsertedBrackets--},g.clearMaybeInsertedClosing=function(){e&&(e.maybeInsertedBrackets=0,e.maybeInsertedRow=-1)},S.inherits(g,x),k.CstyleBehaviour=g}),ace.define("ace/unicode",["require","exports","module"],function(L,k,N){for(var S=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],x=0,d=[],c=0;c2?z%w!=w-1:z%w==0}}else{if(!this.blockComment)return!1;var f=this.blockComment.start,s=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+t.escapeRegExp(f)+")"),b=new RegExp("(?:"+t.escapeRegExp(s)+")\\s*$"),C=function(_,M){R(_,M)||(!p||/\S/.test(_))&&(y.insertInLine({row:M,column:_.length},s),y.insertInLine({row:M,column:h},f))},A=function(_,M){var O;(O=_.match(b))&&y.removeInLine(M,_.length-O[0].length,_.length),(O=_.match(m))&&y.removeInLine(M,O[1].length,O[0].length)},R=function(_,M){if(m.test(_))return!0;for(var O=l.getTokens(M),D=0;D_.length&&(T=_.length)}),h==1/0&&(h=T,p=!1,r=!1),u&&h%w!=0&&(h=Math.floor(h/w)*w),$(r?A:C)},this.toggleBlockComment=function(o,l,g,v){var $=this.blockComment;if($){!$.start&&$[0]&&($=$[0]);var y=new e(l,v.row,v.column),p=y.getCurrentToken();l.selection;var r=l.selection.toOrientedRange(),h,w;if(p&&/comment/.test(p.type)){for(var u,f;p&&/comment/.test(p.type);){var s=p.value.indexOf($.start);if(s!=-1){var m=y.getCurrentTokenRow(),b=y.getCurrentTokenColumn()+s;u=new i(m,b,m,b+$.start.length);break}p=y.stepBackward()}for(var y=new e(l,v.row,v.column),p=y.getCurrentToken();p&&/comment/.test(p.type);){var s=p.value.indexOf($.end);if(s!=-1){var m=y.getCurrentTokenRow(),b=y.getCurrentTokenColumn()+s;f=new i(m,b,m,b+$.end.length);break}p=y.stepForward()}f&&l.remove(f),u&&(l.remove(u),h=u.start.row,w=-$.start.length)}else w=$.start.length,h=g.start.row,l.insert(g.end,$.end),l.insert(g.start,$.start);r.start.row==h&&(r.start.column+=w),r.end.row==h&&(r.end.column+=w),l.selection.fromOrientedRange(r)}},this.getNextLineIndent=function(o,l,g){return this.$getIndent(l)},this.checkOutdent=function(o,l,g){return!1},this.autoOutdent=function(o,l,g){},this.$getIndent=function(o){return o.match(/^\s*/)[0]},this.createWorker=function(o){return null},this.createModeDelegates=function(o){this.$embeds=[],this.$modes={};for(var l in o)if(o[l]){var g=o[l],v=g.prototype.$id,$=S.$modes[v];$||(S.$modes[v]=$=new g),S.$modes[l]||(S.$modes[l]=$),this.$embeds.push(l),this.$modes[l]=$}for(var y=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],l=0;l"u"?this.setPosition(a.row,a.column):this.setPosition(a,t)};(function(){function c(t,e,i){var n=i?t.column<=e.column:t.columnthis.row)){var e=a(t,{row:this.row,column:this.column},this.$insertRight);this.setPosition(e.row,e.column,!0)}},this.setPosition=function(t,e,i){var n;if(i?n={row:t,column:e}:n=this.$clipPositionToDocument(t,e),!(this.row==n.row&&this.column==n.column)){var o={row:this.row,column:this.column};this.row=n.row,this.column=n.column,this._signal("change",{old:o,value:n})}},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(t){this.document=t||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(t,e){var i={};return t>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):t<0?(i.row=0,i.column=0):(i.row=t,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,e))),e<0&&(i.column=0),i}}).call(d.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(L,k,N){var S=L("./lib/oop"),x=L("./apply_delta").applyDelta,d=L("./lib/event_emitter").EventEmitter,c=L("./range").Range,a=L("./anchor").Anchor,t=function(e){this.$lines=[""],e.length===0?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){S.implement(this,d),this.setValue=function(e){var i=this.getLength()-1;this.remove(new c(0,0,i,this.getLine(i).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,i){return new a(this,e,i)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var i=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=i?i[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,i){return this.$lines.slice(e,i+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var i;if(e.start.row===e.end.row)i=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{i=this.getLines(e.start.row,e.end.row),i[0]=(i[0]||"").substring(e.start.column);var n=i.length-1;e.end.row-e.start.row==n&&(i[n]=i[n].substring(0,e.end.column))}return i},this.insertLines=function(e,i){return this.insertFullLines(e,i)},this.removeLines=function(e,i){return this.removeFullLines(e,i)},this.insertNewLine=function(e){return this.insertMergedLines(e,["",""])},this.insert=function(e,i){return this.getLength()<=1&&this.$detectNewLine(i),this.insertMergedLines(e,this.$split(i))},this.insertInLine=function(e,i){var n=this.clippedPos(e.row,e.column),o=this.pos(e.row,e.column+i.length);return this.applyDelta({start:n,end:o,action:"insert",lines:[i]},!0),this.clonePos(o)},this.clippedPos=function(e,i){var n=this.getLength();e===void 0?e=n:e<0?e=0:e>=n&&(e=n-1,i=void 0);var o=this.getLine(e);return i==null&&(i=o.length),i=Math.min(Math.max(i,0),o.length),{row:e,column:i}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,i){return{row:e,column:i}},this.$clipPosition=function(e){var i=this.getLength();return e.row>=i?(e.row=Math.max(0,i-1),e.column=this.getLine(i-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,i){e=Math.min(Math.max(e,0),this.getLength());var n=0;e0,o=i=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,i){if(e instanceof c||(e=c.fromPoints(e.start,e.end)),i.length===0&&e.isEmpty())return e.start;if(i==this.getTextRange(e))return e.end;this.remove(e);var n;return i?n=this.insert(e.start,i):n=e.start,n},this.applyDeltas=function(e){for(var i=0;i=0;i--)this.revertDelta(e[i])},this.applyDelta=function(e,i){var n=e.action=="insert";(n?e.lines.length<=1&&!e.lines[0]:!c.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(x(this.$lines,e,i),this._signal("change",e)))},this.$safeApplyDelta=function(e){var i=this.$lines.length;(e.action=="remove"&&e.start.row20){t.running=setTimeout(t.$worker,20);break}}t.currentLine=i,n==-1&&(n=i),l<=n&&t.fireUpdateEvent(l,n)}}};(function(){S.implement(this,x),this.setTokenizer=function(c){this.tokenizer=c,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(c){this.doc=c,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(c,a){var t={first:c,last:a};this._signal("update",{data:t})},this.start=function(c){this.currentLine=Math.min(c||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(c){var a=c.start.row,t=c.end.row-a;if(t===0)this.lines[a]=null;else if(c.action=="remove")this.lines.splice(a,t+1,null),this.states.splice(a,t+1,null);else{var e=Array(t+1);e.unshift(a,1),this.lines.splice.apply(this.lines,e),this.states.splice.apply(this.states,e)}this.currentLine=Math.min(a,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(c){return this.lines[c]||this.$tokenizeRow(c)},this.getState=function(c){return this.currentLine==c&&this.$tokenizeRow(c),this.states[c]||"start"},this.$tokenizeRow=function(c){var a=this.doc.getLine(c),t=this.states[c-1],e=this.tokenizer.getLineTokens(a,t,c);return this.states[c]+""!=e.state+""?(this.states[c]=e.state,this.lines[c+1]=null,this.currentLine>c+1&&(this.currentLine=c+1)):this.currentLine==c&&(this.currentLine=c+1),this.lines[c]=e.tokens}}).call(d.prototype),k.BackgroundTokenizer=d}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(L,k,N){var S=L("./lib/lang");L("./lib/oop");var x=L("./range").Range,d=function(c,a,t){this.setRegexp(c),this.clazz=a,this.type=t||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(c){this.regExp+""!=c+""&&(this.regExp=c,this.cache=[])},this.update=function(c,a,t,e){if(this.regExp)for(var i=e.firstRow,n=e.lastRow,o=i;o<=n;o++){var l=this.cache[o];l==null&&(l=S.getMatchOffsets(t.getLine(o),this.regExp),l.length>this.MAX_RANGES&&(l=l.slice(0,this.MAX_RANGES)),l=l.map(function(v){return new x(o,v.offset,o,v.offset+v.length)}),this.cache[o]=l.length?l:"");for(var g=l.length;g--;)a.drawSingleLineMarker(c,l[g].toScreenRange(t),this.clazz,e)}}}).call(d.prototype),k.SearchHighlight=d}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(L,k,N){function S(d,c){this.foldData=d,Array.isArray(c)?this.folds=c:c=this.folds=[c];var a=c[c.length-1];this.range=new x(c[0].start.row,c[0].start.column,a.end.row,a.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(t){t.setFoldLine(this)},this)}var x=L("../range").Range;(function(){this.shiftRow=function(d){this.start.row+=d,this.end.row+=d,this.folds.forEach(function(c){c.start.row+=d,c.end.row+=d})},this.addFold=function(d){if(d.sameRow){if(d.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(d),this.folds.sort(function(c,a){return-c.range.compareEnd(a.start.row,a.start.column)}),this.range.compareEnd(d.start.row,d.start.column)>0?(this.end.row=d.end.row,this.end.column=d.end.column):this.range.compareStart(d.end.row,d.end.column)<0&&(this.start.row=d.start.row,this.start.column=d.start.column)}else if(d.start.row==this.end.row)this.folds.push(d),this.end.row=d.end.row,this.end.column=d.end.column;else{if(d.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(d),this.start.row=d.start.row,this.start.column=d.start.column}d.foldLine=this},this.containsRow=function(d){return d>=this.start.row&&d<=this.end.row},this.walk=function(d,c,a){var t=0,e=this.folds,i,n,o,l=!0;c==null&&(c=this.end.row,a=this.end.column);for(var g=0;g0)){var l=x(c,n.start);return o===0?a&&l!==0?-i-2:i:l>0||l===0&&!a?i:-i-1}}return-i-1},this.add=function(c){var a=!c.isEmpty(),t=this.pointIndex(c.start,a);t<0&&(t=-t-1);var e=this.pointIndex(c.end,a,t);return e<0?e=-e-1:e++,this.ranges.splice(t,e-t,c)},this.addList=function(c){for(var a=[],t=c.length;t--;)a.push.apply(a,this.add(c[t]));return a},this.substractPoint=function(c){var a=this.pointIndex(c);if(a>=0)return this.ranges.splice(a,1)},this.merge=function(){var c=[],a=this.ranges;a=a.sort(function(o,l){return x(o.start,l.start)});for(var t=a[0],e,i=1;i=0},this.containsPoint=function(c){return this.pointIndex(c)>=0},this.rangeAtPoint=function(c){var a=this.pointIndex(c);if(a>=0)return this.ranges[a]},this.clipRows=function(c,a){var t=this.ranges;if(t[0].start.row>a||t[t.length-1].start.row=e)break}if(c.action=="insert")for(var v=i-e,$=-a.column+t.column;oe)break;if(g.start.row==e&&g.start.column>=a.column&&(g.start.column==a.column&&this.$bias<=0||(g.start.column+=$,g.start.row+=v)),g.end.row==e&&g.end.column>=a.column){if(g.end.column==a.column&&this.$bias<0)continue;g.end.column==a.column&&$>0&&og.start.column&&g.end.column==n[o+1].start.column&&(g.end.column-=$),g.end.column+=$,g.end.row+=v}}else for(var v=e-i,$=a.column-t.column;oi)break;g.end.rowa.column)&&(g.end.column=a.column,g.end.row=a.row):(g.end.column+=$,g.end.row+=v):g.end.row>i&&(g.end.row+=v),g.start.rowa.column)&&(g.start.column=a.column,g.start.row=a.row):(g.start.column+=$,g.start.row+=v):g.start.row>i&&(g.start.row+=v)}if(v!=0&&o=t)return o;if(o.end.row>t)return null}return null},this.getNextFoldLine=function(t,e){var i=this.$foldData,n=0;for(e&&(n=i.indexOf(e)),n==-1&&(n=0),n;n=t)return o}return null},this.getFoldedRowCount=function(t,e){for(var i=this.$foldData,n=e-t+1,o=0;o=e){v=t?n-=e-v:n=0);break}g>=t&&(v>=t?n-=g-v:n-=g-t+1)}return n},this.$addFoldLine=function(t){return this.$foldData.push(t),this.$foldData.sort(function(e,i){return e.start.row-i.start.row}),t},this.addFold=function(t,e){var i=this.$foldData,n=!1,o;t instanceof c?o=t:(o=new c(e,t),o.collapseChildren=e.collapseChildren),this.$clipRangeToDocument(o.range);var l=o.start.row,g=o.start.column,v=o.end.row,$=o.end.column,y=this.getFoldAt(l,g,1),p=this.getFoldAt(v,$,-1);if(y&&p==y)return y.addSubFold(o);y&&!y.range.isStart(l,g)&&this.removeFold(y),p&&!p.range.isEnd(v,$)&&this.removeFold(p);var r=this.getFoldsInRange(o.range);r.length>0&&(this.removeFolds(r),o.collapseChildren||r.forEach(function(f){o.addSubFold(f)}));for(var h=0;h0&&this.foldAll(t.start.row+1,t.end.row,t.collapseChildren-1),t.subFolds=[]},this.expandFolds=function(t){t.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(t,e){var i,n;if(t==null?(i=new x(0,0,this.getLength(),0),e==null&&(e=!0)):typeof t=="number"?i=new x(t,0,t,this.getLine(t).length):"row"in t?i=x.fromPoints(t,t):i=t,n=this.getFoldsInRangeList(i),e!=0?this.removeFolds(n):this.expandFolds(n),n.length)return n},this.isRowFolded=function(t,e){return!!this.getFoldLine(t,e)},this.getRowFoldEnd=function(t,e){var i=this.getFoldLine(t,e);return i?i.end.row:t},this.getRowFoldStart=function(t,e){var i=this.getFoldLine(t,e);return i?i.start.row:t},this.getFoldDisplayLine=function(t,e,i,n,o){n==null&&(n=t.start.row),o==null&&(o=0),e==null&&(e=t.end.row),i==null&&(i=this.getLine(e).length);var l=this.doc,g="";return t.walk(function(v,$,y,p){if(!($$)break;while(o&&g.test(o.type));o=n.stepBackward()}else o=n.getCurrentToken();return v.end.row=n.getCurrentTokenRow(),v.end.column=n.getCurrentTokenColumn()+o.value.length-2,v}},this.foldAll=function(t,e,i,n){i==null&&(i=1e5);var o=this.foldWidgets;if(o){e=e||this.getLength(),t=t||0;for(var l=t;l=t&&(l=g.end.row,g.collapseChildren=i,this.addFold("...",g))}}},this.foldToLevel=function(t){for(this.foldAll();t-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var t=this;this.foldAll(null,null,null,function(e){for(var i=t.getTokens(e),n=0;n=0;){var l=i[n];if(l==null&&(l=i[n]=this.getFoldWidget(n)),l=="start"){var g=this.getFoldWidgetRange(n);if(o||(o=g),g&&g.end.row>=t)break}n--}return{range:n!==-1&&g,firstRange:o}},this.onFoldWidgetClick=function(t,e){e=e.domEvent;var i={children:e.shiftKey,all:e.ctrlKey||e.metaKey,siblings:e.altKey},n=this.$toggleFoldWidget(t,i);if(!n){var o=e.target||e.srcElement;o&&/ace_fold-widget/.test(o.className)&&(o.className+=" ace_invalid")}},this.$toggleFoldWidget=function(t,e){if(this.getFoldWidget){var i=this.getFoldWidget(t),n=this.getLine(t),o=i==="end"?-1:1,l=this.getFoldAt(t,o===-1?0:n.length,o);if(l)return e.children||e.all?this.removeFold(l):this.expandFold(l),l;var g=this.getFoldWidgetRange(t,!0);if(g&&!g.isMultiLine()&&(l=this.getFoldAt(g.start.row,g.start.column,1),l&&g.isEqual(l.range)))return this.removeFold(l),l;if(e.siblings){var v=this.getParentFoldRangeData(t);if(v.range)var $=v.range.start.row+1,y=v.range.end.row;this.foldAll($,y,e.all?1e4:0)}else e.children?(y=g?g.end.row:this.getLength(),this.foldAll(t+1,y,e.all?1e4:0)):g&&(e.all&&(g.collapseChildren=1e4),this.addFold("...",g));return g}},this.toggleFoldWidget=function(t){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var i=this.$toggleFoldWidget(e,{});if(!i){var n=this.getParentFoldRangeData(e,!0);if(i=n.range||n.firstRange,i){e=i.start.row;var o=this.getFoldAt(e,this.getLine(e).length,1);o?this.removeFold(o):this.addFold("...",i)}}},this.updateFoldWidgets=function(t){var e=t.start.row,i=t.end.row-e;if(i===0)this.foldWidgets[e]=null;else if(t.action=="remove")this.foldWidgets.splice(e,i+1,null);else{var n=Array(i+1);n.unshift(e,1),this.foldWidgets.splice.apply(this.foldWidgets,n)}},this.tokenizerUpdateFoldWidgets=function(t){var e=t.data;e.first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}var x=L("../range").Range,d=L("./fold_line").FoldLine,c=L("./fold").Fold,a=L("../token_iterator").TokenIterator;k.Folding=S}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(L,k,N){function S(){this.findMatchingBracket=function(c,a){if(c.column==0)return null;var t=a||this.getLine(c.row).charAt(c.column-1);if(t=="")return null;var e=t.match(/([\(\[\{])|([\)\]\}])/);return e?e[1]?this.$findClosingBracket(e[1],c):this.$findOpeningBracket(e[2],c):null},this.getBracketRange=function(c){var a=this.getLine(c.row),t=!0,e,i=a.charAt(c.column-1),n=i&&i.match(/([\(\[\{])|([\)\]\}])/);if(n||(i=a.charAt(c.column),c={row:c.row,column:c.column+1},n=i&&i.match(/([\(\[\{])|([\)\]\}])/),t=!1),!n)return null;if(n[1]){var o=this.$findClosingBracket(n[1],c);if(!o)return null;e=d.fromPoints(c,o),t||(e.end.column++,e.start.column--),e.cursor=e.end}else{var o=this.$findOpeningBracket(n[2],c);if(!o)return null;e=d.fromPoints(o,c),t||(e.start.column++,e.end.column--),e.cursor=e.start}return e},this.getMatchingBracketRanges=function(c){var a=this.getLine(c.row),t=a.charAt(c.column-1),e=t&&t.match(/([\(\[\{])|([\)\]\}])/);if(e||(t=a.charAt(c.column),c={row:c.row,column:c.column+1},e=t&&t.match(/([\(\[\{])|([\)\]\}])/)),!e)return null;var i=new d(c.row,c.column-1,c.row,c.column),n=e[1]?this.$findClosingBracket(e[1],c):this.$findOpeningBracket(e[2],c);if(!n)return[i];var o=new d(n.row,n.column,n.row,n.column+1);return[i,o]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(c,a,t){var e=this.$brackets[c],i=1,n=new x(this,a.row,a.column),o=n.getCurrentToken();if(o||(o=n.stepForward()),!!o){t||(t=new RegExp("(\\.?"+o.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=a.column-n.getCurrentTokenColumn()-2,g=o.value;;){for(;l>=0;){var v=g.charAt(l);if(v==e){if(i-=1,i==0)return{row:n.getCurrentTokenRow(),column:l+n.getCurrentTokenColumn()}}else v==c&&(i+=1);l-=1}do o=n.stepBackward();while(o&&!t.test(o.type));if(o==null)break;g=o.value,l=g.length-1}return null}},this.$findClosingBracket=function(c,a,t){var e=this.$brackets[c],i=1,n=new x(this,a.row,a.column),o=n.getCurrentToken();if(o||(o=n.stepForward()),!!o){t||(t=new RegExp("(\\.?"+o.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=a.column-n.getCurrentTokenColumn();;){for(var g=o.value,v=g.length;l=4352&&s<=4447||s>=4515&&s<=4519||s>=4602&&s<=4607||s>=9001&&s<=9002||s>=11904&&s<=11929||s>=11931&&s<=12019||s>=12032&&s<=12245||s>=12272&&s<=12283||s>=12288&&s<=12350||s>=12353&&s<=12438||s>=12441&&s<=12543||s>=12549&&s<=12589||s>=12593&&s<=12686||s>=12688&&s<=12730||s>=12736&&s<=12771||s>=12784&&s<=12830||s>=12832&&s<=12871||s>=12880&&s<=13054||s>=13056&&s<=19903||s>=19968&&s<=42124||s>=42128&&s<=42182||s>=43360&&s<=43388||s>=44032&&s<=55203||s>=55216&&s<=55238||s>=55243&&s<=55291||s>=63744&&s<=64255||s>=65040&&s<=65049||s>=65072&&s<=65106||s>=65108&&s<=65126||s>=65128&&s<=65131||s>=65281&&s<=65376||s>=65504&&s<=65510}S.implement(this,a),this.setDocument=function(s){this.doc&&this.doc.removeListener("change",this.$onChange),this.doc=s,s.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(s){if(!s){this.$docRowCache=[],this.$screenRowCache=[];return}var m=this.$docRowCache.length,b=this.$getRowCacheIndex(this.$docRowCache,s)+1;m>b&&(this.$docRowCache.splice(b,m),this.$screenRowCache.splice(b,m))},this.$getRowCacheIndex=function(s,m){for(var b=0,C=s.length-1;b<=C;){var A=b+C>>1,R=s[A];if(m>R)b=A+1;else{if(!(m=m));R++);return C=b[R],C?(C.index=R,C.start=A-C.value.length,C):null},this.setUndoManager=function(s){if(this.$undoManager=s,this.$informUndoManager&&this.$informUndoManager.cancel(),s){var m=this;s.addSession(this),this.$syncInformUndoManager=function(){m.$informUndoManager.cancel(),m.mergeUndoDeltas=!1},this.$informUndoManager=x.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?x.stringRepeat(" ",this.getTabSize()):" "},this.setUseSoftTabs=function(s){this.setOption("useSoftTabs",s)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(s){this.setOption("tabSize",s)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(s){return this.$useSoftTabs&&s.column%this.$tabSize===0},this.setNavigateWithinSoftTabs=function(s){this.setOption("navigateWithinSoftTabs",s)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(s){this.setOption("overwrite",s)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(s,m){this.$decorations[s]||(this.$decorations[s]=""),this.$decorations[s]+=" "+m,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(s,m){this.$decorations[s]=(this.$decorations[s]||"").replace(" "+m,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(s){this.$breakpoints=[];for(var m=0;m0&&(C=!!b.charAt(m-1).match(this.tokenRe)),C||(C=!!b.charAt(m).match(this.tokenRe)),C)var A=this.tokenRe;else if(/^\s+$/.test(b.slice(m-1,m+1)))var A=/\s/;else var A=this.nonTokenRe;var R=m;if(R>0){do R--;while(R>=0&&b.charAt(R).match(A));R++}for(var E=m;Es&&(s=m.screenWidth)}),this.lineWidgetWidth=s},this.$computeWidth=function(s){if(this.$modified||s){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var m=this.doc.getAllLines(),b=this.$rowLengthCache,C=0,A=0,R=this.$foldData[A],E=R?R.start.row:1/0,I=m.length,T=0;TE){if(T=R.end.row+1,T>=I)break;R=this.$foldData[A++],E=R?R.start.row:1/0}b[T]==null&&(b[T]=this.$getStringScreenWidth(m[T])[0]),b[T]>C&&(C=b[T])}this.screenWidth=C}},this.getLine=function(s){return this.doc.getLine(s)},this.getLines=function(s,m){return this.doc.getLines(s,m)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(s){return this.doc.getTextRange(s||this.selection.getRange())},this.insert=function(s,m){return this.doc.insert(s,m)},this.remove=function(s){return this.doc.remove(s)},this.removeFullLines=function(s,m){return this.doc.removeFullLines(s,m)},this.undoChanges=function(s,m){if(s.length){this.$fromUndo=!0;for(var b=s.length-1;b!=-1;b--){var C=s[b];C.action=="insert"||C.action=="remove"?this.doc.revertDelta(C):C.folds&&this.addFolds(C.folds)}!m&&this.$undoSelect&&(s.selectionBefore?this.selection.fromJSON(s.selectionBefore):this.selection.setRange(this.$getUndoSelection(s,!0))),this.$fromUndo=!1}},this.redoChanges=function(s,m){if(s.length){this.$fromUndo=!0;for(var b=0;bs.end.column&&(R.start.column+=I),R.end.row==s.end.row&&R.end.column>s.end.column&&(R.end.column+=I)),E&&R.start.row>=s.end.row&&(R.start.row+=E,R.end.row+=E)}if(R.end=this.insert(R.start,C),A.length){var T=s.start,_=R.start,E=_.row-T.row,I=_.column-T.column;this.addFolds(A.map(function(D){return D=D.clone(),D.start.row==T.row&&(D.start.column+=I),D.end.row==T.row&&(D.end.column+=I),D.start.row+=E,D.end.row+=E,D}))}return R},this.indentRows=function(s,m,b){b=b.replace(/\t/g,this.getTabString());for(var C=s;C<=m;C++)this.doc.insertInLine({row:C,column:0},b)},this.outdentRows=function(s){for(var m=s.collapseRows(),b=new i(0,0,0,0),C=this.getTabSize(),A=m.start.row;A<=m.end.row;++A){var R=this.getLine(A);b.start.row=A,b.end.row=A;for(var E=0;E0){var C=this.getRowFoldEnd(m+b);if(C>this.doc.getLength()-1)return 0;var A=C-m}else{s=this.$clipRowToDocument(s),m=this.$clipRowToDocument(m);var A=m-s+1}var R=new i(s,0,m,Number.MAX_VALUE),E=this.getFoldsInRange(R).map(function(T){return T=T.clone(),T.start.row+=A,T.end.row+=A,T}),I=b==0?this.doc.getLines(s,m):this.doc.removeFullLines(s,m);return this.doc.insertFullLines(s+A,I),E.length&&this.addFolds(E),A},this.moveLinesUp=function(s,m){return this.$moveLines(s,m,-1)},this.moveLinesDown=function(s,m){return this.$moveLines(s,m,1)},this.duplicateLines=function(s,m){return this.$moveLines(s,m,0)},this.$clipRowToDocument=function(s){return Math.max(0,Math.min(s,this.doc.getLength()-1))},this.$clipColumnToRow=function(s,m){return m<0?0:Math.min(this.doc.getLine(s).length,m)},this.$clipPositionToDocument=function(s,m){if(m=Math.max(0,m),s<0)s=0,m=0;else{var b=this.doc.getLength();s>=b?(s=b-1,m=this.doc.getLine(b-1).length):m=Math.min(this.doc.getLine(s).length,m)}return{row:s,column:m}},this.$clipRangeToDocument=function(s){s.start.row<0?(s.start.row=0,s.start.column=0):s.start.column=this.$clipColumnToRow(s.start.row,s.start.column);var m=this.doc.getLength()-1;return s.end.row>m?(s.end.row=m,s.end.column=this.doc.getLine(m).length):s.end.column=this.$clipColumnToRow(s.end.row,s.end.column),s},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(s){if(s!=this.$useWrapMode){if(this.$useWrapMode=s,this.$modified=!0,this.$resetRowCache(0),s){var m=this.getLength();this.$wrapData=Array(m),this.$updateWrapData(0,m-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(s,m){(this.$wrapLimitRange.min!==s||this.$wrapLimitRange.max!==m)&&(this.$wrapLimitRange={min:s,max:m},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(s,m){var b=this.$wrapLimitRange;b.max<0&&(b={min:m,max:m});var C=this.$constrainWrapLimit(s,b.min,b.max);return C!=this.$wrapLimit&&C>1?(this.$wrapLimit=C,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},this.$constrainWrapLimit=function(s,m,b){return m&&(s=Math.max(m,s)),b&&(s=Math.min(b,s)),s},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(s){this.setWrapLimitRange(s,s)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(s){var m=this.$useWrapMode,b=s.action,C=s.start,A=s.end,R=C.row,E=A.row,I=E-R,T=null;if(this.$updating=!0,I!=0)if(b==="remove"){this[m?"$wrapData":"$rowLengthCache"].splice(R,I);var _=this.$foldData;T=this.getFoldsInRange(s),this.removeFolds(T);var M=this.getFoldLine(A.row),O=0;if(M){M.addRemoveChars(A.row,A.column,C.column-A.column),M.shiftRow(-I);var D=this.getFoldLine(R);D&&D!==M&&(D.merge(M),M=D),O=_.indexOf(M)+1}for(O;O<_.length;O++){var M=_[O];M.start.row>=A.row&&M.shiftRow(-I)}E=R}else{var F=Array(I);F.unshift(R,0);var W=m?this.$wrapData:this.$rowLengthCache;W.splice.apply(W,F);var _=this.$foldData,M=this.getFoldLine(R),O=0;if(M){var B=M.range.compareInside(C.row,C.column);B==0?(M=M.split(C.row,C.column),M&&(M.shiftRow(I),M.addRemoveChars(E,0,A.column-C.column))):B==-1&&(M.addRemoveChars(R,0,A.column-C.column),M.shiftRow(I)),O=_.indexOf(M)+1}for(O;O<_.length;O++){var M=_[O];M.start.row>=R&&M.shiftRow(I)}}else{I=Math.abs(s.start.column-s.end.column),b==="remove"&&(T=this.getFoldsInRange(s),this.removeFolds(T),I=-I);var M=this.getFoldLine(R);M&&M.addRemoveChars(R,C.column,I)}return m&&this.$wrapData.length!=this.doc.getLength(),this.$updating=!1,m?this.$updateWrapData(R,E):this.$updateRowLengthCache(R,E),T},this.$updateRowLengthCache=function(s,m,b){this.$rowLengthCache[s]=null,this.$rowLengthCache[m]=null},this.$updateWrapData=function(s,m){var b=this.doc.getAllLines(),C=this.getTabSize(),A=this.$wrapData,R=this.$wrapLimit,E,I,T=s;for(m=Math.min(m,b.length-1);T<=m;)I=this.getFoldLine(T,I),I?(E=[],I.walk((function(_,M,O,D){var F;if(_!=null){F=this.$getDisplayTokens(_,E.length),F[0]=p;for(var W=1;Wm-D;){var F=I+m-D;if(s[F-1]>=w&&s[F]>=w){A(F);continue}if(s[F]==p||s[F]==r){for(F;F!=I-1&&s[F]!=p;F--);if(F>I){A(F);continue}for(F=I+m,F;F>2)),I-1);F>W&&s[F]W&&s[F]W&&s[F]==h;)F--}else for(;F>W&&s[F]W){A(++F);continue}F=I+m,s[F]==y&&F--,A(F-D)}return R},this.$getDisplayTokens=function(s,m){var b=[],C;m=m||0;for(var A=0;A39&&R<48||R>57&&R<64?b.push(h):R>=4352&&v(R)?b.push($,y):b.push($)}return b},this.$getStringScreenWidth=function(s,m,b){if(m==0)return[0,0];m==null&&(m=1/0),b=b||0;var C,A;for(A=0;A=4352&&v(C)?b+=2:b+=1,!(b>m));A++);return[b,A]},this.lineWidgets=null,this.getRowLength=function(s){var m=1;return this.lineWidgets&&(m+=this.lineWidgets[s]&&this.lineWidgets[s].rowCount||0),!this.$useWrapMode||!this.$wrapData[s]?m:this.$wrapData[s].length+m},this.getRowLineCount=function(s){return!this.$useWrapMode||!this.$wrapData[s]?1:this.$wrapData[s].length+1},this.getRowWrapIndent=function(s){if(this.$useWrapMode){var m=this.screenToDocumentPosition(s,Number.MAX_VALUE),b=this.$wrapData[m.row];return b.length&&b[0]=0)var M=I[T],O=this.$docRowCache[T],D=s>I[_-1];else var D=!_;for(var F=this.getLength()-1,W=this.getNextFoldLine(O),B=W?W.start.row:1/0;M<=s&&(E=this.getRowLength(O),!(M+E>s||O>=F));)M+=E,O++,O>B&&(O=W.end.row+1,W=this.getNextFoldLine(O,W),B=W?W.start.row:1/0),D&&(this.$docRowCache.push(O),this.$screenRowCache.push(M));if(W&&W.start.row<=O)C=this.getFoldDisplayLine(W),O=W.start.row;else{if(M+E<=s||O>F)return{row:F,column:this.getLine(F).length};C=this.getLine(O),W=null}var P=0,z=Math.floor(s-M);if(this.$useWrapMode){var V=this.$wrapData[O];V&&(R=V[z],z>0&&V.length&&(P=V.indent,A=V[z-1]||V[V.length-1],C=C.substring(A)))}return b!==void 0&&this.$bidiHandler.isBidiRow(M+z,O,z)&&(m=this.$bidiHandler.offsetToCol(b)),A+=this.$getStringScreenWidth(C,m-P)[1],this.$useWrapMode&&A>=R&&(A=R-1),W?W.idxToPosition(A):{row:O,column:A}},this.documentToScreenPosition=function(s,m){if(typeof m>"u")var b=this.$clipPositionToDocument(s.row,s.column);else b=this.$clipPositionToDocument(s,m);s=b.row,m=b.column;var M=0,C=null,A=null;A=this.getFoldAt(s,m,1),A&&(s=A.start.row,m=A.start.column);var R,_=0,E=this.$docRowCache,I=this.$getRowCacheIndex(E,s),T=E.length;if(T&&I>=0)var _=E[I],M=this.$screenRowCache[I],O=s>E[T-1];else var O=!T;for(var D=this.getNextFoldLine(_),F=D?D.start.row:1/0;_=F){if(R=D.end.row+1,R>s)break;D=this.getNextFoldLine(R,D),F=D?D.start.row:1/0}else R=_+1;M+=this.getRowLength(_),_=R,O&&(this.$docRowCache.push(_),this.$screenRowCache.push(M))}var W="";D&&_>=F?(W=this.getFoldDisplayLine(D,s,m),C=D.start.row):(W=this.getLine(s).substring(0,m),C=s);var B=0;if(this.$useWrapMode){var P=this.$wrapData[C];if(P){for(var z=0;W.length>=P[z];)M++,z++;W=W.substring(P[z-1]||0,W.length),B=z>0?P.indent:0}}return this.lineWidgets&&this.lineWidgets[_]&&this.lineWidgets[_].rowsAbove&&(M+=this.lineWidgets[_].rowsAbove),{row:M,column:B+this.$getStringScreenWidth(W)[0]}},this.documentToScreenColumn=function(s,m){return this.documentToScreenPosition(s,m).column},this.documentToScreenRow=function(s,m){return this.documentToScreenPosition(s,m).row},this.getScreenLength=function(){var s=0,m=null;if(this.$useWrapMode)for(var A=this.$wrapData.length,R=0,C=0,m=this.$foldData[C++],E=m?m.start.row:1/0;RE&&(R=m.end.row+1,m=this.$foldData[C++],E=m?m.start.row:1/0)}else{s=this.getLength();for(var b=this.$foldData,C=0;Cb));R++);return[C,R]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.selection.detach()},this.isFullWidth=v}).call(g.prototype),L("./edit_session/folding").Folding.call(g.prototype),L("./edit_session/bracket_match").BracketMatch.call(g.prototype),c.defineOptions(g.prototype,"session",{wrap:{set:function(v){if(!v||v=="off"?v=!1:v=="free"?v=!0:v=="printMargin"?v=-1:typeof v=="string"&&(v=parseInt(v,10)||!1),this.$wrap!=v)if(this.$wrap=v,!v)this.setUseWrapMode(!1);else{var $=typeof v=="number"?v:null;this.setWrapLimitRange($,$),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(v){v=v=="auto"?this.$mode.type!="text":v!="text",v!=this.$wrapAsCode&&(this.$wrapAsCode=v,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(v){this.$useWorker=v,this.$stopWorker(),v&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(v){v=parseInt(v),v>0&&this.$tabSize!==v&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=v,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(v){this.setFoldStyle(v)},handlesSet:!0},overwrite:{set:function(v){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(v){this.doc.setNewLineMode(v)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(v){this.setMode(v)},get:function(){return this.$modeId},handlesSet:!0}}),k.EditSession=g}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(L,k,N){function S(t,e){function i(n){return/\w/.test(n)||e.regExp?"\\b":""}return i(t[0])+t+i(t[t.length-1])}var x=L("./lib/lang"),d=L("./lib/oop"),c=L("./range").Range,a=function(){this.$options={}};(function(){this.set=function(t){return d.mixin(this.$options,t),this},this.getOptions=function(){return x.copyObject(this.$options)},this.setOptions=function(t){this.$options=t},this.find=function(t){var e=this.$options,i=this.$matchIterator(t,e);if(!i)return!1;var n=null;return i.forEach(function(o,l,g,v){return n=new c(o,l,g,v),l==v&&e.start&&e.start.start&&e.skipCurrent!=0&&n.isEqual(e.start)?(n=null,!1):!0}),n},this.findAll=function(t){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var i=e.range,n=i?t.getLines(i.start.row,i.end.row):t.doc.getAllLines(),o=[],l=e.re;if(e.$isMultiLine){var g=l.length,v=n.length-g,$;e:for(var y=l.offset||0;y<=v;y++){for(var p=0;pw||(o.push($=new c(y,w,y+g-1,u)),g>2&&(y=y+g-2))}}else for(var f=0;fC&&o[p].end.row==i.end.row;)p--;for(o=o.slice(f,p+1),f=0,p=o.length;f=v;w--)if(r(w,Number.MAX_VALUE,h))return;if(e.wrap!=0){for(w=$,v=g.row;w>=v;w--)if(r(w,Number.MAX_VALUE,h))return}}};else var y=function(h){var w=g.row;if(!r(w,g.column,h)){for(w+=1;w<=$;w++)if(r(w,0,h))return;if(e.wrap!=0){for(w=v,$=g.row;w<=$;w++)if(r(w,0,h))return}}};if(e.$isMultiLine)var p=i.length,r=function(h,w,u){var f=n?h-p+1:h;if(!(f<0)){var s=t.getLine(f),m=s.search(i[0]);if(!(!n&&mw)&&u(f,m,f+p-1,C))return!0}}};else if(n)var r=function(h,w,u){var f=t.getLine(h),s=[],m,b=0;for(i.lastIndex=0;m=i.exec(f);){var C=m[0].length;if(b=m.index,!C){if(b>=f.length)break;i.lastIndex=b+=1}if(m.index+C>w)break;s.push(m.index,C)}for(var A=s.length-1;A>=0;A-=2){var R=s[A-1],C=s[A];if(u(h,R,h,R+C))return!0}};else var r=function(h,w,u){var f=t.getLine(h),s,m;for(i.lastIndex=w;m=i.exec(f);){var b=m[0].length;if(s=m.index,u(h,s,h,s+b))return!0;if(!b&&(i.lastIndex=s+=1,s>=f.length))return!1}};return{forEach:y}}}).call(a.prototype),k.Search=a}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(L,k,N){function S(t,e){this.platform=e||(c.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(t),this.$singleCommand=!0}function x(t,e){S.call(this,t,e),this.$singleCommand=!1}var d=L("../lib/keys"),c=L("../lib/useragent"),a=d.KEY_MODS;x.prototype=S.prototype,(function(){function t(e){return typeof e=="object"&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,i){var n=e&&(typeof e=="string"?e:e.name);e=this.commands[n],i||delete this.commands[n];var o=this.commandKeyBinding;for(var l in o){var g=o[l];if(g==e)delete o[l];else if(Array.isArray(g)){var v=g.indexOf(e);v!=-1&&(g.splice(v,1),g.length==1&&(o[l]=g[0]))}}},this.bindKey=function(e,i,n){if(typeof e=="object"&&e&&(n==null&&(n=e.position),e=e[this.platform]),!!e){if(typeof i=="function")return this.addCommand({exec:i,bindKey:e,name:i.name||e});e.split("|").forEach(function(o){var l="";if(o.indexOf(" ")!=-1){var g=o.split(/\s+/);o=g.pop(),g.forEach(function(y){var p=this.parseKeys(y),r=a[p.hashId]+p.key;l+=(l?" ":"")+r,this._addCommandToBinding(l,"chainKeys")},this),l+=" "}var v=this.parseKeys(o),$=a[v.hashId]+v.key;this._addCommandToBinding(l+$,i,n)},this)}},this._addCommandToBinding=function(e,i,n){var o=this.commandKeyBinding,l;if(!i)delete o[e];else if(!o[e]||this.$singleCommand)o[e]=i;else{Array.isArray(o[e])?(l=o[e].indexOf(i))!=-1&&o[e].splice(l,1):o[e]=[o[e]],typeof n!="number"&&(n=t(i));var g=o[e];for(l=0;ln)break}g.splice(l,0,i)}},this.addCommands=function(e){e&&Object.keys(e).forEach(function(i){var n=e[i];if(n){if(typeof n=="string")return this.bindKey(n,i);typeof n=="function"&&(n={exec:n}),typeof n=="object"&&(n.name||(n.name=i),this.addCommand(n))}},this)},this.removeCommands=function(e){Object.keys(e).forEach(function(i){this.removeCommand(e[i])},this)},this.bindKeys=function(e){Object.keys(e).forEach(function(i){this.bindKey(i,e[i])},this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var i=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function($){return $}),n=i.pop(),o=d[n];if(d.FUNCTION_KEYS[o])n=d.FUNCTION_KEYS[o].toLowerCase();else{if(!i.length)return{key:n,hashId:-1};if(i.length==1&&i[0]=="shift")return{key:n.toUpperCase(),hashId:-1}}for(var l=0,g=i.length;g--;){var v=d.KEY_MODS[i[g]];if(v==null)return typeof console<"u",!1;l|=v}return{key:n,hashId:l}},this.findKeyCommand=function(e,i){var n=a[e]+i;return this.commandKeyBinding[n]},this.handleKeyboard=function(e,i,n,o){if(!(o<0)){var l=a[i]+n,g=this.commandKeyBinding[l];return e.$keyChain&&(e.$keyChain+=" "+l,g=this.commandKeyBinding[e.$keyChain]||g),g&&(g=="chainKeys"||g[g.length-1]=="chainKeys")?(e.$keyChain=e.$keyChain||l,{command:"null"}):(e.$keyChain&&(i&&i!=4||n.length!=1?(i==-1||o>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-l.length-1)),{command:g})}},this.getStatusText=function(e,i){return i.$keyChain||""}}).call(S.prototype),k.HashHandler=S,k.MultiHashHandler=x}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(L,k,N){var S=L("../lib/oop"),x=L("../keyboard/hash_handler").MultiHashHandler,d=L("../lib/event_emitter").EventEmitter,c=function(a,t){x.call(this,t,a),this.byName=this.commands,this.setDefaultHandler("exec",function(e){return e.command.exec(e.editor,e.args||{})})};S.inherits(c,x),(function(){S.implement(this,d),this.exec=function(a,t,e){if(Array.isArray(a)){for(var i=a.length;i--;)if(this.exec(a[i],t,e))return!0;return!1}if(typeof a=="string"&&(a=this.commands[a]),!a||t&&t.$readOnly&&!a.readOnly||this.$checkCommandState!=0&&a.isAvailable&&!a.isAvailable(t))return!1;var n={editor:t,command:a,args:e};return n.returnValue=this._emit("exec",n),this._signal("afterExec",n),n.returnValue!==!1},this.toggleRecording=function(a){if(!this.$inReplay)return a&&a._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=(function(t){this.macro.push([t.command,t.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},this.replay=function(a){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(a);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t=="string"?this.exec(t,a):this.exec(t[0],a,t[1])},this)}finally{this.$inReplay=!1}}},this.trimMacro=function(a){return a.map(function(t){return typeof t[0]!="string"&&(t[0]=t[0].name),t[1]||(t=t[0]),t})}}).call(c.prototype),k.CommandManager=c}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(L,k,N){function S(t,e){return{win:t,mac:e}}var x=L("../lib/lang"),d=L("../config"),c=L("../range").Range;k.commands=[{name:"showSettingsMenu",bindKey:S("Ctrl-,","Command-,"),exec:function(t){d.loadModule("ace/ext/settings_menu",function(e){e.init(t),t.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",bindKey:S("Alt-E","F4"),exec:function(t){d.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",bindKey:S("Alt-Shift-E","Shift-F4"),exec:function(t){d.loadModule("./ext/error_marker",function(e){e.showErrorMarker(t,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:S("Ctrl-A","Command-A"),exec:function(t){t.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:S(null,"Ctrl-L"),exec:function(t){t.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:S("Ctrl-L","Command-L"),exec:function(t,e){typeof e=="number"&&!isNaN(e)&&t.gotoLine(e),t.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:S("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(t){t.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:S("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(t){t.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",bindKey:S("F2","F2"),exec:function(t){t.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",bindKey:S("Alt-F2","Alt-F2"),exec:function(t){t.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:S(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:S(null,"Ctrl-Command-Option-0"),exec:function(t){t.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:S("Alt-0","Command-Option-0"),exec:function(t){t.session.foldAll(),t.session.unfold(t.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:S("Alt-Shift-0","Command-Option-Shift-0"),exec:function(t){t.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:S("Ctrl-K","Command-G"),exec:function(t){t.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:S("Ctrl-Shift-K","Command-Shift-G"),exec:function(t){t.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:S("Alt-K","Ctrl-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:S("Alt-Shift-K","Ctrl-Shift-G"),exec:function(t){t.selection.isEmpty()?t.selection.selectWord():t.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:S("Ctrl-F","Command-F"),exec:function(t){d.loadModule("ace/ext/searchbox",function(e){e.Search(t)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(t){t.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:S("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(t){t.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:S("Ctrl-Home","Command-Home|Command-Up"),exec:function(t){t.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:S("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(t){t.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:S("Up","Up|Ctrl-P"),exec:function(t,e){t.navigateUp(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:S("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(t){t.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:S("Ctrl-End","Command-End|Command-Down"),exec:function(t){t.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:S("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(t){t.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:S("Down","Down|Ctrl-N"),exec:function(t,e){t.navigateDown(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:S("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(t){t.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:S("Ctrl-Left","Option-Left"),exec:function(t){t.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:S("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:S("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(t){t.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:S("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(t){t.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:S("Left","Left|Ctrl-B"),exec:function(t,e){t.navigateLeft(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:S("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(t){t.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:S("Ctrl-Right","Option-Right"),exec:function(t){t.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:S("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:S("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(t){t.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:S("Shift-Right","Shift-Right"),exec:function(t){t.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:S("Right","Right|Ctrl-F"),exec:function(t,e){t.navigateRight(e.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(t){t.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:S(null,"Option-PageDown"),exec:function(t){t.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:S("PageDown","PageDown|Ctrl-V"),exec:function(t){t.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(t){t.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:S(null,"Option-PageUp"),exec:function(t){t.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(t){t.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:S("Ctrl-Up",null),exec:function(t){t.renderer.scrollBy(0,-2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:S("Ctrl-Down",null),exec:function(t){t.renderer.scrollBy(0,2*t.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(t){t.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(t){t.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:S("Ctrl-Alt-E","Command-Option-E"),exec:function(t){t.commands.toggleRecording(t)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:S("Ctrl-Shift-E","Command-Shift-E"),exec:function(t){t.commands.replay(t)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:S("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(t){t.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:S("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(t){t.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:S("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(t){t.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:S(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(t){},readOnly:!0},{name:"cut",description:"Cut",exec:function(t){var e=t.$copyWithEmptySelection&&t.selection.isEmpty(),i=e?t.selection.getLineRange():t.selection.getRange();t._emit("cut",i),i.isEmpty()||t.session.remove(i),t.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(t,e){t.$handlePaste(e)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:S("Ctrl-D","Command-D"),exec:function(t){t.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:S("Ctrl-Shift-D","Command-Shift-D"),exec:function(t){t.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:S("Ctrl-Alt-S","Command-Alt-S"),exec:function(t){t.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:S("Ctrl-/","Command-/"),exec:function(t){t.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:S("Ctrl-Shift-/","Command-Shift-/"),exec:function(t){t.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:S("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(t){t.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:S("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(t){t.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:S("Ctrl-H","Command-Option-F"),exec:function(t){d.loadModule("ace/ext/searchbox",function(e){e.Search(t,!0)})}},{name:"undo",description:"Undo",bindKey:S("Ctrl-Z","Command-Z"),exec:function(t){t.undo()}},{name:"redo",description:"Redo",bindKey:S("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(t){t.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:S("Alt-Shift-Up","Command-Option-Up"),exec:function(t){t.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:S("Alt-Up","Option-Up"),exec:function(t){t.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:S("Alt-Shift-Down","Command-Option-Down"),exec:function(t){t.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:S("Alt-Down","Option-Down"),exec:function(t){t.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:S("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(t){t.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:S("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(t){t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:S("Shift-Delete",null),exec:function(t){if(!t.selection.isEmpty())return!1;t.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:S("Alt-Backspace","Command-Backspace"),exec:function(t){t.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:S("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(t){t.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:S("Ctrl-Shift-Backspace",null),exec:function(t){var e=t.selection.getRange();e.start.column=0,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:S("Ctrl-Shift-Delete",null),exec:function(t){var e=t.selection.getRange();e.end.column=Number.MAX_VALUE,t.session.remove(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:S("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(t){t.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:S("Ctrl-Delete","Alt-Delete"),exec:function(t){t.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:S("Shift-Tab","Shift-Tab"),exec:function(t){t.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:S("Tab","Tab"),exec:function(t){t.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:S("Ctrl-[","Ctrl-["),exec:function(t){t.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:S("Ctrl-]","Ctrl-]"),exec:function(t){t.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(t,e){t.insert(e)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(t,e){t.insert(x.stringRepeat(e.text||"",e.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:S(null,"Ctrl-O"),exec:function(t){t.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:S("Alt-Shift-X","Ctrl-T"),exec:function(t){t.transposeLetters()},multiSelectAction:function(t){t.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:S("Ctrl-U","Ctrl-U"),exec:function(t){t.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:S("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(t){t.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:S(null,null),exec:function(t){t.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:S("Ctrl-Shift-L","Command-Shift-L"),exec:function(t){var e=t.selection.getRange();e.start.column=e.end.column=0,e.end.row++,t.selection.setRange(e,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"joinlines",description:"Join lines",bindKey:S(null,null),exec:function(t){for(var e=t.selection.isBackwards(),i=e?t.selection.getSelectionLead():t.selection.getSelectionAnchor(),n=e?t.selection.getSelectionAnchor():t.selection.getSelectionLead(),o=t.session.doc.getLine(i.row).length,l=t.session.doc.getTextRange(t.selection.getRange()),g=l.replace(/\n\s*/," ").length,v=t.session.doc.getLine(i.row),$=i.row+1;$<=n.row+1;$++){var y=x.stringTrimLeft(x.stringTrimRight(t.session.doc.getLine($)));y.length!==0&&(y=" "+y),v+=y}n.row+10?(t.selection.moveCursorTo(i.row,i.column),t.selection.selectTo(i.row,i.column+g)):(o=t.session.doc.getLine(i.row).length>o?o+1:o,t.selection.moveCursorTo(i.row,o))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:S(null,null),exec:function(t){var e=t.session.doc.getLength()-1,i=t.session.doc.getLine(e).length,n=t.selection.rangeList.ranges,o=[];n.length<1&&(n=[t.selection.getRange()]);for(var l=0;l=b.lastRow||m.end.row<=b.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}s=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}var C=this.selection.toJSON();this.curOp.selectionAfter=C,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(C),this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(u){if(this.$mergeUndoDeltas){var f=this.prevOp,s=this.$mergeableCommands,m=f.command&&u.command.name==f.command.name;if(u.command.name=="insertstring"){var b=u.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),m=m&&this.mergeNextCommand&&(!/\s/.test(b)||/\s/.test(f.args)),this.mergeNextCommand=!0}else m=m&&s.indexOf(u.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(m=!1),m?this.session.mergeUndoDeltas=!0:s.indexOf(u.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},this.setKeyboardHandler=function(u,f){if(u&&typeof u=="string"&&u!="ace"){this.$keybindingId=u;var s=this;y.loadModule(["keybinding",u],function(m){s.$keybindingId==u&&s.keyBinding.setKeyboardHandler(m&&m.handler),f&&f()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(u),f&&f()},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(u){if(this.session!=u){this.curOp&&this.endOperation(),this.curOp={};var f=this.session;if(f){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var s=this.session.getSelection();s.off("changeCursor",this.$onCursorChange),s.off("changeSelection",this.$onSelectionChange)}this.session=u,u?(this.$onDocumentChange=this.onDocumentChange.bind(this),u.on("change",this.$onDocumentChange),this.renderer.setSession(u),this.$onChangeMode=this.onChangeMode.bind(this),u.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),u.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),u.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),u.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),u.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),u.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=u.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(u)),this._signal("changeSession",{session:u,oldSession:f}),this.curOp=null,f&&f._signal("changeEditor",{oldEditor:this}),u&&u._signal("changeEditor",{editor:this}),u&&u.bgTokenizer&&u.bgTokenizer.scheduleStart()}},this.getSession=function(){return this.session},this.setValue=function(u,f){return this.session.doc.setValue(u),f?f==1?this.navigateFileEnd():f==-1&&this.navigateFileStart():this.selectAll(),u},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(u){this.renderer.onResize(u)},this.setTheme=function(u,f){this.renderer.setTheme(u,f)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(u){this.renderer.setStyle(u)},this.unsetStyle=function(u){this.renderer.unsetStyle(u)},this.getFontSize=function(){return this.getOption("fontSize")||x.computedStyle(this.container).fontSize},this.setFontSize=function(u){this.setOption("fontSize",u)},this.$highlightBrackets=function(){if(!this.$highlightPending){var u=this;this.$highlightPending=!0,setTimeout(function(){u.$highlightPending=!1;var f=u.session;if(!(!f||!f.bgTokenizer)){f.$bracketHighlight&&(f.$bracketHighlight.markerIds.forEach(function(b){f.removeMarker(b)}),f.$bracketHighlight=null);var s=f.getMatchingBracketRanges(u.getCursorPosition());if(!s&&f.$mode.getMatching&&(s=f.$mode.getMatching(u.session)),!!s){var m="ace_bracket";Array.isArray(s)?s.length==1&&(m="ace_error_bracket"):s=[s],s.length==2&&(l.comparePoints(s[0].end,s[1].start)==0?s=[l.fromPoints(s[0].start,s[1].end)]:l.comparePoints(s[0].start,s[1].end)==0&&(s=[l.fromPoints(s[1].start,s[0].end)])),f.$bracketHighlight={ranges:s,markerIds:s.map(function(b){return f.addMarker(b,m,"text")})}}}},50)}},this.$highlightTags=function(){if(!this.$highlightTagPending){var u=this;this.$highlightTagPending=!0,setTimeout(function(){u.$highlightTagPending=!1;var f=u.session;if(!(!f||!f.bgTokenizer)){var s=u.getCursorPosition(),m=new p(u.session,s.row,s.column),b=m.getCurrentToken();if(!b||!/\b(?:tag-open|tag-name)/.test(b.type)){f.removeMarker(f.$tagHighlight),f.$tagHighlight=null;return}if(!(b.type.indexOf("tag-open")!==-1&&(b=m.stepForward(),!b))){var C=b.value,A=b.value,R=0,E=m.stepBackward();if(E.value==="<")do E=b,b=m.stepForward(),b&&(b.type.indexOf("tag-name")!==-1?(A=b.value,C===A&&(E.value==="<"?R++:E.value===""&&R--);while(b&&R>=0);else{do if(b=E,E=m.stepBackward(),b){if(b.type.indexOf("tag-name")!==-1)C===b.value&&(E.value==="<"?R++:E.value===""){for(var I=0,T=E;T;){if(T.type.indexOf("tag-name")!==-1&&T.value===C){R--;break}if(T.value==="<")break;T=m.stepBackward(),I++}for(var _=0;_1)&&(f=!1)),u.$highlightLineMarker&&!f)u.removeMarker(u.$highlightLineMarker.id),u.$highlightLineMarker=null;else if(!u.$highlightLineMarker&&f){var s=new l(f.row,f.column,f.row,1/0);s.id=u.addMarker(s,"ace_active-line","screenLine"),u.$highlightLineMarker=s}else f&&(u.$highlightLineMarker.start.row=f.row,u.$highlightLineMarker.end.row=f.row,u.$highlightLineMarker.start.column=f.column,u._signal("changeBackMarker"))},this.onSelectionChange=function(u){var f=this.session;if(f.$selectionMarker&&f.removeMarker(f.$selectionMarker),f.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var s=this.selection.getRange(),m=this.getSelectionStyle();f.$selectionMarker=f.addMarker(s,"ace_selection",m)}var b=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(b),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var u=this.session,f=this.getSelectionRange();if(!(f.isEmpty()||f.isMultiLine())){var s=f.start.column,m=f.end.column,b=u.getLine(f.start.row),C=b.substring(s,m);if(!(C.length>5e3||!/[\w\d]/.test(C))){var A=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:C}),R=b.substring(s-1,m+1);if(A.test(R))return A}}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(u){this.renderer.updateText(),this._emit("changeMode",u)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.getCopyText=function(){var u=this.getSelectedText(),f=this.session.doc.getNewLineCharacter(),s=!1;if(!u&&this.$copyWithEmptySelection){s=!0;for(var m=this.selection.getAllRanges(),b=0;bT.search(/\S|$/)){var R=T.substr(b.column).search(/\S|$/);s.doc.removeInLine(b.row,b.column,b.column+R)}}this.clearSelection();var E=b.column,I=s.getState(b.row),T=s.getLine(b.row),_=m.checkOutdent(I,T,u);if(s.insert(b,u),C&&C.selection&&(C.selection.length==2?this.selection.setSelectionRange(new l(b.row,E+C.selection[0],b.row,E+C.selection[1])):this.selection.setSelectionRange(new l(b.row+C.selection[0],C.selection[1],b.row+C.selection[2],C.selection[3]))),this.$enableAutoIndent){if(s.getDocument().isNewLine(u)){var M=m.getNextLineIndent(I,T.slice(0,b.column),s.getTabString());s.insert({row:b.row+1,column:0},M)}_&&m.autoOutdent(I,s,b.row)}},this.autoIndent=function(){var u=this.session,f=u.getMode(),s,m;if(this.selection.isEmpty())s=0,m=u.doc.getLength()-1;else{var b=this.getSelectionRange();s=b.start.row,m=b.end.row}for(var C="",A="",R="",E,I,T,_=u.getTabString(),M=s;M<=m;M++)M>0&&(C=u.getState(M-1),A=u.getLine(M-1),R=f.getNextLineIndent(C,A,_)),E=u.getLine(M),I=f.$getIndent(E),R!==I&&(I.length>0&&(T=new l(M,0,M,I.length),u.remove(T)),R.length>0&&u.insert({row:M,column:0},R)),f.autoOutdent(C,u,M)},this.onTextInput=function(u,f){if(!f)return this.keyBinding.onTextInput(u);this.startOperation({command:{name:"insertstring"}});var s=this.applyComposition.bind(this,u,f);this.selection.rangeCount?this.forEachSelection(s):s(),this.endOperation()},this.applyComposition=function(u,f){if(f.extendLeft||f.extendRight){var s=this.selection.getRange();s.start.column-=f.extendLeft,s.end.column+=f.extendRight,s.start.column<0&&(s.start.row--,s.start.column+=this.session.getLine(s.start.row).length+1),this.selection.setRange(s),!u&&!s.isEmpty()&&this.remove()}if((u||!this.selection.isEmpty())&&this.insert(u,!0),f.restoreStart||f.restoreEnd){var s=this.selection.getRange();s.start.column-=f.restoreStart,s.end.column-=f.restoreEnd,this.selection.setRange(s)}},this.onCommandKey=function(u,f,s){return this.keyBinding.onCommandKey(u,f,s)},this.setOverwrite=function(u){this.session.setOverwrite(u)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(u){this.setOption("scrollSpeed",u)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(u){this.setOption("dragDelay",u)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(u){this.setOption("selectionStyle",u)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(u){this.setOption("highlightActiveLine",u)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(u){this.setOption("highlightGutterLine",u)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(u){this.setOption("highlightSelectedWord",u)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(u){this.renderer.setAnimatedScroll(u)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(u){this.renderer.setShowInvisibles(u)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(u){this.renderer.setDisplayIndentGuides(u)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(u){this.renderer.setShowPrintMargin(u)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(u){this.renderer.setPrintMarginColumn(u)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(u){this.setOption("readOnly",u)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(u){this.setOption("behavioursEnabled",u)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(u){this.setOption("wrapBehavioursEnabled",u)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(u){this.setOption("showFoldWidgets",u)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(u){this.setOption("fadeFoldWidgets",u)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(u){this.selection.isEmpty()&&(u=="left"?this.selection.selectLeft():this.selection.selectRight());var f=this.getSelectionRange();if(this.getBehavioursEnabled()){var s=this.session,m=s.getState(f.start.row),b=s.getMode().transformAction(m,"deletion",this,s,f);if(f.end.column===0){var C=s.getTextRange(f);if(C[C.length-1]=="\n"){var A=s.getLine(f.end.row);/^\s+$/.test(A)&&(f.end.column=A.length)}}b&&(f=b)}this.session.remove(f),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var u=this.getSelectionRange();u.start.column==u.end.column&&u.start.row==u.end.row&&(u.end.column=0,u.end.row++),this.session.remove(u),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var u=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(u)},this.transposeLetters=function(){if(this.selection.isEmpty()){var u=this.getCursorPosition(),f=u.column;if(f!==0){var s=this.session.getLine(u.row),m,b;fR.toLowerCase()?1:0});for(var b=new l(0,0,0,0),m=u.first;m<=u.last;m++){var C=f.getLine(m);b.start.row=m,b.end.row=m,b.end.column=C.length,f.replace(b,s[m-u.first])}},this.toggleCommentLines=function(){var u=this.session.getState(this.getCursorPosition().row),f=this.$getSelectedRows();this.session.getMode().toggleCommentLines(u,this.session,f.first,f.last)},this.toggleBlockComment=function(){var u=this.getCursorPosition(),f=this.session.getState(u.row),s=this.getSelectionRange();this.session.getMode().toggleBlockComment(f,this.session,s,u)},this.getNumberAt=function(u,f){var s=/[\-]?[0-9]+(?:\.[0-9]+)?/g;s.lastIndex=0;for(var m=this.session.getLine(u);s.lastIndex=f){var C={value:b[0],start:b.index,end:b.index+b[0].length};return C}}return null},this.modifyNumber=function(u){var f=this.selection.getCursor().row,s=this.selection.getCursor().column,m=new l(f,s-1,f,s),b=this.session.getTextRange(m);if(!isNaN(parseFloat(b))&&isFinite(b)){var C=this.getNumberAt(f,s);if(C){var A=C.value.indexOf(".")>=0?C.start+C.value.indexOf(".")+1:C.end,R=C.start+C.value.length-A,E=parseFloat(C.value);E*=Math.pow(10,R),A!==C.end&&s=A&&C<=R&&(s=B,E.selection.clearSelection(),E.moveCursorTo(u,A+m),E.selection.selectTo(u,R+m)),A=R});for(var I=this.$toggleWordPairs,T,_=0;_O+1)break;O=D.last}for(T--,R=this.session.$moveLines(M,O,f?0:u),f&&u==-1&&(_=T+1);_<=T;)A[_].moveBy(R,0),_++;f||(R=0),E+=R}b.fromOrientedRange(b.ranges[0]),b.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(u){return u=(u||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(u.start.row),last:this.session.getRowFoldEnd(u.end.row)}},this.onCompositionStart=function(u){this.renderer.showComposition(u)},this.onCompositionUpdate=function(u){this.renderer.setCompositionText(u)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(u){return u>=this.getFirstVisibleRow()&&u<=this.getLastVisibleRow()},this.isRowFullyVisible=function(u){return u>=this.renderer.getFirstFullyVisibleRow()&&u<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(u,f){var s=this.renderer,m=this.renderer.layerConfig,b=u*Math.floor(m.height/m.lineHeight);f===!0?this.selection.$moveSelection(function(){this.moveCursorBy(b,0)}):f===!1&&(this.selection.moveCursorBy(b,0),this.selection.clearSelection());var C=s.scrollTop;s.scrollBy(0,b*m.lineHeight),f!=null&&s.scrollCursorIntoView(null,.5),s.animateScrolling(C)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(u){this.renderer.scrollToRow(u)},this.scrollToLine=function(u,f,s,m){this.renderer.scrollToLine(u,f,s,m)},this.centerSelection=function(){var u=this.getSelectionRange(),f={row:Math.floor(u.start.row+(u.end.row-u.start.row)/2),column:Math.floor(u.start.column+(u.end.column-u.start.column)/2)};this.renderer.alignCursor(f,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(u,f){this.selection.moveCursorTo(u,f)},this.moveCursorToPosition=function(u){this.selection.moveCursorToPosition(u)},this.jumpToMatching=function(u,f){var s=this.getCursorPosition(),m=new p(this.session,s.row,s.column),b=m.getCurrentToken(),C=b||m.stepForward();if(C){var A,R=!1,E={},I=s.column-C.start,T,_={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(C.value.match(/[{}()\[\]]/g)){for(;I=0;--C)this.$tryReplace(s[C],u)&&m++;return this.selection.setSelectionRange(b),m},this.$tryReplace=function(u,f){var s=this.session.getTextRange(u);return f=this.$search.replace(s,f),f!==null?(u.end=this.session.replace(u,f),u):null},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(u,f,s){f||(f={}),typeof u=="string"||u instanceof RegExp?f.needle=u:typeof u=="object"&&S.mixin(f,u);var m=this.selection.getRange();f.needle==null&&(u=this.session.getTextRange(m)||this.$search.$options.needle,u||(m=this.session.getWordRange(m.start.row,m.start.column),u=this.session.getTextRange(m)),this.$search.set({needle:u})),this.$search.set(f),f.start||this.$search.set({start:m});var b=this.$search.find(this.session);if(f.preventScroll)return b;if(b)return this.revealRange(b,s),b;f.backwards?m.start=m.end:m.end=m.start,this.selection.setRange(m)},this.findNext=function(u,f){this.find({skipCurrent:!0,backwards:!1},u,f)},this.findPrevious=function(u,f){this.find(u,{skipCurrent:!0,backwards:!0},f)},this.revealRange=function(u,f){this.session.unfold(u),this.selection.setSelectionRange(u);var s=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(u.start,u.end,.5),f!==!1&&this.renderer.animateScrolling(s)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(u){u.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},this.setAutoScrollEditorIntoView=function(u){if(u){var f,s=this,m=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var b=this.$scrollAnchor;b.style.cssText="position:absolute",this.container.insertBefore(b,this.container.firstChild);var C=this.on("changeSelection",function(){m=!0}),A=this.renderer.on("beforeRender",function(){m&&(f=s.renderer.container.getBoundingClientRect())}),R=this.renderer.on("afterRender",function(){if(m&&f&&(s.isFocused()||s.searchBox&&s.searchBox.isFocused())){var E=s.renderer,I=E.$cursorLayer.$pixelPos,T=E.layerConfig,_=I.top-T.offset;I.top>=0&&_+f.top<0?m=!0:I.topwindow.innerHeight?m=!1:m=null,m!=null&&(b.style.top=_+"px",b.style.left=I.left+"px",b.style.height=T.lineHeight+"px",b.scrollIntoView(m)),m=f=null}});this.setAutoScrollEditorIntoView=function(E){E||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",C),this.renderer.off("afterRender",R),this.renderer.off("beforeRender",A))}}},this.$resetCursorStyle=function(){var u=this.$cursorStyle||"ace",f=this.renderer.$cursorLayer;f&&(f.setSmoothBlinking(/smooth/.test(u)),f.isBlinking=!this.$readOnly&&u!="wide",x.setCssClass(f.element,"ace_slim-cursors",/slim/.test(u)))},this.prompt=function(u,f,s){var m=this;y.loadModule("./ext/prompt",function(b){b.prompt(m,u,f,s)})}}).call(h.prototype),y.defineOptions(h.prototype,"editor",{selectionStyle:{set:function(u){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:u})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(u){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(u){this.textInput.setReadOnly(u),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(u){this.textInput.setCopyWithEmptySelection(u)},initialValue:!1},cursorStyle:{set:function(u){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(u){this.setAutoScrollEditorIntoView(u)}},keyboardHandler:{set:function(u){this.setKeyboardHandler(u)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(u){this.session.setValue(u)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(u){this.setSession(u)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(u){this.renderer.$gutterLayer.setShowLineNumbers(u),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),u&&this.$relativeLineNumbers?w.attach(this):w.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(u){this.$showLineNumbers&&u?w.attach(this):w.detach(this)}},placeholder:{set:function(u){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var f=this.session&&(this.renderer.$composition||this.getValue());if(f&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),x.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!f&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),x.addCssClass(this.container,"ace_hasPlaceholder");var s=x.createElement("div");s.className="ace_placeholder",s.textContent=this.$placeholder||"",this.renderer.placeholderNode=s,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!f&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var w={getText:function(u,f){return(Math.abs(u.selection.lead.row-f)||f+1+(f<9?"·":""))+""},getWidth:function(u,f,s){return Math.max(f.toString().length,(s.lastRow+1).toString().length,2)*s.characterWidth},update:function(u,f){f.renderer.$loop.schedule(f.renderer.CHANGE_GUTTER)},attach:function(u){u.renderer.$gutterLayer.$renderer=this,u.on("changeSelection",this.update),this.update(null,u)},detach:function(u){u.renderer.$gutterLayer.$renderer==this&&(u.renderer.$gutterLayer.$renderer=null),u.off("changeSelection",this.update),this.update(null,u)}};k.Editor=h}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(L,k,N){function S(r,h){for(var w=h;w--;){var u=r[w];if(u&&!u[0].ignore){for(;w"+r.end.row+":"+r.end.column}function t(r,h){var w=r.action=="insert",u=h.action=="insert";if(w&&u)if(p(h.start,r.end)>=0)n(h,r,-1);else{if(!(p(h.start,r.start)<=0))return null;n(r,h,1)}else if(w&&!u)if(p(h.start,r.end)>=0)n(h,r,-1);else{if(!(p(h.end,r.start)<=0))return null;n(r,h,-1)}else if(!w&&u)if(p(h.start,r.start)>=0)n(h,r,1);else{if(!(p(h.start,r.start)<=0))return null;n(r,h,1)}else if(!w&&!u)if(p(h.start,r.start)>=0)n(h,r,1);else{if(!(p(h.end,r.start)<=0))return null;n(r,h,-1)}return[h,r]}function e(r,h){for(var w=r.length;w--;)for(var u=0;u=0?n(r,h,-1):(p(r.start,h.start)<=0||n(r,y.fromPoints(h.start,r.start),-1),n(h,r,1));else if(!w&&u)p(h.start,r.end)>=0?n(h,r,-1):(p(h.start,r.start)<=0||n(h,y.fromPoints(r.start,h.start),-1),n(r,h,1));else if(!w&&!u)if(p(h.start,r.end)>=0)n(h,r,-1);else{if(!(p(h.end,r.start)<=0)){var f,s;return p(r.start,h.start)<0&&(f=r,r=l(r,h.start)),p(r.end,h.end)>0&&(s=l(r,h.end)),o(h.end,r.start,r.end,-1),s&&!f&&(r.lines=s.lines,r.start=s.start,r.end=s.end,s=r),[h,f,s].filter(Boolean)}n(r,h,-1)}return[h,r]}function n(r,h,w){o(r.start,h.start,h.end,w),o(r.end,h.start,h.end,w)}function o(r,h,w,u){r.row==(u==1?h:w).row&&(r.column+=u*(w.column-h.column)),r.row+=u*(w.row-h.row)}function l(r,h){var w=r.lines,u=r.end;r.end=x(h);var f=r.end.row-r.start.row,s=w.splice(f,w.length),m=f?h.column:h.column-r.start.column;w.push(s[0].substring(0,m)),s[0]=s[0].substr(m);var b={start:x(h),end:u,lines:s,action:r.action};return b}function g(r,h){h=d(h);for(var w=r.length;w--;){for(var u=r[w],f=0;f0},this.canRedo=function(){return this.$redoStack.length>0},this.bookmark=function(r){r==null&&(r=this.$rev),this.mark=r},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(r){return r?c(r):c(this.$undoStack)+"\n---\n"+c(this.$redoStack)}}).call($.prototype);var y=L("./range").Range,p=y.comparePoints;y.comparePoints,k.UndoManager=$}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(L,k,N){var S=L("../lib/dom"),x=function(d,c){this.element=d,this.canvasHeight=c||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0};(function(){this.moveContainer=function(d){S.translate(this.element,0,-(d.firstRowScreen*d.lineHeight%this.canvasHeight)-d.offset*this.$offsetCoefficient)},this.pageChanged=function(d,c){return Math.floor(d.firstRowScreen*d.lineHeight/this.canvasHeight)!==Math.floor(c.firstRowScreen*c.lineHeight/this.canvasHeight)},this.computeLineTop=function(d,c,a){var t=c.firstRowScreen*c.lineHeight,e=Math.floor(t/this.canvasHeight),i=a.documentToScreenRow(d,0)*c.lineHeight;return i-e*this.canvasHeight},this.computeLineHeight=function(d,c,a){return c.lineHeight*a.getRowLineCount(d)},this.getLength=function(){return this.cells.length},this.get=function(d){return this.cells[d]},this.shift=function(){this.$cacheCell(this.cells.shift())},this.pop=function(){this.$cacheCell(this.cells.pop())},this.push=function(d){if(Array.isArray(d)){this.cells.push.apply(this.cells,d);for(var c=S.createFragment(this.element),a=0;av&&(p=g.end.row+1,g=n.getNextFoldLine(p,g),v=g?g.start.row:1/0),p>l){for(;this.$lines.getLength()>y+1;)this.$lines.pop();break}$=this.$lines.get(++y),$?$.row=p:($=this.$lines.createCell(p,i,this.session,S),this.$lines.push($)),this.$renderCell($,i,g,p),p++}this._signal("afterRender"),this.$updateGutterWidth(i)},this.$updateGutterWidth=function(i){var n=this.session,o=n.gutterRenderer||this.$renderer,l=n.$firstLineNumber,g=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||n.$useWrapMode)&&(g=n.getLength()+l-1);var v=o?o.getWidth(n,g,i):g.toString().length*i.characterWidth,$=this.$padding||this.$computePadding();v+=$.left+$.right,v!==this.gutterWidth&&!isNaN(v)&&(this.gutterWidth=v,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",v))},this.$updateCursorRow=function(){if(this.$highlightGutterLine){var i=this.session.selection.getCursor();this.$cursorRow!==i.row&&(this.$cursorRow=i.row)}},this.updateLineHighlight=function(){if(this.$highlightGutterLine){var i=this.session.selection.cursor.row;if(this.$cursorRow=i,!(this.$cursorCell&&this.$cursorCell.row==i)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var n=this.$lines.cells;this.$cursorCell=null;for(var o=0;o=this.$cursorRow){if(l.row>this.$cursorRow){var g=this.session.getFoldLine(this.$cursorRow);if(!(o>0&&g&&g.start.row==n[o-1].row))break;l=n[o-1]}l.element.className="ace_gutter-active-line "+l.element.className,this.$cursorCell=l;break}}}}},this.scrollLines=function(i){var n=this.config;if(this.config=i,this.$updateCursorRow(),this.$lines.pageChanged(n,i))return this.update(i);this.$lines.moveContainer(i);var o=Math.min(i.lastRow+i.gutterOffset,this.session.getLength()-1),l=this.oldLastRow;if(this.oldLastRow=o,!n||l0;g--)this.$lines.shift();if(l>o)for(var g=this.session.getFoldedRowCount(o+1,l);g>0;g--)this.$lines.pop();i.firstRowl&&this.$lines.push(this.$renderLines(i,l+1,o)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(i)},this.$renderLines=function(i,n,o){for(var l=[],g=n,v=this.session.getNextFoldLine(g),$=v?v.start.row:1/0;g>$&&(g=v.end.row+1,v=this.session.getNextFoldLine(g,v),$=v?v.start.row:1/0),!(g>o);){var y=this.$lines.createCell(g,i,this.session,S);this.$renderCell(y,i,v,g),l.push(y),g++}return l},this.$renderCell=function(i,n,o,l){var g=i.element,v=this.session,$=g.childNodes[0],y=g.childNodes[1],p=v.$firstLineNumber,r=v.$breakpoints,h=v.$decorations,w=v.gutterRenderer||this.$renderer,u=this.$showFoldWidgets&&v.foldWidgets,f=o?o.start.row:Number.MAX_VALUE,s="ace_gutter-cell ";if(this.$highlightGutterLine&&(l==this.$cursorRow||o&&l=f&&this.$cursorRow<=o.end.row)&&(s+="ace_gutter-active-line ",this.$cursorCell!=i&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=i)),r[l]&&(s+=r[l]),h[l]&&(s+=h[l]),this.$annotations[l]&&(s+=this.$annotations[l].className),g.className!=s&&(g.className=s),u){var m=u[l];m==null&&(m=u[l]=v.getFoldWidget(l))}if(m){var s="ace_fold-widget ace_"+m;m=="start"&&l==f&&lo.right-n.right)return"foldWidgets"}}).call(e.prototype),k.Gutter=e}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(L,k,N){var S=L("../range").Range,x=L("../lib/dom"),d=function(c){this.element=x.createElement("div"),this.element.className="ace_layer ace_marker-layer",c.appendChild(this.element)};(function(){function c(a,t,e,i){return(a?1:0)|(t?2:0)|(e?4:0)|(i?8:0)}this.$padding=0,this.setPadding=function(a){this.$padding=a},this.setSession=function(a){this.session=a},this.setMarkers=function(a){this.markers=a},this.elt=function(a,t){var e=this.i!=-1&&this.element.childNodes[this.i];e?this.i++:(e=document.createElement("div"),this.element.appendChild(e),this.i=-1),e.style.cssText=t,e.className=a},this.update=function(a){if(a){this.config=a,this.i=0;var t;for(var e in this.markers){var i=this.markers[e];if(!i.range){i.update(t,this,this.session,a);continue}var n=i.range.clipRows(a.firstRow,a.lastRow);if(!n.isEmpty())if(n=n.toScreenRange(this.session),i.renderer){var o=this.$getTop(n.start.row,a),l=this.$padding+n.start.column*a.characterWidth;i.renderer(t,n,l,o,a)}else i.type=="fullLine"?this.drawFullLineMarker(t,n,i.clazz,a):i.type=="screenLine"?this.drawScreenLineMarker(t,n,i.clazz,a):n.isMultiLine()?i.type=="text"?this.drawTextMarker(t,n,i.clazz,a):this.drawMultiLineMarker(t,n,i.clazz,a):this.drawSingleLineMarker(t,n,i.clazz+" ace_start ace_br15",a)}if(this.i!=-1)for(;this.ip,v==g),i,v==g?0:1,n)},this.drawMultiLineMarker=function(a,t,e,i,n){var o=this.$padding,l=i.lineHeight,g=this.$getTop(t.start.row,i),v=o+t.start.column*i.characterWidth;if(n=n||"",this.session.$bidiHandler.isBidiRow(t.start.row)){var $=t.clone();$.end.row=$.start.row,$.end.column=this.session.getLine($.start.row).length,this.drawBidiSingleLineMarker(a,$,e+" ace_br1 ace_start",i,null,n)}else this.elt(e+" ace_br1 ace_start","height:"+l+"px;right:0;top:"+g+"px;left:"+v+"px;"+(n||""));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var $=t.clone();$.start.row=$.end.row,$.start.column=0,this.drawBidiSingleLineMarker(a,$,e+" ace_br12",i,null,n)}else{g=this.$getTop(t.end.row,i);var y=t.end.column*i.characterWidth;this.elt(e+" ace_br12","height:"+l+"px;width:"+y+"px;top:"+g+"px;left:"+o+"px;"+(n||""))}if(l=(t.end.row-t.start.row-1)*i.lineHeight,!(l<=0)){g=this.$getTop(t.start.row+1,i);var p=(t.start.column?1:0)|(t.end.column?0:8);this.elt(e+(p?" ace_br"+p:""),"height:"+l+"px;right:0;top:"+g+"px;left:"+o+"px;"+(n||""))}},this.drawSingleLineMarker=function(a,t,e,i,n,o){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(a,t,e,i,n,o);var l=i.lineHeight,g=(t.end.column+(n||0)-t.start.column)*i.characterWidth,v=this.$getTop(t.start.row,i),$=this.$padding+t.start.column*i.characterWidth;this.elt(e,"height:"+l+"px;width:"+g+"px;top:"+v+"px;left:"+$+"px;"+(o||""))},this.drawBidiSingleLineMarker=function(a,t,e,i,n,o){var l=i.lineHeight,g=this.$getTop(t.start.row,i),v=this.$padding,$=this.session.$bidiHandler.getSelections(t.start.column,t.end.column);$.forEach(function(y){this.elt(e,"height:"+l+"px;width:"+y.width+(n||0)+"px;top:"+g+"px;left:"+(v+y.left)+"px;"+(o||""))},this)},this.drawFullLineMarker=function(a,t,e,i,n){var o=this.$getTop(t.start.row,i),l=i.lineHeight;t.start.row!=t.end.row&&(l+=this.$getTop(t.end.row,i)-o),this.elt(e,"height:"+l+"px;top:"+o+"px;left:0;right:0;"+(n||""))},this.drawScreenLineMarker=function(a,t,e,i,n){var o=this.$getTop(t.start.row,i),l=i.lineHeight;this.elt(e,"height:"+l+"px;top:"+o+"px;left:0;right:0;"+(n||""))}}).call(d.prototype),k.Marker=d}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],function(L,k,N){var S=L("../lib/oop"),x=L("../lib/dom"),d=L("../lib/lang"),c=L("./lines").Lines,a=L("../lib/event_emitter").EventEmitter,t=function(e){this.dom=x,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new c(this.element)};(function(){S.implement(this,a),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e=this.session.doc,i=e.getNewLineCharacter()=="\n"&&e.getNewLineMode()!="windows",n=i?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=n)return this.EOL_CHAR=n,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",(function(i){this._signal("changeCharacterSize",i)}).bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){this.session=e,e&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,typeof e=="string"?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var i=this.$tabStrings=[0],n=1;nr&&(y=p.end.row+1,p=this.session.getNextFoldLine(y,p),r=p?p.start.row:1/0),!(y>l);){var h=g[v++];if(h){this.dom.removeChildren(h),this.$renderLine(h,y,y==r?p:!1),$&&(h.style.top=this.$lines.computeLineTop(y,e,this.session)+"px");var w=e.lineHeight*this.session.getRowLength(y)+"px";h.style.height!=w&&($=!0,h.style.height=w)}y++}if($)for(;v0;l--)this.$lines.shift();if(i.lastRow>e.lastRow)for(var l=this.session.getFoldedRowCount(e.lastRow+1,i.lastRow);l>0;l--)this.$lines.pop();e.firstRowi.lastRow&&this.$lines.push(this.$renderLinesFragment(e,i.lastRow+1,e.lastRow))},this.$renderLinesFragment=function(e,i,n){for(var o=[],l=i,g=this.session.getNextFoldLine(l),v=g?g.start.row:1/0;l>v&&(l=g.end.row+1,g=this.session.getNextFoldLine(l,g),v=g?g.start.row:1/0),!(l>n);){var $=this.$lines.createCell(l,e,this.session),y=$.element;this.dom.removeChildren(y),x.setStyle(y.style,"height",this.$lines.computeLineHeight(l,e,this.session)+"px"),x.setStyle(y.style,"top",this.$lines.computeLineTop(l,e,this.session)+"px"),this.$renderLine(y,l,l==v?g:!1),this.$useLineGroups()?y.className="ace_line_group":y.className="ace_line",o.push($),l++}return o},this.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var i=e.firstRow,n=e.lastRow,o=this.$lines;o.getLength();)o.pop();o.push(this.$renderLinesFragment(e,i,n))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,i,n,o){for(var l=this,g=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,v=this.dom.createFragment(this.element),$,y=0;$=g.exec(o);){var p=$[1],r=$[2],h=$[3],w=$[4],u=$[5];if(!(!l.showSpaces&&r)){var f=y!=$.index?o.slice(y,$.index):"";if(y=$.index+$[0].length,f&&v.appendChild(this.dom.createTextNode(f,this.element)),p){var s=l.session.getScreenTabSize(i+$.index);v.appendChild(l.$tabStrings[s].cloneNode(!0)),i+=s-1}else if(r)if(l.showSpaces){var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_space",m.textContent=d.stringRepeat(l.SPACE_CHAR,r.length),v.appendChild(m)}else v.appendChild(this.com.createTextNode(r,this.element));else if(h){var m=this.dom.createElement("span");m.className="ace_invisible ace_invisible_space ace_invalid",m.textContent=d.stringRepeat(l.SPACE_CHAR,h.length),v.appendChild(m)}else if(w){i+=1;var m=this.dom.createElement("span");m.style.width=l.config.characterWidth*2+"px",m.className=l.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",m.textContent=l.showSpaces?l.SPACE_CHAR:w,v.appendChild(m)}else if(u){i+=1;var m=this.dom.createElement("span");m.style.width=l.config.characterWidth*2+"px",m.className="ace_cjk",m.textContent=u,v.appendChild(m)}}}if(v.appendChild(this.dom.createTextNode(y?o.slice(y):o,this.element)),this.$textToken[n.type])e.appendChild(v);else{var b="ace_"+n.type.replace(/\./g," ace_"),m=this.dom.createElement("span");n.type=="fold"&&(m.style.width=n.value.length*this.config.characterWidth+"px"),m.className=b,m.appendChild(v),e.appendChild(m)}return i+o.length},this.renderIndentGuide=function(e,i,n){var o=i.search(this.$indentGuideRe);if(o<=0||o>=n)return i;if(i[0]==" "){o-=o%this.tabSize;for(var l=o/this.tabSize,g=0;g=g;)v=this.$renderToken($,v,p,r.substring(0,g-o)),r=r.substring(g-o),o=g,$=this.$createLineElement(),e.appendChild($),$.appendChild(this.dom.createTextNode(d.stringRepeat(" ",n.indent),this.element)),l++,v=0,g=n[l]||Number.MAX_VALUE;r.length!=0&&(o+=r.length,v=this.$renderToken($,v,p,r))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage($,v,null,"",!0)},this.$renderSimpleLine=function(e,i){var n=0,o=i[0],l=o.value;this.displayIndentGuides&&(l=this.renderIndentGuide(e,l)),l&&(n=this.$renderToken(e,n,o,l));for(var g=1;gthis.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,o,l);n=this.$renderToken(e,n,o,l)}},this.$renderOverflowMessage=function(e,i,n,o,l){n&&this.$renderToken(e,i,n,o.slice(0,this.MAX_LINE_LENGTH-i));var g=this.dom.createElement("span");g.className="ace_inline_button ace_keyword ace_toggle_wrap",g.textContent=l?"":"",e.appendChild(g)},this.$renderLine=function(e,i,n){if(!n&&n!=0&&(n=this.session.getFoldLine(i)),n)var o=this.$getFoldLineTokens(i,n);else var o=this.session.getTokens(i);var l=e;if(o.length){var g=this.session.getRowSplitData(i);if(g&&g.length){this.$renderWrappedLine(e,o,g);var l=e.lastChild}else{var l=e;this.$useLineGroups()&&(l=this.$createLineElement(),e.appendChild(l)),this.$renderSimpleLine(l,o)}}else this.$useLineGroups()&&(l=this.$createLineElement(),e.appendChild(l));if(this.showEOL&&l){n&&(i=n.end.row);var v=this.dom.createElement("span");v.className="ace_invisible ace_invisible_eol",v.textContent=i==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,l.appendChild(v)}},this.$getFoldLineTokens=function(e,i){function n(v,$,y){for(var p=0,r=0;r+v[p].value.length<$;)if(r+=v[p].value.length,p++,p==v.length)return;if(r!=$){var h=v[p].value.substring($-r);h.length>y-$&&(h=h.substring(0,y-$)),l.push({type:v[p].type,value:h}),r=$+h.length,p+=1}for(;ry?l.push({type:v[p].type,value:h.substring(0,y-r)}):l.push(v[p]),r+=h.length,p+=1}}var o=this.session,l=[],g=o.getTokens(e);return i.walk(function(v,$,y,p,r){v!=null?l.push({type:"fold",value:v}):(r&&(g=o.getTokens($)),g.length&&n(g,p,y))},i.end.row,this.session.getLine(i.end.row).length),l},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(t.prototype),k.Text=t}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(L,k,N){var S=L("../lib/dom"),x=function(d){this.element=S.createElement("div"),this.element.className="ace_layer ace_cursor-layer",d.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),S.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)};(function(){this.$updateOpacity=function(d){for(var c=this.cursors,a=c.length;a--;)S.setStyle(c[a].style,"opacity",d?"":"0")},this.$startCssAnimation=function(){for(var d=this.cursors,c=d.length;c--;)d[c].style.animationDuration=this.blinkInterval+"ms";setTimeout((function(){S.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},this.$stopCssAnimation=function(){S.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(d){this.$padding=d},this.setSession=function(d){this.session=d},this.setBlinking=function(d){d!=this.isBlinking&&(this.isBlinking=d,this.restartTimer())},this.setBlinkInterval=function(d){d!=this.blinkInterval&&(this.blinkInterval=d,this.restartTimer())},this.setSmoothBlinking=function(d){d!=this.smoothBlinking&&(this.smoothBlinking=d,S.setCssClass(this.element,"ace_smooth-blinking",d),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var d=S.createElement("div");return d.className="ace_cursor",this.element.appendChild(d),this.cursors.push(d),d},this.removeCursor=function(){if(this.cursors.length>1){var d=this.cursors.pop();return d.parentNode.removeChild(d),d}},this.hideCursor=function(){this.isVisible=!1,S.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,S.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var d=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&S.removeCssClass(this.element,"ace_smooth-blinking"),d(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&setTimeout((function(){S.addCssClass(this.element,"ace_smooth-blinking")}).bind(this)),S.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var c=(function(){this.timeoutId=setTimeout(function(){d(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){d(!0),c()},this.blinkInterval),c()}},this.getPixelPosition=function(d,c){if(!this.config||!this.session)return{left:0,top:0};d||(d=this.session.selection.getCursor());var a=this.session.documentToScreenPosition(d),t=this.$padding+(this.session.$bidiHandler.isBidiRow(a.row,d.row)?this.session.$bidiHandler.getPosLeft(a.column):a.column*this.config.characterWidth),e=(a.row-(c?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:t,top:e}},this.isCursorInView=function(d,c){return d.top>=0&&d.topd.height+d.offset||i.top<0)&&a>1)){var n=this.cursors[t++]||this.addCursor(),o=n.style;this.drawCursor?this.drawCursor(n,i,d,c[a],this.session):this.isCursorInView(i,d)?(S.setStyle(o,"display","block"),S.translate(n,i.left,i.top),S.setStyle(o,"width",Math.round(d.characterWidth)+"px"),S.setStyle(o,"height",d.lineHeight+"px")):S.setStyle(o,"display","none")}}for(;this.cursors.length>t;)this.removeCursor();var l=this.session.getOverwrite();this.$setOverwrite(l),this.$pixelPos=i,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(d){d!=this.overwrite&&(this.overwrite=d,d?S.addCssClass(this.element,"ace_overwrite-cursors"):S.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(x.prototype),k.Cursor=x}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(L,k,N){var S=L("./lib/oop"),x=L("./lib/dom"),d=L("./lib/event"),c=L("./lib/event_emitter").EventEmitter,a=32768,t=function(n){this.element=x.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=x.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),n.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,d.addListener(this.element,"scroll",this.onScroll.bind(this)),d.addListener(this.element,"mousedown",d.preventDefault)};(function(){S.implement(this,c),this.setVisible=function(n){this.element.style.display=n?"":"none",this.isVisible=n,this.coeff=1}}).call(t.prototype);var e=function(n,o){t.call(this,n),this.scrollTop=0,this.scrollHeight=0,o.$scrollbarWidth=this.width=x.scrollbarWidth(n.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0};S.inherits(e,t),(function(){this.classSuffix="-v",this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var n=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-n)/(this.coeff-n)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(n){this.element.style.height=n+"px"},this.setInnerHeight=this.setScrollHeight=function(n){this.scrollHeight=n,n>a?(this.coeff=a/n,n=a):this.coeff!=1&&(this.coeff=1),this.inner.style.height=n+"px"},this.setScrollTop=function(n){this.scrollTop!=n&&(this.skipEvent=!0,this.scrollTop=n,this.element.scrollTop=n*this.coeff)}}).call(e.prototype);var i=function(n,o){t.call(this,n),this.scrollLeft=0,this.height=o.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"};S.inherits(i,t),(function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(n){this.element.style.width=n+"px"},this.setInnerWidth=function(n){this.inner.style.width=n+"px"},this.setScrollWidth=function(n){this.inner.style.width=n+"px"},this.setScrollLeft=function(n){this.scrollLeft!=n&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=n)}}).call(i.prototype),k.ScrollBar=e,k.ScrollBarV=e,k.ScrollBarH=i,k.VScrollBar=e,k.HScrollBar=i}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(L,k,N){var S=L("./lib/event"),x=function(d,c){this.onRender=d,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=c||window;var a=this;this._flush=function(t){a.pending=!1;var e=a.changes;if(e&&(S.blockIdle(100),a.changes=0,a.onRender(e)),a.changes){if(a.$recursionLimit--<0)return;a.schedule()}else a.$recursionLimit=2}};(function(){this.schedule=function(d){this.changes=this.changes|d,this.changes&&!this.pending&&(S.nextFrame(this._flush),this.pending=!0)},this.clear=function(d){var c=this.changes;return this.changes=0,c}}).call(x.prototype),k.RenderLoop=x}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(L,k,N){var S=L("../lib/oop"),x=L("../lib/dom"),d=L("../lib/lang"),c=L("../lib/event"),a=L("../lib/useragent"),t=L("../lib/event_emitter").EventEmitter,e=256,i=typeof ResizeObserver=="function",n=200,o=k.FontMetrics=function(l){this.el=x.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=x.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=x.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),l.appendChild(this.el),this.$measureNode.textContent=d.stringRepeat("X",e),this.$characterSize={width:0,height:0},i?this.$addObserver():this.checkForSizeChanges()};(function(){S.implement(this,t),this.$characterSize={width:0,height:0},this.$setMeasureNodeStyles=function(l,g){l.width=l.height="auto",l.left=l.top="0px",l.visibility="hidden",l.position="absolute",l.whiteSpace="pre",a.isIE<8?l["font-family"]="inherit":l.font="inherit",l.overflow=g?"hidden":"visible"},this.checkForSizeChanges=function(l){if(l===void 0&&(l=this.$measureSizes()),l&&(this.$characterSize.width!==l.width||this.$characterSize.height!==l.height)){this.$measureNode.style.fontWeight="bold";var g=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=l,this.charSizes=Object.create(null),this.allowBoldFonts=g&&g.width===l.width&&g.height===l.height,this._emit("changeCharacterSize",{data:l})}},this.$addObserver=function(){var l=this;this.$observer=new window.ResizeObserver(function(g){l.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var l=this;return this.$pollSizeChangesTimer=c.onIdle(function g(){l.checkForSizeChanges(),c.onIdle(g,500)},500)},this.setPolling=function(l){l?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(l){var g={height:(l||this.$measureNode).clientHeight,width:(l||this.$measureNode).clientWidth/e};return g.width===0||g.height===0?null:g},this.$measureCharWidth=function(l){this.$main.textContent=d.stringRepeat(l,e);var g=this.$main.getBoundingClientRect();return g.width/e},this.getCharacterWidth=function(l){var g=this.charSizes[l];return g===void 0&&(g=this.charSizes[l]=this.$measureCharWidth(l)/this.$characterSize.width),g},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function l(g){return!g||!g.parentElement?1:(window.getComputedStyle(g).zoom||1)*l(g.parentElement)},this.$initTransformMeasureNodes=function(){var l=function(g,v){return["div",{style:"position: absolute;top:"+g+"px;left:"+v+"px;"}]};this.els=x.buildDom([l(0,0),l(n,0),l(0,n),l(n,n)],this.el)},this.transformCoordinates=function(l,g){function v(_,M,O){var D=_[1]*M[0]-_[0]*M[1];return[(-M[1]*O[0]+M[0]*O[1])/D,(+_[1]*O[0]-_[0]*O[1])/D]}function $(_,M){return[_[0]-M[0],_[1]-M[1]]}function y(_,M){return[_[0]+M[0],_[1]+M[1]]}function p(_,M){return[_*M[0],_*M[1]]}function r(_){var M=_.getBoundingClientRect();return[M.left,M.top]}if(l){var h=this.$getZoom(this.el);l=p(1/h,l)}this.els||this.$initTransformMeasureNodes();var w=r(this.els[0]),u=r(this.els[1]),f=r(this.els[2]),s=r(this.els[3]),m=v($(s,u),$(s,f),$(y(u,f),y(s,w))),b=p(1+m[0],$(u,w)),C=p(1+m[1],$(f,w));if(g){var A=g,R=m[0]*A[0]/n+m[1]*A[1]/n+1,E=y(p(A[0],b),p(A[1],C));return y(p(1/R/n,E),w)}var I=$(l,w),T=v($(b,p(m[0],I)),$(C,p(m[1],I)),I);return p(n,T)}}).call(o.prototype)}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],function(L,k,N){var S=L("./lib/oop"),x=L("./lib/dom"),d=L("./config"),c=L("./layer/gutter").Gutter,a=L("./layer/marker").Marker,t=L("./layer/text").Text,e=L("./layer/cursor").Cursor,i=L("./scrollbar").HScrollBar,n=L("./scrollbar").VScrollBar,o=L("./renderloop").RenderLoop,l=L("./layer/font_metrics").FontMetrics,g=L("./lib/event_emitter").EventEmitter,v='.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}',$=L("./lib/useragent"),y=$.isIE;x.importCssString(v,"ace_editor.css?v=1775629002");var p=function(r,h){var w=this;this.container=r||x.createElement("div"),x.addCssClass(this.container,"ace_editor"),x.HI_DPI&&x.addCssClass(this.container,"ace_hidpi"),this.setTheme(h),this.$gutter=x.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=x.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=x.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new c(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var u=this.$textLayer=new t(this.content);this.canvas=u.element,this.$markerFront=new a(this.content),this.$cursorLayer=new e(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new n(this.container,this),this.scrollBarH=new i(this.container,this),this.scrollBarV.on("scroll",function(f){w.$scrollAnimation||w.session.setScrollTop(f.data-w.scrollMargin.top)}),this.scrollBarH.on("scroll",function(f){w.$scrollAnimation||w.session.setScrollLeft(f.data-w.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new l(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(f){w.updateCharacterSize(),w.onResize(!0,w.gutterWidth,w.$size.width,w.$size.height),w._signal("changeCharacterSize",f)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!$.isIOS,this.$loop=new o(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),d.resetOptions(this),d._signal("renderer",this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,S.implement(this,g),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),x.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},this.setSession=function(r){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=r,r&&this.scrollMargin.top&&r.getScrollTop()<=0&&r.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(r),this.$markerBack.setSession(r),this.$markerFront.setSession(r),this.$gutterLayer.setSession(r),this.$textLayer.setSession(r),r&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},this.updateLines=function(r,h,w){if(h===void 0&&(h=1/0),this.$changedLines?(this.$changedLines.firstRow>r&&(this.$changedLines.firstRow=r),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(r){r?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(r,h,w,u){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=r?1:0;var f=this.container;u||(u=f.clientHeight||f.scrollHeight),w||(w=f.clientWidth||f.scrollWidth);var s=this.$updateCachedSize(r,h,w,u);if(!this.$size.scrollerHeight||!w&&!u)return this.resizing=0;r&&(this.$gutterLayer.$padding=null),r?this.$renderChanges(s|this.$changes,!0):this.$loop.schedule(s|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null}},this.$updateCachedSize=function(r,h,w,u){u-=this.$extraHeight||0;var f=0,s=this.$size,m={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};if(u&&(r||s.height!=u)&&(s.height=u,f|=this.CHANGE_SIZE,s.scrollerHeight=s.height,this.$horizScroll&&(s.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",f|=this.CHANGE_SCROLL),w&&(r||s.width!=w)){f|=this.CHANGE_SIZE,s.width=w,h==null&&(h=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=h,x.setStyle(this.scrollBarH.element.style,"left",h+"px"),x.setStyle(this.scroller.style,"left",h+this.margin.left+"px"),s.scrollerWidth=Math.max(0,w-h-this.scrollBarV.getWidth()-this.margin.h),x.setStyle(this.$gutter.style,"left",this.margin.left+"px");var b=this.scrollBarV.getWidth()+"px";x.setStyle(this.scrollBarH.element.style,"right",b),x.setStyle(this.scroller.style,"right",b),x.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||r)&&(f|=this.CHANGE_FULL)}return s.$dirty=!w||!u,f&&this._signal("resize",m),f},this.onGutterResize=function(r){var h=this.$showGutter?r:0;h!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,h,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var r=this.$size.scrollerWidth-this.$padding*2,h=Math.floor(r/this.characterWidth);return this.session.adjustWrapLimit(h,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(r){this.setOption("animatedScroll",r)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(r){this.setOption("showInvisibles",r),this.session.$bidiHandler.setShowInvisibles(r)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(r){this.setOption("displayIndentGuides",r)},this.setShowPrintMargin=function(r){this.setOption("showPrintMargin",r)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(r){this.setOption("printMarginColumn",r)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(r){return this.setOption("showGutter",r)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(r){this.setOption("fadeFoldWidgets",r)},this.setHighlightGutterLine=function(r){this.setOption("highlightGutterLine",r)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var r=x.createElement("div");r.className="ace_layer ace_print-margin-layer",this.$printMarginEl=x.createElement("div"),this.$printMarginEl.className="ace_print-margin",r.appendChild(this.$printMarginEl),this.content.insertBefore(r,this.content.firstChild)}var h=this.$printMarginEl.style;h.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",h.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var r=this.textarea.style,h=this.$composition;if(!this.$keepTextAreaAtCursor&&!h){x.translate(this.textarea,-100,0);return}var w=this.$cursorLayer.$pixelPos;if(w){h&&h.markerRange&&(w=this.$cursorLayer.getPixelPosition(h.markerRange.start,!0));var u=this.layerConfig,f=w.top,s=w.left;f-=u.offset;var m=h&&h.useTextareaForIME?this.lineHeight:y?0:1;if(f<0||f>u.height-m){x.translate(this.textarea,0,0);return}var b=1,C=this.$size.height-m;if(!h)f+=this.lineHeight;else if(h.useTextareaForIME){var A=this.textarea.value;b=this.characterWidth*this.session.$getStringScreenWidth(A)[0]}else f+=this.lineHeight+2;s-=this.scrollLeft,s>this.$size.scrollerWidth-b&&(s=this.$size.scrollerWidth-b),s+=this.gutterWidth+this.margin.left,x.setStyle(r,"height",m+"px"),x.setStyle(r,"width",b+"px"),x.translate(this.textarea,Math.min(s,this.$size.scrollerWidth-b),Math.min(f,C))}}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},this.getLastFullyVisibleRow=function(){var r=this.layerConfig,h=r.lastRow,w=this.session.documentToScreenRow(h,0)*r.lineHeight;return w-this.session.getScrollTop()>r.height-r.lineHeight?h-1:h},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(r){this.$padding=r,this.$textLayer.setPadding(r),this.$cursorLayer.setPadding(r),this.$markerFront.setPadding(r),this.$markerBack.setPadding(r),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(r,h,w,u){var f=this.scrollMargin;f.top=r|0,f.bottom=h|0,f.right=u|0,f.left=w|0,f.v=f.top+f.bottom,f.h=f.left+f.right,f.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-f.top),this.updateFull()},this.setMargin=function(r,h,w,u){var f=this.margin;f.top=r|0,f.bottom=h|0,f.right=u|0,f.left=w|0,f.v=f.top+f.bottom,f.h=f.left+f.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(r){this.setOption("hScrollBarAlwaysVisible",r)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(r){this.setOption("vScrollBarAlwaysVisible",r)},this.$updateScrollBarV=function(){var r=this.layerConfig.maxHeight,h=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(r-=(h-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>r-h&&(r=this.scrollTop+h,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(r+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(r,h){if(this.$changes&&(r|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!r&&!h){this.$changes|=r;return}if(this.$size.$dirty)return this.$changes|=r,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",r),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var w=this.layerConfig;if(r&this.CHANGE_FULL||r&this.CHANGE_SIZE||r&this.CHANGE_TEXT||r&this.CHANGE_LINES||r&this.CHANGE_SCROLL||r&this.CHANGE_H_SCROLL){if(r|=this.$computeLayerConfig()|this.$loop.clear(),w.firstRow!=this.layerConfig.firstRow&&w.firstRowScreen==this.layerConfig.firstRowScreen){var u=this.scrollTop+(w.firstRow-this.layerConfig.firstRow)*this.lineHeight;u>0&&(this.scrollTop=u,r|=this.CHANGE_SCROLL,r|=this.$computeLayerConfig()|this.$loop.clear())}w=this.layerConfig,this.$updateScrollBarV(),r&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),x.translate(this.content,-this.scrollLeft,-w.offset);var f=w.width+2*this.$padding+"px",s=w.minHeight+"px";x.setStyle(this.content.style,"width",f),x.setStyle(this.content.style,"height",s)}if(r&this.CHANGE_H_SCROLL&&(x.translate(this.content,-this.scrollLeft,-w.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),r&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",r);return}if(r&this.CHANGE_SCROLL){this.$changedLines=null,r&this.CHANGE_TEXT||r&this.CHANGE_LINES?this.$textLayer.update(w):this.$textLayer.scrollLines(w),this.$showGutter&&(r&this.CHANGE_GUTTER||r&this.CHANGE_LINES?this.$gutterLayer.update(w):this.$gutterLayer.scrollLines(w)),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",r);return}r&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w)):r&this.CHANGE_LINES?(this.$updateLines()||r&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(w):r&this.CHANGE_TEXT||r&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(w):r&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(w),r&this.CHANGE_CURSOR&&(this.$cursorLayer.update(w),this.$moveTextAreaToCursor()),r&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(w),r&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(w),this._signal("afterRender",r)},this.$autosize=function(){var r=this.session.getScreenLength()*this.lineHeight,h=this.$maxLines*this.lineHeight,w=Math.min(h,Math.max((this.$minLines||1)*this.lineHeight,r))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(w+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&w>this.$maxPixelHeight&&(w=this.$maxPixelHeight);var u=w<=2*this.lineHeight,f=!u&&r>h;if(w!=this.desiredHeight||this.$size.height!=this.desiredHeight||f!=this.$vScroll){f!=this.$vScroll&&(this.$vScroll=f,this.scrollBarV.setVisible(f));var s=this.container.clientWidth;this.container.style.height=w+"px",this.$updateCachedSize(!0,this.$gutterWidth,s,w),this.desiredHeight=w,this._signal("autosize")}},this.$computeLayerConfig=function(){var r=this.session,h=this.$size,w=h.height<=2*this.lineHeight,u=this.session.getScreenLength(),f=u*this.lineHeight,s=this.$getLongestLine(),m=!w&&(this.$hScrollBarAlwaysVisible||h.scrollerWidth-s-2*this.$padding<0),b=this.$horizScroll!==m;b&&(this.$horizScroll=m,this.scrollBarH.setVisible(m));var C=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var A=h.scrollerHeight+this.lineHeight,R=!this.$maxLines&&this.$scrollPastEnd?(h.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;f+=R;var E=this.scrollMargin;this.session.setScrollTop(Math.max(-E.top,Math.min(this.scrollTop,f-h.scrollerHeight+E.bottom))),this.session.setScrollLeft(Math.max(-E.left,Math.min(this.scrollLeft,s+2*this.$padding-h.scrollerWidth+E.right)));var I=!w&&(this.$vScrollBarAlwaysVisible||h.scrollerHeight-f+R<0||this.scrollTop>E.top),T=C!==I;T&&(this.$vScroll=I,this.scrollBarV.setVisible(I));var _=this.scrollTop%this.lineHeight,M=Math.ceil(A/this.lineHeight)-1,O=Math.max(0,Math.round((this.scrollTop-_)/this.lineHeight)),D=O+M,F,W,B=this.lineHeight;O=r.screenToDocumentRow(O,0);var P=r.getFoldLine(O);P&&(O=P.start.row),F=r.documentToScreenRow(O,0),W=r.getRowLength(O)*B,D=Math.min(r.screenToDocumentRow(D,0),r.getLength()-1),A=h.scrollerHeight+r.getRowLength(D)*B+W,_=this.scrollTop-F*B;var z=0;return(this.layerConfig.width!=s||b)&&(z=this.CHANGE_H_SCROLL),(b||T)&&(z|=this.$updateCachedSize(!0,this.gutterWidth,h.width,h.height),this._signal("scrollbarVisibilityChanged"),T&&(s=this.$getLongestLine())),this.layerConfig={width:s,padding:this.$padding,firstRow:O,firstRowScreen:F,lastRow:D,lineHeight:B,characterWidth:this.characterWidth,minHeight:A,maxHeight:f,offset:_,gutterOffset:B?Math.max(0,Math.ceil((_+h.height-h.scrollerHeight)/B)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),z},this.$updateLines=function(){if(this.$changedLines){var r=this.$changedLines.firstRow,h=this.$changedLines.lastRow;this.$changedLines=null;var w=this.layerConfig;if(!(r>w.lastRow+1)&&!(hthis.$textLayer.MAX_LINE_LENGTH&&(r=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(r*this.characterWidth))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(r,h){this.$gutterLayer.addGutterDecoration(r,h)},this.removeGutterDecoration=function(r,h){this.$gutterLayer.removeGutterDecoration(r,h)},this.updateBreakpoints=function(r){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(r){this.$gutterLayer.setAnnotations(r),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(r,h,w){this.scrollCursorIntoView(r,w),this.scrollCursorIntoView(h,w)},this.scrollCursorIntoView=function(r,h,w){if(this.$size.scrollerHeight!==0){var u=this.$cursorLayer.getPixelPosition(r),f=u.left,s=u.top,m=w&&w.top||0,b=w&&w.bottom||0,C=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;C+m>s?(h&&C+m>s+this.lineHeight&&(s-=h*this.$size.scrollerHeight),s===0&&(s=-this.scrollMargin.top),this.session.setScrollTop(s)):C+this.$size.scrollerHeight-bf?(f=1-this.scrollMargin.top||h>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||r<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||r>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},this.pixelToScreenCoordinates=function(r,h){var w;if(this.$hasCssTransforms){w={top:0,left:0};var u=this.$fontMetrics.transformCoordinates([r,h]);r=u[1]-this.gutterWidth-this.margin.left,h=u[0]}else w=this.scroller.getBoundingClientRect();var f=r+this.scrollLeft-w.left-this.$padding,s=f/this.characterWidth,m=Math.floor((h+this.scrollTop-w.top)/this.lineHeight),b=this.$blockCursor?Math.floor(s):Math.round(s);return{row:m,column:b,side:s-b>0?1:-1,offsetX:f}},this.screenToTextCoordinates=function(r,h){var w;if(this.$hasCssTransforms){w={top:0,left:0};var u=this.$fontMetrics.transformCoordinates([r,h]);r=u[1]-this.gutterWidth-this.margin.left,h=u[0]}else w=this.scroller.getBoundingClientRect();var f=r+this.scrollLeft-w.left-this.$padding,s=f/this.characterWidth,m=this.$blockCursor?Math.floor(s):Math.round(s),b=Math.floor((h+this.scrollTop-w.top)/this.lineHeight);return this.session.screenToDocumentPosition(b,Math.max(m,0),f)},this.textToScreenCoordinates=function(r,h){var w=this.scroller.getBoundingClientRect(),u=this.session.documentToScreenPosition(r,h),f=this.$padding+(this.session.$bidiHandler.isBidiRow(u.row,r)?this.session.$bidiHandler.getPosLeft(u.column):Math.round(u.column*this.characterWidth)),s=u.row*this.lineHeight;return{pageX:w.left+f-this.scrollLeft,pageY:w.top+s-this.scrollTop}},this.visualizeFocus=function(){x.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){x.removeCssClass(this.container,"ace_focus")},this.showComposition=function(r){this.$composition=r,r.cssText||(r.cssText=this.textarea.style.cssText),r.useTextareaForIME==null&&(r.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(x.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):r.markerId=this.session.addMarker(r.markerRange,"ace_composition_marker","text")},this.setCompositionText=function(r){var h=this.session.selection.cursor;this.addToken(r,"composition_placeholder",h.row,h.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),x.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var r=this.session.selection.cursor;this.removeExtraToken(r.row,r.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},this.addToken=function(r,h,w,u){var f=this.session;f.bgTokenizer.lines[w]=null;var s={type:h,value:r},m=f.getTokens(w);if(u==null)m.push(s);else for(var b=0,C=0;C"u")return{postMessage:function(){},terminate:function(){}};if(t.get("loadWorkerFromBlob")){var o=S(n),l=window.URL||window.webkitURL,g=l.createObjectURL(o);return new Worker(g)}return new Worker(n)}var d=L("../lib/oop"),c=L("../lib/net"),a=L("../lib/event_emitter").EventEmitter,t=L("../config"),e=function(n){n.postMessage||(n=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=n,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){d.implement(this,a),this.$createWorkerFromOldConfig=function(n,o,l,g,v){if(L.nameToUrl&&!L.toUrl&&(L.toUrl=L.nameToUrl),t.get("packaged")||!L.toUrl)g=g||t.moduleUrl(o,"worker");else{var $=this.$normalizePath;g=g||$(L.toUrl("ace/worker/worker.js?v=1775629002",null,"_"));var y={};n.forEach(function(p){y[p]=$(L.toUrl(p,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=x(g),v&&this.send("importScripts",v),this.$worker.postMessage({init:!0,tlns:y,module:o,classname:l}),this.$worker},this.onMessage=function(n){var o=n.data;switch(o.type){case"event":this._signal(o.name,{data:o.data});break;case"call":var l=this.callbacks[o.id];l&&(l(o.data),delete this.callbacks[o.id]);break;case"error":this.reportError(o.data);break;case"log":window.console}},this.reportError=function(n){window.console},this.$normalizePath=function(n){return c.qualifyURL(n)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(n,o){this.$worker.postMessage({command:n,args:o})},this.call=function(n,o,l){if(l){var g=this.callbackId++;this.callbacks[g]=l,o.push(g)}this.send(n,o)},this.emit=function(n,o){try{o.data&&o.data.err&&(o.data.err={message:o.data.err.message,stack:o.data.err.stack,code:o.data.err.code}),this.$worker.postMessage({event:n,data:{data:o.data}})}catch(l){}},this.attachToDocument=function(n){this.$doc&&this.terminate(),this.$doc=n,this.call("setValue",[n.getValue()]),n.on("change",this.changeListener)},this.changeListener=function(n){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),n.action=="insert"?this.deltaQueue.push(n.start,n.lines):this.deltaQueue.push(n.start,n.end)},this.$sendDeltaQueue=function(){var n=this.deltaQueue;n&&(this.deltaQueue=null,n.length>50&&n.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:n}))}}).call(e.prototype);var i=function(n,o,l){var g=null,v=!1,$=Object.create(a),y=[],p=new e({messageBuffer:y,terminate:function(){},postMessage:function(h){y.push(h),g&&(v?setTimeout(r):r())}});p.setEmitSync=function(h){v=h};var r=function(){var h=y.shift();h.command?g[h.command].apply(g,h.args):h.event&&$._signal(h.event,h.data)};return $.postMessage=function(h){p.onMessage({data:h})},$.callback=function(h,w){this.postMessage({type:"call",id:w,data:h})},$.emit=function(h,w){this.postMessage({type:"event",name:h,data:w})},t.loadModule(["worker",o],function(h){for(g=new h[l]($);y.length;)r()}),p};k.UIWorkerClient=i,k.WorkerClient=e,k.createWorker=x}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(L,k,N){var S=L("./range").Range,x=L("./lib/event_emitter").EventEmitter,d=L("./lib/oop"),c=function(a,t,e,i,n,o){var l=this;this.length=t,this.session=a,this.doc=a.getDocument(),this.mainClass=n,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=i,this.$onCursorChange=function(){setTimeout(function(){l.onCursorChange()})},this.$pos=e;var g=a.getUndoManager().$undoStack||a.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=g.length,this.setup(),a.selection.on("changeCursor",this.$onCursorChange)};(function(){d.implement(this,x),this.setup=function(){var a=this,t=this.doc,e=this.session;this.selectionBefore=e.selection.toJSON(),e.selection.inMultiSelectMode&&e.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=e.addMarker(new S(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var o=t.createAnchor(n.row,n.column);o.$insertRight=!0,o.detach(),a.others.push(o)}),e.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var a=this.session,t=this;this.othersActive=!0,this.others.forEach(function(e){e.markerId=a.addMarker(new S(e.row,e.column,e.row,e.column+t.length),t.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var a=0;a=this.pos.column&&t.start.column<=this.pos.column+this.length+1,n=t.start.column-this.pos.column;if(this.updateAnchors(a),i&&(this.length+=e),i&&!this.session.$fromUndo){if(a.action==="insert")for(var o=this.others.length-1;o>=0;o--){var l=this.others[o],g={row:l.row,column:l.column+n};this.doc.insertMergedLines(g,a.lines)}else if(a.action==="remove")for(var o=this.others.length-1;o>=0;o--){var l=this.others[o],g={row:l.row,column:l.column+n};this.doc.remove(new S(g.row,g.column,g.row,g.column-e))}}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(a){this.pos.onChange(a);for(var t=this.others.length;t--;)this.others[t].onChange(a);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var a=this,t=this.session,e=function(n,o){t.removeMarker(n.markerId),n.markerId=t.addMarker(new S(n.row,n.column,n.row,n.column+a.length),o,null,!1)};e(this.pos,this.mainClass);for(var i=this.others.length;i--;)e(this.others[i],this.othersClass)}},this.onCursorChange=function(a){if(!(this.$updating||!this.session)){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",a)):(this.hideOtherMarkers(),this._emit("cursorLeave",a))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(this.$undoStackDepth!==-1){for(var a=this.session.getUndoManager(),t=(a.$undoStack||a.$undostack).length-this.$undoStackDepth,e=0;e1?x.multiSelect.joinSelections():x.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(x){x.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(x){x.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(x){x.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],k.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(x){x.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(x){return x&&x.inMultiSelectMode}}];var S=L("../keyboard/hash_handler").HashHandler;k.keyboardHandler=new S(k.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(L,k,N){function S(p,r,h){return v.$options.wrap=!0,v.$options.needle=r,v.$options.backwards=h==-1,v.find(p)}function x(p,r){return p.row==r.row&&p.column==r.column}function d(p){p.$multiselectOnSessionChange||(p.$onAddRange=p.$onAddRange.bind(p),p.$onRemoveRange=p.$onRemoveRange.bind(p),p.$onMultiSelect=p.$onMultiSelect.bind(p),p.$onSingleSelect=p.$onSingleSelect.bind(p),p.$multiselectOnSessionChange=k.onSessionChange.bind(p),p.$checkMultiselectChange=p.$checkMultiselectChange.bind(p),p.$multiselectOnSessionChange(p),p.on("changeSession",p.$multiselectOnSessionChange),p.on("mousedown",i),p.commands.addCommands(l.defaultCommands),c(p))}function c(p){function r(u){w&&(p.renderer.setMouseCursor(""),w=!1)}if(p.textInput){var h=p.textInput.getElement(),w=!1;n.addListener(h,"keydown",function(u){var f=u.keyCode==18&&!(u.ctrlKey||u.shiftKey||u.metaKey);p.$blockSelectEnabled&&f?w||(p.renderer.setMouseCursor("crosshair"),w=!0):w&&r()},p),n.addListener(h,"keyup",r,p),n.addListener(h,"blur",r,p)}}var a=L("./range_list").RangeList,t=L("./range").Range,e=L("./selection").Selection,i=L("./mouse/multi_select_handler").onMouseDown,n=L("./lib/event"),o=L("./lib/lang"),l=L("./commands/multi_select_commands");k.commands=l.defaultCommands.concat(l.multiSelectCommands);var g=L("./search").Search,v=new g,$=L("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call($.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(p,r){if(p){if(!this.inMultiSelectMode&&this.rangeCount===0){var h=this.toOrientedRange();if(this.rangeList.add(h),this.rangeList.add(p),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),r||this.fromOrientedRange(p);this.rangeList.removeAll(),this.rangeList.add(h),this.$onAddRange(h)}p.cursor||(p.cursor=p.end);var w=this.rangeList.add(p);return this.$onAddRange(p),w.length&&this.$onRemoveRange(w),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),r||this.fromOrientedRange(p)}},this.toSingleRange=function(p){p=p||this.ranges[0];var r=this.rangeList.removeAll();r.length&&this.$onRemoveRange(r),p&&this.fromOrientedRange(p)},this.substractPoint=function(p){var r=this.rangeList.substractPoint(p);if(r)return this.$onRemoveRange(r),r[0]},this.mergeOverlappingRanges=function(){var p=this.rangeList.merge();p.length&&this.$onRemoveRange(p)},this.$onAddRange=function(p){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(p),this._signal("addRange",{range:p})},this.$onRemoveRange=function(p){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var r=this.rangeList.ranges.pop();p.push(r),this.rangeCount=0}for(var h=p.length;h--;){var w=this.ranges.indexOf(p[h]);this.ranges.splice(w,1)}this._signal("removeRange",{ranges:p}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),r=r||this.ranges[0],r&&!r.isEqual(this.getRange())&&this.fromOrientedRange(r)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new a,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var p=this.ranges.length?this.ranges:[this.getRange()],r=[],h=0;h1){var p=this.rangeList.ranges,r=p[p.length-1],h=t.fromPoints(p[0].start,r.end);this.toSingleRange(),this.setSelectionRange(h,r.cursor==r.start)}else{var w=this.session.documentToScreenPosition(this.cursor),u=this.session.documentToScreenPosition(this.anchor),f=this.rectangularRangeBlock(w,u);f.forEach(this.addRange,this)}},this.rectangularRangeBlock=function(p,r,h){var w=[],u=p.column0;)_--;if(_>0)for(var M=0;w[M].isEmpty();)M++;for(var O=_;O>=M;O--)w[O].isEmpty()&&w.splice(O,1)}return w}}).call(e.prototype);var y=L("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(p){p.cursor||(p.cursor=p.end);var r=this.getSelectionStyle();return p.marker=this.session.addMarker(p,"ace_selection",r),this.session.$selectionMarkers.push(p),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,p},this.removeSelectionMarker=function(p){if(p.marker){this.session.removeMarker(p.marker);var r=this.session.$selectionMarkers.indexOf(p);r!=-1&&this.session.$selectionMarkers.splice(r,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(p){for(var r=this.session.$selectionMarkers,h=p.length;h--;){var w=p[h];if(w.marker){this.session.removeMarker(w.marker);var u=r.indexOf(w);u!=-1&&r.splice(u,1)}}this.session.selectionMarkerCount=r.length},this.$onAddRange=function(p){this.addSelectionMarker(p.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(p){this.removeSelectionMarkers(p.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(p){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(l.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(p){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(l.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(p){var r=p.command,h=p.editor;if(h.multiSelect){if(r.multiSelectAction)r.multiSelectAction=="forEach"?w=h.forEachSelection(r,p.args):r.multiSelectAction=="forEachLine"?w=h.forEachSelection(r,p.args,!0):r.multiSelectAction=="single"?(h.exitMultiSelectMode(),w=r.exec(h,p.args||{})):w=r.multiSelectAction(h,p.args||{});else{var w=r.exec(h,p.args||{});h.multiSelect.addRange(h.multiSelect.toOrientedRange()),h.multiSelect.mergeOverlappingRanges()}return w}},this.forEachSelection=function(p,r,h){if(!this.inVirtualSelectionMode){var w=h&&h.keepOrder,u=h==1||h&&h.$byLines,f=this.session,s=this.selection,m=s.rangeList,b=(w?s:m).ranges,C;if(!b.length)return p.exec?p.exec(this,r||{}):p(this,r||{});var A=s._eventRegistry;s._eventRegistry={};var R=new e(f);this.inVirtualSelectionMode=!0;for(var E=b.length;E--;){if(u)for(;E>0&&b[E].start.row==b[E-1].end.row;)E--;R.fromOrientedRange(b[E]),R.index=E,this.selection=f.selection=R;var I=p.exec?p.exec(this,r||{}):p(this,r||{});!C&&I!==void 0&&(C=I),R.toOrientedRange(b[E])}R.detach(),this.selection=f.selection=s,this.inVirtualSelectionMode=!1,s._eventRegistry=A,s.mergeOverlappingRanges(),s.ranges[0]&&s.fromOrientedRange(s.ranges[0]);var T=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),T&&T.from==T.to&&this.renderer.animateScrolling(T.from),C}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var p="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var r=this.multiSelect.rangeList.ranges,h=[],w=0;w0);s<0&&(s=0),m>=C&&(m=C-1)}var R=this.session.removeFullLines(s,m);R=this.$reAlignText(R,b),this.session.insert({row:s,column:0},R.join("\n")+"\n"),b||(f.start.column=0,f.end.column=R[R.length-1].length),this.selection.setRange(f)}else{u.forEach(function(_){r.substractPoint(_.cursor)});var E=0,I=1/0,T=h.map(function(_){var M=_.cursor,O=p.getLine(M.row),D=O.substr(M.column).search(/\S/g);return D==-1&&(D=0),M.column>E&&(E=M.column),DF?p.insert(O,o.stringRepeat(" ",D-F)):p.remove(new t(O.row,O.column,O.row,O.column-D+F)),_.start.column=_.end.column=E,_.start.row=_.end.row=O.row,_.cursor=_.end}),r.fromOrientedRange(h[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(p,r){function h(R){return o.stringRepeat(" ",R)}function w(R){return R[2]?h(b)+R[2]+h(C-R[2].length+A)+R[4].replace(/^([=:])\s+/,"$1 "):R[0]}function u(R){return R[2]?h(b+C-R[2].length)+R[2]+h(A)+R[4].replace(/^([=:])\s+/,"$1 "):R[0]}function f(R){return R[2]?h(b)+R[2]+h(A)+R[4].replace(/^([=:])\s+/,"$1 "):R[0]}var s=!0,m=!0,b,C,A;return p.map(function(R){var E=R.match(/(\s*)(.*?)(\s*)([=:].*)/);return E?b==null?(b=E[1].length,C=E[2].length,A=E[3].length,E):(b+C+A!=E[1].length+E[2].length+E[3].length&&(m=!1),b!=E[1].length&&(s=!1),b>E[1].length&&(b=E[1].length),CE[3].length&&(A=E[3].length),E):[R]}).map(r?w:s?m?u:w:f)}}).call(y.prototype),k.onSessionChange=function(p){var r=p.session;r&&!r.multiSelect&&(r.$selectionMarkers=[],r.selection.$initRangeList(),r.multiSelect=r.selection),this.multiSelect=r&&r.multiSelect;var h=p.oldSession;h&&(h.multiSelect.off("addRange",this.$onAddRange),h.multiSelect.off("removeRange",this.$onRemoveRange),h.multiSelect.off("multiSelect",this.$onMultiSelect),h.multiSelect.off("singleSelect",this.$onSingleSelect),h.multiSelect.lead.off("change",this.$checkMultiselectChange),h.multiSelect.anchor.off("change",this.$checkMultiselectChange)),r&&(r.multiSelect.on("addRange",this.$onAddRange),r.multiSelect.on("removeRange",this.$onRemoveRange),r.multiSelect.on("multiSelect",this.$onMultiSelect),r.multiSelect.on("singleSelect",this.$onSingleSelect),r.multiSelect.lead.on("change",this.$checkMultiselectChange),r.multiSelect.anchor.on("change",this.$checkMultiselectChange)),r&&this.inMultiSelectMode!=r.selection.inMultiSelectMode&&(r.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},k.MultiSelect=d,L("./config").defineOptions(y.prototype,"editor",{enableMultiselect:{set:function(p){d(this),p?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",i)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",i))},value:!0},enableBlockSelect:{set:function(p){this.$blockSelectEnabled=p},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(L,k,N){var S=L("../../range").Range,x=k.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(d,c,a){var t=d.getLine(a);return this.foldingStartMarker.test(t)?"start":c=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(t)?"end":""},this.getFoldWidgetRange=function(d,c,a){return null},this.indentationBlock=function(d,c,a){var t=/\S/,e=d.getLine(c),i=e.search(t);if(i!=-1){for(var n=a||e.length,o=d.getLength(),l=c,g=c;++cl){var y=d.getLine(g).length;return new S(l,n,g,y)}}},this.openingBracketBlock=function(d,c,a,t,e){var i={row:a,column:t+1},n=d.$findClosingBracket(c,i,e);if(n){var o=d.foldWidgets[n.row];return o==null&&(o=d.getFoldWidget(n.row)),o=="start"&&n.row>i.row&&(n.row--,n.column=d.getLine(n.row).length),S.fromPoints(i,n)}},this.closingBracketBlock=function(d,c,a,t,e){var i={row:a,column:t},n=d.$findOpeningBracket(c,i);if(n)return n.column++,i.column--,S.fromPoints(n,i)}}).call(x.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(L,k,N){k.isDark=!1,k.cssClass="ace-tm",k.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',k.$id="ace/theme/textmate";var S=L("../lib/dom");S.importCssString(k.cssText,k.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(L,k,N){function S(d){this.session=d,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}var x=L("./lib/dom");(function(){this.getRowLength=function(d){var c;return this.lineWidgets?c=this.lineWidgets[d]&&this.lineWidgets[d].rowCount||0:c=0,!this.$useWrapMode||!this.$wrapData[d]?1+c:this.$wrapData[d].length+1+c},this.$getWidgetScreenLength=function(){var d=0;return this.lineWidgets.forEach(function(c){c&&c.rowCount&&!c.hidden&&(d+=c.rowCount)}),d},this.$onChangeEditor=function(d){this.attach(d.editor)},this.attach=function(d){d&&d.widgetManager&&d.widgetManager!=this&&d.widgetManager.detach(),this.editor!=d&&(this.detach(),this.editor=d,d&&(d.widgetManager=this,d.renderer.on("beforeRender",this.measureWidgets),d.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(d){var c=this.editor;if(c){this.editor=null,c.widgetManager=null,c.renderer.off("beforeRender",this.measureWidgets),c.renderer.off("afterRender",this.renderWidgets);var a=this.session.lineWidgets;a&&a.forEach(function(t){t&&t.el&&t.el.parentNode&&(t._inDocument=!1,t.el.parentNode.removeChild(t.el))})}},this.updateOnFold=function(d,c){var a=c.lineWidgets;if(!(!a||!d.action)){for(var t=d.data,e=t.start.row,i=t.end.row,n=d.action=="add",o=e+1;oc[a].column&&a++,i.unshift(a,0),c.splice.apply(c,i),this.$updateRows()}}},this.$updateRows=function(){var d=this.session.lineWidgets;if(d){var c=!0;d.forEach(function(a,t){if(a)for(c=!1,a.row=t;a.$oldWidget;)a.$oldWidget.row=t,a=a.$oldWidget}),c&&(this.session.lineWidgets=null)}},this.$registerLineWidget=function(d){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var c=this.session.lineWidgets[d.row];return c&&(d.$oldWidget=c,c.el&&c.el.parentNode&&(c.el.parentNode.removeChild(c.el),c._inDocument=!1)),this.session.lineWidgets[d.row]=d,d},this.addLineWidget=function(d){if(this.$registerLineWidget(d),d.session=this.session,!this.editor)return d;var c=this.editor.renderer;d.html&&!d.el&&(d.el=x.createElement("div"),d.el.innerHTML=d.html),d.el&&(x.addCssClass(d.el,"ace_lineWidgetContainer"),d.el.style.position="absolute",d.el.style.zIndex=5,c.container.appendChild(d.el),d._inDocument=!0,d.coverGutter||(d.el.style.zIndex=3),d.pixelHeight==null&&(d.pixelHeight=d.el.offsetHeight)),d.rowCount==null&&(d.rowCount=d.pixelHeight/c.layerConfig.lineHeight);var a=this.session.getFoldAt(d.row,0);if(d.$fold=a,a){var t=this.session.lineWidgets;d.row==a.end.row&&!t[a.start.row]?t[a.start.row]=d:d.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:d.row}}}),this.$updateRows(),this.renderWidgets(null,c),this.onWidgetChanged(d),d},this.removeLineWidget=function(d){if(d._inDocument=!1,d.session=null,d.el&&d.el.parentNode&&d.el.parentNode.removeChild(d.el),d.editor&&d.editor.destroy)try{d.editor.destroy()}catch(a){}if(this.session.lineWidgets){var c=this.session.lineWidgets[d.row];if(c==d)this.session.lineWidgets[d.row]=d.$oldWidget,d.$oldWidget&&this.onWidgetChanged(d.$oldWidget);else for(;c;){if(c.$oldWidget==d){c.$oldWidget=d.$oldWidget;break}c=c.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:d.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(d){for(var c=this.session.lineWidgets,a=c&&c[d],t=[];a;)t.push(a),a=a.$oldWidget;return t},this.onWidgetChanged=function(d){this.session._changedWidgets.push(d),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(d,c){var a=this.session._changedWidgets,t=c.layerConfig;if(!(!a||!a.length)){for(var e=1/0,i=0;i0&&!t[e];)e--;this.firstRow=a.firstRow,this.lastRow=a.lastRow,c.$cursorLayer.config=a;for(var n=e;n<=i;n++){var o=t[n];if(!(!o||!o.el)){if(o.hidden){o.el.style.top=-100-(o.pixelHeight||0)+"px";continue}o._inDocument||(o._inDocument=!0,c.container.appendChild(o.el));var l=c.$cursorLayer.getPixelPosition({row:n,column:0},!0).top;o.coverLine||(l+=a.lineHeight*this.session.getRowLineCount(o.row)),o.el.style.top=l-a.offset+"px";var g=o.coverGutter?0:c.gutterWidth;o.fixedWidth||(g-=c.scrollLeft),o.el.style.left=g+"px",o.fullWidth&&o.screenWidth&&(o.el.style.minWidth=a.width+2*a.padding+"px"),o.fixedWidth?o.el.style.right=c.scrollBar.getWidth()+"px":o.el.style.right=""}}}}}).call(S.prototype),k.LineWidgets=S}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(L,k,N){function S(t,e,i){for(var n=0,o=t.length-1;n<=o;){var l=n+o>>1,g=i(e,t[l]);if(g>0)n=l+1;else{if(!(g<0))return l;o=l-1}}return-(n+1)}function x(t,e,i){var n=t.getAnnotations().sort(a.comparePoints);if(n.length){var o=S(n,{row:e,column:-1},a.comparePoints);o<0&&(o=-o-1),o>=n.length?o=i>0?0:n.length-1:o===0&&i<0&&(o=n.length-1);var l=n[o];if(!(!l||!i)){if(l.row===e){do l=n[o+=i];while(l&&l.row===e);if(!l)return n.slice()}var g=[];e=l.row;do g[i<0?"unshift":"push"](l),l=n[o+=i];while(l&&l.row==e);return g.length&&g}}}var d=L("../line_widgets").LineWidgets,c=L("../lib/dom"),a=L("../range").Range;k.showErrorMarker=function(t,e){var i=t.session;i.widgetManager||(i.widgetManager=new d(i),i.widgetManager.attach(t));var n=t.getCursorPosition(),o=n.row,l=i.widgetManager.getWidgetsAtRow(o).filter(function(u){return u.type=="errorMarker"})[0];l?l.destroy():o-=e;var g=x(i,o,e),v;if(g){var $=g[0];n.column=($.pos&&typeof $.column!="number"?$.pos.sc:$.column)||0,n.row=$.row,v=t.renderer.$gutterLayer.$annotations[n.row]}else{if(l)return;v={text:["Looks good!"],className:"ace_ok"}}t.session.unfold(n.row),t.selection.moveToPosition(n);var y={row:n.row,fixedWidth:!0,coverGutter:!0,el:c.createElement("div"),type:"errorMarker"},p=y.el.appendChild(c.createElement("div")),r=y.el.appendChild(c.createElement("div"));r.className="error_widget_arrow "+v.className;var h=t.renderer.$cursorLayer.getPixelPosition(n).left;r.style.left=h+t.renderer.gutterWidth-5+"px",y.el.className="error_widget_wrapper",p.className="error_widget "+v.className,p.innerHTML=v.text.join("
"),p.appendChild(c.createElement("div"));var w=function(u,f,s){if(f===0&&(s==="esc"||s==="return"))return y.destroy(),{command:"null"}};y.destroy=function(){t.$mouseHandler.isMousePressed||(t.keyBinding.removeKeyboardHandler(w),i.widgetManager.removeLineWidget(y),t.off("changeSelection",y.destroy),t.off("changeSession",y.destroy),t.off("mouseup",y.destroy),t.off("change",y.destroy))},t.keyBinding.addKeyboardHandler(w),t.on("changeSelection",y.destroy),t.on("changeSession",y.destroy),t.on("mouseup",y.destroy),t.on("change",y.destroy),t.session.widgetManager.addLineWidget(y),y.el.onmousedown=t.focus.bind(t),t.renderer.scrollCursorIntoView(null,.5,{bottom:y.el.offsetHeight})},c.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(L,k,N){L("./lib/fixoldbrowsers");var S=L("./lib/dom"),x=L("./lib/event"),d=L("./range").Range,c=L("./editor").Editor,a=L("./edit_session").EditSession,t=L("./undomanager").UndoManager,e=L("./virtual_renderer").VirtualRenderer;L("./worker/worker_client"),L("./keyboard/hash_handler"),L("./placeholder"),L("./multi_select"),L("./mode/folding/fold_mode"),L("./theme/textmate"),L("./ext/error_marker"),k.config=L("./config"),k.require=L,typeof define=="function"&&(k.define=define),k.edit=function(i,n){if(typeof i=="string"){var o=i;if(i=document.getElementById(o),!i)throw new Error("ace.edit can't find div #"+o)}if(i&&i.env&&i.env.editor instanceof c)return i.env.editor;var l="";if(i&&/input|textarea/i.test(i.tagName)){var g=i;l=g.value,i=S.createElement("pre"),g.parentNode.replaceChild(i,g)}else i&&(l=i.textContent,i.innerHTML="");var v=k.createEditSession(l),$=new c(new e(i),v,n),y={document:v,editor:$,onResize:$.resize.bind($,null)};return g&&(y.textarea=g),x.addListener(window,"resize",y.onResize),$.on("destroy",function(){x.removeListener(window,"resize",y.onResize),y.editor.container.env=null}),$.container.env=$.env=y,$},k.createEditSession=function(i,n){var o=new a(i,n);return o.setUndoManager(new t),o},k.Range=d,k.Editor=c,k.EditSession=a,k.UndoManager=t,k.VirtualRenderer=e,k.version=k.config.version});(function(){ace.require(["ace/ace"],function(L){L&&(L.config.init(!0),L.define=ace.define),window.ace||(window.ace=L);for(var k in L)L.hasOwnProperty(k)&&(window.ace[k]=L[k]);window.ace.default=window.ace,typeof ue=="object"&&typeof me=="object"&&ue&&(ue.exports=window.ace)})})()});export default ve();