PATH:
var
/
www
/
vhosts
/
sandbox.dos-group.com
/
httpdocs
/
mendrisio
/
wp-content
/
plugins
/
vfb-pro
/
admin
/
assets
/
js
!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);this.CodeMirror=e()}}(function(){"use strict";function e(r,n){if(!(this instanceof e))return new e(r,n);this.options=n=n?So(n):{},So(ja,n,!1),h(n);var i=n.value;"string"==typeof i&&(i=new ul(i,n.mode)),this.doc=i;var o=this.display=new t(r,i);o.wrapper.CodeMirror=this,u(this),l(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),n.autofocus&&!ma&&Wr(this),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new vo,keySeq:null},ia&&11>oa&&setTimeout(Lo(Nr,this,!0),20),Hr(this),Eo(),ir(this),this.curOp.forceUpdate=!0,Ei(this,i),n.autofocus&&!ma||Ho()==o.input?setTimeout(Lo(nn,this),20):on(this);for(var a in Ra)Ra.hasOwnProperty(a)&&Ra[a](this,n[a],Ba);k(this);for(var s=0;s<Ka.length;++s)Ka[s](this);ar(this)}function t(e,t){var r=this,n=r.input=No("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");aa?n.style.width="1000px":n.setAttribute("wrap","off"),pa&&(n.style.border="1px solid black"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck","false"),r.inputDiv=No("div",[n],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),r.scrollbarFiller=No("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("not-content","true"),r.gutterFiller=No("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("not-content","true"),r.lineDiv=No("div",null,"CodeMirror-code"),r.selectionDiv=No("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=No("div",null,"CodeMirror-cursors"),r.measure=No("div",null,"CodeMirror-measure"),r.lineMeasure=No("div",null,"CodeMirror-measure"),r.lineSpace=No("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=No("div",[No("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=No("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=No("div",null,null,"position: absolute; height: "+bl+"px; width: 1px;"),r.gutters=No("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=No("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=No("div",[r.inputDiv,r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),ia&&8>oa&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),pa&&(n.style.width="0px"),aa||(r.scroller.draggable=!0),da&&(r.inputDiv.style.height="1px",r.inputDiv.style.position="absolute"),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.prevInput="",r.alignWidgets=!1,r.pollingFast=!1,r.poll=new vo,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.inaccurateSelection=!1,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null}function r(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),n(t)}function n(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,St(e,100),e.state.modeGen++,e.curOp&&br(e)}function i(e){e.options.lineWrapping?(Dl(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Hl(e.display.wrapper,"CodeMirror-wrap"),f(e)),a(e),br(e),Kt(e),setTimeout(function(){y(e)},100)}function o(e){var t=rr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/nr(e.display)-3);return function(i){if(ui(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function a(e){var t=e.doc,r=o(e);t.iter(function(e){var t=r(e);t!=e.height&&Bi(e,t)})}function l(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Kt(e)}function s(e){u(e),br(e),setTimeout(function(){x(e)},20)}function u(e){var t=e.display.gutters,r=e.options.gutters;Wo(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(No("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",c(e)}function c(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function d(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=ri(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=ni(n);){var i=t.find(0,!0);r-=n.text.length-i.from.ch,n=i.to.line,r+=n.text.length-i.to.ch}return r}function f(e){var t=e.display,r=e.doc;t.maxLine=Fi(r,r.first),t.maxLineLength=d(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=d(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function h(e){var t=xo(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Nt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+zt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function m(e,t,r){this.cm=r;var n=this.vert=No("div",[No("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=No("div",[No("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),ml(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),ml(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedOverlay=!1,ia&&8>oa&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Hl(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ml(e,"mousedown",function(){t.state.focused&&setTimeout(Lo(Wr,t),0)}),e.setAttribute("not-content","true")},function(e,r){"horizontal"==r?Ur(t,e):Kr(t,e)},t),t.display.scrollbars.addClass&&Dl(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var r=e.display.barWidth,n=e.display.barHeight;b(e,t);for(var i=0;4>i&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&W(e),b(e,p(e)),r=e.display.barWidth,n=e.display.barHeight}function b(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function w(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-At(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=Vi(t,n),a=Vi(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;o>l?(o=l,a=Vi(t,qi(Fi(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=Vi(t,qi(Fi(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function x(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=S(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&r[a].gutter&&(r[a].gutter.style.left=o);var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function k(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=C(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(No("div",[No("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a),n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",c(e),!0}return!1}function C(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function S(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function L(e,t,r){var n=e.display;this.viewport=t,this.visible=w(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ot(e),this.force=r,this.dims=O(e)}function M(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=zt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=zt(e)+"px",t.scrollbarsClipped=!0)}function T(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return xr(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==Lr(e))return!1;k(e)&&(xr(e),t.dims=O(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),ka&&(o=li(e.doc,o),a=si(e.doc,a));var l=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Sr(e,o,a),r.viewOffset=qi(Fi(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var s=Lr(e);if(!l&&0==s&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var u=Ho();return s>4&&(r.lineDiv.style.display="none"),H(e,r.updateLineNumbers,t.dims),s>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,u&&Ho()!=u&&u.offsetHeight&&u.focus(),Wo(r.cursorDiv),Wo(r.selectionDiv),r.gutters.style.height=0,l&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,St(e,400)),r.updateLineNumbers=null,!0}function A(e,t){for(var r=t.force,n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Ot(e))r=!0;else if(r=!1,n&&null!=n.top&&(n={top:Math.min(e.doc.height+Nt(e.display)-Ht(e),n.top)}),t.visible=w(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!T(e,t))break;W(e);var o=p(e);wt(e),$(e,o),y(e,o)}co(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(co(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function N(e,t){var r=new L(e,t);if(T(e,r)){W(e),A(e,r);var n=p(e);wt(e),$(e,n),y(e,n)}}function $(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var r=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=r+"px",e.display.gutters.style.height=Math.max(r+zt(e),t.clientHeight)+"px"}function W(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i,o=t.view[n];if(!o.hidden){if(ia&&8>oa){var a=o.node.offsetTop+o.node.offsetHeight;i=a-r,r=a}else{var l=o.node.getBoundingClientRect();i=l.bottom-l.top}var s=o.line.height-i;if(2>i&&(i=rr(t)),(s>.001||-.001>s)&&(Bi(o.line,i),z(o.line),o.rest))for(var u=0;u<o.rest.length;u++)z(o.rest[u])}}}function z(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function O(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)r[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[a]]=o.clientWidth;return{fixedPos:S(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function H(e,t,r){function n(t){var r=t.nextSibling;return aa&&ga&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var i=e.display,o=e.options.lineNumbers,a=i.lineDiv,l=a.firstChild,s=i.view,u=i.viewFrom,c=0;c<s.length;c++){var d=s[c];if(d.hidden);else if(d.node){for(;l!=d.node;)l=n(l);var f=o&&null!=t&&u>=t&&d.lineNumber;d.changes&&(xo(d.changes,"gutter")>-1&&(f=!1),D(e,d,u,r)),f&&(Wo(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(C(e.options,u)))),l=d.node.nextSibling}else{var h=G(e,d,u,r);a.insertBefore(h,l)}u+=d.size}for(;l;)l=n(l)}function D(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?F(e,t):"gutter"==o?R(e,t,r,n):"class"==o?j(t):"widget"==o&&B(t,n)}t.changes=null}function P(e){return e.node==e.text&&(e.node=No("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),ia&&8>oa&&(e.node.style.zIndex=2)),e.node}function I(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var r=P(e);e.background=r.insertBefore(No("div",null,t),r.firstChild)}}function E(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Li(e,t)}function F(e,t){var r=t.text.className,n=E(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,j(t)):r&&(t.text.className=r)}function j(e){I(e),e.line.wrapClass?P(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function R(e,t,r,n){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var o=P(t),a=t.gutter=o.insertBefore(No("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),t.text);if(t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(No("div",C(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var l=0;l<e.options.gutters.length;++l){var s=e.options.gutters[l],u=i.hasOwnProperty(s)&&i[s];u&&a.appendChild(No("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[s]+"px; width: "+n.gutterWidth[s]+"px"))}}}function B(e,t){e.alignable&&(e.alignable=null);for(var r,n=e.node.firstChild;n;n=r){var r=n.nextSibling;"CodeMirror-linewidget"==n.className&&e.node.removeChild(n)}V(e,t)}function G(e,t,r,n){var i=E(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),j(t),R(e,t,r,n),V(t,n),t.node}function V(e,t){if(q(e.line,e,t,!0),e.rest)for(var r=0;r<e.rest.length;r++)q(e.rest[r],e,t,!1)}function q(e,t,r,n){if(e.widgets)for(var i=P(t),o=0,a=e.widgets;o<a.length;++o){var l=a[o],s=No("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||s.setAttribute("cm-ignore-events","true"),K(l,s,t,r),n&&l.above?i.insertBefore(s,t.gutter||t.text):i.appendChild(s),co(l,"redraw")}}function K(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function U(e){return Ca(e.line,e.ch)}function _(e,t){return Sa(e,t)<0?t:e}function X(e,t){return Sa(e,t)<0?e:t}function Y(e,t){this.ranges=e,this.primIndex=t}function Z(e,t){this.anchor=e,this.head=t}function Q(e,t){var r=e[t];e.sort(function(e,t){return Sa(e.from(),t.from())}),t=xo(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(Sa(o.to(),i.from())>=0){var a=X(o.from(),i.from()),l=_(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;t>=n&&--t,e.splice(--n,2,new Z(s?l:a,s?a:l))}}return new Y(e,t)}function J(e,t){return new Y([new Z(e,t||e)],0)}function et(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function tt(e,t){if(t.line<e.first)return Ca(e.first,0);var r=e.first+e.size-1;return t.line>r?Ca(r,Fi(e,r).text.length):rt(t,Fi(e,t.line).text.length)}function rt(e,t){var r=e.ch;return null==r||r>t?Ca(e.line,t):0>r?Ca(e.line,0):e}function nt(e,t){return t>=e.first&&t<e.first+e.size}function it(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=tt(e,t[n]);return r}function ot(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=Sa(r,i)<0;o!=Sa(n,i)<0?(i=r,r=n):o!=Sa(r,n)<0&&(r=n)}return new Z(i,r)}return new Z(n||r,r)}function at(e,t,r,n){ft(e,new Y([ot(e,e.sel.primary(),t,r)],0),n)}function lt(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=ot(e,e.sel.ranges[i],t[i],null);var o=Q(n,e.sel.primIndex);ft(e,o,r)}function st(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,ft(e,Q(i,e.sel.primIndex),n)}function ut(e,t,r,n){ft(e,J(t,r),n)}function ct(e,t){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new Z(tt(e,t[r].anchor),tt(e,t[r].head))}};return vl(e,"beforeSelectionChange",e,r),e.cm&&vl(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Q(r.ranges,r.ranges.length-1):t}function dt(e,t,r){var n=e.history.done,i=wo(n);i&&i.ranges?(n[n.length-1]=t,ht(e,t,r)):ft(e,t,r)}function ft(e,t,r){ht(e,t,r),Qi(e,e.sel,e.cm?e.cm.curOp.id:0/0,r)}function ht(e,t,r){(mo(e,"beforeSelectionChange")||e.cm&&mo(e.cm,"beforeSelectionChange"))&&(t=ct(e,t));var n=r&&r.bias||(Sa(t.primary().head,e.sel.primary().head)<0?-1:1);pt(e,gt(e,t,n,!0)),r&&r.scroll===!1||!e.cm||Ln(e.cm)}function pt(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,po(e.cm)),co(e,"cursorActivity",e))}function mt(e){pt(e,gt(e,e.sel,null,!1),xl)}function gt(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=vt(e,a.anchor,r,n),s=vt(e,a.head,r,n);(i||l!=a.anchor||s!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Z(l,s))}return i?Q(i,t.primIndex):t}function vt(e,t,r,n){var i=!1,o=t,a=r||1;e.cantEdit=!1;e:for(;;){var l=Fi(e,o.line);if(l.markedSpans)for(var s=0;s<l.markedSpans.length;++s){var u=l.markedSpans[s],c=u.marker;if((null==u.from||(c.inclusiveLeft?u.from<=o.ch:u.from<o.ch))&&(null==u.to||(c.inclusiveRight?u.to>=o.ch:u.to>o.ch))){if(n&&(vl(c,"beforeCursorEnter"),c.explicitlyCleared)){if(l.markedSpans){--s;continue}break}if(!c.atomic)continue;var d=c.find(0>a?-1:1);if(0==Sa(d,o)&&(d.ch+=a,d.ch<0?d=d.line>e.first?tt(e,Ca(d.line-1)):null:d.ch>l.text.length&&(d=d.line<e.first+e.size-1?Ca(d.line+1,0):null),!d)){if(i)return n?(e.cantEdit=!0,Ca(e.first,0)):vt(e,t,r,!0);i=!0,d=t,a=-a}o=d;continue e}}return o}}function yt(e){for(var t=e.display,r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++){var l=r.sel.ranges[a],s=l.empty();(s||e.options.showCursorWhenSelecting)&&xt(e,l,i),s||kt(e,l,o)}if(e.options.moveInputWithCursor){var u=Zt(e,r.sel.primary().head,"div"),c=t.wrapper.getBoundingClientRect(),d=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,u.top+d.top-c.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,u.left+d.left-c.left))}return n}function bt(e,t){zo(e.display.cursorDiv,t.cursors),zo(e.display.selectionDiv,t.selection),null!=t.teTop&&(e.display.inputDiv.style.top=t.teTop+"px",e.display.inputDiv.style.left=t.teLeft+"px")}function wt(e){bt(e,yt(e))}function xt(e,t,r){var n=Zt(e,t.head,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(No("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(No("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function kt(e,t,r){function n(e,t,r,n){0>t&&(t=0),t=Math.round(t),n=Math.round(n),l.appendChild(No("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==r?c-e:r)+"px; height: "+(n-t)+"px"))}function i(t,r,i){function o(r,n){return Yt(e,Ca(t,r),"div",d,n)}var l,s,d=Fi(a,t),f=d.text.length;return Go(Ki(d),r||0,null==i?f:i,function(e,t,a){var d,h,p,m=o(e,"left");if(e==t)d=m,h=p=m.left;else{if(d=o(t-1,"right"),"rtl"==a){var g=m;m=d,d=g}h=m.left,p=d.right}null==r&&0==e&&(h=u),d.top-m.top>3&&(n(h,m.top,null,m.bottom),h=u,m.bottom<d.top&&n(h,m.bottom,null,d.top)),null==i&&t==f&&(p=c),(!l||m.top<l.top||m.top==l.top&&m.left<l.left)&&(l=m),(!s||d.bottom>s.bottom||d.bottom==s.bottom&&d.right>s.right)&&(s=d),u+1>h&&(h=u),n(h,d.top,p-h,d.bottom)}),{start:l,end:s}}var o=e.display,a=e.doc,l=document.createDocumentFragment(),s=Wt(e.display),u=s.left,c=Math.max(o.sizerWidth,Ot(e)-o.sizer.offsetLeft)-s.right,d=t.from(),f=t.to();if(d.line==f.line)i(d.line,d.ch,f.ch);else{var h=Fi(a,d.line),p=Fi(a,f.line),m=oi(h)==oi(p),g=i(d.line,d.ch,m?h.text.length+1:null).end,v=i(f.line,m?0:null,f.ch).start;m&&(g.top<v.top-2?(n(g.right,g.top,null,g.bottom),n(u,v.top,v.left,v.bottom)):n(g.right,g.top,v.left-g.right,g.bottom)),g.bottom<v.top&&n(u,g.bottom,null,v.top)}r.appendChild(l)}function Ct(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function St(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Lo(Lt,e))}function Lt(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=_a(t.mode,Tt(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=xi(e,o,n,!0);o.styles=l.styles;var s=o.styleClasses,u=l.classes;u?o.styleClasses=u:s&&(o.styleClasses=null);for(var c=!a||a.length!=o.styles.length||s!=u&&(!s||!u||s.bgClass!=u.bgClass||s.textClass!=u.textClass),d=0;!c&&d<a.length;++d)c=a[d]!=o.styles[d];c&&i.push(t.frontier),o.stateAfter=_a(t.mode,n)}else Ci(e,o.text,n),o.stateAfter=0==t.frontier%5?_a(t.mode,n):null;return++t.frontier,+new Date>r?(St(e,e.options.workDelay),!0):void 0}),i.length&&hr(e,function(){for(var t=0;t<i.length;t++)wr(e,i[t],"text")})}}function Mt(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=Fi(o,l-1);if(s.stateAfter&&(!r||l<=o.frontier))return l;var u=Sl(s.text,null,e.options.tabSize);(null==i||n>u)&&(i=l-1,n=u)}return i}function Tt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=Mt(e,t,r),a=o>n.first&&Fi(n,o-1).stateAfter;return a=a?_a(n.mode,a):$a(n.mode),n.iter(o,t,function(r){Ci(e,r.text,a);var l=o==t-1||0==o%5||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=l?_a(n.mode,a):null,++o}),r&&(n.frontier=o),a}function At(e){return e.lineSpace.offsetTop}function Nt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Wt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=zo(e.measure,No("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function zt(e){return bl-e.display.nativeBarWidth}function Ot(e){return e.display.scroller.clientWidth-zt(e)-e.display.barWidth}function Ht(e){return e.display.scroller.clientHeight-zt(e)-e.display.barHeight}function Dt(e,t,r){var n=e.options.lineWrapping,i=n&&Ot(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],u=a[l+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Pt(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var n=0;n<e.rest.length;n++)if(Gi(e.rest[n])>r)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function It(e,t){t=oi(t);var r=Gi(t),n=e.display.externalMeasured=new vr(e.doc,t,r);n.lineN=r;var i=n.built=Li(e,n);return n.text=i.pre,zo(e.display.lineMeasure,i.pre),n}function Et(e,t,r,n){return Rt(e,jt(e,t),r,n)}function Ft(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[kr(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function jt(e,t){var r=Gi(t),n=Ft(e,r);n&&!n.text?n=null:n&&n.changes&&D(e,n,r,O(e)),n||(n=It(e,t));var i=Pt(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Rt(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Dt(e,t.view,t.rect),t.hasHeights=!0),o=Bt(e,t,r,n),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Bt(e,t,r,n){for(var i,o,a,l,s=t.map,u=0;u<s.length;u+=3){var c=s[u],d=s[u+1];if(c>r?(o=0,a=1,l="left"):d>r?(o=r-c,a=o+1):(u==s.length-3||r==d&&s[u+3]>r)&&(a=d-c,o=a-1,r>=d&&(l="right")),null!=o){if(i=s[u+2],c==d&&n==(i.insertLeft?"left":"right")&&(l=n),"left"==n&&0==o)for(;u&&s[u-2]==s[u-3]&&s[u-1].insertLeft;)i=s[(u-=3)+2],l="left";if("right"==n&&o==d-c)for(;u<s.length-3&&s[u+3]==s[u+4]&&!s[u+5].insertLeft;)i=s[(u+=3)+2],l="right";break}}var f;if(3==i.nodeType){for(var u=0;4>u;u++){for(;o&&Ao(t.line.text.charAt(c+o));)--o;for(;d>c+a&&Ao(t.line.text.charAt(c+a));)++a;if(ia&&9>oa&&0==o&&a==d-c)f=i.parentNode.getBoundingClientRect();else if(ia&&e.options.lineWrapping){var h=Tl(i,o,a).getClientRects();f=h.length?h["right"==n?h.length-1:0]:Aa}else f=Tl(i,o,a).getBoundingClientRect()||Aa;if(f.left||f.right||0==o)break;a=o,o-=1,l="right"}ia&&11>oa&&(f=Gt(e.display.measure,f))}else{o>0&&(l=n="right");var h;f=e.options.lineWrapping&&(h=i.getClientRects()).length>1?h["right"==n?h.length-1:0]:i.getBoundingClientRect()}if(ia&&9>oa&&!o&&(!f||!f.left&&!f.right)){var p=i.parentNode.getClientRects()[0];f=p?{left:p.left,right:p.left+nr(e.display),top:p.top,bottom:p.bottom}:Aa}for(var m=f.top-t.rect.top,g=f.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,u=0;u<y.length-1&&!(v<y[u]);u++);var b=u?y[u-1]:0,w=y[u],x={left:("right"==l?f.right:f.left)-t.rect.left,right:("left"==l?f.left:f.right)-t.rect.left,top:b,bottom:w};return f.left||f.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=m,x.rbottom=g),x}function Gt(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Bo(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function Vt(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function qt(e){e.display.externalMeasure=null,Wo(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Vt(e.display.view[t])}function Kt(e){qt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ut(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function _t(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function $t(e,t,r,n){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=fi(t.widgets[i]);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=qi(t);if("local"==n?a+=At(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==n?0:_t());var s=l.left+("window"==n?0:Ut());r.left+=s,r.right+=s}return r.top+=a,r.bottom+=a,r}function Xt(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=Ut(),i-=_t();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function Yt(e,t,r,n,i){return n||(n=Fi(e.doc,t.line)),$t(e,n,Et(e,n,t.ch,i),r)}function Zt(e,t,r,n,i,o){function a(t,a){var l=Rt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,$t(e,n,l,r)}function l(e,t){var r=s[t],n=r.level%2;return e==Vo(r)&&t&&r.level<s[t-1].level?(r=s[--t],e=qo(r)-(r.level%2?0:1),n=!0):e==qo(r)&&t<s.length-1&&r.level<s[t+1].level&&(r=s[++t],e=Vo(r)-r.level%2,n=!1),n&&e==r.to&&e>r.from?a(e-1):a(e,n)}n=n||Fi(e.doc,t.line),i||(i=jt(e,n));var s=Ki(n),u=t.ch;if(!s)return a(u);var c=Zo(s,u),d=l(u,c);return null!=Gl&&(d.other=l(u,Gl)),d}function Qt(e,t){var r=0,t=tt(e.doc,t);e.options.lineWrapping||(r=nr(e.display)*t.ch);var n=Fi(e.doc,t.line),i=qi(n)+At(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Jt(e,t,r,n){var i=Ca(e,t);return i.xRel=n,r&&(i.outside=!0),i}function er(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,0>r)return Jt(n.first,0,!0,-1);var i=Vi(n,r),o=n.first+n.size-1;if(i>o)return Jt(n.first+n.size-1,Fi(n,o).text.length,!0,1);0>t&&(t=0);for(var a=Fi(n,i);;){var l=tr(e,a,i,t,r),s=ni(a),u=s&&s.find(0,!0);if(!s||!(l.ch>u.from.ch||l.ch==u.from.ch&&l.xRel>0))return l;i=Gi(a=u.to.line)}}function tr(e,t,r,n,i){function o(n){var i=Zt(e,Ca(r,n),"line",t,u);return l=!0,a>i.bottom?i.left-s:a<i.top?i.left+s:(l=!1,i.left)}var a=i-qi(t),l=!1,s=2*e.display.wrapper.clientWidth,u=jt(e,t),c=Ki(t),d=t.text.length,f=Ko(t),h=Uo(t),p=o(f),m=l,g=o(h),v=l;if(n>g)return Jt(r,h,v,1);for(;;){if(c?h==f||h==Jo(t,f,1):1>=h-f){for(var y=p>n||g-n>=n-p?f:h,b=n-(y==f?p:g);Ao(t.text.charAt(y));)++y;var w=Jt(r,y,y==f?m:v,-1>b?-1:b>1?1:0);return w}var x=Math.ceil(d/2),k=f+x;if(c){k=f;for(var C=0;x>C;++C)k=Jo(t,k,1)}var S=o(k);S>n?(h=k,g=S,(v=l)&&(g+=1e3),d=x):(f=k,p=S,m=l,d-=x)}}function rr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==La){La=No("pre");for(var t=0;49>t;++t)La.appendChild(document.createTextNode("x")),La.appendChild(No("br"));La.appendChild(document.createTextNode("x"))}zo(e.measure,La);var r=La.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Wo(e.measure),r||1}function nr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=No("span","xxxxxxxxxx"),r=No("pre",[t]);zo(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function ir(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++Wa},Na?Na.ops.push(e.curOp):e.curOp.ownsGroup=Na={ops:[e.curOp],delayedCallbacks:[]} }function or(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r]();for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++](i.cm)}}while(r<t.length)}function ar(e){var t=e.curOp,r=t.ownsGroup;if(r)try{or(r)}finally{Na=null;for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;lr(r)}}function lr(e){for(var t=e.ops,r=0;r<t.length;r++)sr(t[r]);for(var r=0;r<t.length;r++)ur(t[r]);for(var r=0;r<t.length;r++)cr(t[r]);for(var r=0;r<t.length;r++)dr(t[r]);for(var r=0;r<t.length;r++)fr(t[r])}function sr(e){var t=e.cm,r=t.display;M(t),e.updateMaxLine&&f(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new L(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ur(e){e.updatedDisplay=e.mustUpdate&&T(e.cm,e.update)}function cr(e){var t=e.cm,r=t.display;e.updatedDisplay&&W(t),e.barMeasure=p(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Et(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+zt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Ot(t))),(e.updatedDisplay||e.selectionChanged)&&(e.newSelectionNodes=yt(t))}function dr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ur(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.newSelectionNodes&&bt(t,e.newSelectionNodes),e.updatedDisplay&&$(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.selectionChanged&&Ct(t),t.state.focused&&e.updateInput&&Nr(t,e.typing)}function fr(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&A(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(n.scrollTop),r.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-Ot(t),e.scrollLeft)),r.scrollbars.setScrollLeft(n.scrollLeft),r.scroller.scrollLeft=n.scrollLeft,x(t)),e.scrollToPos){var i=xn(t,tt(n,e.scrollToPos.from),tt(n,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&wn(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||vl(o[l],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&vl(a[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&vl(t,"changes",t,e.changeObjs)}function hr(e,t){if(e.curOp)return t();ir(e);try{return t()}finally{ar(e)}}function pr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ir(e);try{return t.apply(e,arguments)}finally{ar(e)}}}function mr(e){return function(){if(this.curOp)return e.apply(this,arguments);ir(this);try{return e.apply(this,arguments)}finally{ar(this)}}}function gr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ir(t);try{return e.apply(this,arguments)}finally{ar(t)}}}function vr(e,t,r){this.line=t,this.rest=ai(t),this.size=this.rest?Gi(wo(this.rest))-r+1:1,this.node=this.text=null,this.hidden=ui(e,t)}function yr(e,t,r){for(var n,i=[],o=t;r>o;o=n){var a=new vr(e.doc,Fi(e.doc,o),o);n=o+a.size,i.push(a)}return i}function br(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)ka&&li(e.doc,t)<i.viewTo&&xr(e);else if(r<=i.viewFrom)ka&&si(e.doc,r+n)>i.viewFrom?xr(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)xr(e);else if(t<=i.viewFrom){var o=Cr(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):xr(e)}else if(r>=i.viewTo){var o=Cr(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):xr(e)}else{var a=Cr(e,t,t,-1),l=Cr(e,r,r+n,1);a&&l?(i.view=i.view.slice(0,a.index).concat(yr(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):xr(e)}var s=i.externalMeasured;s&&(r<s.lineN?s.lineN+=n:t<s.lineN+s.size&&(i.externalMeasured=null))}function wr(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[kr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==xo(a,r)&&a.push(r)}}}function xr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function kr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,0>t)return n}function Cr(e,t,r,n){var i,o=kr(e,t),a=e.display.view;if(!ka||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=0,s=e.display.viewFrom;o>l;l++)s+=a[l].size;if(s!=t){if(n>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;li(e.doc,r)!=r;){if(o==(0>n?0:a.length-1))return null;r+=n*a[o-(0>n?1:0)].size,o+=n}return{index:o,lineN:r}}function Sr(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=yr(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=yr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(kr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(yr(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,kr(e,r)))),n.viewTo=r}function Lr(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function Mr(e){e.display.pollingFast||e.display.poll.set(e.options.pollInterval,function(){Ar(e),e.state.focused&&Mr(e)})}function Tr(e){function t(){var n=Ar(e);n||r?(e.display.pollingFast=!1,Mr(e)):(r=!0,e.display.poll.set(60,t))}var r=!1;e.display.pollingFast=!0,e.display.poll.set(20,t)}function Ar(e){var t=e.display.input,r=e.display.prevInput,n=e.doc;if(!e.state.focused||Fl(t)&&!r||Or(e)||e.options.disableInput||e.state.keySeq)return!1;e.state.pasteIncoming&&e.state.fakedLastChar&&(t.value=t.value.substring(0,t.value.length-1),e.state.fakedLastChar=!1);var i=t.value;if(i==r&&!e.somethingSelected())return!1;if(ia&&oa>=9&&e.display.inputHasSelection===i||ga&&/[\uf700-\uf7ff]/.test(i))return Nr(e),!1;var o=!e.curOp;o&&ir(e),e.display.shift=!1,8203!=i.charCodeAt(0)||n.sel!=e.display.selForContextMenu||r||(r="");for(var a=0,l=Math.min(r.length,i.length);l>a&&r.charCodeAt(a)==i.charCodeAt(a);)++a;var s=i.slice(a),u=El(s),c=null;e.state.pasteIncoming&&n.sel.ranges.length>1&&(za&&za.join("\n")==s?c=0==n.sel.ranges.length%za.length&&ko(za,El):u.length==n.sel.ranges.length&&(c=ko(u,function(e){return[e]})));for(var d=n.sel.ranges.length-1;d>=0;d--){var f=n.sel.ranges[d],h=f.from(),p=f.to();a<r.length?h=Ca(h.line,h.ch-(r.length-a)):e.state.overwrite&&f.empty()&&!e.state.pasteIncoming&&(p=Ca(p.line,Math.min(Fi(n,p.line).text.length,p.ch+wo(u).length)));var m=e.curOp.updateInput,g={from:h,to:p,text:c?c[d%c.length]:u,origin:e.state.pasteIncoming?"paste":e.state.cutIncoming?"cut":"+input"};if(hn(e.doc,g),co(e,"inputRead",e,g),s&&!e.state.pasteIncoming&&e.options.electricChars&&e.options.smartIndent&&f.head.ch<100&&(!d||n.sel.ranges[d-1].head.line!=f.head.line)){var v=e.getModeAt(f.head),y=Fa(g);if(v.electricChars){for(var b=0;b<v.electricChars.length;b++)if(s.indexOf(v.electricChars.charAt(b))>-1){Tn(e,y.line,"smart");break}}else v.electricInput&&v.electricInput.test(Fi(n,y.line).text.slice(0,y.ch))&&Tn(e,y.line,"smart")}}return Ln(e),e.curOp.updateInput=m,e.curOp.typing=!0,i.length>1e3||i.indexOf("\n")>-1?t.value=e.display.prevInput="":e.display.prevInput=i,o&&ar(e),e.state.pasteIncoming=e.state.cutIncoming=!1,!0}function Nr(e,t){if(!e.display.contextMenuPending){var r,n,i=e.doc;if(e.somethingSelected()){e.display.prevInput="";var o=i.sel.primary();r=jl&&(o.to().line-o.from().line>100||(n=e.getSelection()).length>1e3);var a=r?"-":n||e.getSelection();e.display.input.value=a,e.state.focused&&Ml(e.display.input),ia&&oa>=9&&(e.display.inputHasSelection=a)}else t||(e.display.prevInput=e.display.input.value="",ia&&oa>=9&&(e.display.inputHasSelection=null));e.display.inaccurateSelection=r}}function Wr(e){"nocursor"==e.options.readOnly||ma&&Ho()==e.display.input||e.display.input.focus()}function zr(e){e.state.focused||(Wr(e),nn(e))}function Or(e){return e.options.readOnly||e.doc.cantEdit}function Hr(e){function t(t){ho(e,t)||pl(t)}function r(t){if(e.somethingSelected())za=e.getSelections(),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,n.input.value=za.join("\n"),Ml(n.input));else{for(var r=[],i=[],o=0;o<e.doc.sel.ranges.length;o++){var a=e.doc.sel.ranges[o].head.line,l={anchor:Ca(a,0),head:Ca(a+1,0)};i.push(l),r.push(e.getRange(l.anchor,l.head))}"cut"==t.type?e.setSelections(i,null,xl):(n.prevInput="",n.input.value=r.join("\n"),Ml(n.input)),za=r}"cut"==t.type&&(e.state.cutIncoming=!0)}var n=e.display;ml(n.scroller,"mousedown",pr(e,Er)),ia&&11>oa?ml(n.scroller,"dblclick",pr(e,function(t){if(!ho(e,t)){var r=Ir(e,t);if(r&&!Gr(e,t)&&!Pr(e.display,t)){fl(t);var n=e.findWordAt(r);at(e.doc,n.anchor,n.head)}}})):ml(n.scroller,"dblclick",function(t){ho(e,t)||fl(t)}),ml(n.lineSpace,"selectstart",function(e){Pr(n,e)||fl(e)}),wa||ml(n.scroller,"contextmenu",function(t){an(e,t)}),ml(n.scroller,"scroll",function(){n.scroller.clientHeight&&(Kr(e,n.scroller.scrollTop),Ur(e,n.scroller.scrollLeft,!0),vl(e,"scroll",e))}),ml(n.scroller,"mousewheel",function(t){_r(e,t)}),ml(n.scroller,"DOMMouseScroll",function(t){_r(e,t)}),ml(n.wrapper,"scroll",function(){n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),ml(n.input,"keyup",function(t){tn.call(e,t)}),ml(n.input,"input",function(){ia&&oa>=9&&e.display.inputHasSelection&&(e.display.inputHasSelection=null),Ar(e)}),ml(n.input,"keydown",pr(e,Jr)),ml(n.input,"keypress",pr(e,rn)),ml(n.input,"focus",Lo(nn,e)),ml(n.input,"blur",Lo(on,e)),e.options.dragDrop&&(ml(n.scroller,"dragstart",function(t){qr(e,t)}),ml(n.scroller,"dragenter",t),ml(n.scroller,"dragover",t),ml(n.scroller,"drop",pr(e,Vr))),ml(n.scroller,"paste",function(t){Pr(n,t)||(e.state.pasteIncoming=!0,Wr(e),Tr(e))}),ml(n.input,"paste",function(){if(aa&&!e.state.fakedLastChar&&!(new Date-e.state.lastMiddleDown<200)){var t=n.input.selectionStart,r=n.input.selectionEnd;n.input.value+="$",n.input.selectionEnd=r,n.input.selectionStart=t,e.state.fakedLastChar=!0}e.state.pasteIncoming=!0,Tr(e)}),ml(n.input,"cut",r),ml(n.input,"copy",r),da&&ml(n.sizer,"mouseup",function(){Ho()==n.input&&n.input.blur(),Wr(e)})}function Dr(e){var t=e.display;(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth)&&(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Pr(e,t){for(var r=so(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Ir(e,t,r,n){var i=e.display;if(!r&&"true"==so(t).getAttribute("not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,u=er(e,o,a);if(n&&1==u.xRel&&(s=Fi(e.doc,u.line).text).length==u.ch){var c=Sl(s,s.length,e.options.tabSize)-s.length;u=Ca(u.line,Math.max(0,Math.round((o-Wt(e.display).left)/nr(e.display))-c))}return u}function Er(e){if(!ho(this,e)){var t=this,r=t.display;if(r.shift=e.shiftKey,Pr(r,e))return void(aa||(r.scroller.draggable=!1,setTimeout(function(){r.scroller.draggable=!0},100)));if(!Gr(t,e)){var n=Ir(t,e);switch(window.focus(),uo(e)){case 1:n?Fr(t,e,n):so(e)==r.scroller&&fl(e);break;case 2:aa&&(t.state.lastMiddleDown=+new Date),n&&at(t.doc,n),setTimeout(Lo(Wr,t),20),fl(e);break;case 3:wa&&an(t,e)}}}}function Fr(e,t,r){setTimeout(Lo(zr,e),0);var n,i=+new Date;Ta&&Ta.time>i-400&&0==Sa(Ta.pos,r)?n="triple":Ma&&Ma.time>i-400&&0==Sa(Ma.pos,r)?(n="double",Ta={time:i,pos:r}):(n="single",Ma={time:i,pos:r});var o,a=e.doc.sel,l=ga?t.metaKey:t.ctrlKey;e.options.dragDrop&&Il&&!Or(e)&&"single"==n&&(o=a.contains(r))>-1&&!a.ranges[o].empty()?jr(e,t,r,l):Rr(e,t,r,n,l)}function jr(e,t,r,n){var i=e.display,o=pr(e,function(a){aa&&(i.scroller.draggable=!1),e.state.draggingText=!1,gl(document,"mouseup",o),gl(i.scroller,"drop",o),Math.abs(t.clientX-a.clientX)+Math.abs(t.clientY-a.clientY)<10&&(fl(a),n||at(e.doc,r),Wr(e),ia&&9==oa&&setTimeout(function(){document.body.focus(),Wr(e)},20))});aa&&(i.scroller.draggable=!0),e.state.draggingText=o,i.scroller.dragDrop&&i.scroller.dragDrop(),ml(document,"mouseup",o),ml(i.scroller,"drop",o)}function Rr(e,t,r,n,i){function o(t){if(0!=Sa(g,t))if(g=t,"rect"==n){for(var i=[],o=e.options.tabSize,a=Sl(Fi(u,r.line).text,r.ch,o),l=Sl(Fi(u,t.line).text,t.ch,o),s=Math.min(a,l),h=Math.max(a,l),p=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));m>=p;p++){var v=Fi(u,p).text,y=yo(v,s,o);s==h?i.push(new Z(Ca(p,y),Ca(p,y))):v.length>y&&i.push(new Z(Ca(p,y),Ca(p,yo(v,h,o))))}i.length||i.push(new Z(r,r)),ft(u,Q(f.ranges.slice(0,d).concat(i),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=c,w=b.anchor,x=t;if("single"!=n){if("double"==n)var k=e.findWordAt(t);else var k=new Z(Ca(t.line,0),tt(u,Ca(t.line+1,0)));Sa(k.anchor,w)>0?(x=k.head,w=X(b.from(),k.anchor)):(x=k.anchor,w=_(b.to(),k.head))}var i=f.ranges.slice(0);i[d]=new Z(tt(u,w),x),ft(u,Q(i,d),kl)}}function a(t){var r=++y,i=Ir(e,t,!0,"rect"==n);if(i)if(0!=Sa(i,g)){zr(e),o(i);var l=w(s,u);(i.line>=l.to||i.line<l.from)&&setTimeout(pr(e,function(){y==r&&a(t)}),150)}else{var c=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;c&&setTimeout(pr(e,function(){y==r&&(s.scroller.scrollTop+=c,a(t))}),50)}}function l(t){y=1/0,fl(t),Wr(e),gl(document,"mousemove",b),gl(document,"mouseup",x),u.history.lastSelOrigin=null}var s=e.display,u=e.doc;fl(t);var c,d,f=u.sel,h=f.ranges;if(i&&!t.shiftKey?(d=u.sel.contains(r),c=d>-1?h[d]:new Z(r,r)):c=u.sel.primary(),t.altKey)n="rect",i||(c=new Z(r,r)),r=Ir(e,t,!0,!0),d=-1;else if("double"==n){var p=e.findWordAt(r);c=e.display.shift||u.extend?ot(u,c,p.anchor,p.head):p}else if("triple"==n){var m=new Z(Ca(r.line,0),tt(u,Ca(r.line+1,0)));c=e.display.shift||u.extend?ot(u,c,m.anchor,m.head):m}else c=ot(u,c,r);i?-1==d?(d=h.length,ft(u,Q(h.concat([c]),d),{scroll:!1,origin:"*mouse"})):h.length>1&&h[d].empty()&&"single"==n?(ft(u,Q(h.slice(0,d).concat(h.slice(d+1)),0)),f=u.sel):st(u,d,c,kl):(d=0,ft(u,new Y([c],0),kl),f=u.sel);var g=r,v=s.wrapper.getBoundingClientRect(),y=0,b=pr(e,function(e){uo(e)?a(e):l(e)}),x=pr(e,l);ml(document,"mousemove",b),ml(document,"mouseup",x)}function Br(e,t,r,n,i){try{var o=t.clientX,a=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&fl(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(a>s.bottom||!mo(e,r))return lo(t);a-=s.top-l.viewOffset;for(var u=0;u<e.options.gutters.length;++u){var c=l.gutters.childNodes[u];if(c&&c.getBoundingClientRect().right>=o){var d=Vi(e.doc,a),f=e.options.gutters[u];return i(e,r,e,d,f,t),lo(t)}}}function Gr(e,t){return Br(e,t,"gutterClick",!0,co)}function Vr(e){var t=this;if(!ho(t,e)&&!Pr(t.display,e)){fl(e),ia&&(Oa=+new Date);var r=Ir(t,e,!0),n=e.dataTransfer.files;if(r&&!Or(t))if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),a=0,l=function(e,n){var l=new FileReader;l.onload=pr(t,function(){if(o[n]=l.result,++a==i){r=tt(t.doc,r);var e={from:r,to:r,text:El(o.join("\n")),origin:"paste"};hn(t.doc,e),dt(t.doc,J(r,Fa(e)))}}),l.readAsText(e)},s=0;i>s;++s)l(n[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(Lo(Wr,t),20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(ga?e.metaKey:e.ctrlKey))var u=t.listSelections();if(ht(t.doc,J(r,r)),u)for(var s=0;s<u.length;++s)bn(t.doc,"",u[s].anchor,u[s].head,"drag");t.replaceSelection(o,"around","paste"),Wr(t)}}catch(e){}}}}function qr(e,t){if(ia&&(!e.state.draggingText||+new Date-Oa<100))return void pl(t);if(!ho(e,t)&&!Pr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!ca)){var r=No("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ua&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),ua&&r.parentNode.removeChild(r)}}function Kr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,ta||N(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),ta&&N(e),St(e,100))}function Ur(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,x(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function _r(e,t){var r=Pa(t),n=r.x,i=r.y,o=e.display,a=o.scroller;if(n&&a.scrollWidth>a.clientWidth||i&&a.scrollHeight>a.clientHeight){if(i&&ga&&aa)e:for(var l=t.target,s=o.view;l!=a;l=l.parentNode)for(var u=0;u<s.length;u++)if(s[u].node==l){e.display.currentWheelTarget=l;break e}if(n&&!ta&&!ua&&null!=Da)return i&&Kr(e,Math.max(0,Math.min(a.scrollTop+i*Da,a.scrollHeight-a.clientHeight))),Ur(e,Math.max(0,Math.min(a.scrollLeft+n*Da,a.scrollWidth-a.clientWidth))),fl(t),void(o.wheelStartX=null);if(i&&null!=Da){var c=i*Da,d=e.doc.scrollTop,f=d+o.wrapper.clientHeight;0>c?d=Math.max(0,d+c-50):f=Math.min(e.doc.height,f+c+50),N(e,{top:d,bottom:f})}20>Ha&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(Da=(Da*Ha+r)/(Ha+1),++Ha)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function $r(e,t,r){if("string"==typeof t&&(t=Xa[t],!t))return!1;e.display.pollingFast&&Ar(e)&&(e.display.pollingFast=!1);var n=e.display.shift,i=!1;try{Or(e)&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=wl}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function Xr(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Za(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Za(t,e.options.extraKeys,r,e)||Za(t,e.options.keyMap,r,e)}function Yr(e,t,r,n){var i=e.state.keySeq;if(i){if(Qa(t))return"handled";Ia.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,Nr(e))}),t=i+" "+t}var o=Xr(e,t,n);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&co(e,"keyHandled",e,t,r),("handled"==o||"multi"==o)&&(fl(r),Ct(e)),i&&!o&&/\'$/.test(t)?(fl(r),!0):!!o}function Zr(e,t){var r=Ja(t,!0);return r?t.shiftKey&&!e.state.keySeq?Yr(e,"Shift-"+r,t,function(t){return $r(e,t,!0)})||Yr(e,r,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?$r(e,t):void 0}):Yr(e,r,t,function(t){return $r(e,t)}):!1}function Qr(e,t,r){return Yr(e,"'"+r+"'",t,function(t){return $r(e,t,!0)})}function Jr(e){var t=this;if(zr(t),!ho(t,e)){ia&&11>oa&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=Zr(t,e);ua&&(Ea=n?r:null,!n&&88==r&&!jl&&(ga?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||en(t)}}function en(e){function t(e){18!=e.keyCode&&e.altKey||(Hl(r,"CodeMirror-crosshair"),gl(document,"keyup",t),gl(document,"mouseover",t))}var r=e.display.lineDiv;Dl(r,"CodeMirror-crosshair"),ml(document,"keyup",t),ml(document,"mouseover",t)}function tn(e){16==e.keyCode&&(this.doc.sel.shift=!1),ho(this,e)}function rn(e){var t=this;if(!(ho(t,e)||e.ctrlKey&&!e.altKey||ga&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(ua&&r==Ea)return Ea=null,void fl(e);if(!(ua&&(!e.which||e.which<10)||da)||!Zr(t,e)){var i=String.fromCharCode(null==n?r:n);Qr(t,e,i)||(ia&&oa>=9&&(t.display.inputHasSelection=null),Tr(t))}}}function nn(e){"nocursor"!=e.options.readOnly&&(e.state.focused||(vl(e,"focus",e),e.state.focused=!0,Dl(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(Nr(e),aa&&setTimeout(Lo(Nr,e,!0),0))),Mr(e),Ct(e))}function on(e){e.state.focused&&(vl(e,"blur",e),e.state.focused=!1,Hl(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function an(e,t){function r(){if(null!=i.input.selectionStart){var t=e.somethingSelected(),r=i.input.value=""+(t?i.input.value:"");i.prevInput=t?"":"",i.input.selectionStart=1,i.input.selectionEnd=r.length,i.selForContextMenu=e.doc.sel}}function n(){if(i.contextMenuPending=!1,i.inputDiv.style.position="relative",i.input.style.cssText=s,ia&&9>oa&&i.scrollbars.setScrollTop(i.scroller.scrollTop=a),Mr(e),null!=i.input.selectionStart){(!ia||ia&&9>oa)&&r();var t=0,n=function(){i.selForContextMenu==e.doc.sel&&0==i.input.selectionStart?pr(e,Xa.selectAll)(e):t++<10?i.detectingSelectAll=setTimeout(n,500):Nr(e)};i.detectingSelectAll=setTimeout(n,200)}}if(!ho(e,t,"contextmenu")){var i=e.display;if(!Pr(i,t)&&!ln(e,t)){var o=Ir(e,t),a=i.scroller.scrollTop;if(o&&!ua){var l=e.options.resetSelectionOnContextMenu;l&&-1==e.doc.sel.contains(o)&&pr(e,ft)(e.doc,J(o),xl);var s=i.input.style.cssText;if(i.inputDiv.style.position="absolute",i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: "+(ia?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",aa)var u=window.scrollY;if(Wr(e),aa&&window.scrollTo(null,u),Nr(e),e.somethingSelected()||(i.input.value=i.prevInput=" "),i.contextMenuPending=!0,i.selForContextMenu=e.doc.sel,clearTimeout(i.detectingSelectAll),ia&&oa>=9&&r(),wa){pl(t);var c=function(){gl(window,"mouseup",c),setTimeout(n,20)};ml(window,"mouseup",c)}else setTimeout(n,50)}}}}function ln(e,t){return mo(e,"gutterContextMenu")?Br(e,t,"gutterContextMenu",!1,vl):!1}function sn(e,t){if(Sa(e,t.from)<0)return e;if(Sa(e,t.to)<=0)return Fa(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Fa(t).ch-t.to.ch),Ca(r,n)}function un(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new Z(sn(i.anchor,t),sn(i.head,t)))}return Q(r,e.sel.primIndex)}function cn(e,t,r){return e.line==t.line?Ca(r.line,e.ch-t.ch+r.ch):Ca(r.line+(e.line-t.line),e.ch)}function dn(e,t,r){for(var n=[],i=Ca(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=cn(l.from,i,o),u=cn(Fa(l),i,o);if(i=l.to,o=u,"around"==r){var c=e.sel.ranges[a],d=Sa(c.head,c.anchor)<0;n[a]=new Z(d?u:s,d?s:u)}else n[a]=new Z(s,s)}return new Y(n,e.sel.primIndex)}function fn(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return r&&(n.update=function(t,r,n,i){t&&(this.from=tt(e,t)),r&&(this.to=tt(e,r)),n&&(this.text=n),void 0!==i&&(this.origin=i)}),vl(e,"beforeChange",e,n),e.cm&&vl(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function hn(e,t,r){if(e.cm){if(!e.cm.curOp)return pr(e.cm,hn)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(mo(e,"beforeChange")||e.cm&&mo(e.cm,"beforeChange"))||(t=fn(e,t,!0))){var n=xa&&!r&&Xn(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)pn(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else pn(e,t)}}function pn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Sa(t.from,t.to)){var r=un(e,t);Yi(e,t,r,e.cm?e.cm.curOp.id:0/0),vn(e,t,r,Un(e,t));var n=[];Ii(e,function(e,r){r||-1!=xo(n,e.history)||(ao(e.history,t),n.push(e.history)),vn(e,t,null,Un(e,t))})}}function mn(e,t,r){if(!e.cm||!e.cm.state.suppressEdits){for(var n,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(n=a[s],r?!n.ranges||n.equals(e.sel):n.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;n=a.pop(),n.ranges;){if(Ji(n,l),r&&!n.equals(e.sel))return void ft(e,n,{clearRedo:!1});o=n}var u=[];Ji(o,l),l.push({changes:u,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var c=mo(e,"beforeChange")||e.cm&&mo(e.cm,"beforeChange"),s=n.changes.length-1;s>=0;--s){var d=n.changes[s];if(d.origin=t,c&&!fn(e,d,!1))return void(a.length=0);u.push(_i(e,d));var f=s?un(e,d):wo(a);vn(e,d,f,$n(e,d)),!s&&e.cm&&e.cm.scrollIntoView({from:d.from,to:Fa(d)});var h=[];Ii(e,function(e,t){t||-1!=xo(h,e.history)||(ao(e.history,d),h.push(e.history)),vn(e,d,null,$n(e,d))})}}}}function gn(e,t){if(0!=t&&(e.first+=t,e.sel=new Y(ko(e.sel.ranges,function(e){return new Z(Ca(e.anchor.line+t,e.anchor.ch),Ca(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){br(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)wr(e.cm,n,"gutter")}}function vn(e,t,r,n){if(e.cm&&!e.cm.curOp)return pr(e.cm,vn)(e,t,r,n);if(t.to.line<e.first)return void gn(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);gn(e,i),t={from:Ca(e.first,0),to:Ca(t.to.line+i,t.to.ch),text:[wo(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:Ca(o,Fi(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ji(e,t.from,t.to),r||(r=un(e,t)),e.cm?yn(e.cm,t,n):Hi(e,t,n),ht(e,r,xl)}}function yn(e,t,r){var n=e.doc,i=e.display,a=t.from,l=t.to,s=!1,u=a.line;e.options.lineWrapping||(u=Gi(oi(Fi(n,a.line))),n.iter(u,l.line+1,function(e){return e==i.maxLine?(s=!0,!0):void 0})),n.sel.contains(t.from,t.to)>-1&&po(e),Hi(n,t,r,o(e)),e.options.lineWrapping||(n.iter(u,a.line+t.text.length,function(e){var t=d(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,a.line),St(e,400);var c=t.text.length-(l.line-a.line)-1;t.full?br(e):a.line!=l.line||1!=t.text.length||Oi(e.doc,t)?br(e,a.line,l.line+1,c):wr(e,a.line,"text");var f=mo(e,"changes"),h=mo(e,"change");if(h||f){var p={from:a,to:l,text:t.text,removed:t.removed,origin:t.origin};h&&co(e,"change",e,p),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function bn(e,t,r,n,i){if(n||(n=r),Sa(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=El(t)),hn(e,{from:r,to:n,text:t,origin:i})}function wn(e,t){if(!ho(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!ha){var o=No("div","",null,"position: absolute; top: "+(t.top-r.viewOffset-At(e.display))+"px; height: "+(t.bottom-t.top+zt(e)+r.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function xn(e,t,r,n){null==n&&(n=0);for(var i=0;5>i;i++){var o=!1,a=Zt(e,t),l=r&&r!=t?Zt(e,r):a,s=Cn(e,Math.min(a.left,l.left),Math.min(a.top,l.top)-n,Math.max(a.left,l.left),Math.max(a.bottom,l.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=s.scrollTop&&(Kr(e,s.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=s.scrollLeft&&(Ur(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return a}function kn(e,t,r,n,i){var o=Cn(e,t,r,n,i);null!=o.scrollTop&&Kr(e,o.scrollTop),null!=o.scrollLeft&&Ur(e,o.scrollLeft)}function Cn(e,t,r,n,i){var o=e.display,a=rr(e.display);0>r&&(r=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Ht(e),u={};i-r>s&&(i=r+s);var c=e.doc.height+Nt(o),d=a>r,f=i>c-a;if(l>r)u.scrollTop=d?0:r;else if(i>l+s){var h=Math.min(r,(f?c:i)-s);h!=l&&(u.scrollTop=h)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=Ot(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=n-t>m;return g&&(n=t+m),10>t?u.scrollLeft=0:p>t?u.scrollLeft=Math.max(0,t-(g?0:10)):n>m+p-3&&(u.scrollLeft=n+(g?0:10)-m),u}function Sn(e,t,r){(null!=t||null!=r)&&Mn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Ln(e){Mn(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?Ca(t.line,t.ch-1):t,n=Ca(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Mn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=Qt(e,t.from),n=Qt(e,t.to),i=Cn(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Tn(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Tt(e,t):r="prev");var a=e.options.tabSize,l=Fi(o,t),s=Sl(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u,c=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&(u=o.mode.indent(i,l.text.slice(c.length),l.text),u==wl||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?Sl(Fi(o,t-1).text,null,a):0:"add"==r?u=s+e.options.indentUnit:"subtract"==r?u=s-e.options.indentUnit:"number"==typeof r&&(u=s+r),u=Math.max(0,u);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(u/a);h;--h)f+=a,d+=" ";if(u>f&&(d+=bo(u-f)),d!=c)bn(o,d,Ca(t,0),Ca(t,c.length),"+input");else for(var h=0;h<o.sel.ranges.length;h++){var p=o.sel.ranges[h];if(p.head.line==t&&p.head.ch<c.length){var f=Ca(t,c.length);st(o,h,new Z(f,f));break}}l.stateAfter=null}function An(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=Fi(e,et(e,t)):i=Gi(t),null==i?null:(n(o,i)&&e.cm&&wr(e.cm,i,r),o)}function Nn(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&Sa(o.from,wo(n).to)<=0;){var a=n.pop();if(Sa(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}hr(e,function(){for(var t=n.length-1;t>=0;t--)bn(e.doc,"",n[t].from,n[t].to,"+delete");Ln(e)})}function Wn(e,t,r,n,i){function o(){var t=l+r;return t<e.first||t>=e.first+e.size?d=!1:(l=t,c=Fi(e,t))}function a(e){var t=(i?Jo:ea)(c,s,r,!0);if(null==t){if(e||!o())return d=!1;s=i?(0>r?Uo:Ko)(c):0>r?c.text.length:0}else s=t;return!0}var l=t.line,s=t.ch,u=r,c=Fi(e,l),d=!0;if("char"==n)a();else if("column"==n)a(!0);else if("word"==n||"group"==n)for(var f=null,h="group"==n,p=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;!(0>r)||a(!m);m=!1){var g=c.text.charAt(s)||"\n",v=Mo(g,p)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||m||v||(v="s"),f&&f!=v){0>r&&(r=1,a());break}if(v&&(f=v),r>0&&!a(!m))break}var y=vt(e,Ca(l,s),u,!0);return d||(y.hitSide=!0),y}function zn(e,t,r,n){var i,o=e.doc,a=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+r*(l-(0>r?1.5:.5)*rr(e.display))}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;;){var s=er(e,a,i);if(!s.outside)break;if(0>r?0>=i:i>=o.height){s.hitSide=!0;break}i+=5*r}return s}function On(t,r,n,i){e.defaults[t]=r,n&&(Ra[t]=i?function(e,t,r){r!=Ba&&n(e,t,r)}:n)}function Hn(e){for(var t,r,n,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else{if(!/^s(hift)$/i.test(l))throw new Error("Unrecognized modifier name: "+l);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Dn(e){return"string"==typeof e?Ya[e]:e}function Pn(e,t,r,n,i){if(n&&n.shared)return In(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return pr(e.cm,Pn)(e,t,r,n,i); var o=new tl(e,i),a=Sa(t,r);if(n&&So(n,o,!1),a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=No("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(ii(e,t.line,t,r,o)||t.line!=r.line&&ii(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");ka=!0}o.addToHistory&&Yi(e,{from:t,to:r,origin:"markText"},e.sel,0/0);var l,s=t.line,u=e.cm;if(e.iter(s,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&oi(e)==u.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&Bi(e,0),Vn(e,new Rn(o,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s}),o.collapsed&&e.iter(t.line,r.line+1,function(t){ui(e,t)&&Bi(t,0)}),o.clearOnEnter&&ml(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(xa=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++rl,o.atomic=!0),u){if(l&&(u.curOp.updateMaxLine=!0),o.collapsed)br(u,t.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=r.line;c++)wr(u,c,"text");o.atomic&&mt(u.doc),co(u,"markerAdded",u,o)}return o}function In(e,t,r,n,i){n=So(n),n.shared=!1;var o=[Pn(e,t,r,n,i)],a=o[0],l=n.widgetNode;return Ii(e,function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(Pn(e,tt(e,t),tt(e,r),n,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=wo(o)}),new nl(o,a)}function En(e){return e.findMarks(Ca(e.first,0),e.clipPos(Ca(e.lastLine())),function(e){return e.parent})}function Fn(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(Sa(o,a)){var l=Pn(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}function jn(e){for(var t=0;t<e.length;t++){var r=e[t],n=[r.primary.doc];Ii(r.primary.doc,function(e){n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==xo(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}}}function Rn(e,t,r){this.marker=e,this.from=t,this.to=r}function Bn(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Gn(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Vn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function qn(e,t,r){if(e)for(var n,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Rn(a,o.from,s?null:o.to))}}return n}function Kn(e,t,r){if(e)for(var n,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Rn(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}function Un(e,t){if(t.full)return null;var r=nt(e,t.from.line)&&Fi(e,t.from.line).markedSpans,n=nt(e,t.to.line)&&Fi(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==Sa(t.from,t.to),l=qn(r,i,a),s=Kn(n,o,a),u=1==t.text.length,c=wo(t.text).length+(u?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var h=Bn(s,f.marker);h?u&&(f.to=null==h.to?null:h.to+c):f.to=i}}if(s)for(var d=0;d<s.length;++d){var f=s[d];if(null!=f.to&&(f.to+=c),null==f.from){var h=Bn(l,f.marker);h||(f.from=c,u&&(l||(l=[])).push(f))}else f.from+=c,u&&(l||(l=[])).push(f)}l&&(l=_n(l)),s&&s!=l&&(s=_n(s));var p=[l];if(!u){var m,g=t.text.length-2;if(g>0&&l)for(var d=0;d<l.length;++d)null==l[d].to&&(m||(m=[])).push(new Rn(l[d].marker,null,null));for(var d=0;g>d;++d)p.push(m);p.push(s)}return p}function _n(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function $n(e,t){var r=ro(e,t),n=Un(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function Xn(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=xo(n,r)||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var u=i[s];if(!(Sa(u.to,l.from)<0||Sa(u.from,l.to)>0)){var c=[s,1],d=Sa(u.from,l.from),f=Sa(u.to,l.to);(0>d||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:l.from}),(f>0||!a.inclusiveRight&&!f)&&c.push({from:l.to,to:u.to}),i.splice.apply(i,c),s+=c.length-1}}return i}function Yn(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Zn(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Qn(e){return e.inclusiveLeft?-1:0}function Jn(e){return e.inclusiveRight?1:0}function ei(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=Sa(n.from,i.from)||Qn(e)-Qn(t);if(o)return-o;var a=Sa(n.to,i.to)||Jn(e)-Jn(t);return a?a:t.id-e.id}function ti(e,t){var r,n=ka&&e.markedSpans;if(n)for(var i,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||ei(r,i.marker)<0)&&(r=i.marker);return r}function ri(e){return ti(e,!0)}function ni(e){return ti(e,!1)}function ii(e,t,r,n,i){var o=Fi(e,t),a=ka&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var u=s.marker.find(0),c=Sa(u.from,r)||Qn(s.marker)-Qn(i),d=Sa(u.to,n)||Jn(s.marker)-Jn(i);if(!(c>=0&&0>=d||0>=c&&d>=0)&&(0>=c&&(Sa(u.to,r)>0||s.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(Sa(u.from,n)<0||s.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function oi(e){for(var t;t=ri(e);)e=t.find(-1,!0).line;return e}function ai(e){for(var t,r;t=ni(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function li(e,t){var r=Fi(e,t),n=oi(r);return r==n?t:Gi(n)}function si(e,t){if(t>e.lastLine())return t;var r,n=Fi(e,t);if(!ui(e,n))return t;for(;r=ni(n);)n=r.find(1,!0).line;return Gi(n)+1}function ui(e,t){var r=ka&&t.markedSpans;if(r)for(var n,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&ci(e,t,n))return!0}}function ci(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return ci(e,n.line,Bn(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&ci(e,t,i))return!0}function di(e,t,r){qi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sn(e,null,r)}function fi(e){if(null!=e.height)return e.height;if(!Oo(document.body,e.node)){var t="position: relative;";e.coverGutter&&(t+="margin-left: -"+e.cm.getGutterElement().offsetWidth+"px;"),zo(e.cm.display.measure,No("div",[e.node],null,t))}return e.height=e.node.offsetHeight}function hi(e,t,r,n){var i=new il(e,r,n);return i.noHScroll&&(e.display.alignWidgets=!0),An(e.doc,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,!ui(e.doc,t)){var n=qi(t)<e.doc.scrollTop;Bi(t,t.height+fi(i)),n&&Sn(e,null,i.height),e.curOp.forceUpdate=!0}return!0}),i}function pi(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Yn(e),Zn(e,r);var i=n?n(e):1;i!=e.height&&Bi(e,i)}function mi(e){e.parent=null,Yn(e)}function gi(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function vi(t,r){if(t.blankLine)return t.blankLine(r);if(t.innerMode){var n=e.innerMode(t,r);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function yi(t,r,n,i){for(var o=0;10>o;o++){i&&(i[0]=e.innerMode(t,n).mode);var a=t.token(r,n);if(r.pos>r.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function bi(e,t,r,n){function i(e){return{start:d.start,end:d.pos,string:d.current(),type:o||null,state:e?_a(a.mode,c):c}}var o,a=e.doc,l=a.mode;t=tt(a,t);var s,u=Fi(a,t.line),c=Tt(e,t.line,r),d=new el(u.text,e.options.tabSize);for(n&&(s=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,o=yi(l,d,c),n&&s.push(i(!0));return n?s:i()}function wi(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,u=0,c=null,d=new el(t,e.options.tabSize),f=e.options.addModeClass&&[null];for(""==t&&gi(vi(r,n),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&Ci(e,t,n,d.pos),d.pos=t.length,s=null):s=gi(yi(r,d,n,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||c!=s){for(;u<d.start;)u=Math.min(d.start,u+5e4),i(u,c);c=s}d.start=d.pos}for(;u<d.pos;){var p=Math.min(d.pos,u+5e4);i(p,c),u=p}}function xi(e,t,r,n){var i=[e.state.modeGen],o={};wi(e,t.text,e.doc.mode,r,function(e,t){i.push(e,t)},o,n);for(var a=0;a<e.state.overlays.length;++a){var l=e.state.overlays[a],s=1,u=0;wi(e,t.text,l.mode,!0,function(e,t){for(var r=s;e>u;){var n=i[s];n>e&&i.splice(s,1,e,i[s+1],n),s+=2,u=Math.min(e,n)}if(t)if(l.opaque)i.splice(r,s-r,e,"cm-overlay "+t),s=r+2;else for(;s>r;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function ki(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=xi(e,t,t.stateAfter=Tt(e,Gi(t)));t.styles=n.styles,n.classes?t.styleClasses=n.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function Ci(e,t,r,n){var i=e.doc.mode,o=new el(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&vi(i,r);!o.eol()&&o.pos<=e.options.maxHighlightLength;)yi(i,o,r),o.start=o.pos}function Si(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?ll:al;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Li(e,t){var r=No("span",null,null,aa?"padding-right: .1px":null),n={pre:No("pre",[r]),content:r,col:0,pos:0,cm:e};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;n.pos=0,n.addToken=Ti,(ia||aa)&&e.getOption("lineWrapping")&&(n.addToken=Ai(n.addToken)),Ro(e.display.measure)&&(o=Ki(a))&&(n.addToken=Ni(n.addToken,o)),n.map=[];var l=t!=e.display.externalMeasured&&Gi(a);zi(a,n,ki(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=Po(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=Po(a.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(jo(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return aa&&/\bcm-tab\b/.test(n.content.lastChild.className)&&(n.content.className="cm-tab-wrap-hack"),vl(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=Po(n.pre.className,n.textClass||"")),n}function Mi(e){var t=No("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t}function Ti(e,t,r,n,i,o,a){if(t){var l=e.cm.options.specialChars,s=!1;if(l.test(t))for(var u=document.createDocumentFragment(),c=0;;){l.lastIndex=c;var d=l.exec(t),f=d?d.index-c:t.length-c;if(f){var h=document.createTextNode(t.slice(c,c+f));u.appendChild(ia&&9>oa?No("span",[h]):h),e.map.push(e.pos,e.pos+f,h),e.col+=f,e.pos+=f}if(!d)break;if(c+=f+1," "==d[0]){var p=e.cm.options.tabSize,m=p-e.col%p,h=u.appendChild(No("span",bo(m),"cm-tab"));e.col+=m}else{var h=e.cm.options.specialCharPlaceholder(d[0]);u.appendChild(ia&&9>oa?No("span",[h]):h),e.col+=1}e.map.push(e.pos,e.pos+1,h),e.pos++}else{e.col+=t.length;var u=document.createTextNode(t);e.map.push(e.pos,e.pos+t.length,u),ia&&9>oa&&(s=!0),e.pos+=t.length}if(r||n||i||s||a){var g=r||"";n&&(g+=n),i&&(g+=i);var v=No("span",[u],g,a);return o&&(v.title=o),e.content.appendChild(v)}e.content.appendChild(u)}}function Ai(e){function t(e){for(var t=" ",r=0;r<e.length-2;++r)t+=r%2?" ":" ";return t+=" "}return function(r,n,i,o,a,l){e(r,n.replace(/ {3,}/g,t),i,o,a,l)}}function Ni(e,t){return function(r,n,i,o,a,l){i=i?i+" cm-force-border":"cm-force-border";for(var s=r.pos,u=s+n.length;;){for(var c=0;c<t.length;c++){var d=t[c];if(d.to>s&&d.from<=s)break}if(d.to>=u)return e(r,n,i,o,a,l);e(r,n.slice(0,d.to-s),i,o,null,l),o=null,n=n.slice(d.to-s),s=d.to}}}function Wi(e,t,r,n){var i=!n&&r.widgetNode;i&&(e.map.push(e.pos,e.pos+t,i),e.content.appendChild(i)),e.pos+=t}function zi(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,u,c,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=u=c=d=l="",f=null,v=1/0;for(var y=[],b=0;b<n.length;++b){var w=n[b],x=w.marker;w.from<=p&&(null==w.to||w.to>p)?(null!=w.to&&v>w.to&&(v=w.to,u=""),x.className&&(s+=" "+x.className),x.css&&(l=x.css),x.startStyle&&w.from==p&&(c+=" "+x.startStyle),x.endStyle&&w.to==v&&(u+=" "+x.endStyle),x.title&&!d&&(d=x.title),x.collapsed&&(!f||ei(f.marker,x)<0)&&(f=w)):w.from>p&&v>w.from&&(v=w.from),"bookmark"==x.type&&w.from==p&&x.widgetNode&&y.push(x)}if(f&&(f.from||0)==p&&(Wi(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to))return;if(!f&&y.length)for(var b=0;b<y.length;++b)Wi(t,0,y[b])}if(p>=h)break;for(var k=Math.min(h,v);;){if(g){var C=p+g.length;if(!f){var S=C>k?g.slice(0,k-p):g;t.addToken(t,S,a?a+s:s,c,p+S.length==v?u:"",d,l)}if(C>=k){g=g.slice(k-p),p=k;break}p=C,c=""}g=i.slice(o,o=r[m++]),a=Si(r[m++],t.cm.options)}}else for(var m=1;m<r.length;m+=2)t.addToken(t,i.slice(o,o=r[m]),Si(r[m+1],t.cm.options))}function Oi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==wo(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Hi(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){pi(e,r,i,n),co(e,"change",e,t)}function a(e,t){for(var r=e,o=[];t>r;++r)o.push(new ol(u[r],i(r),n));return o}var l=t.from,s=t.to,u=t.text,c=Fi(e,l.line),d=Fi(e,s.line),f=wo(u),h=i(u.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(Oi(e,t)){var m=a(0,u.length-1);o(d,d.text,h),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(c==d)if(1==u.length)o(c,c.text.slice(0,l.ch)+f+c.text.slice(s.ch),h);else{var m=a(1,u.length-1);m.push(new ol(f+c.text.slice(s.ch),h,n)),o(c,c.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,m)}else if(1==u.length)o(c,c.text.slice(0,l.ch)+u[0]+d.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(c,c.text.slice(0,l.ch)+u[0],i(0)),o(d,f+d.text.slice(s.ch),h);var m=a(1,u.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,m)}co(e,"change",e,t)}function Di(e){this.lines=e,this.parent=null;for(var t=0,r=0;t<e.length;++t)e[t].parent=this,r+=e[t].height;this.height=r}function Pi(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}function Ii(e,t,r){function n(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;(!r||s)&&(t(l.doc,s),n(l.doc,e,s))}}}n(e,null,!0)}function Ei(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,a(e),r(e),e.options.lineWrapping||f(e),e.options.mode=t.modeOption,br(e)}function Fi(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(o>t){r=i;break}t-=o}return r.lines[t]}function ji(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function Ri(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function Bi(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Gi(e){if(null==e.parent)return null;for(var t=e.parent,r=xo(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function Vi(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(o>t){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var n=0;n<e.lines.length;++n){var a=e.lines[n],l=a.height;if(l>t)break;t-=l}return r+n}function qi(e){e=oi(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var n=0;n<o.children.length;++n){var a=o.children[n];if(a==r)break;t+=a.height}return t}function Ki(e){var t=e.order;return null==t&&(t=e.order=Vl(e.text)),t}function Ui(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function _i(e,t){var r={from:U(t.from),to:Fa(t),text:ji(e,t.from,t.to)};return eo(e,r,t.from.line,t.to.line+1),Ii(e,function(e){eo(e,r,t.from.line,t.to.line+1)},!0),r}function $i(e){for(;e.length;){var t=wo(e);if(!t.ranges)break;e.pop()}}function Xi(e,t){return t?($i(e.done),wo(e.done)):e.done.length&&!wo(e.done).ranges?wo(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),wo(e.done)):void 0}function Yi(e,t,r,n){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Xi(i,i.lastOp==n))){var l=wo(o.changes);0==Sa(t.from,t.to)&&0==Sa(t.from,l.to)?l.to=Fa(t):o.changes.push(_i(e,t))}else{var s=wo(i.done);for(s&&s.ranges||Ji(e.sel,i.done),o={changes:[_i(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||vl(e,"historyAdded")}function Zi(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Qi(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Zi(e,o,wo(i.done),t))?i.done[i.done.length-1]=t:Ji(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&$i(i.undone)}function Ji(e,t){var r=wo(t);r&&r.ranges&&r.equals(e)||t.push(e)}function eo(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function to(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function ro(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=0,i=[];n<t.text.length;++n)i.push(to(r[n]));return i}function no(e,t,r){for(var n=0,i=[];n<e.length;++n){var o=e[n];if(o.ranges)i.push(r?Y.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];i.push({changes:l});for(var s=0;s<a.length;++s){var u,c=a[s];if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&xo(t,Number(u[1]))>-1&&(wo(l)[d]=c[d],delete c[d])}}}return i}function io(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function oo(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)io(o.ranges[l].anchor,t,r,n),io(o.ranges[l].head,t,r,n)}else{for(var l=0;l<o.changes.length;++l){var s=o.changes[l];if(r<s.from.line)s.from=Ca(s.from.line+n,s.from.ch),s.to=Ca(s.to.line+n,s.to.ch);else if(t<=s.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function ao(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;oo(e.done,r,n,i),oo(e.undone,r,n,i)}function lo(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function so(e){return e.target||e.srcElement}function uo(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),ga&&e.ctrlKey&&1==t&&(t=3),t}function co(e,t){function r(e){return function(){e.apply(null,o)}}var n=e._handlers&&e._handlers[t];if(n){var i,o=Array.prototype.slice.call(arguments,2);Na?i=Na.delayedCallbacks:yl?i=yl:(i=yl=[],setTimeout(fo,0));for(var a=0;a<n.length;++a)i.push(r(n[a]))}}function fo(){var e=yl;yl=null;for(var t=0;t<e.length;++t)e[t]()}function ho(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),vl(e,r||t.type,e,t),lo(t)||t.codemirrorIgnore}function po(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==xo(r,t[n])&&r.push(t[n])}function mo(e,t){var r=e._handlers&&e._handlers[t];return r&&r.length>0}function go(e){e.prototype.on=function(e,t){ml(this,e,t)},e.prototype.off=function(e,t){gl(this,e,t)}}function vo(){this.id=null}function yo(e,t,r){for(var n=0,i=0;;){var o=e.indexOf(" ",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function bo(e){for(;Ll.length<=e;)Ll.push(wo(Ll)+" ");return Ll[e]}function wo(e){return e[e.length-1]}function xo(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function ko(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Co(e,t){var r;if(Object.create)r=Object.create(e);else{var n=function(){};n.prototype=e,r=new n}return t&&So(t,r),r}function So(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||r===!1&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function Lo(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Mo(e,t){return t?t.source.indexOf("\\w")>-1&&Nl(e)?!0:t.test(e):Nl(e)}function To(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Ao(e){return e.charCodeAt(0)>=768&&Wl.test(e)}function No(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Wo(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function zo(e,t){return Wo(e).appendChild(t)}function Oo(e,t){if(e.contains)return e.contains(t);for(;t=t.parentNode;)if(t==e)return!0}function Ho(){return document.activeElement}function Do(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Po(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!Do(r[n]).test(t)&&(t+=" "+r[n]);return t}function Io(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function Eo(){Pl||(Fo(),Pl=!0)}function Fo(){var e;ml(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Io(Dr)},100))}),ml(window,"blur",function(){Io(on)})}function jo(e){if(null==zl){var t=No("span","");zo(e,No("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(zl=t.offsetWidth<=1&&t.offsetHeight>2&&!(ia&&8>oa))}return zl?No("span",""):No("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function Ro(e){if(null!=Ol)return Ol;var t=zo(e,document.createTextNode("AخA")),r=Tl(t,0,1).getBoundingClientRect();if(!r||r.left==r.right)return!1;var n=Tl(t,1,2).getBoundingClientRect();return Ol=n.right-r.right<3}function Bo(e){if(null!=Rl)return Rl;var t=zo(e,No("span","x")),r=t.getBoundingClientRect(),n=Tl(t,0,1).getBoundingClientRect();return Rl=Math.abs(r.left-n.left)>1}function Go(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function Vo(e){return e.level%2?e.to:e.from}function qo(e){return e.level%2?e.from:e.to}function Ko(e){var t=Ki(e);return t?Vo(t[0]):0}function Uo(e){var t=Ki(e);return t?qo(wo(t)):e.text.length}function _o(e,t){var r=Fi(e.doc,t),n=oi(r);n!=r&&(t=Gi(n));var i=Ki(n),o=i?i[0].level%2?Uo(n):Ko(n):0;return Ca(t,o)}function $o(e,t){for(var r,n=Fi(e.doc,t);r=ni(n);)n=r.find(1,!0).line,t=null;var i=Ki(n),o=i?i[0].level%2?Ko(n):Uo(n):n.text.length;return Ca(null==t?Gi(n):t,o)}function Xo(e,t){var r=_o(e,t.line),n=Fi(e.doc,r.line),i=Ki(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return Ca(r.line,a?0:o)}return r}function Yo(e,t,r){var n=e[0].level;return t==n?!0:r==n?!1:r>t}function Zo(e,t){Gl=null;for(var r,n=0;n<e.length;++n){var i=e[n];if(i.from<t&&i.to>t)return n;if(i.from==t||i.to==t){if(null!=r)return Yo(e,i.level,e[r].level)?(i.from!=i.to&&(Gl=r),n):(i.from!=i.to&&(Gl=n),r);r=n}}return r}function Qo(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&Ao(e.text.charAt(t)));return t}function Jo(e,t,r,n){var i=Ki(e);if(!i)return ea(e,t,r,n);for(var o=Zo(i,t),a=i[o],l=Qo(e,t,a.level%2?-r:r,n);;){if(l>a.from&&l<a.to)return l;if(l==a.from||l==a.to)return Zo(i,l)==o?l:(a=i[o+=r],r>0==a.level%2?a.to:a.from);if(a=i[o+=r],!a)return null;l=r>0==a.level%2?Qo(e,a.to,-1,n):Qo(e,a.from,1,n)}}function ea(e,t,r,n){var i=t+r;if(n)for(;i>0&&Ao(e.text.charAt(i));)i+=r;return 0>i||i>e.text.length?null:i}var ta=/gecko\/\d/i.test(navigator.userAgent),ra=/MSIE \d/.test(navigator.userAgent),na=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ia=ra||na,oa=ia&&(ra?document.documentMode||6:na[1]),aa=/WebKit\//.test(navigator.userAgent),la=aa&&/Qt\/\d+\.\d+/.test(navigator.userAgent),sa=/Chrome\//.test(navigator.userAgent),ua=/Opera\//.test(navigator.userAgent),ca=/Apple Computer/.test(navigator.vendor),da=/KHTML\//.test(navigator.userAgent),fa=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),ha=/PhantomJS/.test(navigator.userAgent),pa=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),ma=pa||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ga=pa||/Mac/.test(navigator.platform),va=/win/i.test(navigator.platform),ya=ua&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);ya&&(ya=Number(ya[1])),ya&&ya>=15&&(ua=!1,aa=!0);var ba=ga&&(la||ua&&(null==ya||12.11>ya)),wa=ta||ia&&oa>=9,xa=!1,ka=!1;m.prototype=So({update:function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&e.clientHeight>0&&(0==n&&this.overlayHack(),this.checkedOverlay=!0),{right:r?n:0,bottom:t?n:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e)},overlayHack:function(){var e=ga&&!fa?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=e;var t=this,r=function(e){so(e)!=t.vert&&so(e)!=t.horiz&&pr(t.cm,Er)(e)};ml(this.vert,"mousedown",r),ml(this.horiz,"mousedown",r)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=So({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g};var Ca=e.Pos=function(e,t){return this instanceof Ca?(this.line=e,void(this.ch=t)):new Ca(e,t)},Sa=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch};Y.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(0!=Sa(r.anchor,n.anchor)||0!=Sa(r.head,n.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Z(U(this.ranges[t].anchor),U(this.ranges[t].head));return new Y(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(Sa(t,n.from())>=0&&Sa(e,n.to())<=0)return r}return-1}},Z.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return _(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var La,Ma,Ta,Aa={left:0,right:0,top:0,bottom:0},Na=null,Wa=0,za=null,Oa=0,Ha=0,Da=null;ia?Da=-.53:ta?Da=15:sa?Da=-.7:ca&&(Da=-1/3);var Pa=function(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}};e.wheelEventPixels=function(e){var t=Pa(e);return t.x*=Da,t.y*=Da,t};var Ia=new vo,Ea=null,Fa=e.changeEnd=function(e){return e.text?Ca(e.from.line+e.text.length-1,wo(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),Wr(this),Tr(this)},setOption:function(e,t){var r=this.options,n=r[e];(r[e]!=t||"mode"==e)&&(r[e]=t,Ra.hasOwnProperty(e)&&pr(this,Ra[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Dn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:mr(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:n,modeSpec:t,opaque:r&&r.opaque}),this.state.modeGen++,br(this)}),removeOverlay:mr(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void br(this)}}),indentLine:mr(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),nt(this.doc,e)&&Tn(this,e,t,r)}),indentSelection:mr(function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(Tn(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&Ln(this));else{var o=i.from(),a=i.to(),l=Math.max(r,o.line);r=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;r>s;++s)Tn(this,s,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&st(this.doc,n,new Z(o,u[n].to()),xl)}}}),getTokenAt:function(e,t){return bi(this,e,t)},getLineTokens:function(e,t){return bi(this,Ca(e),t,!0)},getTokenTypeAt:function(e){e=tt(this.doc,e);var t,r=ki(this,Fi(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var l=t?t.indexOf("cm-overlay "):-1;return 0>l?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Ua.hasOwnProperty(t))return Ua;var n=Ua[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=n[i[t][o]];a&&r.push(a)}else i.helperType&&n[i.helperType]?r.push(n[i.helperType]):n[i.name]&&r.push(n[i.name]); for(var o=0;o<n._global.length;o++){var l=n._global[o];l.pred(i,this)&&-1==xo(r,l.val)&&r.push(l.val)}return r},getStateAfter:function(e,t){var r=this.doc;return e=et(r,null==e?r.first+r.size-1:e),Tt(this,e+1,t)},cursorCoords:function(e,t){var r,n=this.doc.sel.primary();return r=null==e?n.head:"object"==typeof e?tt(this.doc,e):e?n.from():n.to(),Zt(this,r,t||"page")},charCoords:function(e,t){return Yt(this,tt(this.doc,e),t||"page")},coordsChar:function(e,t){return e=Xt(this,e,t||"page"),er(this,e.left,e.top)},lineAtHeight:function(e,t){return e=Xt(this,{top:e,left:0},t||"page").top,Vi(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var r=!1,n=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>n&&(e=n,r=!0);var i=Fi(this.doc,e);return $t(this,i,{top:0,left:0},t||"page").top+(r?this.doc.height-qi(i):0)},defaultTextHeight:function(){return rr(this.display)},defaultCharWidth:function(){return nr(this.display)},setGutterMarker:mr(function(e,t,r){return An(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&To(n)&&(e.gutterMarkers=null),!0})}),clearGutter:mr(function(e){var t=this,r=t.doc,n=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&(r.gutterMarkers[e]=null,wr(t,n,"gutter"),To(r.gutterMarkers)&&(r.gutterMarkers=null)),++n})}),addLineWidget:mr(function(e,t,r){return hi(this,e,t,r)}),removeLineWidget:function(e){e.clear()},lineInfo:function(e){if("number"==typeof e){if(!nt(this.doc,e))return null;var t=e;if(e=Fi(this.doc,e),!e)return null}else{var t=Gi(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=Zt(this,tt(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>u&&(l=u-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&kn(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:mr(Jr),triggerOnKeyPress:mr(rn),triggerOnKeyUp:tn,execCommand:function(e){return Xa.hasOwnProperty(e)?Xa[e](this):void 0},findPosH:function(e,t,r,n){var i=1;0>t&&(i=-1,t=-t);for(var o=0,a=tt(this.doc,e);t>o&&(a=Wn(this.doc,a,i,r,n),!a.hitSide);++o);return a},moveH:mr(function(e,t){var r=this;r.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Wn(r.doc,n.head,e,t,r.options.rtlMoveVisually):0>e?n.from():n.to()},Cl)}),deleteH:mr(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Nn(this,function(r){var i=Wn(n,r.head,e,t,!1);return 0>e?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;0>t&&(i=-1,t=-t);for(var a=0,l=tt(this.doc,e);t>a;++a){var s=Zt(this,l,"div");if(null==o?o=s.left:s.left=o,l=zn(this,s,i,r),l.hitSide)break}return l},moveV:mr(function(e,t){var r=this,n=this.doc,i=[],o=!r.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(a){if(o)return 0>e?a.from():a.to();var l=Zt(r,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=zn(r,l,e,t);return"page"==t&&a==n.sel.primary()&&Sn(r,null,Yt(r,s,"div").top-l.top),s},Cl),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,r=Fi(t,e.line).text,n=e.ch,i=e.ch;if(r){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==r.length)&&n?--n:++i;for(var a=r.charAt(n),l=Mo(a,o)?function(e){return Mo(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Mo(e)};n>0&&l(r.charAt(n-1));)--n;for(;i<r.length&&l(r.charAt(i));)++i}return new Z(Ca(e.line,n),Ca(e.line,i))},toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?Dl(this.display.cursorDiv,"CodeMirror-overwrite"):Hl(this.display.cursorDiv,"CodeMirror-overwrite"),vl(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return Ho()==this.display.input},scrollTo:mr(function(e,t){(null!=e||null!=t)&&Mn(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-zt(this)-this.display.barHeight,width:e.scrollWidth-zt(this)-this.display.barWidth,clientHeight:Ht(this),clientWidth:Ot(this)}},scrollIntoView:mr(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:Ca(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)Mn(this),this.curOp.scrollToPos=e;else{var r=Cn(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(r.scrollLeft,r.scrollTop)}}),setSize:mr(function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var n=this;null!=e&&(n.display.wrapper.style.width=r(e)),null!=t&&(n.display.wrapper.style.height=r(t)),n.options.lineWrapping&&qt(this);var i=n.display.viewFrom;n.doc.iter(i,n.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){wr(n,i,"widget");break}++i}),n.curOp.forceUpdate=!0,vl(n,"refresh",this)}),operation:function(e){return hr(this,e)},refresh:mr(function(){var e=this.display.cachedTextHeight;br(this),this.curOp.forceUpdate=!0,Kt(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),c(this),(null==e||Math.abs(e-rr(this.display))>.5)&&a(this),vl(this,"refresh",this)}),swapDoc:mr(function(e){var t=this.doc;return t.cm=null,Ei(this,e),Kt(this),Nr(this),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,co(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},go(e);var ja=e.defaults={},Ra=e.optionHandlers={},Ba=e.Init={toString:function(){return"CodeMirror.Init"}};On("value","",function(e,t){e.setValue(t)},!0),On("mode",null,function(e,t){e.doc.modeOption=t,r(e)},!0),On("indentUnit",2,r,!0),On("indentWithTabs",!1),On("smartIndent",!0),On("tabSize",4,function(e){n(e),Kt(e),br(e)},!0),On("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t){e.options.specialChars=new RegExp(t.source+(t.test(" ")?"":"| "),"g"),e.refresh()},!0),On("specialCharPlaceholder",Mi,function(e){e.refresh()},!0),On("electricChars",!0),On("rtlMoveVisually",!va),On("wholeLineUpdateBefore",!0),On("theme","default",function(e){l(e),s(e)},!0),On("keyMap","default",function(t,r,n){var i=Dn(r),o=n!=e.Init&&Dn(n);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),On("extraKeys",null),On("lineWrapping",!1,i,!0),On("gutters",[],function(e){h(e.options),s(e)},!0),On("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?S(e.display)+"px":"0",e.refresh()},!0),On("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),On("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),On("lineNumbers",!1,function(e){h(e.options),s(e)},!0),On("firstLineNumber",1,s,!0),On("lineNumberFormatter",function(e){return e},s,!0),On("showCursorWhenSelecting",!1,wt,!0),On("resetSelectionOnContextMenu",!0),On("readOnly",!1,function(e,t){"nocursor"==t?(on(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||Nr(e))}),On("disableInput",!1,function(e,t){t||Nr(e)},!0),On("dragDrop",!0),On("cursorBlinkRate",530),On("cursorScrollMargin",0),On("cursorHeight",1,wt,!0),On("singleCursorHeightPerLine",!0,wt,!0),On("workTime",100),On("workDelay",100),On("flattenSpans",!0,n,!0),On("addModeClass",!1,n,!0),On("pollInterval",100),On("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),On("historyEventDelay",1250),On("viewportMargin",10,function(e){e.refresh()},!0),On("maxHighlightLength",1e4,n,!0),On("moveInputWithCursor",!0,function(e,t){t||(e.display.inputDiv.style.top=e.display.inputDiv.style.left=0)}),On("tabindex",null,function(e,t){e.display.input.tabIndex=t||""}),On("autofocus",null);var Ga=e.modes={},Va=e.mimeModes={};e.defineMode=function(t,r){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),Ga[t]=r},e.defineMIME=function(e,t){Va[e]=t},e.resolveMode=function(t){if("string"==typeof t&&Va.hasOwnProperty(t))t=Va[t];else if(t&&"string"==typeof t.name&&Va.hasOwnProperty(t.name)){var r=Va[t.name];"string"==typeof r&&(r={name:r}),t=Co(r,t),t.name=r.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,r){var r=e.resolveMode(r),n=Ga[r.name];if(!n)return e.getMode(t,"text/plain");var i=n(t,r);if(qa.hasOwnProperty(r.name)){var o=qa[r.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=r.name,r.helperType&&(i.helperType=r.helperType),r.modeProps)for(var a in r.modeProps)i[a]=r.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var qa=e.modeExtensions={};e.extendMode=function(e,t){var r=qa.hasOwnProperty(e)?qa[e]:qa[e]={};So(t,r)},e.defineExtension=function(t,r){e.prototype[t]=r},e.defineDocExtension=function(e,t){ul.prototype[e]=t},e.defineOption=On;var Ka=[];e.defineInitHook=function(e){Ka.push(e)};var Ua=e.helpers={};e.registerHelper=function(t,r,n){Ua.hasOwnProperty(t)||(Ua[t]=e[t]={_global:[]}),Ua[t][r]=n},e.registerGlobalHelper=function(t,r,n,i){e.registerHelper(t,r,i),Ua[t]._global.push({pred:n,val:i})};var _a=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},$a=e.startState=function(e,t,r){return e.startState?e.startState(t,r):!0};e.innerMode=function(e,t){for(;e.innerMode;){var r=e.innerMode(t);if(!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}};var Xa=e.commands={selectAll:function(e){e.setSelection(Ca(e.firstLine(),0),Ca(e.lastLine()),xl)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xl)},killLine:function(e){Nn(e,function(t){if(t.empty()){var r=Fi(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:Ca(t.head.line+1,0)}:{from:t.head,to:Ca(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Nn(e,function(t){return{from:Ca(t.from().line,0),to:tt(e.doc,Ca(t.to().line+1,0))}})},delLineLeft:function(e){Nn(e,function(e){return{from:Ca(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Nn(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){Nn(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(Ca(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(Ca(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return _o(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return Xo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return $o(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Cl)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Cl)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?Xo(e,t.head):n},Cl)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=Sl(e.getLine(o.line),o.ch,n);t.push(new Array(n-a%n+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){hr(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){var i=t[n].head,o=Fi(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new Ca(i.line,i.ch-1)),i.ch>0)i=new Ca(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Ca(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Fi(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+"\n"+a.charAt(a.length-1),Ca(i.line-1,a.length-1),Ca(i.line,1),"+transpose")}r.push(new Z(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){hr(e,function(){for(var t=e.listSelections().length,r=0;t>r;r++){var n=e.listSelections()[r];e.replaceRange("\n",n.anchor,n.head,"+input"),e.indentLine(n.from().line+1,null,!0),Ln(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},Ya=e.keyMap={};Ya.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ya.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ya.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},Ya.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ya["default"]=ga?Ya.macDefault:Ya.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=ko(r.split(" "),Hn),o=0;o<i.length;o++){var a,l;o==i.length-1?(l=r,a=n):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var u in t)e[u]=t[u];return e};var Za=e.lookupKey=function(e,t,r,n){t=Dn(t);var i=t.call?t.call(e,n):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Za(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=Za(e,t.fallthrough[o],r,n);if(a)return a}}},Qa=e.isModifierKey=function(e){var t="string"==typeof e?e:Bl[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},Ja=e.keyName=function(e,t){if(ua&&34==e.keyCode&&e["char"])return!1;var r=Bl[e.keyCode],n=r;return null==n||e.altGraphKey?!1:(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(ba?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(ba?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n)};e.fromTextArea=function(t,r){function n(){t.value=u.getValue()}if(r||(r={}),r.value=t.value,!r.tabindex&&t.tabindex&&(r.tabindex=t.tabindex),!r.placeholder&&t.placeholder&&(r.placeholder=t.placeholder),null==r.autofocus){var i=Ho();r.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form&&(ml(t.form,"submit",n),!r.leaveSubmitMethodAlone)){var o=t.form,a=o.submit;try{var l=o.submit=function(){n(),o.submit=a,o.submit(),o.submit=l}}catch(s){}}t.style.display="none";var u=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},r);return u.save=n,u.getTextArea=function(){return t},u.toTextArea=function(){u.toTextArea=isNaN,n(),t.parentNode.removeChild(u.getWrapperElement()),t.style.display="",t.form&&(gl(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=a))},u};var el=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};el.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var r=t==e;else var r=t&&(e.test?e.test(t):e(t));return r?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Sl(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Sl(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Sl(this.string,null,this.tabSize)-(this.lineStart?Sl(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var tl=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e};go(tl),tl.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&ir(e),mo(this,"clear")){var r=this.find();r&&co(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=Bn(a.markedSpans,this);e&&!this.collapsed?wr(e,Gi(a),"text"):e&&(null!=l.to&&(i=Gi(a)),null!=l.from&&(n=Gi(a))),a.markedSpans=Gn(a.markedSpans,l),null==l.from&&this.collapsed&&!ui(this.doc,a)&&e&&Bi(a,rr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var s=oi(this.lines[o]),u=d(s);u>e.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&br(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&mt(e.doc)),e&&co(e,"markerCleared",e,this),t&&ar(e),this.parent&&this.parent.clear()}},tl.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;i<this.lines.length;++i){var o=this.lines[i],a=Bn(o.markedSpans,this);if(null!=a.from&&(r=Ca(t?o:Gi(o),a.from),-1==e))return r;if(null!=a.to&&(n=Ca(t?o:Gi(o),a.to),1==e))return n}return r&&{from:r,to:n}},tl.prototype.changed=function(){var e=this.find(-1,!0),t=this,r=this.doc.cm;e&&r&&hr(r,function(){var n=e.line,i=Gi(e.line),o=Ft(r,i);if(o&&(Vt(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!ui(t.doc,n)&&null!=t.height){var a=t.height;t.height=null;var l=fi(t)-a;l&&Bi(n,n.height+l)}})},tl.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=xo(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},tl.prototype.detachLine=function(e){if(this.lines.splice(xo(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var rl=0,nl=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};go(nl),nl.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();co(this,"clear")}},nl.prototype.find=function(e,t){return this.primary.find(e,t)};var il=e.LineWidget=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.cm=e,this.node=t};go(il),il.prototype.clear=function(){var e=this.cm,t=this.line.widgets,r=this.line,n=Gi(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=fi(this);hr(e,function(){di(e,r,-o),wr(e,n,"widget"),Bi(r,Math.max(0,r.height-o))})}},il.prototype.changed=function(){var e=this.height,t=this.cm,r=this.line;this.height=null;var n=fi(this)-e;n&&hr(t,function(){t.curOp.forceUpdate=!0,di(t,r,n),Bi(r,r.height+n)})};var ol=e.Line=function(e,t,r){this.text=e,Zn(this,t),this.height=r?r(this):1};go(ol),ol.prototype.lineNo=function(){return Gi(this)};var al={},ll={};Di.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;n>r;++r){var i=this.lines[r];this.height-=i.height,mi(i),co(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;n>e;++e)if(r(this.lines[e]))return!0}},Pi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(i>e){var o=Math.min(t,i-e),a=n.height;if(n.removeInner(e,o),this.height-=a-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Di))){var l=[];this.collapse(l),this.children=[new Di(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(o>=e){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var a=i.lines.splice(i.lines.length-25,25),l=new Di(a);i.height-=l.height,this.children.splice(n+1,0,l),l.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Pi(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=xo(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new Pi(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(o>e){var a=Math.min(t,o-e);if(i.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var sl=0,ul=e.Doc=function(e,t,r){if(!(this instanceof ul))return new ul(e,t,r);null==r&&(r=0),Pi.call(this,[new Di([new ol("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=r;var n=Ca(r,0);this.sel=J(n),this.history=new Ui(null),this.id=++sl,this.modeOption=t,"string"==typeof e&&(e=El(e)),Hi(this,{from:n,to:n,text:e}),ft(this,J(n),xl)};ul.prototype=Co(Pi.prototype,{constructor:ul,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ri(this,this.first,this.first+this.size);return e===!1?t:t.join(e||"\n")},setValue:gr(function(e){var t=Ca(this.first,0),r=this.first+this.size-1;hn(this,{from:t,to:Ca(r,Fi(this,r).text.length),text:El(e),origin:"setValue",full:!0},!0),ft(this,J(t))}),replaceRange:function(e,t,r,n){t=tt(this,t),r=r?tt(this,r):t,bn(this,e,t,r,n)},getRange:function(e,t,r){var n=ji(this,tt(this,e),tt(this,t));return r===!1?n:n.join(r||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return nt(this,e)?Fi(this,e):void 0},getLineNumber:function(e){return Gi(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Fi(this,e)),oi(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return tt(this,e)},getCursor:function(e){var t,r=this.sel.primary();return t=null==e||"head"==e?r.head:"anchor"==e?r.anchor:"end"==e||"to"==e||e===!1?r.to():r.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:gr(function(e,t,r){ut(this,tt(this,"number"==typeof e?Ca(e,t||0):e),null,r)}),setSelection:gr(function(e,t,r){ut(this,tt(this,e),tt(this,t||e),r)}),extendSelection:gr(function(e,t,r){at(this,tt(this,e),t&&tt(this,t),r)}),extendSelections:gr(function(e,t){lt(this,it(this,e,t))}),extendSelectionsBy:gr(function(e,t){lt(this,ko(this.sel.ranges,e),t)}),setSelections:gr(function(e,t,r){if(e.length){for(var n=0,i=[];n<e.length;n++)i[n]=new Z(tt(this,e[n].anchor),tt(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ft(this,Q(i,t),r)}}),addSelection:gr(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Z(tt(this,e),tt(this,t||e))),ft(this,Q(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=ji(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||"\n")},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=ji(this,r[n].from(),r[n].to());e!==!1&&(i=i.join(e||"\n")),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:gr(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:El(e[o]),origin:r}}for(var l=t&&"end"!=t&&dn(this,n,t),o=n.length-1;o>=0;o--)hn(this,n[o]);l?dt(this,l):this.cm&&Ln(this.cm)}),undo:gr(function(){mn(this,"undo")}),redo:gr(function(){mn(this,"redo")}),undoSelection:gr(function(){mn(this,"undo",!0)}),redoSelection:gr(function(){mn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new Ui(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:no(this.history.done),undone:no(this.history.undone)}},setHistory:function(e){var t=this.history=new Ui(this.history.maxGeneration);t.done=no(e.done.slice(0),null,!0),t.undone=no(e.undone.slice(0),null,!0)},addLineClass:gr(function(e,t,r){return An(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(Do(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0})}),removeLineClass:gr(function(e,t,r){return An(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(Do(r));if(!o)return!1;var a=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),markText:function(e,t,r){return Pn(this,tt(this,e),tt(this,t),r,"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared};return e=tt(this,e),Pn(this,e,e,r,"bookmark")},findMarksAt:function(e){e=tt(this,e);var t=[],r=Fi(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=tt(this,e),t=tt(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];i==e.line&&e.ch>s.to||null==s.from&&i!=e.line||i==t.line&&s.from>t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans; if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first;return this.iter(function(n){var i=n.text.length+1;return i>e?(t=e,!0):(e-=i,void++r)}),tt(this,Ca(r,t))},indexFromPos:function(e){e=tt(this,e);var t=e.ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new ul(Ri(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new ul(Ri(this,t,r),e.mode||this.modeOption,t);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Fn(n,En(this)),n},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=this.linked[r];if(n.doc==t){this.linked.splice(r,1),t.unlinkDoc(this),jn(En(this));break}}if(t.history==this.history){var i=[t.id];Ii(t,function(e){i.push(e.id)},!0),t.history=new Ui(null),t.history.done=no(this.history.done,i),t.history.undone=no(this.history.undone,i)}},iterLinkedDocs:function(e){Ii(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),ul.prototype.eachLine=ul.prototype.iter;var cl="iter insert remove copy getEditor".split(" ");for(var dl in ul.prototype)ul.prototype.hasOwnProperty(dl)&&xo(cl,dl)<0&&(e.prototype[dl]=function(e){return function(){return e.apply(this.doc,arguments)}}(ul.prototype[dl]));go(ul);var fl=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},hl=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},pl=e.e_stop=function(e){fl(e),hl(e)},ml=e.on=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={}),i=n[t]||(n[t]=[]);i.push(r)}},gl=e.off=function(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers&&e._handlers[t];if(!n)return;for(var i=0;i<n.length;++i)if(n[i]==r){n.splice(i,1);break}}},vl=e.signal=function(e,t){var r=e._handlers&&e._handlers[t];if(r)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)},yl=null,bl=30,wl=e.Pass={toString:function(){return"CodeMirror.Pass"}},xl={scroll:!1},kl={origin:"*mouse"},Cl={origin:"+move"};vo.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Sl=e.countColumn=function(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=n||0,a=i||0;;){var l=e.indexOf(" ",o);if(0>l||l>=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}},Ll=[""],Ml=function(e){e.select()};pa?Ml=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:ia&&(Ml=function(e){try{e.select()}catch(t){}});var Tl,Al=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Nl=e.isWordChar=function(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Al.test(e))},Wl=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Tl=document.createRange?function(e,t,r){var n=document.createRange();return n.setEnd(e,r),n.setStart(e,t),n}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n},ia&&11>oa&&(Ho=function(){try{return document.activeElement}catch(e){return document.body}});var zl,Ol,Hl=e.rmClass=function(e,t){var r=e.className,n=Do(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}},Dl=e.addClass=function(e,t){var r=e.className;Do(t).test(r)||(e.className+=(r?" ":"")+t)},Pl=!1,Il=function(){if(ia&&9>oa)return!1;var e=No("div");return"draggable"in e||"dragDrop"in e}(),El=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;n>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Fl=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(r){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},jl=function(){var e=No("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Rl=null,Bl={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=Bl,function(){for(var e=0;10>e;e++)Bl[e+48]=Bl[e+96]=String(e);for(var e=65;90>=e;e++)Bl[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)Bl[e+111]=Bl[e+63235]="F"+e}();var Gl,Vl=function(){function e(e){return 247>=e?r.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?n.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,u="L";return function(r){if(!i.test(r))return!1;for(var n,c=r.length,d=[],f=0;c>f;++f)d.push(n=e(r.charCodeAt(f)));for(var f=0,h=u;c>f;++f){var n=d[f];"m"==n?d[f]=h:h=n}for(var f=0,p=u;c>f;++f){var n=d[f];"1"==n&&"r"==p?d[f]="n":a.test(n)&&(p=n,"r"==n&&(d[f]="R"))}for(var f=1,h=d[0];c-1>f;++f){var n=d[f];"+"==n&&"1"==h&&"1"==d[f+1]?d[f]="1":","!=n||h!=d[f+1]||"1"!=h&&"n"!=h||(d[f]=h),h=n}for(var f=0;c>f;++f){var n=d[f];if(","==n)d[f]="N";else if("%"==n){for(var m=f+1;c>m&&"%"==d[m];++m);for(var g=f&&"!"==d[f-1]||c>m&&"1"==d[m]?"1":"N",v=f;m>v;++v)d[v]=g;f=m-1}}for(var f=0,p=u;c>f;++f){var n=d[f];"L"==p&&"1"==n?d[f]="L":a.test(n)&&(p=n)}for(var f=0;c>f;++f)if(o.test(d[f])){for(var m=f+1;c>m&&o.test(d[m]);++m);for(var y="L"==(f?d[f-1]:u),b="L"==(c>m?d[m]:u),g=y||b?"L":"R",v=f;m>v;++v)d[v]=g;f=m-1}for(var w,x=[],f=0;c>f;)if(l.test(d[f])){var k=f;for(++f;c>f&&l.test(d[f]);++f);x.push(new t(0,k,f))}else{var C=f,S=x.length;for(++f;c>f&&"L"!=d[f];++f);for(var v=C;f>v;)if(s.test(d[v])){v>C&&x.splice(S,0,new t(1,C,v));var L=v;for(++v;f>v&&s.test(d[v]);++v);x.splice(S,0,new t(2,L,v)),C=v}else++v;f>C&&x.splice(S,0,new t(1,C,f))}return 1==x[0].level&&(w=r.match(/^\s+/))&&(x[0].from=w[0].length,x.unshift(new t(0,0,w[0].length))),1==wo(x).level&&(w=r.match(/\s+$/))&&(wo(x).to-=w[0].length,x.push(new t(0,c-w[0].length,c))),x[0].level!=wo(x).level&&x.push(new t(x[0].level,c,c)),x}}();return e.version="4.11.1",e}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=!0;return t}function r(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}function n(e,t){return e.skipTo("-->")?(e.match("-->"),t.tokenize=null):e.skipToEnd(),["comment","comment"]}e.defineMode("css",function(t,r){function n(e,t){return h=t,e}function i(e,t){var r=e.next();if(g[r]){var i=g[r](e,t);if(i!==!1)return i}return"@"==r?(e.eatWhile(/[\w\\\-]/),n("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?n(null,"compare"):'"'==r||"'"==r?(t.tokenize=o(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),n("atom","hash")):"!"==r?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),n("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):"u"==r&&e.match("rl(")?(e.backUp(1),t.tokenize=a,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^\w+-/)?n("meta","meta"):void 0}function o(e){return function(t,r){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(r.tokenize=null),n("string","string")}}function a(e,t){return e.next(),t.tokenize=e.match(/\s*[\"\')]/,!1)?null:o(")"),n(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r){return e.context=new l(r,t.indentation()+m,e.context),r}function u(e){return e.context=e.context.prev,e.context.type}function c(e,t,r){return L[r.context.type](e,t,r)}function d(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return c(e,t,r)}function f(e){var t=e.current().toLowerCase();p=k.hasOwnProperty(t)?"atom":x.hasOwnProperty(t)?"keyword":"variable"}r.propertyKeywords||(r=e.resolveMode("text/css"));var h,p,m=t.indentUnit,g=r.tokenHooks,v=r.mediaTypes||{},y=r.mediaFeatures||{},b=r.propertyKeywords||{},w=r.nonStandardPropertyKeywords||{},x=r.colorKeywords||{},k=r.valueKeywords||{},C=r.fontProperties||{},S=r.allowNested,L={};return L.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return u(r);if("@media"==e)return s(r,t,"media");if("@font-face"==e)return"font_face_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)p="builtin";else if("word"==e)p="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(S&&"("==e)return s(r,t,"parens")}return r.context.type},L.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return b.hasOwnProperty(n)?(p="property","maybeprop"):w.hasOwnProperty(n)?(p="string-2","maybeprop"):S?(p=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(p+=" error","maybeprop")}return"meta"==e?"block":S||"hash"!=e&&"qualifier"!=e?L.top(e,t,r):(p="error","block")},L.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):c(e,t,r)},L.prop=function(e,t,r){if(";"==e)return u(r);if("{"==e&&S)return s(r,t,"propBlock");if("}"==e||"{"==e)return d(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return s(r,t,"interpolation")}else p+=" error";return"prop"},L.propBlock=function(e,t,r){return"}"==e?u(r):"word"==e?(p="property","maybeprop"):r.context.type},L.parens=function(e,t,r){return"{"==e||"}"==e?d(e,t,r):")"==e?u(r):"("==e?s(r,t,"parens"):("word"==e&&f(t),"parens")},L.pseudo=function(e,t,r){return"word"==e?(p="variable-3",r.context.type):c(e,t,r)},L.media=function(e,t,r){if("("==e)return s(r,t,"media_parens");if("}"==e)return d(e,t,r);if("{"==e)return u(r)&&s(r,t,S?"block":"top");if("word"==e){var n=t.current().toLowerCase();p="only"==n||"not"==n||"and"==n?"keyword":v.hasOwnProperty(n)?"attribute":y.hasOwnProperty(n)?"property":"error"}return r.context.type},L.media_parens=function(e,t,r){return")"==e?u(r):"{"==e||"}"==e?d(e,t,r,2):L.media(e,t,r)},L.font_face_before=function(e,t,r){return"{"==e?s(r,t,"font_face"):c(e,t,r)},L.font_face=function(e,t,r){return"}"==e?u(r):"word"==e?(p=C.hasOwnProperty(t.current().toLowerCase())?"property":"error","maybeprop"):"font_face"},L.keyframes=function(e,t,r){return"word"==e?(p="variable","keyframes"):"{"==e?s(r,t,"top"):c(e,t,r)},L.at=function(e,t,r){return";"==e?u(r):"{"==e||"}"==e?d(e,t,r):("word"==e?p="tag":"hash"==e&&(p="builtin"),"at")},L.interpolation=function(e,t,r){return"}"==e?u(r):"{"==e||";"==e?d(e,t,r):("variable"!=e&&(p="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:"top",context:new l("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||i)(e,t);return r&&"object"==typeof r&&(h=r[1],r=r[0]),p=r,t.state=L[t.state](h,e,t),p},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),!r.prev||("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"font_face"!=r.type)&&(")"!=n||"parens"!=r.type&&"media_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"media"!=r.type)||(i=r.indent-m,r=r.prev),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(i),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],l=t(a),s=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=t(s),c=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],d=t(c),f=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],h=t(f),p=["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"],m=t(p),g=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],v=t(g),y=i.concat(a).concat(s).concat(c).concat(f).concat(p);e.registerHelper("hintWords","css",y),e.defineMIME("text/css",{mediaTypes:o,mediaFeatures:l,propertyKeywords:u,nonStandardPropertyKeywords:d,colorKeywords:h,valueKeywords:m,fontProperties:v,tokenHooks:{"<":function(e,t){return e.match("!--")?(t.tokenize=n,n(e,t)):!1},"/":function(e,t){return e.eat("*")?(t.tokenize=r,r(e,t)):!1}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:l,propertyKeywords:u,nonStandardPropertyKeywords:d,colorKeywords:h,valueKeywords:m,fontProperties:v,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return e.match(/\s*\{/)?[null,"{"]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return e.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:l,propertyKeywords:u,nonStandardPropertyKeywords:d,colorKeywords:h,valueKeywords:m,fontProperties:v,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlmixed",function(t,r){function n(e,t){var r=t.htmlState.tagName;r&&(r=r.toLowerCase());var n=l.token(e,t.htmlState);if("script"==r&&/\btag\b/.test(n)&&">"==e.current()){var i=e.string.slice(Math.max(0,e.pos-100),e.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);i=i?i[1]:"",i&&/[\"\']/.test(i.charAt(0))&&(i=i.slice(1,i.length-1));for(var c=0;c<u.length;++c){var d=u[c];if("string"==typeof d.matches?i==d.matches:d.matches.test(i)){d.mode&&(t.token=o,t.localMode=d.mode,t.localState=d.mode.startState&&d.mode.startState(l.indent(t.htmlState,"")));break}}}else"style"==r&&/\btag\b/.test(n)&&">"==e.current()&&(t.token=a,t.localMode=s,t.localState=s.startState(l.indent(t.htmlState,"")));return n}function i(e,t,r){var n,i=e.current(),o=i.search(t);return o>-1?e.backUp(i.length-o):(n=i.match(/<\/?$/))&&(e.backUp(i.length),e.match(t,!1)||e.match(i)),r }function o(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=n,t.localState=t.localMode=null,null):i(e,/<\/\s*script\s*>/,t.localMode.token(e,t.localState))}function a(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=n,t.localState=t.localMode=null,null):i(e,/<\/\s*style\s*>/,s.token(e,t.localState))}var l=e.getMode(t,{name:"xml",htmlMode:!0,multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag}),s=e.getMode(t,"css"),u=[],c=r&&r.scriptTypes;if(u.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:e.getMode(t,"javascript")}),c)for(var d=0;d<c.length;++d){var f=c[d];u.push({matches:f.matches,mode:f.mode&&e.getMode(t,f.mode)})}return u.push({matches:/./,mode:e.getMode(t,"text/plain")}),{startState:function(){var e=l.startState();return{token:n,localMode:null,localState:null,htmlState:e}},copyState:function(t){if(t.localState)var r=e.copyState(t.localMode,t.localState);return{token:t.token,localMode:t.localMode,localState:r,htmlState:e.copyState(l,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r){return!t.localMode||/^\s*<\//.test(r)?l.indent(t.htmlState,r):t.localMode.indent?t.localMode.indent(t.localState,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||l}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,r){function n(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function i(e,t,r){return mt=e,gt=r,t}function o(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=a(r),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==r&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return i(r);if("="==r&&e.eat(">"))return i("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==r)return e.eat("*")?(t.tokenize=l,l(e,t)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(n(e),e.eatWhile(/[gimy]/),i("regexp","string-2")):(e.eatWhile(St),i("operator","operator",e.current()));if("`"==r)return t.tokenize=s,s(e,t);if("#"==r)return e.skipToEnd(),i("error","error");if(St.test(r))return e.eatWhile(St),i("operator","operator",e.current());if(kt.test(r)){e.eatWhile(kt);var o=e.current(),u=Ct.propertyIsEnumerable(o)&&Ct[o];return u&&"."!=t.lastType?i(u.type,u.style,o):i("variable","variable",o)}}function a(e){return function(t,r){var n,a=!1;if(bt&&"@"==t.peek()&&t.match(Lt))return r.tokenize=o,i("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||a);)a=!a&&"\\"==n;return a||(r.tokenize=o),i("string","string")}}function l(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=o;break}n="*"==r}return i("comment","comment")}function s(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=o;break}n=!n&&"\\"==r}return i("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(0>r)){for(var n=0,i=!1,o=r-1;o>=0;--o){var a=e.string.charAt(o),l=Mt.indexOf(a);if(l>=0&&3>l){if(!n){++o;break}if(0==--n)break}else if(l>=3&&6>l)++n;else if(kt.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!n){++o;break}}}i&&!n&&(t.fatArrowAt=o)}}function c(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function d(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function f(e,t,r,n,i){var o=e.cc;for(At.state=e,At.stream=i,At.marked=null,At.cc=o,At.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():wt?k:x;if(a(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return At.marked?At.marked:"variable"==r&&d(e,n)?"variable-2":t}}}function h(){for(var e=arguments.length-1;e>=0;e--)At.cc.push(arguments[e])}function p(){return h.apply(null,arguments),!0}function m(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var n=At.state;if(n.context){if(At.marked="def",t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function g(){At.state.context={prev:At.state.context,vars:At.state.localVars},At.state.localVars=Nt}function v(){At.state.localVars=At.state.context.vars,At.state.context=At.state.context.prev}function y(e,t){var r=function(){var r=At.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new c(n,At.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function b(){var e=At.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function w(e){function t(r){return r==e?p():";"==e?h():p(t)}return t}function x(e,t){return"var"==e?p(y("vardef",t.length),G,w(";"),b):"keyword a"==e?p(y("form"),k,x,b):"keyword b"==e?p(y("form"),x,b):"{"==e?p(y("}"),j,b):";"==e?p():"if"==e?("else"==At.state.lexical.info&&At.state.cc[At.state.cc.length-1]==b&&At.state.cc.pop()(),p(y("form"),k,x,b,_)):"function"==e?p(et):"for"==e?p(y("form"),X,x,b):"variable"==e?p(y("stat"),H):"switch"==e?p(y("form"),k,y("}","switch"),w("{"),j,b,b):"case"==e?p(k,w(":")):"default"==e?p(w(":")):"catch"==e?p(y("form"),g,w("("),tt,w(")"),x,b,v):"module"==e?p(y("form"),g,at,v,b):"class"==e?p(y("form"),rt,b):"export"==e?p(y("form"),lt,b):"import"==e?p(y("form"),st,b):h(y("stat"),k,w(";"),b)}function k(e){return S(e,!1)}function C(e){return S(e,!0)}function S(e,t){if(At.state.fatArrowAt==At.stream.start){var r=t?O:z;if("("==e)return p(g,y(")"),E(V,")"),b,w("=>"),r,v);if("variable"==e)return h(g,V,w("=>"),r,v)}var n=t?A:T;return Tt.hasOwnProperty(e)?p(n):"function"==e?p(et,n):"keyword c"==e?p(t?M:L):"("==e?p(y(")"),L,ht,w(")"),b,n):"operator"==e||"spread"==e?p(t?C:k):"["==e?p(y("]"),dt,b,n):"{"==e?F(P,"}",null,n):"quasi"==e?h(N,n):p()}function L(e){return e.match(/[;\}\)\],]/)?h():h(k)}function M(e){return e.match(/[;\}\)\],]/)?h():h(C)}function T(e,t){return","==e?p(k):A(e,t,!1)}function A(e,t,r){var n=0==r?T:A,i=0==r?k:C;return"=>"==e?p(g,r?O:z,v):"operator"==e?/\+\+|--/.test(t)?p(n):"?"==t?p(k,w(":"),i):p(i):"quasi"==e?h(N,n):";"!=e?"("==e?F(C,")","call",n):"."==e?p(D,n):"["==e?p(y("]"),L,w("]"),b,n):void 0:void 0}function N(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?p(N):p(k,W)}function W(e){return"}"==e?(At.marked="string-2",At.state.tokenize=s,p(N)):void 0}function z(e){return u(At.stream,At.state),h("{"==e?x:k)}function O(e){return u(At.stream,At.state),h("{"==e?x:C)}function H(e){return":"==e?p(b,x):h(T,w(";"),b)}function D(e){return"variable"==e?(At.marked="property",p()):void 0}function P(e,t){return"variable"==e||"keyword"==At.style?(At.marked="property",p("get"==t||"set"==t?I:$)):"number"==e||"string"==e?(At.marked=bt?"property":At.style+" property",p($)):"jsonld-keyword"==e?p($):"["==e?p(k,w("]"),$):void 0}function I(e){return"variable"!=e?h($):(At.marked="property",p(et))}function $(e){return":"==e?p(C):"("==e?h(et):void 0}function E(e,t){function r(n){if(","==n){var i=At.state.lexical;return"call"==i.info&&(i.pos=(i.pos||0)+1),p(e,r)}return n==t?p():p(w(t))}return function(n){return n==t?p():h(e,r)}}function F(e,t,r){for(var n=3;n<arguments.length;n++)At.cc.push(arguments[n]);return p(y(t,r),E(e,t),b)}function j(e){return"}"==e?p():h(x,j)}function R(e){return xt&&":"==e?p(B):void 0}function B(e){return"variable"==e?(At.marked="variable-3",p()):void 0}function G(){return h(V,R,K,U)}function V(e,t){return"variable"==e?(m(t),p()):"["==e?F(V,"]"):"{"==e?F(q,"}"):void 0}function q(e,t){return"variable"!=e||At.stream.match(/^\s*:/,!1)?("variable"==e&&(At.marked="property"),p(w(":"),V,K)):(m(t),p(K))}function K(e,t){return"="==t?p(C):void 0}function U(e){return","==e?p(G):void 0}function _(e,t){return"keyword b"==e&&"else"==t?p(y("form","else"),x,b):void 0}function X(e){return"("==e?p(y(")"),Y,w(")"),b):void 0}function Y(e){return"var"==e?p(G,w(";"),Q):";"==e?p(Q):"variable"==e?p(Z):h(k,w(";"),Q)}function Z(e,t){return"in"==t||"of"==t?(At.marked="keyword",p(k)):p(T,Q)}function Q(e,t){return";"==e?p(J):"in"==t||"of"==t?(At.marked="keyword",p(k)):h(k,w(";"),J)}function J(e){")"!=e&&p(k)}function et(e,t){return"*"==t?(At.marked="keyword",p(et)):"variable"==e?(m(t),p(et)):"("==e?p(g,y(")"),E(tt,")"),b,x,v):void 0}function tt(e){return"spread"==e?p(tt):h(V,R)}function rt(e,t){return"variable"==e?(m(t),p(nt)):void 0}function nt(e,t){return"extends"==t?p(k,nt):"{"==e?p(y("}"),it,b):void 0}function it(e,t){return"variable"==e||"keyword"==At.style?(At.marked="property","get"==t||"set"==t?p(ot,et,it):p(et,it)):"*"==t?(At.marked="keyword",p(it)):";"==e?p(it):"}"==e?p():void 0}function ot(e){return"variable"!=e?h():(At.marked="property",p())}function at(e,t){return"string"==e?p(x):"variable"==e?(m(t),p(ct)):void 0}function lt(e,t){return"*"==t?(At.marked="keyword",p(ct,w(";"))):"default"==t?(At.marked="keyword",p(k,w(";"))):h(x)}function st(e){return"string"==e?p():h(ut,ct)}function ut(e,t){return"{"==e?F(ut,"}"):("variable"==e&&m(t),p())}function ct(e,t){return"from"==t?(At.marked="keyword",p(k)):void 0}function dt(e){return"]"==e?p():h(C,ft)}function ft(e){return"for"==e?h(ht,w("]")):","==e?p(E(M,"]")):h(E(C,"]"))}function ht(e){return"for"==e?p(X,ht):"if"==e?p(k,ht):void 0}function pt(e,t){return"operator"==e.lastType||","==e.lastType||St.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var mt,gt,vt=t.indentUnit,yt=r.statementIndent,bt=r.jsonld,wt=r.json||bt,xt=r.typescript,kt=r.wordCharacters||/[\w$\xa1-\uffff]/,Ct=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={"if":e("if"),"while":t,"with":t,"else":r,"do":r,"try":r,"finally":r,"return":n,"break":n,"continue":n,"new":n,"delete":n,"throw":n,"debugger":n,"var":e("var"),"const":e("var"),let:e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":e("this"),module:e("module"),"class":e("class"),"super":e("atom"),"yield":n,"export":e("export"),"import":e("import"),"extends":n};if(xt){var l={type:"variable",style:"variable-3"},s={"interface":e("interface"),"extends":e("extends"),constructor:e("constructor"),"public":e("public"),"private":e("private"),"protected":e("protected"),"static":e("static"),string:l,number:l,bool:l,any:l};for(var u in s)a[u]=s[u]}return a}(),St=/[+\-*&%=<>!?|~^]/,Lt=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Mt="([{}])",Tt={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},At={state:null,column:null,marked:null,cc:null},Nt={name:"this",next:{name:"arguments"}};return b.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new c((e||0)-vt,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=l&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==mt?r:(t.lastType="operator"!=mt||"++"!=gt&&"--"!=gt?mt:"incdec",f(t,r,mt,gt,e))},indent:function(t,n){if(t.tokenize==l)return e.Pass;if(t.tokenize!=o)return 0;var i=n&&n.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(n))for(var s=t.cc.length-1;s>=0;--s){var u=t.cc[s];if(u==b)a=a.prev;else if(u!=_)break}"stat"==a.type&&"}"==i&&(a=a.prev),yt&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var c=a.type,d=i==c;return"vardef"==c?a.indented+("operator"==t.lastType||","==t.lastType?a.info+1:0):"form"==c&&"{"==i?a.indented:"form"==c?a.indented+vt:"stat"==c?a.indented+(pt(t,n)?yt||vt:0):"switch"!=a.info||d||0==r.doubleIndentSwitch?a.align?a.column+(d?0:1):a.indented+(d?0:vt):a.indented+(/^(?:case|default)\b/.test(n)?vt:2*vt)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:wt?null:"/*",blockCommentEnd:wt?null:"*/",lineComment:wt?null:"//",fold:"brace",helperType:wt?"json":"javascript",jsonldMode:bt,jsonMode:wt}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("xml",function(t,r){function n(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?r(a("atom","]]>")):null:e.match("--")?r(a("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(l(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=a("meta","?>"),"meta"):(C=e.eat("/")?"closeTag":"openTag",t.tokenize=i,"tag bracket");if("&"==n){var o;return o=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),o?"atom":"error"}return e.eatWhile(/[^&<]/),null}function i(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=n,C=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return C="equals",null;if("<"==r){t.tokenize=n,t.state=d,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=o(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function o(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=i;break}return"string"};return t.isInAttribute=!0,t}function a(e,t){return function(r,i){for(;!r.eol();){if(r.match(t)){i.tokenize=n;break}r.next()}return e}}function l(e){return function(t,r){for(var i;null!=(i=t.next());){if("<"==i)return r.tokenize=l(e+1),r.tokenize(t,r);if(">"==i){if(1==e){r.tokenize=n;break}return r.tokenize=l(e-1),r.tokenize(t,r)}}return"meta"}}function s(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(L.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function u(e){e.context&&(e.context=e.context.prev)}function c(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!L.contextGrabbers.hasOwnProperty(r)||!L.contextGrabbers[r].hasOwnProperty(t))return;u(e)}}function d(e,t,r){return"openTag"==e?(r.tagStart=t.column(),f):"closeTag"==e?h:d}function f(e,t,r){return"word"==e?(r.tagName=t.current(),S="tag",g):(S="error",f)}function h(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&L.implicitlyClosed.hasOwnProperty(r.context.tagName)&&u(r),r.context&&r.context.tagName==n?(S="tag",p):(S="tag error",m)}return S="error",m}function p(e,t,r){return"endTag"!=e?(S="error",p):(u(r),d)}function m(e,t,r){return S="error",p(e,t,r)}function g(e,t,r){if("word"==e)return S="attribute",v;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||L.autoSelfClosers.hasOwnProperty(n)?c(r,n):(c(r,n),r.context=new s(r,n,i==r.indented)),d}return S="error",g}function v(e,t,r){return"equals"==e?y:(L.allowMissing||(S="error"),g(e,t,r))}function y(e,t,r){return"string"==e?b:"word"==e&&L.allowUnquoted?(S="string",g):(S="error",g(e,t,r))}function b(e,t,r){return"string"==e?b:g(e,t,r)}var w=t.indentUnit,x=r.multilineTagIndentFactor||1,k=r.multilineTagIndentPastTag;null==k&&(k=!0);var C,S,L=r.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},M=r.alignCDATA;return{startState:function(){return{tokenize:n,state:d,indented:0,tagName:null,tagStart:null,context:null}},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;C=null;var r=t.tokenize(e,t);return(r||C)&&"comment"!=r&&(S=null,t.state=t.state(C||r,e,t),S&&(r="error"==S?r+" error":S)),r},indent:function(t,r,o){var a=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+w;if(a&&a.noIndent)return e.Pass;if(t.tokenize!=i&&t.tokenize!=n)return o?o.match(/^(\s*)/)[0].length:0;if(t.tagName)return k?t.tagStart+t.tagName.length+2:t.tagStart+w*x;if(M&&/<!\[CDATA\[/.test(r))return 0;var l=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(l&&l[1])for(;a;){if(a.tagName==l[2]){a=a.prev;break}if(!L.implicitlyClosed.hasOwnProperty(a.tagName))break;a=a.prev}else if(l)for(;a;){var s=L.contextGrabbers[a.tagName];if(!s||!s.hasOwnProperty(l[2]))break;a=a.prev}for(;a&&!a.startOfLine;)a=a.prev;return a?a.indent+w:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:r.htmlMode?"html":"xml",helperType:r.htmlMode?"html":"xml"}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,r,n){return{startState:function(){return{base:e.startState(t),overlay:e.startState(r),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(n){return{base:e.copyState(t,n.base),overlay:e.copyState(r,n.overlay),basePos:n.basePos,baseCur:null,overlayPos:n.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=r.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||n&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,r){return t.indent(e.base,r)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){t.blankLine&&t.blankLine(e.base),r.blankLine&&r.blankLine(e.overlay)}}}});
[-] confirm.min.js
[open]
[-] vfb-admin.js
[open]
[-] vfb-admin.min.js
[open]
[-] token-field.min.js
[open]
[-] auto-complete.js
[open]
[+]
..
[-] accordion.min.js
[open]
[+]
partials
[-] accordion.js
[open]
[-] codemirror.min.js
[open]
[-] auto-complete.min.js
[open]
[-] datetimepicker.min.js
[open]
[-] datetimepicker.js
[open]
[-] codemirror.js
[open]
[-] index.php
[open]
[-] confirm.js
[open]
[-] token-field.js
[open]