1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[74585],{3181:(e,t,r)=>{r.r(t),r.d(t,{default:()=>m});var n,i=r(12115),o=r(12178);r(7005),r(81957),r(47650),r(66143),r(12669),r(6800);var s={exports:{}};!function(e,t){o.c,e.exports=function(){var e,t,r,n,i,o,s,l,a,u=navigator.userAgent,c=navigator.platform,h=/gecko\/\d/i.test(u),d=/MSIE \d/.test(u),f=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(u),p=/Edge\/(\d+)/.exec(u),g=d||f||p,m=g&&(d?document.documentMode||6:+(p||f)[1]),v=!p&&/WebKit\//.test(u),y=v&&/Qt\/\d+\.\d+/.test(u),b=!p&&/Chrome\/(\d+)/.exec(u),x=b&&+b[1],w=/Opera\//.test(u),C=/Apple Computer/.test(navigator.vendor),S=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(u),k=/PhantomJS/.test(u),L=C&&(/Mobile\/\w+/.test(u)||navigator.maxTouchPoints>2),T=/Android/.test(u),M=L||T||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(u),N=L||/Mac/.test(c),D=/\bCrOS\b/.test(u),O=/win/i.test(c),A=w&&u.match(/Version\/(\d*\.\d*)/);A&&(A=Number(A[1])),A&&A>=15&&(w=!1,v=!0);var W=N&&(y||w&&(null==A||A<12.11)),H=h||g&&m>=9;function P(e){return RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E=function(e,t){var r=e.className,n=P(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:"")}};function F(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function I(e,t){return F(e).appendChild(t)}function z(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 R(e,t,r,n){var i=z(e,t,r,n);return i.setAttribute("role","presentation"),i}function B(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function U(e){var t,r=e.ownerDocument||e;try{t=e.activeElement}catch(e){t=r.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function G(e,t){var r=e.className;P(t).test(r)||(e.className+=(r?" ":"")+t)}function V(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!P(r[n]).test(t)&&(t+=" "+r[n]);return t}n=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var K=function(e){e.select()};function j(e){return e.display.wrapper.ownerDocument}function _(e){return X(e.display.wrapper)}function X(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function q(e){return j(e).defaultView}function Y(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function $(e,t,r){for(var n in t||(t={}),e)Object.prototype.hasOwnProperty.call(e,n)&&(!1!==r||!Object.prototype.hasOwnProperty.call(t,n))&&(t[n]=e[n]);return t}function Z(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,s=i||0;;){var l=e.indexOf(" ",o);if(l<0||l>=t)return s+(t-o);s+=l-o,s+=r-s%r,o=l+1}}L?K=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:g&&(K=function(e){try{e.select()}catch(e){}});var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=Y(this.onTimeout,this)};function J(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return -1}Q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-new Date)},Q.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var ee={toString:function(){return"CodeMirror.Pass"}},et={scroll:!1},er={origin:"*mouse"},en={origin:"+move"};function ei(e,t,r){for(var n=0,i=0;;){var o=e.indexOf(" ",n);-1==o&&(o=e.length);var s=o-n;if(o==e.length||i+s>=t)return n+Math.min(s,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}var eo=[""];function es(e){for(;eo.length<=e;)eo.push(el(eo)+" ");return eo[e]}function el(e){return e[e.length-1]}function ea(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function eu(){}function ec(e,t){var r;return Object.create?r=Object.create(e):(eu.prototype=e,r=new eu),t&&$(t,r),r}
1var eh=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ed(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||eh.test(e))}function ef(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ed(e))||t.test(e):ed(e)}function ep(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var eg=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function em(e){return e.charCodeAt(0)>=768&&eg.test(e)}function ev(e,t,r){for(;(r<0?t>0:t<e.length)&&em(e.charAt(t));)t+=r;return t}function ey(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}var eb=null;function ex(e,t,r){var n;eb=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:eb=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:eb=i)}return null!=n?n:eb}var ew=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,i=/[1n]/;function o(e,t,r){this.level=e,this.from=t,this.to=r}return function(s,l){var a="ltr"==l?"L":"R";if(0==s.length||"ltr"==l&&!e.test(s))return!1;for(var u=s.length,c=[],h=0;h<u;++h)c.push(function(e){if(e<=247)return"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(e);if(1424<=e&&e<=1524)return"R";if(1536<=e&&e<=1785)return"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(e-1536);if(1774<=e&&e<=2220)return"r";if(8192<=e&&e<=8203)return"w";else if(8204==e)return"b";else return"L"}(s.charCodeAt(h)));for(var d=0,f=a;d<u;++d){var p=c[d];"m"==p?c[d]=f:f=p}for(var g=0,m=a;g<u;++g){var v=c[g];"1"==v&&"r"==m?c[g]="n":r.test(v)&&(m=v,"r"==v&&(c[g]="R"))}for(var y=1,b=c[0];y<u-1;++y){var x=c[y];"+"==x&&"1"==b&&"1"==c[y+1]?c[y]="1":","==x&&b==c[y+1]&&("1"==b||"n"==b)&&(c[y]=b),b=x}for(var w=0;w<u;++w){var C=c[w];if(","==C)c[w]="N";else if("%"==C){var S=void 0;for(S=w+1;S<u&&"%"==c[S];++S);for(var k=w&&"!"==c[w-1]||S<u&&"1"==c[S]?"1":"N",L=w;L<S;++L)c[L]=k;w=S-1}}for(var T=0,M=a;T<u;++T){var N=c[T];"L"==M&&"1"==N?c[T]="L":r.test(N)&&(M=N)}for(var D=0;D<u;++D)if(t.test(c[D])){var O=void 0;for(O=D+1;O<u&&t.test(c[O]);++O);for(var A=(D?c[D-1]:a)=="L",W=A==((O<u?c[O]:a)=="L")?A?"L":"R":a,H=D;H<O;++H)c[H]=W;D=O-1}for(var P,E=[],F=0;F<u;)if(n.test(c[F])){var I=F;for(++F;F<u&&n.test(c[F]);++F);E.push(new o(0,I,F))}else{var z=F,R=E.length,B=+("rtl"==l);for(++F;F<u&&"L"!=c[F];++F);for(var U=z;U<F;)if(i.test(c[U])){z<U&&(E.splice(R,0,new o(1,z,U)),R+=B);var G=U;for(++U;U<F&&i.test(c[U]);++U);E.splice(R,0,new o(2,G,U)),R+=B,z=U}else++U;z<F&&E.splice(R,0,new o(1,z,F))}return"ltr"==l&&(1==E[0].level&&(P=s.match(/^\s+/))&&(E[0].from=P[0].length,E.unshift(new o(0,0,P[0].length))),1==el(E).level&&(P=s.match(/\s+$/))&&(el(E).to-=P[0].length,E.push(new o(0,u-P[0].length,u)))),"rtl"==l?E.reverse():E}}();function eC(e,t){var r=e.order;return null==r&&(r=e.order=ew(e.text,t)),r}var eS=[],ek=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={});n[t]=(n[t]||eS).concat(r)}};function eL(e,t){return e._handlers&&e._handlers[t]||eS}function eT(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,i=n&&n[t];if(i){var o=J(i,r);o>
1-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function eM(e,t){var r=eL(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function eN(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),eM(e,r||t.type,e,t),eP(t)||t.codemirrorIgnore}function eD(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==J(r,t[n])&&r.push(t[n])}function eO(e,t){return eL(e,t).length>0}function eA(e){e.prototype.on=function(e,t){ek(this,e,t)},e.prototype.off=function(e,t){eT(this,e,t)}}function eW(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function eH(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function eP(e){return null!=e.defaultPrevented?e.defaultPrevented:!1==e.returnValue}function eE(e){eW(e),eH(e)}function eF(e){return e.target||e.srcElement}function eI(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),N&&e.ctrlKey&&1==t&&(t=3),t}var ez=function(){if(g&&m<9)return!1;var e=z("div");return"draggable"in e||"dragDrop"in e}(),eR=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),s=o.indexOf("\r");-1!=s?(r.push(o.slice(0,s)),t+=s+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},eB=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!!t&&t.parentElement()==e&&0!=t.compareEndPoints("StartToEnd",t)},eU="oncopy"in(e=z("div"))||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy),eG=null,eV={},eK={};function ej(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),eV[e]=t}function e_(e){if("string"==typeof e&&eK.hasOwnProperty(e))e=eK[e];else if(e&&"string"==typeof e.name&&eK.hasOwnProperty(e.name)){var t=eK[e.name];"string"==typeof t&&(t={name:t}),(e=ec(t,e)).name=t.name}else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return e_("application/xml");else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return e_("application/json");return"string"==typeof e?{name:e}:e||{name:"null"}}
1function eX(e,t){var r=eV[(t=e_(t)).name];if(!r)return eX(e,"text/plain");var n=r(e,t);if(eq.hasOwnProperty(t.name)){var i=eq[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)n[s]=t.modeProps[s];return n}var eq={};function eY(e,t){if(!0===t)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}function e$(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function eZ(e,t,r){return!e.startState||e.startState(t,r)}var eQ=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function eJ(e,t){if((t-=e.first)<0||t>=e.size)throw 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(t<o){r=i;break}t-=o}return r.lines[t]}function e0(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;
1i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function e1(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function e2(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function e3(e){if(null==e.parent)return null;for(var t=e.parent,r=J(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 e5(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(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var s=0;s<e.lines.length;++s){var l=e.lines[s].height;if(t<l)break;t-=l}return r+s}function e6(e,t){return t>=e.first&&t<e.first+e.size}function e9(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function e8(e,t,r){if(void 0===r&&(r=null),!(this instanceof e8))return new e8(e,t,r);this.line=e,this.ch=t,this.sticky=r}function e7(e,t){return e.line-t.line||e.ch-t.ch}function e4(e,t){return e.sticky==t.sticky&&0==e7(e,t)}function te(e){return e8(e.line,e.ch)}function tt(e,t){return 0>e7(e,t)?t:e}function tr(e,t){return 0>e7(e,t)?e:t}function tn(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ti(e,t){if(t.line<e.first)return e8(e.first,0);var r,n,i,o=e.first+e.size-1;return t.line>o?e8(o,eJ(e,o).text.length):(r=t,n=eJ(e,t.line).text.length,null==(i=r.ch)||i>n?e8(r.line,n):i<0?e8(r.line,0):r)}function to(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=ti(e,t[n]);return r}eQ.prototype.eol=function(){return this.pos>=this.string.length},eQ.prototype.sol=function(){return this.pos==this.lineStart},eQ.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},eQ.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eQ.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},eQ.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eQ.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},eQ.prototype.skipToEnd=function(){this.pos=this.string.length},eQ.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},eQ.prototype.backUp=function(e){this.pos-=e},eQ.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Z(this.string,this.lineStart,this.tabSize):0)},eQ.prototype.indentation=function(){return Z(this.string,null,this.tabSize)-(this.lineStart?Z(this.string,this.lineStart,this.tabSize):0)},eQ.prototype.match=function(e,t,r){if("string"==typeof e){var n=function(e){return r?e.toLowerCase():e};if(n(this.string.substr(this.pos,e.length))==n(e))return!1!==t&&(this.pos+=e.length),!0}else{var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}},eQ.prototype.current=function(){return this.string.slice(this.start,this.pos)},eQ.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},eQ.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},eQ.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ts=function(e,t){this.state=e,this.lookAhead=t},tl=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function ta(e,t,r,n){var i=[e.state.modeGen],o={};tv(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var s=r.state,l=0;l<e.state.overlays.length;++l)!function(n){r.baseTokens=i;var l=e.state.overlays[n],a=1,u=0;r.state=!0,tv(e,t.text,l.mode,r,function(e,t){for(var r=a;u<e;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(l.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}},o),r.state=s,r.baseTokens=null,r.baseTokenPos=1}(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function tu(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=tc(e,e3(t)),i=t.text.length>e.options.maxHighlightLength&&eY(e.doc.mode,n.state),o=ta(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function tc(e,t,r){var n=e.doc,i=e.display;
vendor: 4,192 bytes, line 1
1if(!n.mode.startState)return new tl(n,!0,t);var o=function(e,t,r){for(var n,i,o=e.doc,s=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>s;--l){if(l<=o.first)return o.first;var a=eJ(o,l-1),u=a.stateAfter;if(u&&(!r||l+(u instanceof ts?u.lookAhead:0)<=o.modeFrontier))return l;var c=Z(a.text,null,e.options.tabSize);(null==i||n>c)&&(i=l-1,n=c)}return i}(e,t,r),s=o>n.first&&eJ(n,o-1).stateAfter,l=s?tl.fromSaved(n,s,o):new tl(n,eZ(n.mode),o);return n.iter(o,t,function(r){th(e,r.text,l);var n=l.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?l.save():null,l.nextLine()}),r&&(n.modeFrontier=l.line),l}function th(e,t,r,n){var i=e.doc.mode,o=new eQ(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&td(i,r.state);!o.eol();)tf(i,o,r.state),o.start=o.pos}function td(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=e$(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}}function tf(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=e$(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw Error("Mode "+e.name+" failed to advance stream.")}tl.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},tl.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},tl.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},tl.fromSaved=function(e,t,r){return t instanceof ts?new tl(e,eY(e.mode,t.state),r,t.lookAhead):new tl(e,eY(e.mode,t),r)},tl.prototype.save=function(e){var t=!1!==e?eY(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ts(t,this.maxLookAhead):t};var tp=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function tg(e,t,r,n){var i,o=e.doc,s=o.mode;t=ti(o,t);var l,a=eJ(o,t.line),u=tc(e,t.line,r),c=new eQ(a.text,e.options.tabSize,u);for(n&&(l=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=tf(s,c,u.state),n&&l.push(new tp(c,i,eY(o.mode,u.state)));return n?l:new tp(c,i,u.state)}function tm(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]:RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function tv(e,t,r,n,i,o,s){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var a,u=0,c=null,h=new eQ(t,e.options.tabSize,n),d=e.options.addModeClass&&[null];for(""==t&&tm(td(r,n.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(l=!1,s&&th(e,t,n,h.pos),h.pos=t.length,a=null):a=tm(tf(r,h,n.state,d),o),d){var f=d[0].name;f&&(a="m-"+(a?f+" "+a:f))}if(!l||c!=a){for(;u<h.start;)i(u=Math.min(h.start,u+5e3),c);c=a}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e3);i(p,c),u=p}}var ty=!1,tb=!1;function tx(e,t,r){this.marker=e,this.from=t,this.to=r}function tw(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function tC(e,t){if(t.full)return null;var r=e6(e,t.from.line)&&eJ(e,t.from.line).markedSpans,n=e6(e,t.to.line)&&eJ(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,s=0==e7(t.from,t.to),l=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],s=o.marker;if(null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==s.type&&(!r||!o.marker.insertLeft)){var l=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new tx(s,o.from,l?null:o.to))}}return n}(r,i,s),a=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],s=o.marker;if(null==o.to||(s.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==s.type&&(!r||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new tx(s,l?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,s),u=1==t.text.length,c=el(t.text).length+(u?i:0);if(l)for(var h=0;h<l.length;++h){var d=l[h];if(null==d.to){var f=tw(a,d.marker);f?u&&(d.to=null==f.to?null:f.to+c):d.to=i}}if(a)for(var p=0;p<a.length;++p){var g=a[p];
1null!=g.to&&(g.to+=c),null==g.from?!tw(l,g.marker)&&(g.from=c,u&&(l||(l=[])).push(g)):(g.from+=c,u&&(l||(l=[])).push(g))}l&&(l=tS(l)),a&&a!=l&&(a=tS(a));var m=[l];if(!u){var v,y=t.text.length-2;if(y>0&&l)for(var b=0;b<l.length;++b)null==l[b].to&&(v||(v=[])).push(new tx(l[b].marker,null,null));for(var x=0;x<y;++x)m.push(v);m.push(a)}return m}function tS(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function tk(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function tL(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function tT(e){return e.inclusiveLeft?-1:0}function tM(e){return+!!e.inclusiveRight}function tN(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=e7(n.from,i.from)||tT(e)-tT(t);if(o)return-o;var s=e7(n.to,i.to)||tM(e)-tM(t);return s||t.id-e.id}function tD(e,t){var r,n=tb&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&(t?i.from:i.to)==null&&(!r||0>tN(r,i.marker))&&(r=i.marker);return r}function tO(e,t,r,n,i){var o=eJ(e,t),s=tb&&o.markedSpans;if(s)for(var l=0;l<s.length;++l){var a=s[l];if(a.marker.collapsed){var u=a.marker.find(0),c=e7(u.from,r)||tT(a.marker)-tT(i),h=e7(u.to,n)||tM(a.marker)-tM(i);if((!(c>=0)||!(h<=0))&&(!(c<=0)||!(h>=0))&&(c<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?e7(u.to,r)>=0:e7(u.to,r)>0)||c>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?0>=e7(u.from,n):0>e7(u.from,n))))return!0}}}function tA(e){for(var t;t=tD(e,!0);)e=t.find(-1,!0).line;return e}function tW(e,t){var r=eJ(e,t),n=tA(r);return r==n?t:e3(n)}function tH(e,t){if(t>e.lastLine())return t;var r,n=eJ(e,t);if(!tP(e,n))return t;for(;r=tD(n,!1);)n=r.find(1,!0).line;return e3(n)+1}function tP(e,t){var r=tb&&t.markedSpans;if(r){for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed&&(null==n.from||!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&function e(t,r,n){if(null==n.to){var i=n.marker.find(1,!0);return e(t,i.line,tw(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==r.text.length)return!0;for(var o=void 0,s=0;s<r.markedSpans.length;++s)if((o=r.markedSpans[s]).marker.collapsed&&!o.marker.widgetNode&&o.from==n.to&&(null==o.to||o.to!=n.from)&&(o.marker.inclusiveLeft||n.marker.inclusiveRight)&&e(t,r,o))return!0}(e,t,n)))return!0}}function tE(e){e=tA(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;o=(r=o).parent)for(var s=0;s<o.children.length;++s){var l=o.children[s];if(l==r)break;t+=l.height}return t}function tF(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=tD(n,!0);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=tD(n,!1);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function tI(e){var t=e.display,r=e.doc;t.maxLine=eJ(r,r.first),t.maxLineLength=tF(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=tF(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}var tz=function(e,t,r){this.text=e,tL(this,t),this.height=r?r(this):1}
1;tz.prototype.lineNo=function(){return e3(this)},eA(tz);var tR={},tB={};function tU(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?tB:tR;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function tG(e,t){var r=R("span",null,null,v?"padding-right: .1px":null),s={pre:R("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var l=0;l<=(t.rest?t.rest.length:0);l++){var a=l?t.rest[l-1]:t.line,u=void 0;s.pos=0,s.addToken=tV,function(e){if(null!=o)return o;var t=I(e,document.createTextNode("AØ®A")),r=n(t,0,1).getBoundingClientRect(),i=n(t,1,2).getBoundingClientRect();return F(e),!!r&&r.left!=r.right&&(o=i.right-r.right<3)}(e.display.measure)&&(u=eC(a,e.doc.direction))&&(s.addToken=function(e,t){return function(r,n,i,o,s,l,a){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var h=void 0,d=0;d<t.length&&(!((h=t[d]).to>u)||!(h.from<=u));d++);if(h.to>=c)return e(r,n,i,o,s,l,a);e(r,n.slice(0,h.to-u),i,o,null,l,a),o=null,n=n.slice(h.to-u),u=h.to}}}(s.addToken,u)),s.map=[];var c=t!=e.display.externalMeasured&&e3(a);(function(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(!n){for(var s=1;s<r.length;s+=2)t.addToken(t,i.slice(o,o=r[s]),tU(r[s+1],t.cm.options));return}for(var l,a,u,c,h,d,f,p=i.length,g=0,m=1,v="",y=0;;){if(y==g){u=c=h=a="",f=null,d=null,y=1/0;for(var b=[],x=void 0,w=0;w<n.length;++w){var C=n[w],S=C.marker;if("bookmark"==S.type&&C.from==g&&S.widgetNode)b.push(S);else if(C.from<=g&&(null==C.to||C.to>g||S.collapsed&&C.to==g&&C.from==g)){if(null!=C.to&&C.to!=g&&y>C.to&&(y=C.to,c=""),S.className&&(u+=" "+S.className),S.css&&(a=(a?a+";":"")+S.css),S.startStyle&&C.from==g&&(h+=" "+S.startStyle),S.endStyle&&C.to==y&&(x||(x=[])).push(S.endStyle,C.to),S.title&&((f||(f={})).title=S.title),S.attributes)for(var k in S.attributes)(f||(f={}))[k]=S.attributes[k];S.collapsed&&(!d||0>tN(d.marker,S))&&(d=C)}else C.from>g&&y>C.from&&(y=C.from)}if(x)for(var L=0;L<x.length;L+=2)x[L+1]==y&&(c+=" "+x[L]);if(!d||d.from==g)for(var T=0;T<b.length;++T)tK(t,0,b[T]);if(d&&(d.from||0)==g){if(tK(t,(null==d.to?p+1:d.to)-g,d.marker,null==d.from),null==d.to)return;d.to==g&&(d=!1)}}if(g>=p)break;for(var M=Math.min(p,y);;){if(v){var N=g+v.length;if(!d){var D=N>M?v.slice(0,M-g):v;t.addToken(t,D,l?l+u:u,h,g+D.length==y?c:"",a,f)}if(N>=M){v=v.slice(M-g),g=M;break}g=N,h=""}v=i.slice(o,o=r[m++]),l=tU(r[m++],t.cm.options)}}})(a,s,tu(e,a,c)),a.styleClasses&&(a.styleClasses.bgClass&&(s.bgClass=V(a.styleClasses.bgClass,s.bgClass||"")),a.styleClasses.textClass&&(s.textClass=V(a.styleClasses.textClass,s.textClass||""))),0==s.map.length&&s.map.push(0,0,s.content.appendChild(function(e){if(null==i){var t=z("span","â");I(e,z("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(i=t.offsetWidth<=1&&t.offsetHeight>2&&!(g&&m<8))}var r=i?z("span","â"):z("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}(e.display.measure))),0==l?(t.measure.map=s.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(s.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(v){var h=s.content.lastChild;(/\bcm-tab\b/.test(h.className)||h.querySelector&&h.querySelector(".cm-tab"))&&(s.content.className="cm-tab-wrap-hack")}return eM(e,"renderLine",e,t.line,s.pre),s.pre.className&&(s.textClass=V(s.pre.className,s.textClass||"")),s}function tV(e,t,r,n,i,o,s){if(t){var l,a=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "==o&&r&&(i==e.length-1||32==e.charCodeAt(i+1))&&(o="\xa0"),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,u=e.cm.state.specialChars,c=!1;if(u.test(t)){l=document.createDocumentFragment();for(var h=0;;){u.lastIndex=h;var d=u.exec(t),f=d?d.index-h:t.length-h;if(f){var p=document.createTextNode(a.slice(h,h+f));g&&m<9?l.appendChild(z("span",[p])):l.appendChild(p),e.map.push(e.pos,e.pos+f,p),e.col+=f,e.pos+=f}if(!d)break;h+=f+1;var v=void 0;if(" "==d[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=l.appendChild(z("span",es(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text"," "),e.col+=b}else"\r"==d[0]||"\n"==d[0]?(v=l.appendChild(z("span","\r"==d[0]?"â":"â¤","cm-invalidchar"))).setAttribute("cm-text",d[0]):((v=e.cm.options.specialCharPlaceholder(d[0])).setAttribute("cm-text",d[0]),g&&m<9?l.appendChild(z("span",[v])):l.appendChild(v)),e.col+=1;e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,l=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,l),g&&m<9&&(c=!0),e.pos+=t.length;
vendor: 4,489 bytes, line 1
1if(e.trailingSpace=32==a.charCodeAt(t.length-1),r||n||i||c||o||s){var x=r||"";n&&(x+=n),i&&(x+=i);var w=z("span",[l],x,o);if(s)for(var C in s)s.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&w.setAttribute(C,s[C]);return e.content.appendChild(w)}e.content.appendChild(l)}}function tK(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function tj(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=tD(e,!1);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?e3(el(this.rest))-r+1:1,this.node=this.text=null,this.hidden=tP(e,t)}function t_(e,t,r){for(var n,i=[],o=t;o<r;o=n){var s=new tj(e.doc,eJ(e.doc,o),o);n=o+s.size,i.push(s)}return i}var tX=null,tq=null;function tY(e,t){var r=eL(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);tX?n=tX.delayedCallbacks:tq?n=tq:(n=tq=[],setTimeout(t$,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},s=0;s<r.length;++s)o(s)}}function t$(){var e=tq;tq=null;for(var t=0;t<e.length;++t)e[t]()}function tZ(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?function(e,t){var r=t.text.className,n=tJ(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,t0(e,t)):r&&(t.text.className=r)}(e,t):"gutter"==o?t1(e,t,r,n):"class"==o?t0(e,t):"widget"==o&&function(e,t,r){t.alignable&&(t.alignable=null);for(var n=P("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);t2(e,t,r)}(e,t,n)}t.changes=null}function tQ(e){return e.node==e.text&&(e.node=z("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),g&&m<8&&(e.node.style.zIndex=2)),e.node}function tJ(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):tG(e,t)}function t0(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=tQ(t);t.background=n.insertBefore(z("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}t.line.wrapClass?tQ(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function t1(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=tQ(t);t.gutterBackground=z("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var s=tQ(t),l=t.gutter=z("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(l.setAttribute("aria-hidden","true"),e.display.input.setUneditable(l),s.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(z("div",e9(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var a=0;a<e.display.gutterSpecs.length;++a){var u=e.display.gutterSpecs[a].className,c=o.hasOwnProperty(u)&&o[u];c&&l.appendChild(z("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function t2(e,t,r){if(t3(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)t3(e,t.rest[n],t,r,!1)}function t3(e,t,r,n,i){if(t.widgets)for(var o=tQ(r),s=0,l=t.widgets;s<l.length;++s){var a=l[s],u=z("div",[a.node],"CodeMirror-linewidget"+(a.className?" "+a.className:""));a.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),function(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);
1var 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"))}(a,u,r,n),e.display.input.setUneditable(u),i&&a.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),tY(a,"redraw")}}function t5(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!B(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),I(t.display.measure,z("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function t6(e,t){for(var r=eF(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 t9(e){return e.lineSpace.offsetTop}function t8(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function t7(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=I(e.measure,z("pre","x","CodeMirror-line-like")),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 t4(e){return 50-e.display.nativeBarWidth}function re(e){return e.display.scroller.clientWidth-t4(e)-e.display.barWidth}function rt(e){return e.display.scroller.clientHeight-t4(e)-e.display.barHeight}function rr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){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 i=0;i<e.rest.length;i++)if(e3(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function rn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[rA(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function ri(e,t){var r,n,i,o,s=e3(t),l=rn(e,s);l&&!l.text?l=null:l&&l.changes&&(tZ(e,l,s,rT(e)),e.curOp.forceUpdate=!0),l||(n=e3(r=tA(r=t)),(i=e.display.externalMeasured=new tj(e.doc,r,n)).lineN=n,o=i.built=tG(e,i),i.text=o.pre,I(e.display.lineMeasure,o.pre),l=i);var a=rr(l,t,s);return{line:t,view:l,rect:null,map:a.map,cache:a.cache,before:a.before,hasHeights:!1}}function ro(e,t,r,i,o){t.before&&(r=-1);var s,l=r+(i||"");return t.cache.hasOwnProperty(l)?s=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(!function(e,t,r){var n=e.options.lineWrapping,i=n&&re(e);
1if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var s=t.text.firstChild.getClientRects(),l=0;l<s.length-1;l++){var a=s[l],u=s[l+1];Math.abs(a.bottom-u.bottom)>2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(s=function(e,t,r,i){var o,s,l=rl(t.map,r,i),a=l.node,u=l.start,c=l.end,h=l.collapse;if(3==a.nodeType){for(var d=0;d<4;d++){for(;u&&em(t.line.text.charAt(l.coverStart+u));)--u;for(;l.coverStart+c<l.coverEnd&&em(t.line.text.charAt(l.coverStart+c));)++c;if((o=g&&m<9&&0==u&&c==l.coverEnd-l.coverStart?a.parentNode.getBoundingClientRect():function(e,t){var r=rs;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}(n(a,u,c).getClientRects(),i)).left||o.right||0==u)break;c=u,u-=1,h="right"}g&&m<11&&(o=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=eG)return eG;var t=I(e,z("span","x")),r=t.getBoundingClientRect(),i=n(t,0,1).getBoundingClientRect();return eG=Math.abs(r.left-i.left)>1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*i,bottom:t.bottom*i}}(e.display.measure,o))}else u>0&&(h=i="right"),o=e.options.lineWrapping&&(s=a.getClientRects()).length>1?s["right"==i?s.length-1:0]:a.getBoundingClientRect();if(g&&m<9&&!u&&(!o||!o.left&&!o.right)){var f=a.parentNode.getClientRects()[0];o=f?{left:f.left,right:f.left+rL(e.display),top:f.top,bottom:f.bottom}:rs}for(var p=o.top-t.rect.top,v=o.bottom-t.rect.top,y=(p+v)/2,b=t.view.measure.heights,x=0;x<b.length-1&&!(y<b[x]);x++);var w=x?b[x-1]:0,C=b[x],S={left:("right"==h?o.right:o.left)-t.rect.left,right:("left"==h?o.left:o.right)-t.rect.left,top:w,bottom:C};return o.left||o.right||(S.bogus=!0),e.options.singleCursorHeightPerLine||(S.rtop=p,S.rbottom=v),S}(e,t,r,i)).bogus||(t.cache[l]=s)),{left:s.left,right:s.right,top:o?s.rtop:s.top,bottom:o?s.rbottom:s.bottom}}var rs={left:0,right:0,top:0,bottom:0};function rl(e,t,r){for(var n,i,o,s,l,a,u=0;u<e.length;u+=3)if(l=e[u],a=e[u+1],t<l?(i=0,o=1,s="left"):t<a?o=(i=t-l)+1:(u==e.length-3||t==a&&e[u+3]>t)&&(i=(o=a-l)-1,t>=a&&(s="right")),null!=i){if(n=e[u+2],l==a&&r==(n.insertLeft?"left":"right")&&(s=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[(u-=3)+2],s="left";if("right"==r&&i==a-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],s="right";break}return{node:n,start:i,end:o,collapse:s,coverStart:l,coverEnd:a}}function ra(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 ru(e){e.display.externalMeasure=null,F(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ra(e.display.view[t])}function rc(e){ru(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function rh(e){return b&&T?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function rd(e){return b&&T?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function rf(e){var t=tA(e).widgets,r=0;if(t)for(var n=0;n<t.length;++n)t[n].above&&(r+=t5(t[n]));return r}function rp(e,t,r,n,i){if(!i){var o=rf(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var s=tE(t);if("local"==n?s+=t9(e.display):s-=e.display.viewOffset,"page"==n||"window"==n){var l=e.display.lineSpace.getBoundingClientRect();s+=l.top+("window"==n?0:rd(j(e)));var a=l.left+("window"==n?0:rh(j(e)));r.left+=a,r.right+=a}return r.top+=s,r.bottom+=s,r}function rg(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=rh(j(e)),i-=rd(j(e));else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var s=e.display.lineSpace.getBoundingClientRect();return{left:n-s.left,top:i-s.top}}function rm(e,t,r,n,i){var o,s;return n||(n=eJ(e.doc,t.line)),rp(e,n,(o=n,s=t.ch,ro(e,ri(e,o),s,i)),r)}
1function rv(e,t,r,n,i,o){function s(t,s){var l=ro(e,i,t,s?"right":"left",o);return s?l.left=l.right:l.right=l.left,rp(e,n,l,r)}n=n||eJ(e.doc,t.line),i||(i=ri(e,n));var l=eC(n,e.doc.direction),a=t.ch,u=t.sticky;if(a>=n.text.length?(a=n.text.length,u="before"):a<=0&&(a=0,u="after"),!l)return s("before"==u?a-1:a,"before"==u);function c(e,t,r){return s(r?e-1:e,1==l[t].level!=r)}var h=ex(l,a,u),d=eb,f=c(a,h,"before"==u);return null!=d&&(f.other=c(a,d,"before"!=u)),f}function ry(e,t){var r=0;t=ti(e.doc,t),e.options.lineWrapping||(r=rL(e.display)*t.ch);var n=eJ(e.doc,t.line),i=tE(n)+t9(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function rb(e,t,r,n,i){var o=e8(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function rx(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return rb(n.first,0,null,-1,-1);var i=e5(n,r),o=n.first+n.size-1;if(i>o)return rb(n.first+n.size-1,eJ(n,o).text.length,null,1,1);t<0&&(t=0);for(var s=eJ(n,i);;){var l=function(e,t,r,n,i){i-=tE(t);var o=ri(e,t),s=rf(t),l=0,a=t.text.length,u=!0,c=eC(t,e.doc.direction);if(c){var h=(e.options.lineWrapping?function(e,t,r,n,i,o,s){var l=rw(e,t,n,s),a=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,h=null,d=0;d<i.length;d++){var f=i[d];if(!(f.from>=u)&&!(f.to<=a)){var p=ro(e,n,1!=f.level?Math.min(u,f.to)-1:Math.max(a,f.from)).right,g=p<o?o-p+1e9:p-o;(!c||h>g)&&(c=f,h=g)}}return c||(c=i[i.length-1]),c.from<a&&(c={from:a,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}:function(e,t,r,n,i,o,s){var l=ey(function(l){var a=i[l],u=1!=a.level;return rS(rv(e,e8(r,u?a.to:a.from,u?"before":"after"),"line",t,n),o,s,!0)},0,i.length-1),a=i[l];if(l>0){var u=1!=a.level,c=rv(e,e8(r,u?a.from:a.to,u?"after":"before"),"line",t,n);rS(c,o,s,!0)&&c.top>s&&(a=i[l-1])}return a})(e,t,r,o,c,n,i);l=(u=1!=h.level)?h.from:h.to-1,a=u?h.to:h.from-1}var d,f,p=null,g=null,m=ey(function(t){var r=ro(e,o,t);return r.top+=s,r.bottom+=s,!!rS(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)},l,a),v=!1;if(g){var y=n-g.left<g.right-n,b=y==u;m=p+ +!b,f=b?"after":"before",d=y?g.left:g.right}else{!u&&(m==a||m==l)&&m++,f=0==m?"after":m==t.text.length?"before":ro(e,o,m-!!u).bottom+s<=i==u?"after":"before";var x=rv(e,e8(r,m,f),"line",t,o);d=x.left,v=i<x.top?-1:+(i>=x.bottom)}return rb(r,m=ev(t.text,m,1),f,v,n-d)}(e,s,i,t,r),a=function(e,t){var r,n=tb&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||0>tN(r,o.marker))&&(r=o.marker)}return r}(s,l.ch+ +(l.xRel>0||l.outside>0));if(!a)return l;var u=a.find(1);if(u.line==i)return u;s=eJ(n,i=u.line)}}function rw(e,t,r,n){n-=rf(t);var i=t.text.length,o=ey(function(t){return ro(e,r,t-1).bottom<=n},i,0);return i=ey(function(t){return ro(e,r,t).top>n},o,i),{begin:o,end:i}}function rC(e,t,r,n){r||(r=ri(e,t));var i=rp(e,t,ro(e,r,n),"line").top;return rw(e,t,r,i)}function rS(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function rk(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==s){s=z("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)s.appendChild(document.createTextNode("x")),s.appendChild(z("br"));s.appendChild(document.createTextNode("x"))}I(e.measure,s);var r=s.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),F(e.measure),r||1}function rL(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=z("span","xxxxxxxxxx"),r=z("pre",[t],"CodeMirror-line-like");I(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function rT(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var l=e.display.gutterSpecs[s].className;r[l]=o.offsetLeft+o.clientLeft+i,n[l]=o.clientWidth}return{fixedPos:rM(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function rM(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function rN(e){var t=rk(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/rL(e.display)-3);return function(i){if(tP(e.doc,i))return 0;var o=0;if(i.widgets)for(var s=0;s<i.widgets.length;s++)i.widgets[s].height&&(o+=i.widgets[s].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function rD(e){var t=e.doc,r=rN(e);t.iter(function(e){var t=r(e);t!=e.height&&e2(e,t)})}function rO(e,t,r,n){var i=e.display;
1if(!r&&"true"==eF(t).getAttribute("cm-not-content"))return null;var o,s,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,s=t.clientY-l.top}catch(e){return null}var a,u=rx(e,o,s);if(n&&u.xRel>0&&(a=eJ(e.doc,u.line).text).length==u.ch){var c=Z(a,a.length,e.options.tabSize)-a.length;u=e8(u.line,Math.max(0,Math.round((o-t7(e.display).left)/rL(e.display))-c))}return u}function rA(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function rW(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)tb&&tW(e.doc,t)<i.viewTo&&rP(e);else if(r<=i.viewFrom)tb&&tH(e.doc,r+n)>i.viewFrom?rP(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)rP(e);else if(t<=i.viewFrom){var o=rE(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):rP(e)}else if(r>=i.viewTo){var s=rE(e,t,t,-1);s?(i.view=i.view.slice(0,s.index),i.viewTo=s.lineN):rP(e)}else{var l=rE(e,t,t,-1),a=rE(e,r,r+n,1);l&&a?(i.view=i.view.slice(0,l.index).concat(t_(e,l.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):rP(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function rH(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[rA(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==J(s,r)&&s.push(r)}}}function rP(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function rE(e,t,r,n){var i,o=rA(e,t),s=e.display.view;if(!tb||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,a=0;a<o;a++)l+=s[a].size;if(l!=t){if(n>0){if(o==s.length-1)return null;i=l+s[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;tW(e.doc,r)!=r;){if(o==(n<0?0:s.length-1))return null;r+=n*s[o-(n<0)].size,o+=n}return{index:o,lineN:r}}function rF(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 rI(e){e.display.input.showSelection(e.display.input.prepareSelection())}function rz(e,t){void 0===t&&(t=!0);var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),s=e.options.$customCursor;s&&(t=!0);for(var l=0;l<r.sel.ranges.length;l++)if(t||l!=r.sel.primIndex){var a=r.sel.ranges[l];if(!(a.from().line>=e.display.viewTo)&&!(a.to().line<e.display.viewFrom)){var u=a.empty();if(s){var c=s(e,a);c&&rR(e,c,i)}else(u||e.options.showCursorWhenSelecting)&&rR(e,a.head,i);u||function(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),s=t7(e.display),l=s.left,a=Math.max(n.sizerWidth,re(e)-n.sizer.offsetLeft)-s.right,u="ltr"==i.direction;function c(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(z("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?a-e:r)+"px;\n height: "+(n-t)+"px"))}function h(t,r,n){var o,s,h=eJ(i,t),d=h.text.length;function f(r,n){return rm(e,e8(t,r),"div",h,n)}function p(t,r,n){var i=rC(e,h,null,t),o="ltr"==r==("after"==n)?"left":"right";return f("after"==n?i.begin:i.end-(/\s/.test(h.text.charAt(i.end-1))?2:1),o)[o]}var g=eC(h,i.direction);return!function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var s=e[o];(s.from<r&&s.to>t||t==r&&s.to==t)&&(n(Math.max(s.from,t),Math.min(s.to,r),1==s.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(g,r||0,null==n?d:n,function(e,t,i,h){var m,v,y,b,x="ltr"==i,w=f(e,x?"left":"right"),C=f(t-1,x?"right":"left"),S=null==r&&0==e,k=null==n&&t==d,L=0==h,T=!g||h==g.length-1;if(C.top-w.top<=3){var M=(u?S:k)&&L,N=(u?k:S)&&T,D=M?l:(x?w:C).left,O=N?a:(x?C:w).right;c(D,w.top,O-D,w.bottom)}else x?(m=u&&S&&L?l:w.left,v=u?a:p(e,i,"before"),y=u?l:p(t,i,"after"),b=u&&k&&T?a:C.right):(m=u?p(e,i,"before"):l,v=!u&&S&&L?a:w.right,y=!u&&k&&T?l:C.left,b=u?p(t,i,"after"):a),c(m,w.top,v-m,w.bottom),w.bottom<C.top&&c(l,w.bottom,null,C.top),c(y,C.top,b-y,C.bottom);(!o||0>rB(w,o))&&(o=w),0>rB(C,o)&&(o=C),(!s||0>rB(w,s))&&(s=w),0>rB(C,s)&&(s=C)}),{start:o,end:s}}var d=t.from(),f=t.to();if(d.line==f.line)h(d.line,d.ch,f.ch);
1else{var p=eJ(i,d.line),g=eJ(i,f.line),m=tA(p)==tA(g),v=h(d.line,d.ch,m?p.text.length+1:null).end,y=h(f.line,m?0:null,f.ch).start;m&&(v.top<y.top-2?(c(v.right,v.top,null,v.bottom),c(l,y.top,y.left,y.bottom)):c(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&c(l,v.bottom,null,y.top)}r.appendChild(o)}(e,a,o)}}return n}function rR(e,t,r){var n=rv(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(z("div","\xa0","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",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=rm(e,t,"div",null,null),s=o.right-o.left;i.style.width=(s>0?s:e.defaultCharWidth())+"px"}if(n.other){var l=r.appendChild(z("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=n.other.left+"px",l.style.top=n.other.top+"px",l.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function rB(e,t){return e.top-t.top||e.left-t.left}function rU(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(){e.hasFocus()||rj(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function rG(e){!e.hasFocus()&&(e.display.input.focus(),e.state.focused||rK(e))}function rV(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&rj(e))},100)}function rK(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(eM(e,"focus",e,t),e.state.focused=!0,G(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),v&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),rU(e))}function rj(e,t){e.state.delayingBlurEvent||(e.state.focused&&(eM(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function r_(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,s=0;s<t.view.length;s++){var l=t.view[s],a=e.options.lineWrapping,u=void 0,c=0;if(!l.hidden){if(i+=l.line.height,g&&m<8){var h=l.node.offsetTop+l.node.offsetHeight;u=h-r,r=h}else{var d=l.node.getBoundingClientRect();u=d.bottom-d.top,!a&&l.text.firstChild&&(c=l.text.firstChild.getBoundingClientRect().right-d.left-1)}var f=l.line.height-u;if((f>.005||f<-.005)&&(i<n&&(o-=f),e2(l.line,u),rX(l.line),l.rest))for(var p=0;p<l.rest.length;p++)rX(l.rest[p]);if(c>e.display.sizerWidth){var v=Math.ceil(c/rL(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function rX(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function rq(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-t9(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=e5(t,n),s=e5(t,i);if(r&&r.ensure){var l=r.ensure.from.line,a=r.ensure.to.line;l<o?(o=l,s=e5(t,tE(eJ(t,l))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=s&&(o=e5(t,tE(eJ(t,a))-e.wrapper.clientHeight),s=a)}return{from:o,to:Math.max(s,o+1)}}function rY(e,t){var r=e.display,n=rk(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=rt(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+t8(r),a=t.top<n,u=t.bottom>l-n;if(t.top<i)s.scrollTop=a?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?l:t.bottom)-o);c!=i&&(s.scrollTop=c)}var h=e.options.fixedGutter?0:r.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft-h,f=re(e)-r.gutters.offsetWidth,p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?s.scrollLeft=0:t.left<d?s.scrollLeft=Math.max(0,t.left+h-10*!p):t.right>f+d-3&&(s.scrollLeft=t.right+10*!p-f),s}function r$(e,t){null!=t&&(rJ(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function rZ(e){rJ(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function rQ(e,t,r){(null!=t||null!=r)&&rJ(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function rJ(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=ry(e,t.from),n=ry(e,t.to);r0(e,r,n,t.margin)}}
1function r0(e,t,r,n){var i=rY(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});rQ(e,i.scrollLeft,i.scrollTop)}function r1(e,t){2>Math.abs(e.doc.scrollTop-t)||(h||nf(e,{top:t}),r2(e,t,!0),h&&nf(e),na(e,100))}function r2(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function r3(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),((r?t!=e.doc.scrollLeft:!(2>Math.abs(e.doc.scrollLeft-t)))||n)&&(e.doc.scrollLeft=t,nm(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function r5(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+t8(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+t4(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var r6=function(e,t,r){this.cm=r;var n=this.vert=z("div",[z("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=z("div",[z("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),ek(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),ek(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,g&&m<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};r6.prototype.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.scrollTop=0,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=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},r6.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},r6.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},r6.prototype.zeroWidthHack=function(){this.horiz.style.height=this.vert.style.width=N&&!S?"12px":"18px",this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Q,this.disableVert=new Q},r6.prototype.enableZeroWidthBar=function(e,t,r){e.style.visibility="",t.set(1e3,function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.visibility="hidden":t.set(1e3,n)})},r6.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var r9=function(){};function r8(e,t){t||(t=r5(e));var r=e.display.barWidth,n=e.display.barHeight;r7(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&r_(e),r7(e,r5(e)),r=e.display.barWidth,n=e.display.barHeight}function r7(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",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",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=""}r9.prototype.update=function(){return{bottom:0,right:0}},r9.prototype.setScrollLeft=function(){},r9.prototype.setScrollTop=function(){},r9.prototype.clear=function(){};var r4={native:r6,null:r9};function ne(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new r4[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ek(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?r3(e,t):r1(e,t)},e),e.display.scrollbars.addClass&&G(e.display.wrapper,e.display.scrollbars.addClass)}var nt=0;function nr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeOb
1js:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++nt,markArrays:null},t=e.curOp,tX?tX.ops.push(t):t.ownsGroup=tX={ops:[t],delayedCallbacks:[]}}function nn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{var n=r.delayedCallbacks,i=0;do{for(;i<n.length;i++)n[i].call(null);for(var o=0;o<r.ops.length;o++){var s=r.ops[o];if(s.cursorActivityHandlers)for(;s.cursorActivityCalled<s.cursorActivityHandlers.length;)s.cursorActivityHandlers[s.cursorActivityCalled++].call(null,s.cm)}}while(i<n.length)}finally{tX=null,t(r)}}(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t,r=e.ops,n=0;n<r.length;n++)!function(e){var t=e.cm,r=t.display;(function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=t4(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=t4(e)+"px",t.scrollbarsClipped=!0)})(t),e.updateMaxLine&&tI(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 nc(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}(r[n]);for(var i=0;i<r.length;i++){(t=r[i]).updatedDisplay=t.mustUpdate&&nh(t.cm,t.update)}for(var o=0;o<r.length;o++)!function(e){var t,r,n=e.cm,i=n.display;e.updatedDisplay&&r_(n),e.barMeasure=r5(n),i.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=(t=i.maxLine,r=i.maxLine.text.length,ro(n,ri(n,t),r,void 0)).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+t4(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-re(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}(r[o]);for(var s=0;s<r.length;s++)!function(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&r3(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==U(_(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&r8(t,e.barMeasure),e.updatedDisplay&&ng(t,e.barMeasure),e.selectionChanged&&rU(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&rG(e.cm)}(r[s]);for(var l=0;l<r.length;l++)!function(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&nd(t,e.update),null!=r.wheelStartX&&(null!=e.scrollTop||null!=e.scrollLeft||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&r2(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&r3(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=function(e,t,r,n){null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==t.sticky?e8(t.line,t.ch+1,"before"):t,t=t.ch?e8(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var i,o=0;o<5;o++){var s=!1,l=rv(e,t),a=r&&r!=t?rv(e,r):l,u=rY(e,i={left:Math.min(l.left,a.left),top:Math.min(l.top,a.top)-n,right:Math.max(l.left,a.left),bottom:Math.max(l.bottom,a.bottom)+n}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(r1(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(s=!0)),null!=u.scrollLeft&&(r3(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(s=!0)),!s)break}return i}(t,ti(n,e.scrollToPos.from),ti(n,e.scrollToPos.to),e.scrollToPos.margin);!function(e,t){if(!eN(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null,o=r.wrapper.ownerDocument;if(t.top+n.top<0?i=!0:t.bottom+n.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),null!=i&&!k){var s=z("div","â",null,"position: absolute;\n top: "+(t.top-r.viewOffset-t9(e.display))+"px;\n height: "+(t.bottom-t.top+t4(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(i),e.display.lineSpace.removeChild(s)}}}(t,i)}var o=e.maybeHiddenMarkers,s=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||eM(o[l],"hide");if(s)for(var a=0;a<s.length;++a)s[a].lines.length&&eM(s[a],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeOb
1js&&eM(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}(r[l])}(e)})}function ni(e,t){if(e.curOp)return t();nr(e);try{return t()}finally{nn(e)}}function no(e,t){return function(){if(e.curOp)return t.apply(e,arguments);nr(e);try{return t.apply(e,arguments)}finally{nn(e)}}}function ns(e){return function(){if(this.curOp)return e.apply(this,arguments);nr(this);try{return e.apply(this,arguments)}finally{nn(this)}}}function nl(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);nr(t);try{return e.apply(this,arguments)}finally{nn(t)}}}function na(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,Y(nu,e))}function nu(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=tc(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(n.line>=e.display.viewFrom){var s=o.styles,l=o.text.length>e.options.maxHighlightLength?eY(t.mode,n.state):null,a=ta(e,o,n,!0);l&&(n.state=l),o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!s||s.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!h&&d<s.length;++d)h=s[d]!=o.styles[d];h&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&th(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return na(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&ni(e,function(){for(var t=0;t<i.length;t++)rH(e,i[t],"text")})}}var nc=function(e,t,r){var n=e.display;this.viewport=t,this.visible=rq(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=re(e),this.force=r,this.dims=rT(e),this.events=[]};function nh(e,t){var r,n,i,o=e.display,s=e.doc;if(t.editorIsHidden)return rP(e),!1;if(!t.force&&t.visible.from>=o.viewFrom&&t.visible.to<=o.viewTo&&(null==o.updateLineNumbers||o.updateLineNumbers>=o.viewTo)&&o.renderedView==o.view&&0==rF(e))return!1;nv(e)&&(rP(e),t.dims=rT(e));var l=s.first+s.size,a=Math.max(t.visible.from-e.options.viewportMargin,s.first),u=Math.min(l,t.visible.to+e.options.viewportMargin);o.viewFrom<a&&a-o.viewFrom<20&&(a=Math.max(s.first,o.viewFrom)),o.viewTo>u&&o.viewTo-u<20&&(u=Math.min(l,o.viewTo)),tb&&(a=tW(e.doc,a),u=tH(e.doc,u));var c=a!=o.viewFrom||u!=o.viewTo||o.lastWrapHeight!=t.wrapperHeight||o.lastWrapWidth!=t.wrapperWidth;r=a,n=u,0==(i=e.display).view.length||r>=i.viewTo||n<=i.viewFrom?(i.view=t_(e,r,n),i.viewFrom=r):(i.viewFrom>r?i.view=t_(e,r,i.viewFrom).concat(i.view):i.viewFrom<r&&(i.view=i.view.slice(rA(e,r))),i.viewFrom=r,i.viewTo<n?i.view=i.view.concat(t_(e,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,rA(e,n)))),i.viewTo=n,o.viewOffset=tE(eJ(e.doc,o.viewFrom)),e.display.mover.style.top=o.viewOffset+"px";var h=rF(e);if(!c&&0==h&&!t.force&&o.renderedView==o.view&&(null==o.updateLineNumbers||o.updateLineNumbers>=o.viewTo))return!1;var d=function(e){if(e.hasFocus())return null;var t=U(_(e));if(!t||!B(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=q(e).getSelection();n.anchorNode&&n.extend&&B(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);h>4&&(o.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,s=o.firstChild;function l(t){var r=t.nextSibling;return v&&N&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var a=n.view,u=n.viewFrom,c=0;c<a.length;c++){var h=a[c];if(h.hidden);else if(h.node&&h.node.parentNode==o){for(;s!=h.node;)s=l(s);var d=i&&null!=t&&t<=u&&h.lineNumber;h.changes&&(J(h.changes,"gutter")>-1&&(d=!1),tZ(e,h,u,r)),d&&(F(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(e9(e.options,u)))),s=h.node.nextSibling}else{var f=function(e,t,r,n){var i=tJ(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),t0(e,t),t1(e,t,r,n),t2(e,t,n),t.node}(e,h,u,r);o.insertBefore(f,s)}u+=h.size}for(;s;)s=l(s)}(e,o.updateLineNumbers,t.dims),h>4&&(o.lineDiv.style.display=""),o.renderedView=o.view;if(d&&d.activeElt&&d.activeElt!=U(X(d.activeElt))&&(d.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(d.activeElt.nodeName)&&d.anchorNode&&B(document.body,d.anchorNode)&&B(document.body,d.focusNode))){var f=d.activeElt.ownerDocument,p=f.defaultView.getSelection(),g=f.createRange();g.setEnd(d.anchorNode,d.anchorOffset),g.collapse(!1),p.removeAllRanges(),p.addRange(g),p.extend(d.focusNode,d.focusOffset)}return F(o.cursorDiv),F(o.selectionDiv),o.gutters.style.height=o.sizer.style.minHeight=0,c&&
1(o.lastWrapHeight=t.wrapperHeight,o.lastWrapWidth=t.wrapperWidth,na(e,400)),o.updateLineNumbers=null,!0}function nd(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=re(e))n&&(t.visible=rq(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+t8(e.display)-rt(e),r.top)}),t.visible=rq(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!nh(e,t))break;r_(e);var i=r5(e);rI(e),r8(e,i),ng(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function nf(e,t){var r=new nc(e,t);if(nh(e,r)){r_(e),nd(e,r);var n=r5(e);rI(e),r8(e,n),ng(e,n),r.finish()}}function np(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",tY(e,"gutterChanged",e)}function ng(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+t4(e)+"px"}function nm(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=rM(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",s=0;s<r.length;s++)if(!r[s].hidden){e.options.fixedGutter&&(r[s].gutter&&(r[s].gutter.style.left=o),r[s].gutterBackground&&(r[s].gutterBackground.style.left=o));var l=r[s].alignable;if(l)for(var a=0;a<l.length;a++)l[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function nv(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=e9(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(z("div",[z("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,s=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-s)+1,n.lineNumWidth=n.lineNumInnerWidth+s,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",np(e.display),!0}return!1}function ny(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var o=e[i],s=null;if("string"!=typeof o&&(s=o.style,o=o.className),"CodeMirror-linenumbers"==o)if(!t)continue;else n=!0;r.push({className:o,style:s})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function nb(e){var t=e.gutters,r=e.gutterSpecs;F(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],o=i.className,s=i.style,l=t.appendChild(z("div",null,"CodeMirror-gutter "+o));s&&(l.style.cssText=s),"CodeMirror-linenumbers"==o&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",np(e)}function nx(e){nb(e.display),rW(e),nm(e)}function nw(e,t,r,n){this.input=r,this.scrollbarFiller=z("div",null,"CodeMirror-scrollbar-filler"),this.scrollbarFiller.setAttribute("cm-not-content","true"),this.gutterFiller=z("div",null,"CodeMirror-gutter-filler"),this.gutterFiller.setAttribute("cm-not-content","true"),this.lineDiv=R("div",null,"CodeMirror-code"),this.selectionDiv=z("div",null,null,"position: relative; z-index: 1"),this.cursorDiv=z("div",null,"CodeMirror-cursors"),this.measure=z("div",null,"CodeMirror-measure"),this.lineMeasure=z("div",null,"CodeMirror-measure"),this.lineSpace=R("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");var i=R("div",[this.lineSpace],"CodeMirror-lines");this.mover=z("div",[i],null,"position: relative"),this.sizer=z("div",[this.mover],"CodeMirror-sizer"),this.sizerWidth=null,this.heightForcer=z("div",null,null,"position: absolute; height: 50px; width: 1px;"),this.gutters=z("div",null,"CodeMirror-gutters"),this.lineGutter=null,this.scroller=z("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll"),this.scroller.setAttribute("tabIndex","-1"),this.wrapper=z("div",[this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror"),b&&105===x&&(this.wrapper.style.clipPath="inset(0px)"),this.wrapper.setAttribute("translate","no"),g&&m<8&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0),v||h&&M||(this.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(this.wrapper):e(this.wrapper)),this.viewFrom=this.viewTo=t.first,this.reportedViewFrom=this.reportedViewTo=t.first,this.view=[],this.renderedView=null,this.externalMeasured=null,this.viewOffset=0,this.lastWrapHeight=this.lastWrapWidth=0,this.updateLineNumbers=null,this.nativeBarWidth=this.barHeight=this.barWidth=0,this.scrollbarsClipped=!1,this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=null,this.alignWidgets=!1,this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null,this.maxLine=null,this.maxLineLength=0,this.maxLineChanged=!1,this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null,this.shift=!1,this.selForContextMenu=null,this.activeTouch=null,this.gutterSpecs=ny(n.gutters,n.lineNumbers),nb(this),r.init(this)}nc.prototype.signal=function(e,t){eO(e,t)&&this.events.push(arguments)},nc.prototype.finish=function(){for(var e=0;e<this.events.length;e++)eM.apply(null,this.events[e])};var nC=0,nS=null;function nk(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}}function nL(e,t){b&&102==x&&(null==e.display.chromeScrollHack?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var r=nk(t),n=r.x,i=r.y,o=nS;0===t.deltaMode&&(n=t.deltaX,i=t.deltaY,o=1);var s=e.display,l=s.scroller,a=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(n&&a||i&&u){if(i&&N&&v){e:for(var c=t.target,d=s.view;c!=l;c=c.parentNode)for(var f=0;f<d.length;f++)if(d[f].node==c){e.display.currentWheelTarget=c;break e}}if(n&&!h&&!w&&null!=o){i&&u&&r1(e,Math.max(0,l.scrollTop+i*o)),r3(e,Math.max(0,l.scrollLeft+n*o)),(!i||i&&u)&&eW(t),s.wheelStartX=null;return}if(i&&null!=o){var p=i*o,g=e.doc.scrollTop,m=g+s.wrapper.clientHeight;p<0?g=Math.max(0,g+p-50):m=Math.min(e.doc.height,m+p+50),nf(e,{top:g,bottom:m})}nC<20&&0!==t.deltaMode&&(null==s.wheelStartX?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=n,s.wheelDY=i,setTimeout(function(){if(null!=s.wheelStartX){var e=l.scrollLeft-s.wheelStartX,t=l.scrollTop-s.wheelStartY,r=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,r&&(nS=(nS*nC+r)/(nC+1),++nC)}},200)):(s.wheelDX+=n,s.wheelDY+=i))}}g?nS=-.53:h?nS=15:b?nS=-.7:C&&(nS=-1/3);var nT=function(e,t){this.ranges=e,this.primIndex=t};nT.prototype.primary=function(){return this.ranges[this.primIndex]},nT.prototype.equals=function(e){if(e==this)return!0;
1if(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(!e4(r.anchor,n.anchor)||!e4(r.head,n.head))return!1}return!0},nT.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new nM(te(this.ranges[t].anchor),te(this.ranges[t].head));return new nT(e,this.primIndex)},nT.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},nT.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(e7(t,n.from())>=0&&0>=e7(e,n.to()))return r}return -1};var nM=function(e,t){this.anchor=e,this.head=t};function nN(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(e,t){return e7(e.from(),t.from())}),r=J(t,i);for(var o=1;o<t.length;o++){var s=t[o],l=t[o-1],a=e7(l.to(),s.from());if(n&&!s.empty()?a>0:a>=0){var u=tr(l.from(),s.from()),c=tt(l.to(),s.to()),h=l.empty()?s.from()==s.head:l.from()==l.head;o<=r&&--r,t.splice(--o,2,new nM(h?c:u,h?u:c))}}return new nT(t,r)}function nD(e,t){return new nT([new nM(e,t||e)],0)}function nO(e){return e.text?e8(e.from.line+e.text.length-1,el(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function nA(e,t){if(0>e7(e,t.from))return e;if(0>=e7(e,t.to))return nO(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+=nO(t).ch-t.to.ch),e8(r,n)}function nW(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new nM(nA(i.anchor,t),nA(i.head,t)))}return nN(e.cm,r,e.sel.primIndex)}function nH(e,t,r){return e.line==t.line?e8(r.line,e.ch-t.ch+r.ch):e8(r.line+(e.line-t.line),e.ch)}function nP(e){e.doc.mode=eX(e.options,e.doc.modeOption),nE(e)}function nE(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,na(e,100),e.state.modeGen++,e.curOp&&rW(e)}function nF(e,t){return 0==t.from.ch&&0==t.to.ch&&""==el(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function nI(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){var o;e.text=r,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),tk(e),tL(e,i),(o=n?n(e):1)!=e.height&&e2(e,o),tY(e,"change",e,t)}function s(e,t){for(var r=[],o=e;o<t;++o)r.push(new tz(u[o],i(o),n));return r}var l=t.from,a=t.to,u=t.text,c=eJ(e,l.line),h=eJ(e,a.line),d=el(u),f=i(u.length-1),p=a.line-l.line;if(t.full)e.insert(0,s(0,u.length)),e.remove(u.length,e.size-u.length);else if(nF(e,t)){var g=s(0,u.length-1);o(h,h.text,f),p&&e.remove(l.line,p),g.length&&e.insert(l.line,g)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,l.ch)+d+c.text.slice(a.ch),f);else{var m=s(1,u.length-1);m.push(new tz(d+c.text.slice(a.ch),f,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]+h.text.slice(a.ch),i(0)),e.remove(l.line+1,p);else{o(c,c.text.slice(0,l.ch)+u[0],i(0)),o(h,d+h.text.slice(a.ch),f);var v=s(1,u.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,v)}tY(e,"change",e,t)}function nz(e,t,r){!function e(n,i,o){if(n.linked)for(var s=0;s<n.linked.length;++s){var l=n.linked[s];if(l.doc!=i){var a=o&&l.sharedHist;(!r||a)&&(t(l.doc,a),e(l.doc,n,a))}}}(e,null,!0)}function nR(e,t){if(t.cm)throw Error("This document is already in use.");e.doc=t,t.cm=e,rD(e),nP(e),nB(e),e.options.direction=t.direction,e.options.lineWrapping||tI(e),e.options.mode=t.modeOption,rW(e)}function nB(e){("rtl"==e.doc.direction?G:E)(e.display.lineDiv,"CodeMirror-rtl")}function nU(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function nG(e,t){var r={from:te(t.from),to:nO(t),text:e0(e,t.from,t.to)};return n_(e,r,t.from.line,t.to.line+1),nz(e,function(e){return n_(e,r,t.from.line,t.to.line+1)},!0),r}function nV(e){for(;e.length;)if(el(e).ranges)e.pop();else break}function nK(e,t,r,n){var i,o,s=e.history;s.undone.length=0;var l,a=+new Date;if((s.lastOp==n||s.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&s.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(i=s,l=s.lastOp==n?(nV(i.done),el(i.done)):i.done.length&&!el(i.done).ranges?el(i.done):i.done.length>1&&!i.done[i.done.length-2].ranges?(i.done.pop(),el(i.done)):void 0))o=el(l.changes),0==e7(t.from,t.to)&&0==e7(t.from,o.to)?o.to=nO(t):l.changes.push(nG(e,t));else{var u=el(s.done);for(u&&u.ranges||nj(e.sel,s.done),l={changes:[nG(e,t)],generation:s.generation},s.done.push(l);s.done.length>s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift()}s.done.push(r),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=a,s.lastOp=s.lastSelOp=n,s.lastOrigin=s.lastSelOrigin=t.origin,o||eM(e,"historyAdded")}function nj(e,t){var r=el(t);r&&r.ranges&&r.equals(e)||t.push(e)}function n_(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 nX(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(function(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}(r[i]));return n}(e,t),n=tC(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],s=n[i];if(o&&s)t:for(var l=0;l<s.length;++l){for(var a=s[l],u=0;u<o.length;++u)if(o[u].marker==a.marker)continue t;o.push(a)}else s&&(r[i]=s)}return r}function nq(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){n.push(r?nT.prototype.deepCopy.call(o):o);continue}var s=o.changes,l=[];n.push({changes:l});for(var a=0;a<s.length;++a){var u=s[a],c=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&J(t,Number(c[1]))>-1&&(el(l)[h]=u[h],delete u[h])}}return n}function nY(e,t,r,n){if(!n)return new nM(r||t,t);var i=e.anchor;if(r){var o=0>e7(t,i);o!=0>e7(r,i)?(i=t,t=r):o!=0>e7(t,r)&&(t=r)}return new nM(i,t)}function n$(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),n0(e,new nT([nY(e.sel.primary(),t,r,i)],0),n)}function nZ(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=nY(e.sel.ranges[o],t[o],null,i);var s=nN(e.cm,n,e.sel.primIndex);n0(e,s,r)}function nQ(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,n0(e,nN(e.cm,i,e.sel.primIndex),n)}nM.prototype.from=function(){return tr(this.anchor,this.head)},nM.prototype.to=function(){return tt(this.anchor,this.head)},nM.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function nJ(e,t,r){var n=e.history.done,i=el(n);i&&i.ranges?(n[n.length-1]=t,n1(e,t,r)):n0(e,t,r)}function n0(e,t,r){n1(e,t,r),function(e,t,r,n){var i,o,s=e.history,l=n&&n.origin;r==s.lastSelOp||l&&s.lastSelOrigin==l&&(s.lastModTime==s.lastSelTime&&s.lastOrigin==l||(i=el(s.done),"*"==(o=l.charAt(0))||"+"==o&&i.ranges.length==t.ranges.length&&i.somethingSelected()==t.somethingSelected()&&new Date-e.history.lastSelTime
1<=(e.cm?e.cm.options.historyEventDelay:500)))?s.done[s.done.length-1]=t:nj(t,s.done),s.lastSelTime=+new Date,s.lastSelOrigin=l,s.lastSelOp=r,n&&!1!==n.clearRedo&&nV(s.undone)}(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function n1(e,t,r){(eO(e,"beforeSelectionChange")||e.cm&&eO(e.cm,"beforeSelectionChange"))&&(i={ranges:(n=t).ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new nM(ti(e,t[r].anchor),ti(e,t[r].head))},origin:r&&r.origin},eM(e,"beforeSelectionChange",e,i),e.cm&&eM(e.cm,"beforeSelectionChange",e.cm,i),t=i.ranges!=n.ranges?nN(e.cm,i.ranges,i.ranges.length-1):n);var n,i,o=r&&r.bias||(0>e7(t.primary().head,e.sel.primary().head)?-1:1);n2(e,n5(e,t,o,!0)),!(r&&!1===r.scroll)&&e.cm&&"nocursor"!=e.cm.getOption("readOnly")&&rZ(e.cm)}function n2(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,eD(e.cm)),tY(e,"cursorActivity",e))}function n3(e){n2(e,n5(e,e.sel,null,!1))}function n5(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var s=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=n9(e,s.anchor,l&&l.anchor,r,n),u=s.head==s.anchor?a:n9(e,s.head,l&&l.head,r,n);(i||a!=s.anchor||u!=s.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new nM(a,u))}return i?nN(e.cm,i,t.primIndex):t}function n6(e,t,r,n,i){var o=eJ(e,t.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var l=o.markedSpans[s],a=l.marker,u="selectLeft"in a?!a.selectLeft:a.inclusiveLeft,c="selectRight"in a?!a.selectRight:a.inclusiveRight;if((null==l.from||(u?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(c?l.to>=t.ch:l.to>t.ch))){if(i&&(eM(a,"beforeCursorEnter"),a.explicitlyCleared))if(o.markedSpans){--s;continue}else break;if(!a.atomic)continue;if(r){var h=a.find(n<0?1:-1),d=void 0;if((n<0?c:u)&&(h=n8(e,h,-n,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(d=e7(h,r))&&(n<0?d<0:d>0))return n6(e,h,t,n,i)}var f=a.find(n<0?-1:1);return(n<0?u:c)&&(f=n8(e,f,n,f.line==t.line?o:null)),f?n6(e,f,t,n,i):null}}return t}function n9(e,t,r,n,i){var o=n||1,s=n6(e,t,r,o,i)||!i&&n6(e,t,r,o,!0)||n6(e,t,r,-o,i)||!i&&n6(e,t,r,-o,!0);return s||(e.cantEdit=!0,e8(e.first,0))}function n8(e,t,r,n){if(r<0&&0==t.ch)if(t.line>e.first)return ti(e,e8(t.line-1));else return null;return r>0&&t.ch==(n||eJ(e,t.line)).text.length?t.line<e.first+e.size-1?e8(t.line+1,0):null:new e8(t.line,t.ch+r)}function n7(e){e.setSelection(e8(e.firstLine(),0),e8(e.lastLine()),et)}function n4(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return(r&&(n.update=function(t,r,i,o){t&&(n.from=ti(e,t)),r&&(n.to=ti(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),eM(e,"beforeChange",e,n),e.cm&&eM(e.cm,"beforeChange",e.cm,n),n.canceled)?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function ie(e,t,r){if(e.cm){if(!e.cm.curOp)return no(e.cm,ie)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(eO(e,"beforeChange")||e.cm&&eO(e.cm,"beforeChange"))||(t=n4(e,t,!0))){var n=ty&&!r&&function(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==J(n,r))&&(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var s=n[o],l=s.find(0),a=0;a<i.length;++a){var u=i[a];if(!(0>e7(u.to,l.from)||e7(u.from,l.to)>0)){var c=[a,1],h=e7(u.from,l.from),d=e7(u.to,l.to);!(h<0)&&(s.inclusiveLeft||h)||c.push({from:u.from,to:l.from}),!(d>0)&&(s.inclusiveRight||d)||c.push({from:l.to,to:u.to}),i.splice.apply(i,c),a+=c.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)it(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else it(e,t)}}function it(e,t){if(1!=t.text.length||""!=t.text[0]||0!=e7(t.from,t.to)){var r=nW(e,t);nK(e,t,r,e.cm?e.cm.curOp.id:NaN),io(e,t,r,tC(e,t));var n=[];nz(e,function(e,r){r||-1!=J(n,e.history)||(iu(e.history,t),n.push(e.history)),io(e,t,null,tC(e,t))})}}function ir(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,o=e.history,s=e.sel,l="undo"==t?o.done:o.undone,a="undo"==t?o.undone:o.done,u=0;u<l.length&&(i=l[u],r?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=l.length){for(o.lastOrigin=o.lastSelOrigin=null;;)if((i=l.pop()).ranges){if(nj(i,a),r&&!i.equals(e.sel))return void n0(e,i,{clearRedo:!1});s=i}else if(n)return void l.push(i);else break;var c=[];nj(s,a),a.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var h=eO(e,"beforeChange")||e.cm&&eO(e.cm,"beforeChange"),d=i.changes.length-1;d>=0;--d){var f=function(r){var n=i.changes[r];if(n.origin=t,h&&!n4(e,n,!1))return l.length=0,{};c.push(nG(e,n));var o=r?nW(e,n):el(l);io(e,n,o,nX(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:nO(n)});var s=[];nz(e,function(e,t){t||-1!=J(s,e.history)||(iu(e.history,n),s.push(e.history)),io(e,n,null,nX(e,n))})}(d);if(f)return f.v}}}}function ii(e,t){if(0!=t&&(e.first+=t,e.sel=new nT(ea(e.sel.ranges,function(e){return new nM(e8(e.anchor.line+t,e.anchor.ch),e8(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){rW(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)rH(e.cm,n,"gutter")}}function io(e,t,r,n){if(e.cm&&!e.cm.curOp)return no(e.cm,io)(e,t,r,n);if(t.to.line<e.first)return void ii(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>
vendor: 4,674 bytes, line 1
1e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ii(e,i),t={from:e8(e.first,0),to:e8(t.to.line+i,t.to.ch),text:[el(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:e8(o,eJ(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=e0(e,t.from,t.to),r||(r=nW(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,s=t.to,l=!1,a=o.line;e.options.lineWrapping||(a=e3(tA(eJ(n,o.line))),n.iter(a,s.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),n.sel.contains(t.from,t.to)>-1&&eD(e),nI(n,t,r,rN(e)),!e.options.lineWrapping&&(n.iter(a,o.line+t.text.length,function(e){var t=tF(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=eJ(e,n).stateAfter;if(i&&(!(i instanceof ts)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}(n,o.line),na(e,400);var u=t.text.length-(s.line-o.line)-1;t.full?rW(e):o.line!=s.line||1!=t.text.length||nF(e.doc,t)?rW(e,o.line,s.line+1,u):rH(e,o.line,"text");var c=eO(e,"changes"),h=eO(e,"change");if(h||c){var d={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};h&&tY(e,"change",e,d),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,n):nI(e,t,n),n1(e,r,et),e.cantEdit&&n9(e,e8(e.firstLine(),0))&&(e.cantEdit=!1)}}function is(e,t,r,n,i){var o;n||(n=r),0>e7(n,r)&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),ie(e,{from:r,to:n,text:t,origin:i})}function il(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ia(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],s=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)il(o.ranges[l].anchor,t,r,n),il(o.ranges[l].head,t,r,n);continue}for(var a=0;a<o.changes.length;++a){var u=o.changes[a];if(r<u.from.line)u.from=e8(u.from.line+n,u.from.ch),u.to=e8(u.to.line+n,u.to.ch);else if(t<=u.to.line){s=!1;break}}s||(e.splice(0,i+1),i=0)}}function iu(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;ia(e.done,r,n,i),ia(e.undone,r,n,i)}function ic(e,t,r,n){var i=t,o=t;return("number"==typeof t?o=eJ(e,tn(e,t)):i=e3(t),null==i)?null:(n(o,i)&&e.cm&&rH(e.cm,i,r),o)}function ih(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function id(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}ih.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,i.parent=null,tk(i),tY(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;e<n;++e)if(r(this.lines[e]))return!0}},id.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(e<i){var o=Math.min(t,i-e),s=n.height;if(n.removeInner(e,o),this.height-=s-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 ih))){var l=[];this.collapse(l),this.children=[new ih(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(e<=o){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(var s=i.lines.length%25+25,l=s;l<i.lines.length;){var a=new ih(i.lines.slice(l,l+=25));i.height-=a.height,this.children.splice(++n,0,a),a.parent=this}i.lines=i.lines.slice(0,s),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new id(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=J(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new id(e.children);n.parent=e,e.children=[n,t],e=n}t.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(e<o){var s=Math.min(t,o-e);if(i.iterN(e,s,r))return!0;
1if(0==(t-=s))break;e=0}else e-=o}}};var ip=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function ig(e,t,r){tE(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&r$(e,r)}ip.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=e3(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=t5(this);e2(r,Math.max(0,r.height-o)),e&&(ni(e,function(){ig(e,r,-o),rH(e,n,"widget")}),tY(e,"lineWidgetCleared",e,this,n))}},ip.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=t5(this)-t;i&&(tP(this.doc,n)||e2(n,n.height+i),r&&ni(r,function(){r.curOp.forceUpdate=!0,ig(r,n,i),tY(r,"lineWidgetChanged",r,e,e3(n))}))},eA(ip);var im=0,iv=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++im};function iy(e,t,r,n,i){if(n&&n.shared){var o,s,l,a,u,c,h,d;return o=e,s=t,l=r,a=n,u=i,(a=$(a)).shared=!1,h=(c=[iy(o,s,l,a,u)])[0],d=a.widgetNode,nz(o,function(e){d&&(a.widgetNode=d.cloneNode(!0)),c.push(iy(e,ti(e,s),ti(e,l),a,u));for(var t=0;t<e.linked.length;++t)if(e.linked[t].isParent)return;h=el(c)}),new ib(c,h)}if(e.cm&&!e.cm.curOp)return no(e.cm,iy)(e,t,r,n,i);var f=new iv(e,i),p=e7(t,r);if(n&&$(n,f,!1),p>0||0==p&&!1!==f.clearWhenEmpty)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=R("span",[f.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(tO(e,t.line,t,r,f)||t.line!=r.line&&tO(e,r.line,t,r,f))throw Error("Inserting collapsed marker partially overlapping an existing one");tb=!0}f.addToHistory&&nK(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var g,m=t.line,v=e.cm;if(e.iter(m,r.line+1,function(n){var i,o,s;v&&f.collapsed&&!v.options.lineWrapping&&tA(n)==v.display.maxLine&&(g=!0),f.collapsed&&m!=t.line&&e2(n,0),i=new tx(f,m==t.line?t.ch:null,m==r.line?r.ch:null),(s=(o=e.cm&&e.cm.curOp)&&window.WeakSet&&(o.markedSpans||(o.markedSpans=new WeakSet)))&&n.markedSpans&&s.has(n.markedSpans)?n.markedSpans.push(i):(n.markedSpans=n.markedSpans?n.markedSpans.concat([i]):[i],s&&s.add(n.markedSpans)),i.marker.attachLine(n),++m}),f.collapsed&&e.iter(t.line,r.line+1,function(t){tP(e,t)&&e2(t,0)}),f.clearOnEnter&&ek(f,"beforeCursorEnter",function(){return f.clear()}),f.readOnly&&(ty=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),f.collapsed&&(f.id=++im,f.atomic=!0),v){if(g&&(v.curOp.updateMaxLine=!0),f.collapsed)rW(v,t.line,r.line+1);else if(f.className||f.startStyle||f.endStyle||f.css||f.attributes||f.title)for(var y=t.line;y<=r.line;y++)rH(v,y,"text");f.atomic&&n3(v.doc),tY(v,"markerAdded",v,f)}return f}iv.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&nr(e),eO(this,"clear")){var r=this.find();r&&tY(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var s=this.lines[o],l=tw(s.markedSpans,this);e&&!this.collapsed?rH(e,e3(s),"text"):e&&(null!=l.to&&(i=e3(s)),null!=l.from&&(n=e3(s))),s.markedSpans=function(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}(s.markedSpans,l),null==l.from&&this.collapsed&&!tP(this.doc,s)&&e&&e2(s,rk(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var a=0;a<this.lines.length;++a){var u=tA(this.lines[a]),c=tF(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&rW(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&n3(e.doc)),e&&tY(e,"markerCleared",e,this,n,i),t&&nn(e),this.parent&&this.parent.clear()}},iv.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],s=tw(o.markedSpans,this);if(null!=s.from&&(r=e8(t?o:e3(o),s.from),-1==e))return r;if(null!=s.to&&(n=e8(t?o:e3(o),s.to),1==e))return n}return r&&{from:r,to:n}},iv.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&ni(n,function(){var i=t.line,o=rn(n,e3(t.line));if(o&&(ra(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!tP(r.doc,i)&&null!=r.height){var s=r.height;r.height=null;var l=t5(r)-s;l&&e2(i,i.height+l)}tY(n,"markerChanged",n,e)})},iv.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=J(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},iv.prototype.detachLine=function(e){if(this.lines.splice(J(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},eA(iv);var ib=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function ix(e){return e.findMarks(e8(e.first,0),e.clipPos(e8(e.lastLine()
vendor: 1,418 bytes, line 1
1)),function(e){return e.parent})}ib.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();tY(this,"clear")}},ib.prototype.find=function(e,t){return this.primary.find(e,t)},eA(ib);var iw=0,iC=function(e,t,r,n,i){if(!(this instanceof iC))return new iC(e,t,r,n,i);null==r&&(r=0),id.call(this,[new ih([new tz("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=e8(r,0);this.sel=nD(o),this.history=new nU(null),this.id=++iw,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),nI(this,{from:o,to:o,text:e}),n0(this,nD(o),et)};iC.prototype=ec(id.prototype,{constructor:iC,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=e1(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:nl(function(e){var t=e8(this.first,0),r=this.first+this.size-1;ie(this,{from:t,to:e8(r,eJ(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&rQ(this.cm,0,0),n0(this,nD(t),et)}
1),replaceRange:function(e,t,r,n){t=ti(this,t),r=r?ti(this,r):t,is(this,e,t,r,n)},getRange:function(e,t,r){var n=e0(this,ti(this,e),ti(this,t));return!1===r?n:""===r?n.join(""):n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(e6(this,e))return eJ(this,e)},getLineNumber:function(e){return e3(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=eJ(this,e)),tA(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ti(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:nl(function(e,t,r){var n;n=ti(this,"number"==typeof e?e8(e,t||0):e),n0(this,nD(n,null),r)}),setSelection:nl(function(e,t,r){var n,i;n=ti(this,e),i=ti(this,t||e),n0(this,nD(n,i),r)}),extendSelection:nl(function(e,t,r){n$(this,ti(this,e),t&&ti(this,t),r)}),extendSelections:nl(function(e,t){nZ(this,to(this,e),t)}),extendSelectionsBy:nl(function(e,t){nZ(this,to(this,ea(this.sel.ranges,e)),t)}),setSelections:nl(function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new nM(ti(this,e[i].anchor),ti(this,e[i].head||e[i].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),n0(this,nN(this.cm,n,t),r)}}),addSelection:nl(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new nM(ti(this,e),ti(this,t||e))),n0(this,nN(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=e0(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=e0(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),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:nl(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var s=i.ranges[o];n[o]={from:s.from(),to:s.to(),text:this.splitLines(e[o]),origin:r}}for(var l=t&&"end"!=t&&function(e,t,r){for(var n=[],i=e8(e.first,0),o=i,s=0;s<t.length;s++){var l=t[s],a=nH(l.from,i,o),u=nH(nO(l),i,o);if(i=l.to,o=u,"around"==r){var c=e.sel.ranges[s],h=0>e7(c.head,c.anchor);n[s]=new nM(h?u:a,h?a:u)}else n[s]=new nM(a,a)}return new nT(n,e.sel.primIndex)}(this,n,t),a=n.length-1;a>=0;a--)ie(this,n[a]);l?nJ(this,l):this.cm&&rZ(this.cm)}),undo:nl(function(){ir(this,"undo")}),redo:nl(function(){ir(this,"redo")}),undoSelection:nl(function(){ir(this,"undo",!0)}),redoSelection:nl(function(){ir(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 i=0;i<e.undone.length;i++)!e.undone[i].ranges&&++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new nU(this.history),nz(this,function(t){return t.history=e.history},!0)},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:nq(this.history.done),undone:nq(this.history.undone)}},setHistory:function(e){var t=this.history=new nU(this.history);t.done=nq(e.done.slice(0),null,!0),t.undone=nq(e.undone.slice(0),null,!0)},setGutterMarker:nl(function(e,t,r){return ic(this,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&ep(n)&&(e.gutterMarkers=null),!0})}),clearGutter:nl(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&ic(t,r,"gutter",function(){return r.gutterMarkers[e]=null,ep(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!e6(this,e)||(t=e,!(e=eJ(this,e))))return null}else if(null==(t=e3(e)))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}},addLineClass:nl(function(e,t,r){return ic(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";
1if(e[n]){if(P(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0})}),removeLineClass:nl(function(e,t,r){return ic(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(P(r));if(!o)return!1;var s=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&s!=i.length?" ":"")+i.slice(s)||null}return!0})}),addLineWidget:nl(function(e,t,r){var n,i,o;return n=this,i=new ip(n,t,r),(o=n.cm)&&i.noHScroll&&(o.display.alignWidgets=!0),ic(n,e,"widget",function(e){var t=e.widgets||(e.widgets=[]);if(null==i.insertAt?t.push(i):t.splice(Math.min(t.length,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!tP(n,e)){var r=tE(e)<n.scrollTop;e2(e,e.height+t5(i)),r&&r$(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&tY(o,"lineWidgetAdded",o,i,"number"==typeof e?e:e3(e)),i}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return iy(this,ti(this,e),ti(this,t),r,r&&r.type||"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,handleMouseEvents:t&&t.handleMouseEvents};return iy(this,e=ti(this,e),e,r,"bookmark")},findMarksAt:function(e){e=ti(this,e);var t=[],r=eJ(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=ti(this,e),t=ti(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var l=0;l<s.length;l++){var a=s[l];!(null!=a.to&&i==e.line&&e.ch>=a.to||null==a.from&&i!=e.line||null!=a.from&&i==t.line&&a.from>=t.ch)&&(!r||r(a.marker))&&n.push(a.marker.parent||a.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,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r}),ti(this,e8(r,t))},indexFromPos:function(e){var t=(e=ti(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new iC(e1(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);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 iC(e1(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);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}],!function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),s=e.clipPos(i.to);if(e7(o,s)){var l=iy(e,o,s,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}(n,ix(this)),n},unlinkDoc:function(e){if(e instanceof or&&(e=e.doc),this.linked){for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),function(e){for(var t=0;t<e.length;t++)!function(t){var r=e[t],n=[r.primary.doc];nz(r.primary.doc,function(e){return n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==J(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}}(t)}(ix(this));break}}if(e.history==this.history){var r=[e.id];nz(e,function(e){return r.push(e.id)},!0),e.history=new nU(null),e.history.done=nq(this.history.done,r),e.history.undone=nq(this.history.undone,r)}},iterLinkedDocs:function(e){nz(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):eR(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:nl(function(e){if("rtl"!=e&&(e="ltr"),e!=this.direction){var t;this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&ni(t=this.cm,function(){nB(t),rW(t)})}})}),iC.prototype.eachLine=iC.prototype.iter;var iS=0;function ik(e){var t=this;if(iL(t),!(eN(t,e)||t6(t.display,e))){eW(e),g&&(iS=+new Date);var r=rO(t,e,!0),n=e.dataTransfer.files;if(!(!r||t.isReadOnly()))if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),s=0,l=function(){++s==i&&no(t,function(){var e={from:r=ti(t.doc,r),to:r,text:t.doc.splitLines(o.filter(function(e){return null!=e}).join(t.doc.lineSeparator())),origin:"paste"};ie(t.doc,e),nJ(t.doc,nD(ti(t.doc,r),ti(t.doc,nO(e))))})()},a=function(e,r){if(t.options.allowDropFileTypes&&-1==J(t.options.allowDropFileTypes,e.type))return void l();var n=new FileReader;n.onerror=function(){return l()},n.onload=function(){var e=n.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e))return void l();o[r]=e,l()},n.readAsText(e)},u=0;u<n.length;u++)a(n[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var c,h=e.dataTransfer.getData("Text");if(h){if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),n1(t.doc,nD(r,r)),c)for(var d=0;d<c.length;++d)is(t.doc,"",c[d].anchor,c[d].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(e){}}}}
1function iL(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function iT(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var t=0;t<r.length;t++)e(r[t])})}}var iM=!1;function iN(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var iD={3:"Pause",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",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},iO=0;iO<10;iO++)iD[iO+48]=iD[iO+96]=String(iO);for(var iA=65;iA<=90;iA++)iD[iA]=String.fromCharCode(iA);for(var iW=1;iW<=12;iW++)iD[iW+111]=iD[iW+63235]="F"+iW;var iH={};function iP(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var s=0;s<o.length-1;s++){var l=o[s];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))n=!0;else throw Error("Unrecognized modifier name: "+l)}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function iE(e,t,r,n){var i=(t=iR(t)).call?t.call(e,n):t[e];if(!1===i)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 iE(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var s=iE(e,t.fallthrough[o],r,n);if(s)return s}}}function iF(e){var t="string"==typeof e?e:iD[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function iI(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(W?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(W?t.ctrlKey:t.metaKey)&&"Mod"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function iz(e,t){if(w&&34==e.keyCode&&e.char)return!1;var r=iD[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),iI(r,e,t))}function iR(e){return"string"==typeof e?iH[e]:e}function iB(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&0>=e7(o.from,el(n).to);){var s=n.pop();if(0>e7(s.from,o.from)){o.from=s.from;break}}n.push(o)}ni(e,function(){for(var t=n.length-1;t>=0;t--)is(e.doc,"",n[t].from,n[t].to,"+delete");rZ(e)})}function iU(e,t,r){var n=ev(e.text,t+r,r);return n<0||n>e.text.length?null:n}function iG(e,t,r){var n=iU(e,t.ch,r);return null==n?null:new e8(t.line,n,r<0?"after":"before")}function iV(e,t,r,n,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=eC(r,t.doc.direction);if(o){var s,l=i<0?el(o):o[0],a=i<0==(1==l.level)?"after":"before";if(l.level>0||"rtl"==t.doc.direction){var u=ri(t,r),c=ro(t,u,s=i<0?r.text.length-1:0).top;s=ey(function(e){return ro(t,u,e).top==c},i<0==(1==l.level)?l.from:l.to-1,s),"before"==a&&(s=iU(r,s,1))}else s=i<0?l.to:l.from;return new e8(n,s,a)}}return new e8(n,i<0?r.text.length:0,i<0?"before":"after")}iH.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"},iH.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"},iH.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},iH.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"]},iH.default=N?iH.macDefault:iH.pcDefault;var iK={selectAll:n7,singleSelection:function(e){return e.setSelection(e.getCursor("anch
1or"),e.getCursor("head"),et)},killLine:function(e){return iB(e,function(t){if(!t.empty())return{from:t.from(),to:t.to()};var r=eJ(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:e8(t.head.line+1,0)}:{from:t.head,to:e8(t.head.line,r)}})},deleteLine:function(e){return iB(e,function(t){return{from:e8(t.from().line,0),to:ti(e.doc,e8(t.to().line+1,0))}})},delLineLeft:function(e){return iB(e,function(e){return{from:e8(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return iB(e,function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}})},delWrappedLineRight:function(e){return iB(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){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(e8(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(e8(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ij(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return i_(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){var r,n,i,o;return r=e,n=t.head.line,(o=function(e){for(var t;t=tD(e,!1);)e=t.find(1,!0).line;return e}(i=eJ(r.doc,n)))!=i&&(n=e3(o)),iV(!0,r,i,n,-1)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},en)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},en)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?i_(e,t.head):n},en)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return 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(),s=Z(e.getLine(o.line),o.ch,n);t.push(es(n-s%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ni(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=eJ(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new e8(i.line,i.ch-1)),i.ch>0)i=new e8(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),e8(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var s=eJ(e.doc,i.line-1).text;s&&(i=new e8(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),e8(i.line-1,s.length-1),i,"+transpose"))}}r.push(new nM(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return ni(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;
1r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);rZ(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ij(e,t){var r=eJ(e.doc,t),n=tA(r);return n!=r&&(t=e3(n)),iV(!0,e,n,t,1)}function i_(e,t){var r=ij(e,t.line),n=eJ(e.doc,r.line),i=eC(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(r.ch,n.text.search(/\S/)),s=t.line==r.line&&t.ch<=o&&t.ch;return e8(r.line,s?0:o,r.sticky)}return r}function iX(e,t,r){if("string"==typeof t&&!(t=iK[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=ee}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var iq=new Q;function iY(e,t,r,n){var i=e.state.keySeq;if(i){if(iF(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:iq.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),i$(e,i+" "+t,r,n))return!0}return i$(e,t,r,n)}function i$(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=iE(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&iE(t,e.options.extraKeys,r,e)||iE(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&tY(e,"keyHandled",e,t,r),("handled"==i||"multi"==i)&&(eW(r),rU(e)),!!i}function iZ(e,t){var r=iz(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?iY(e,"Shift-"+r,t,function(t){return iX(e,t,!0)})||iY(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return iX(e,t)}):iY(e,r,t,function(t){return iX(e,t)}))}var iQ=null;function iJ(e){if((!e.target||e.target==this.display.input.getField())&&(this.curOp.focus=U(_(this)),!eN(this,e))){g&&m<11&&27==e.keyCode&&(e.returnValue=!1);var t=e.keyCode;this.display.shift=16==t||e.shiftKey;var r=iZ(this,e);w&&(iQ=r?t:null,!r&&88==t&&!eU&&(N?e.metaKey:e.ctrlKey)&&this.replaceSelection("",null,"cut")),h&&!N&&!r&&46==t&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=t||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(E(t,"CodeMirror-crosshair"),eT(document,"keyup",r),eT(document,"mouseover",r))}G(t,"CodeMirror-crosshair"),ek(document,"keyup",r),ek(document,"mouseover",r)}(this)}}function i0(e){16==e.keyCode&&(this.doc.sel.shift=!1),eN(this,e)}function i1(e){if(e.target&&e.target!=this.display.input.getField()||t6(this.display,e)||eN(this,e)||e.ctrlKey&&!e.altKey||N&&e.metaKey)return;var t,r=e.keyCode,n=e.charCode;if(w&&r==iQ){iQ=null,eW(e);return}if(!(w&&(!e.which||e.which<10)&&iZ(this,e))){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(t=this,iY(t,"'"+i+"'",e,function(e){return iX(t,e,!0)})||this.display.input.onKeyPress(e))}}var i2=function(e,t,r){this.time=e,this.pos=t,this.button=r};function i3(e){var t,r=this.display;if(!(eN(this,e)||r.activeTouch&&r.input.supportsTouch())){if(r.input.ensurePolled(),r.shift=e.shiftKey,t6(r,e)){v||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(!i9(this,e)){var n,i,o,s,u,c,h=rO(this,e),d=eI(e),f=h?(t=+new Date,a&&a.compare(t,h,d)?(l=a=null,"triple"):l&&l.compare(t,h,d)?(a=new i2(t,h,d),l=null,"double"):(l=new i2(t,h,d),a=null,"single")):"single";q(this).focus(),1==d&&this.state.selectingText&&this.state.selectingText(e),h&&(n=this,i=d,o=h,s=f,u=e,c="Click","double"==s?c="Double"+c:"triple"==s&&(c="Triple"+c),iY(n,iI(c=(1==i?"Left":2==i?"Middle":"Right")+c,u),u,function(e){if("string"==typeof e&&(e=iK[e]),!e)return!1;var t=!1;try{n.isReadOnly()&&(n.state.suppressEdits=!0),t=e(n,o)!=ee}finally{n.state.suppressEdits=!1}return t}))||(1==d?h?function(e,t,r,n){g?setTimeout(Y(rG,e),0):e.curOp.focus=U(_(e));var i,o,s,l,a,u,c,h,d,f,p,y,b=(null==(p=(f=e.getOption("configureMouse"))?f(e,r,n):{}).unit&&(p.unit=(D?n.shiftKey&&n.metaKey:n.altKey)?"rectangle":"single"==r?"char":"double"==r?"word":"line"),(null==p.extend||e.doc.extend)&&(p.extend=e.doc.extend||n.shiftKey),null==p.addNew&&(p.addNew=N?n.metaKey:n.ctrlKey),null==p.moveOnDrag&&(p.moveOnDrag=!(N?n.altKey:n.
1ctrlKey)),p),x=e.doc.sel;e.options.dragDrop&&ez&&!e.isReadOnly()&&"single"==r&&(y=x.contains(t))>-1&&(0>e7((y=x.ranges[y]).from(),t)||t.xRel>0)&&(e7(y.to(),t)>0||t.xRel<0)?(i=e,o=n,s=t,l=b,a=i.display,u=!1,c=no(i,function(e){v&&(a.scroller.draggable=!1),i.state.draggingText=!1,i.state.delayingBlurEvent&&(i.hasFocus()?i.state.delayingBlurEvent=!1:rV(i)),eT(a.wrapper.ownerDocument,"mouseup",c),eT(a.wrapper.ownerDocument,"mousemove",h),eT(a.scroller,"dragstart",d),eT(a.scroller,"drop",c),u||(eW(e),l.addNew||n$(i.doc,s,null,null,l.extend),v&&!C||g&&9==m?setTimeout(function(){a.wrapper.ownerDocument.body.focus({preventScroll:!0}),a.input.focus()},20):a.input.focus())}),h=function(e){u=u||Math.abs(o.clientX-e.clientX)+Math.abs(o.clientY-e.clientY)>=10},d=function(){return u=!0},v&&(a.scroller.draggable=!0),i.state.draggingText=c,c.copy=!l.moveOnDrag,ek(a.wrapper.ownerDocument,"mouseup",c),ek(a.wrapper.ownerDocument,"mousemove",h),ek(a.scroller,"dragstart",d),ek(a.scroller,"drop",c),i.state.delayingBlurEvent=!0,setTimeout(function(){return a.input.focus()},20),a.scroller.dragDrop&&a.scroller.dragDrop()):function(e,t,r,n){g&&rV(e);var i=e.display,o=e.doc;eW(t);var s,l,a=o.sel,u=a.ranges;if(n.addNew&&!n.extend?s=(l=o.sel.contains(r))>-1?u[l]:new nM(r,r):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(s=new nM(r,r)),r=rO(e,t,!0,!0),l=-1;else{var c=i5(e,r,n.unit);s=n.extend?nY(s,c.anchor,c.head,n.extend):c}n.addNew?-1==l?(l=u.length,n0(o,nN(e,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==n.unit&&!n.extend?(n0(o,nN(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),a=o.sel):nQ(o,l,s,er):(l=0,n0(o,new nT([s],0),er),a=o.sel);var h=r,d=i.wrapper.getBoundingClientRect(),f=0;function p(t){e.state.selectingText=!1,f=1/0,t&&(eW(t),i.input.focus()),eT(i.wrapper.ownerDocument,"mousemove",m),eT(i.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var m=no(e,function(t){0!==t.buttons&&eI(t)?function t(u){var c=++f,p=rO(e,u,!0,"rectangle"==n.unit);if(p)if(0!=e7(p,h)){e.curOp.focus=U(_(e)),function(t){if(0!=e7(h,t))if(h=t,"rectangle"==n.unit){for(var i=[],u=e.options.tabSize,c=Z(eJ(o,r.line).text,r.ch,u),d=Z(eJ(o,t.line).text,t.ch,u),f=Math.min(c,d),p=Math.max(c,d),g=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=m;g++){var v=eJ(o,g).text,y=ei(v,f,u);f==p?i.push(new nM(e8(g,y),e8(g,y))):v.length>y&&i.push(new nM(e8(g,y),e8(g,ei(v,p,u))))}i.length||i.push(new nM(r,r)),n0(o,nN(e,a.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=s,w=i5(e,t,n.unit),C=x.anchor;e7(w.anchor,C)>0?(b=w.head,C=tr(x.from(),w.anchor)):(b=w.anchor,C=tt(x.to(),w.head));var S=a.ranges.slice(0);S[l]=function(e,t){var r,n=t.anchor,i=t.head,o=eJ(e.doc,n.line);if(0==e7(n,i)&&n.sticky==i.sticky)return t;var s=eC(o);if(!s)return t;var l=ex(s,n.ch,n.sticky),a=s[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var u=l+ +(a.from==n.ch!=(1!=a.level));if(0==u||u==s.length)return t;if(i.line!=n.line)r=(i.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ex(s,i.ch,i.sticky),h=c-l||(i.ch-n.ch)*(1==a.level?-1:1);r=c==u-1||c==u?h<0:h>0}var d=s[u+(r?-1:0)],f=r==(1==d.level),p=f?d.from:d.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?t:new nM(new e8(n.line,p,g),i)}(e,new nM(ti(o,C),b)),n0(o,nN(e,S,l),er)}}(p);var g=rq(i,o);(p.line>=g.to||p.line<g.from)&&setTimeout(no(e,function(){f==c&&t(u)}),150)}else{var m=u.clientY<d.top?-20:20*(u.clientY>d.bottom);m&&setTimeout(no(e,function(){f==c&&(i.scroller.scrollTop+=m,t(u))}),50)}}(t):p(t)}),v=no(e,p);e.state.selectingText=v,ek(i.wrapper.ownerDocument,"mousemove",m),ek(i.wrapper.ownerDocument,"mouseup",v)}(e,n,t,b)}(this,h,f,e):eF(e)==r.scroller&&eW(e):2==d?(h&&n$(this.doc,h),setTimeout(function(){return r.input.focus()},20)):3==d&&(H?this.display.input.onContextMenu(e):rV(this)))}}}function i5(e,t,r){if("char"==r)return new nM(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new nM(e8(t.line,0),ti(e.doc,e8(t.line+1,0)));var n=r(e,t);return new nM(n.from,n.to)}function i6(e,t,r,n){if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>
1=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&eW(t);var i,o,s=e.display,l=s.lineDiv.getBoundingClientRect();if(o>l.bottom||!eO(e,r))return eP(t);o-=l.top-s.viewOffset;for(var a=0;a<e.display.gutterSpecs.length;++a){var u=s.gutters.childNodes[a];if(u&&u.getBoundingClientRect().right>=i){var c=e5(e.doc,o),h=e.display.gutterSpecs[a];return eM(e,r,e,c,h.className,t),eP(t)}}}function i9(e,t){return i6(e,t,"gutterClick",!0)}function i8(e,t){var r,n;!(t6(e.display,t)||(r=e,n=t,eO(r,"gutterContextMenu")&&i6(r,n,"gutterContextMenu",!1)))&&!eN(e,t,"contextmenu")&&(H||e.display.input.onContextMenu(t))}function i7(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),rc(e)}i2.prototype.compare=function(e,t,r){return this.time+400>e&&0==e7(t,this.pos)&&r==this.button};var i4={toString:function(){return"CodeMirror.Init"}},oe={},ot={};function or(e,t){var r,n=this;if(!(this instanceof or))return new or(e,t);this.options=t=t?$(t):{},$(oe,t,!1);var i=t.value;"string"==typeof i?i=new iC(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var o=new or.inputStyles[t.inputStyle](this),s=this.display=new nw(e,i,o,t);for(var l in s.wrapper.CodeMirror=this,i7(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ne(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Q,keySeq:null,specialChars:null},t.autofocus&&!M&&s.input.focus(),g&&m<11&&setTimeout(function(){return n.display.input.reset(!0)},20),function(e){var t=e.display;ek(t.scroller,"mousedown",no(e,i3)),g&&m<11?ek(t.scroller,"dblclick",no(e,function(t){if(!eN(e,t)){var r=rO(e,t);if(!(!r||i9(e,t)||t6(e.display,t))){eW(t);var n=e.findWordAt(r);n$(e.doc,n.anchor,n.head)}}})):ek(t.scroller,"dblclick",function(t){return eN(e,t)||eW(t)}),ek(t.scroller,"contextmenu",function(t){return i8(e,t)}),ek(t.input.getField(),"contextmenu",function(r){t.scroller.contains(r.target)||i8(e,r)});var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),(n=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}ek(t.scroller,"touchstart",function(i){if(!eN(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!i9(e,i)){t.input.ensurePolled(),clearTimeout(r);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),ek(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ek(t.scroller,"touchend",function(r){var n=t.activeTouch;if(n&&!t6(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var s,l=e.coordsChar(t.activeTouch,"page");s=!n.prev||o(n,n.prev)?new nM(l,l):!n.prev.prev||o(n,n.prev.prev)?e.findWordAt(l):new nM(e8(l.line,0),ti(e.doc,e8(l.line+1,0))),e.setSelection(s.anchor,s.head),e.focus(),eW(r)}i()}),ek(t.scroller,"touchcancel",i),ek(t.scroller,"scroll",function(){t.scroller.clientHeight&&(r1(e,t.scroller.scrollTop),r3(e,t.scroller.scrollLeft,!0),eM(e,"scroll",e))}),ek(t.scroller,"mousewheel",function(t){return nL(e,t)}),ek(t.scroller,"DOMMouseScroll",function(t){return nL(e,t)}),ek(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){eN(e,t)||eE(t)},over:function(t){if(!eN(e,t)){var r=e,n=t,i=rO(r,n);if(i){var o=document.createDocumentFragment();rR(r,i,o),r.display.dragCursor||(r.display.dragCursor=z("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)),I(r.display.dragCursor,o)}eE(t)}},start:function(t){var r=e,n=t;if(g&&(!r.state.draggingText||new Date-iS<100))return void eE(n);if(!(eN(r,n)||t6(r.display,n))&&(n.dataTransfer.setData("Text",r.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!C)){var i=z("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",w&&(i.width=i.height=1,r.display.wrapper.appendChild(i),i._top=i.offsetTop),n.dataTransfer.setDragImage(i,0,0),w&&i.parentNode.removeChild(i)}},drop:no(e,ik),leave:function(t){eN(e,t)||iL(e)}};var s=t.input.getField();ek(s,"keyup",function(t){return i0.call(e,t)}),ek(s,"keydown",no(e,iJ)),ek(s,"keypress",no(e,i1)),ek(s,"focus",function(t){return rK(e,t)}),ek(s,"blur",function(t){return rj(e,t)})}(this),iM||(ek(window,"resize",function(){null==r&&(r=setTimeout(function(){r=null,iT(iN)},100))}),ek(window,"blur",function(){return iT(rj)}),iM=!0),nr(this),this.curOp.forceUpdate=!0,nR(this,i),t.autofocus&&!M||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&rK(n)},20):rj(this),ot)ot.hasOwnProperty(l)&&ot[l](this,t[l],i4);nv(this),t.finishInit&&t.finishInit(this);for(var a=0;a<on.length;++a)on[a](this);nn(this),v&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(s.lineDiv).textRendering&&(s.lineDiv.style.textRendering="auto")}or.defaults=oe,or.optionHandlers=ot;var on=[];function oi(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=tc(e,t).state:r="prev");var s=e.options.tabSize,l=eJ(o,t),a=Z(l.text,null,s);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))==ee||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?Z(eJ(o,t-1).text,null,s):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/s);f;--f)d+=s,h+=" ";if(d<u&&(h+=es(u-d)),h!=c)return is(o,h,e8(t,0),e8(t,c.length),"+input"),l.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p];if(g.head.line==t&&g.head.ch<c.length){var m=e8(t,c.length);nQ(o,p,new nM(m,m));break}}}or.defineInitHook=function(e){return on.push(e)};var oo=null;function os(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var s=new Date-200,l="paste"==i||e.state.pasteIncoming>s,a=eR(t),u=null;if(l&&n.ranges.length>1)if(oo&&oo.text.join("\n")==t){if(n.ranges.length%oo.text.length==0){u=[];for(var c=0;c<oo.text.length;c++)u.push(o.splitLines(oo.text[c]))}}else a.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(u=ea(a,function(e){return[e]}));for(var h=e.curOp.updateInput,d=n.ranges.length-1;d>=0;d--){var f=n.ranges[d],p=f.from(),g=f.to();f.empty()&&(r&&r>0?p=e8(p.line,p.ch-r):e.state.overwrite&&!l?g=e8(g.line,Math.min(eJ(o,g.line).text.length,g.ch+el(a).length)):l&&oo&&oo.lineWise&&oo.text.join("\n")==a.join("\n")&&(p=g=e8(p.line,0)));var m={from:p,to:g,text:u?u[d%u.length]:a,origin:i||(l?"paste":e.state.cutIncoming>s?"cut":"+input")};
1ie(e.doc,m),tY(e,"inputRead",e,m)}t&&!l&&oa(e,t),rZ(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&ni(t,function(){return os(t,r,0,null,"paste")}),!0}function oa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100)&&(!n||r.ranges[n-1].head.line!=i.head.line)){var o=e.getModeAt(i.head),s=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){s=oi(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(eJ(e.doc,i.head.line).text.slice(0,i.head.ch))&&(s=oi(e,i.head.line,"smart"));s&&tY(e,"electricInput",e,i.head.line)}}}function ou(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:e8(i,0),head:e8(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function oc(e,t,r,n){e.setAttribute("autocorrect",r?"on":"off"),e.setAttribute("autocapitalize",n?"on":"off"),e.setAttribute("spellcheck",!!t)}function oh(){var e=z("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=z("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return v?e.style.width="1000px":e.setAttribute("wrap","off"),L&&(e.style.border="1px solid black"),t}function od(e,t,r,n,i){var o=t,s=r,l=eJ(e,t.line),a=i&&"rtl"==e.direction?-r:r;function u(o){if("codepoint"==n){var s,u,c=l.text.charCodeAt(t.ch+(r>0?0:-1));if(isNaN(c))s=null;else{var h=r>0?c>=55296&&c<56320:c>=56320&&c<57343;s=new e8(t.line,Math.max(0,Math.min(l.text.length,t.ch+r*(h?2:1))),-r)}}else s=i?function(e,t,r,n){var i,o=eC(t,e.doc.direction);if(!o)return iG(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var s=ex(o,r.ch,r.sticky),l=o[s];if("ltr"==e.doc.direction&&l.level%2==0&&(n>0?l.to>r.ch:l.from<r.ch))return iG(t,r,n);var a=function(e,r){return iU(t,e instanceof e8?e.ch:e,r)},u=function(r){return e.options.lineWrapping?(i=i||ri(e,t),rC(e,t,i,r)):{begin:0,end:t.text.length}},c=u("before"==r.sticky?a(r,-1):r.ch);if("rtl"==e.doc.direction||1==l.level){var h=1==l.level==n<0,d=a(r,h?1:-1);if(null!=d&&(h?d<=l.to&&d<=c.end:d>=l.from&&d>=c.begin))return new e8(r.line,d,h?"before":"after")}var f=function(e,t,n){for(var i=function(e,t){return t?new e8(r.line,a(e,1),"before"):new e8(r.line,e,"after")};e>=0&&e<o.length;e+=t){var s=o[e],l=t>0==(1!=s.level),u=l?n.begin:a(n.end,-1);if(s.from<=u&&u<s.to||(u=l?s.from:a(s.to,-1),n.begin<=u&&u<n.end))return i(u,l)}},p=f(s+n,n,c);if(p)return p;var g=n>0?c.end:a(c.begin,-1);return null!=g&&!(n>0&&g==t.text.length)&&(p=f(n>0?0:o.length-1,n,u(g)))?p:null}(e.cm,l,t,r):iG(l,t,r);if(null==s){if(!(!o&&!((u=t.line+a)<e.first)&&!(u>=e.first+e.size)&&(t=new e8(u,t.ch,t.sticky),l=eJ(e,u))))return!1;t=iV(i,e.cm,l,t.line,a)}else t=s;return!0}if("char"==n||"codepoint"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var c=null,h="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(r<0)||u(!f);f=!1){var p=l.text.charAt(t.ch)||"\n",g=ef(p,d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||g||(g="s"),c&&c!=g){r<0&&(r=1,u(),t.sticky="after");break}if(g&&(c=g),r>0&&!u(!f))break}var m=n9(e,t,o,s,!0);return e4(o,m)&&(m.hitSide=!0),m}function of(e,t,r,n){var i,o,s=e.doc,l=t.left;if("page"==n){var a=Math.max(Math.min(e.display.wrapper.clientHeight,q(e).innerHeight||s(e).documentElement.clientHeight)-.5*rk(e.display),3);o=(r>0?t.bottom:t.top)+r*a}else"line"==n&&(o=r>0?t.bottom+3:t.top-3);for(;(i=rx(e,l,o)).outside;){if(r<0?o<=0:o>=s.height){i.hitSide=!0;break}o+=5*r}return i}var op=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function og(e,t){var r=rn(e,t.line);if(!r||r.hidden)return null;var n=eJ(e.doc,t.line),i=rr(r,n,t.line),o=eC(n,e.doc.direction),s="left";o&&(s=ex(o,t.ch)%2?"right":"left");var l=rl(i.map,t.ch,s);return l.offset="right"==l.collapse?l.end:l.start,l}function om(e,t){return t&&(e.bad=!0),e}function ov(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return om(e.clipPos(e8(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return function(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!B(n,t))return om(e8(e3(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?el(e.rest):e.line;return om(e8(e3(o),o.text.length),i)}var s=3==t.nodeType?t:null,l=t;for(!s&&1==t.childNodes.length&&3==t.firstChild.nodeType&&(s=t.firstChild,r&&(r=s.nodeValue.length));l.parentNode!=n;)l=l.parentNode;var a=e.measure,u=a.maps;function c(t,r,n){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?a.map:u[i],s=0;s<o.length;s+=3){var l=o[s+2];if(l==t||l==r){var c=e3(i<0?e.line:e.rest[i]),h=o[s]+n;return(n<0||l!=t)&&(h=o[s+ +!!n]),e8(c,h)}}}var h=c(s,l,r);if(h)return om(h,i);for(var d=l.nextSibling,f=s?s.nodeValue.length-r:0;d;d=d.nextSibling){if(h=c(d,d.firstChild,0))return om(e8(h.line,h.ch-f),i);f+=d.textContent.length}for(var p=l.previousSibling,g=r;p;p=p.previousSibling){if(h=c(p,p.firstChild,-1))return om(e8(h.line,h.ch+g),i);g+=p.textContent.length}}(o,t,r)}}op.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;
1if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function s(e){if(!(!o(e)||eN(n,e))){if(n.somethingSelected())oo={lineWise:!1,text:n.getSelections()},"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=ou(n);oo={lineWise:!0,text:t.text},"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,et),n.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var s=oo.text.join("\n");if(e.clipboardData.setData("Text",s),e.clipboardData.getData("Text")==s)return void e.preventDefault()}var l=oh(),a=l.firstChild;oc(a),n.display.lineSpace.insertBefore(l,n.display.lineSpace.firstChild),a.value=oo.text.join("\n");var u=U(X(i));K(a),setTimeout(function(){n.display.lineSpace.removeChild(l),u.focus(),u==i&&r.showPrimarySelection()},50)}}i.contentEditable=!0,oc(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),ek(i,"paste",function(e){!(!o(e)||eN(n,e)||ol(e,n))&&m<=11&&setTimeout(no(n,function(){return t.updateFromDOM()}),20)}),ek(i,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),ek(i,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),ek(i,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ek(i,"touchstart",function(){return r.forceCompositionEnd()}),ek(i,"input",function(){t.composing||t.readFromDOMSoon()}),ek(i,"copy",s),ek(i,"cut",s)},op.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},op.prototype.prepareSelection=function(){var e=rz(this.cm,!1);return e.focus=U(X(this.div))==this.div,e},op.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},op.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},op.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)return void e.removeAllRanges();var s=ov(t,e.anchorNode,e.anchorOffset),l=ov(t,e.focusNode,e.focusOffset);if(!s||s.bad||!l||l.bad||0!=e7(tr(s,l),i)||0!=e7(tt(s,l),o)){var a=t.display.view,u=i.line>=t.display.viewFrom&&og(t,i)||{node:a[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&og(t,o);if(!c){var d=a[a.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(!u||!c)return void e.removeAllRanges();var p,g=e.rangeCount&&e.getRangeAt(0);try{p=n(u.node,u.offset,c.offset,c.node)}catch(e){}p&&(!h&&t.state.focused?(e.collapse(u.node,u.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),g&&null==e.anchorNode?e.addRange(g):h&&this.startGracePeriod()),this.rememberSelection()}},op.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},op.prototype.showMultipleSelections=function(e){I(this.cm.display.cursorDiv,e.cursors),I(this.cm.display.selectionDiv,e.selection)},op.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},op.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return B(this.div,t)},op.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&U(X(this.div))==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},op.prototype.blur=function(){this.div.blur()},op.prototype.getField=function(){return this.div},op.prototype.supportsTouch=function(){return!0},op.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):ni(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))})},op.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},op.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(T&&b&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var r=ov(t,e.anchorNode,e.anchorOffset),n=ov(t,e.focusNode,e.focusOffset);r&&n&&ni(t,function(){n0(t.doc,nD(r,n),et),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},op.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n,i,o=this.cm,s=o.display,l=o.doc.sel.primary(),a=l.from(),u=l.to();if(0==a.ch&&a.line>o.firstLine()&&(a=e8(a.line-1,eJ(o.doc,a.line-1).length)),u.ch==eJ(o.doc,u.line).text.length&&u.line<o.lastLine()&&(u=e8(u.line+1,0)),a.line<s.viewFrom||u.line>s.viewTo-1)return!1;a.line==s.viewFrom||0==(e=rA(o,a.line))?(t=e3(s.view[0].line),r=s.view[0].node):(t=e3(s.view[e].line),r=s.view[e-1].node.nextSibling);
1var c=rA(o,u.line);if(c==s.view.length-1?(n=s.viewTo-1,i=s.lineDiv.lastChild):(n=e3(s.view[c+1].line)-1,i=s.view[c+1].node.previousSibling),!r)return!1;for(var h=o.doc.splitLines(function(e,t,r,n,i){var o="",s=!1,l=e.doc.lineSeparator(),a=!1;function u(){s&&(o+=l,a&&(o+=l),s=a=!1)}function c(e){e&&(u(),o+=e)}for(;!function t(r){if(1==r.nodeType){var o=r.getAttribute("cm-text");if(o)return void c(o);var h,d=r.getAttribute("cm-marker");if(d){var f,p=e.findMarks(e8(n,0),e8(i+1,0),(f=+d,function(e){return e.id==f}));p.length&&(h=p[0].find(0))&&c(e0(e.doc,h.from,h.to).join(l));return}if("false"!=r.getAttribute("contenteditable")){var g=/^(pre|div|p|li|table|br)$/i.test(r.nodeName);if(/^br$/i.test(r.nodeName)||0!=r.textContent.length){g&&u();for(var m=0;m<r.childNodes.length;m++)t(r.childNodes[m]);/^(pre|p)$/i.test(r.nodeName)&&(a=!0),g&&(s=!0)}}}else 3==r.nodeType&&c(r.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}(t),t!=r;)t=t.nextSibling,a=!1;return o}(o,r,i,t,n)),d=e0(o.doc,e8(t,0),e8(n,eJ(o.doc,n).text.length));h.length>1&&d.length>1;)if(el(h)==el(d))h.pop(),d.pop(),n--;else if(h[0]==d[0])h.shift(),d.shift(),t++;else break;for(var f=0,p=0,g=h[0],m=d[0],v=Math.min(g.length,m.length);f<v&&g.charCodeAt(f)==m.charCodeAt(f);)++f;for(var y=el(h),b=el(d),x=Math.min(y.length-(1==h.length?f:0),b.length-(1==d.length?f:0));p<x&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==d.length&&t==a.line)for(;f&&f>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var w=e8(t,f),C=e8(n,d.length?el(d).length-p:0);if(h.length>1||h[0]||e7(w,C))return is(o.doc,h,w,C,"+input"),!0},op.prototype.ensurePolled=function(){this.forceCompositionEnd()},op.prototype.reset=function(){this.forceCompositionEnd()},op.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},op.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(!e.composing.done)return;else e.composing=null;e.updateFromDOM()},80))},op.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ni(this.cm,function(){return rW(e.cm)})},op.prototype.setUneditable=function(e){e.contentEditable="false"},op.prototype.onKeyPress=function(e){0!=e.charCode&&!this.composing&&(e.preventDefault(),this.cm.isReadOnly()||no(this.cm,os)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},op.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},op.prototype.onContextMenu=function(){},op.prototype.resetPosition=function(){},op.prototype.needsContentAttribute=!0;var oy=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Q,this.hasSelection=!1,this.composing=null,this.resetting=!1};oy.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!eN(n,e)){if(n.somethingSelected())oo={lineWise:!1,text:n.getSelections()};else{if(!n.options.lineWiseCopyCut)return;var t=ou(n);oo={lineWise:!0,text:t.text},"cut"==e.type?n.setSelections(t.ranges,null,et):(r.prevInput="",i.value=t.text.join("\n"),K(i))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),L&&(i.style.width="0px"),ek(i,"input",function(){g&&m>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),ek(i,"paste",function(e){eN(n,e)||ol(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())}),ek(i,"cut",o),ek(i,"copy",o),ek(e.scroller,"paste",function(t){if(!(t6(e,t)||eN(n,t))){if(!i.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}}),ek(e.lineSpace,"selectstart",function(t){t6(e,t)||eW(t)}),ek(i,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),ek(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},oy.prototype.createField=function(e){this.wrapper=oh(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;oc(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},oy.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},oy.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=rz(e);if(e.options.moveInputWithCursor){var i=rv(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+s.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+s.left-o.left))}return n},oy.prototype.showSelection=function(e){var t=this.cm.display;I(t.cursorDiv,e.cursors),I(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},oy.prototype.reset=function(e){if(!this.contextMenuPending&&(!this.composing||!e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&K(this.textarea),g&&m>=9&&(this.hasSelection=r)}else!e&&(this.prevInput=this.textarea.value="",g&&m>=9&&(this.hasSelection=null));this.resetting=!1}},oy.prototype.getField=function(){return this.textarea},oy.prototype.supportsTouch=function(){return!1}
1,oy.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!M||U(X(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},oy.prototype.blur=function(){this.textarea.blur()},oy.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},oy.prototype.receivedFocus=function(){this.slowPoll()},oy.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},oy.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))})},oy.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||eB(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(g&&m>=9&&this.hasSelection===i||N&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="â"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,l=Math.min(n.length,i.length);s<l&&n.charCodeAt(s)==i.charCodeAt(s);)++s;return ni(t,function(){os(t,i.slice(s),n.length-s,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},oy.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},oy.prototype.onKeyPress=function(){g&&m>=9&&(this.hasSelection=null),this.fastPoll()},oy.prototype.onContextMenu=function(e){var t,r=this,n=r.cm,i=n.display,o=r.textarea;r.contextMenuPending&&r.contextMenuPending();var s=rO(n,e),l=i.scroller.scrollTop;if(s&&!w){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(s)&&no(n,n0)(n.doc,nD(s),et);var a=o.style.cssText,u=r.wrapper.style.cssText,c=r.wrapper.offsetParent.getBoundingClientRect();if(r.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-c.top-5)+"px; left: "+(e.clientX-c.left-5)+"px;\n z-index: 1000; background: "+(g?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",v&&(t=o.ownerDocument.defaultView.scrollY),i.input.focus(),v&&o.ownerDocument.defaultView.scrollTo(null,t),i.input.reset(),n.somethingSelected()||(o.value=r.prevInput=" "),r.contextMenuPending=f,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),g&&m>=9&&d(),H){eE(e);var h=function(){eT(window,"mouseup",h),setTimeout(f,20)};ek(window,"mouseup",h)}else setTimeout(f,50)}function d(){if(null!=o.selectionStart){var e=n.somethingSelected(),t="â"+(e?o.value:"");o.value="â",o.value=t,r.prevInput=e?"":"â",o.selectionStart=1,o.selectionEnd=t.length,i.selForContextMenu=n.doc.sel}}function f(){if(r.contextMenuPending==f&&(r.contextMenuPending=!1,r.wrapper.style.cssText=u,o.style.cssText=a,g&&m<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=l),null!=o.selectionStart)){(!g||g&&m<9)&&d();var e=0,t=function(){i.selForContextMenu==n.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"â"==r.prevInput?no(n,n7)(n):e++<10?i.detectingSelectAll=setTimeout(t,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(t,200)}}},oy.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},oy.prototype.setUneditable=function(){},oy.prototype.needsContentAttribute=!1;var ob=or.optionHandlers;function ox(e,t,r,n){or.defaults[e]=t,r&&(ob[e]=n?function(e,t,n){n!=i4&&r(e,t,n)}:r)}or.defineOption=ox,or.Init=i4,ox("value","",function(e,t){return e.setValue(t)},!0),ox("mode",null,function(e,t){e.doc.modeOption=t,nP(e)},!0),ox("indentUnit",2,nP,!0),ox("indentWithTabs",!1),ox("smartIndent",!0),ox("tabSize",4,function(e){nE(e),rc(e),rW(e)},!0),ox("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(e8(n,o))}n++});for(var i=r.length-1;i>=0;i--)is(e.doc,t,r[i],e8(r[i].line,r[i].ch+t.length))}}),ox("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(e,t,r){e.state.specialChars=RegExp(t.source+(t.test(" ")?"":"| "),"g"),r!=i4&&e.refresh()}),ox("specialCharPlaceholder",function(e){var t=z("span","â¢","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t},function(e){return e.refresh()},!0),ox("electricChars",!0),ox("inputStyle",M?"contenteditable":"textarea",function(){throw Error("inputStyle can not (yet) be changed in a running editor")}
1,!0),ox("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),ox("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),ox("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),ox("rtlMoveVisually",!O),ox("wholeLineUpdateBefore",!0),ox("theme","default",function(e){i7(e),nx(e)},!0),ox("keyMap","default",function(e,t,r){var n=iR(t),i=r!=i4&&iR(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),ox("extraKeys",null),ox("configureMouse",null),ox("lineWrapping",!1,function(e){e.options.lineWrapping?(G(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),tI(e)),rD(e),rW(e),rc(e),setTimeout(function(){return r8(e)},100)},!0),ox("gutters",[],function(e,t){e.display.gutterSpecs=ny(t,e.options.lineNumbers),nx(e)},!0),ox("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?rM(e.display)+"px":"0",e.refresh()},!0),ox("coverGutterNextToScrollbar",!1,function(e){return r8(e)},!0),ox("scrollbarStyle","native",function(e){ne(e),r8(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),ox("lineNumbers",!1,function(e,t){e.display.gutterSpecs=ny(e.options.gutters,t),nx(e)},!0),ox("firstLineNumber",1,nx,!0),ox("lineNumberFormatter",function(e){return e},nx,!0),ox("showCursorWhenSelecting",!1,rI,!0),ox("resetSelectionOnContextMenu",!0),ox("lineWiseCopyCut",!0),ox("pasteLinesPerSelection",!0),ox("selectionsMayTouch",!1),ox("readOnly",!1,function(e,t){"nocursor"==t&&(rj(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),ox("screenReaderLabel",null,function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)}),ox("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),ox("dragDrop",!0,function(e,t,r){if(!t!=!(r&&r!=i4)){var n=e.display.dragFunctions,i=t?ek:eT;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}),ox("allowDropFileTypes",null),ox("cursorBlinkRate",530),ox("cursorScrollMargin",0),ox("cursorHeight",1,rI,!0),ox("singleCursorHeightPerLine",!0,rI,!0),ox("workTime",100),ox("workDelay",100),ox("flattenSpans",!0,nE,!0),ox("addModeClass",!1,nE,!0),ox("pollInterval",100),ox("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),ox("historyEventDelay",1250),ox("viewportMargin",10,function(e){return e.refresh()},!0),ox("maxHighlightLength",1e4,nE,!0),ox("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),ox("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),ox("autofocus",null),ox("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),ox("phrases",null),t=or.optionHandlers,r=or.helpers={},or.prototype={constructor:or,focus:function(){q(this).focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];(n[e]!=r||"mode"==e)&&(n[e]=r,t.hasOwnProperty(e)&&no(this,t[e])(this,r,i),eM(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](iR(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:ns(function(e,t){var r=e.token?e:or.getMode(this.options,e);if(r.startState)throw Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:r,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,rW(this)}),removeOverlay:ns(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){t.splice(r,1),this.state.modeGen++,rW(this);return}}}),indentLine:ns(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),e6(this.doc,e)&&oi(this,e,t,r)}),indentSelection:ns(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&&(oi(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&rZ(this));else{var o=i.from(),s=i.to(),l=Math.max(r,o.line);r=Math.min(this.lastLine(),s.line-!s.ch)+1;for(var a=l;a<r;++a)oi(this,a,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&nQ(this.doc,n,new nM(o,u[n].to()),et)}}}),getTokenAt:function(e,t){return tg(this,e,t)},getLineTokens:function(e,t){return tg(this,e8(e),t,!0)},getTokenTypeAt:function(e){e=ti(this.doc,e);var t,r=tu(this,eJ(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var s=n+i>>1;
1if((s?r[2*s-1]:0)>=o)i=s;else if(r[2*s+1]<o)n=s+1;else{t=r[2*s+2];break}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?or.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!r.hasOwnProperty(t))return n;var i=r[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&n.push(i[o[t]]);else if(o[t])for(var s=0;s<o[t].length;s++){var l=i[o[t][s]];l&&n.push(l)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var a=0;a<i._global.length;a++){var u=i._global[a];u.pred(o,this)&&-1==J(n,u.val)&&n.push(u.val)}return n},getStateAfter:function(e,t){var r=this.doc;return tc(this,(e=tn(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return rv(this,null==e?r.head:"object"==typeof e?ti(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return rm(this,ti(this.doc,e),t||"page")},coordsChar:function(e,t){return rx(this,(e=rg(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=rg(this,{top:e,left:0},t||"page").top,e5(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=eJ(this.doc,e)}else n=e;return rp(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-tE(n):0)},defaultTextHeight:function(){return rk(this.display)},defaultCharWidth:function(){return rL(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,s=this.display,l=(e=rv(this,ti(this.doc,e))).bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var u=Math.max(s.wrapper.clientHeight,this.doc.height),c=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>u)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=u&&(l=e.bottom),a+t.offsetWidth>c&&(a=c-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(a=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),r&&(null!=(o=rY(this,{left:a,top:l,right:a+t.offsetWidth,bottom:l+t.offsetHeight})).scrollTop&&r1(this,o.scrollTop),null!=o.scrollLeft&&r3(this,o.scrollLeft))},triggerOnKeyDown:ns(iJ),triggerOnKeyPress:ns(i1),triggerOnKeyUp:i0,triggerOnMouseDown:ns(i3),execCommand:function(e){if(iK.hasOwnProperty(e))return iK[e].call(null,this)},triggerElectric:ns(function(e){oa(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=ti(this.doc,e),s=0;s<t&&!(o=od(this.doc,o,i,r,n)).hitSide;++s);return o},moveH:ns(function(e,t){var r=this;this.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?od(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()},en)}),deleteH:ns(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):iB(this,function(r){var i=od(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var s=ti(this.doc,e),l=0;l<t;++l){var a=rv(this,s,"div");if(null==o?o=a.left:a.left=o,(s=of(this,a,i,r)).hitSide)break}return s},moveV:ns(function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(s){if(o)return e<0?s.from():s.to();var l=rv(r,s.head,"div");null!=s.goalColumn&&(l.left=s.goalColumn),i.push(l.left);var a=of(r,l,e,t);return"page"==t&&s==n.sel.primary()&&r$(r,rm(r,a,"div").top-l.top),a},en),i.length)for(var s=0;s<n.sel.ranges.length;s++)n.sel.ranges[s].goalColumn=i[s]}),findWordAt:function(e){var t=eJ(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");("before"==e.sticky||n==t.length)&&r?--r:++n;for(var o=t.charAt(r),s=ef(o,i)?function(e){return ef(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ef(e)};r>0&&s(t.charAt(r-1));)--r;for(;n<t.length&&s(t.charAt(n));)++n}return new nM(e8(e.line,r),e8(e.line,n))},toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?G(this.display.cursorDiv,"CodeMirror-overwrite"):E(this.display.cursorDiv,"CodeMirror-overwrite"),eM(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==U(_(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ns(function(e,t){rQ(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-t4(this)-this.display.barHeight,width:e.scrollWidth-t4(this)-this.display.barWidth,clientHeight:rt(this),clientWidth:re(this)}},scrollIntoView:ns(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:e8
1(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){var r;r=e,rJ(this),this.curOp.scrollToPos=r}else r0(this,e.from,e.to,e.margin)}),setSize:ns(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&ru(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets){for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){rH(r,i,"widget");break}}++i}),this.curOp.forceUpdate=!0,eM(this,"refresh",this)}),operation:function(e){return ni(this,e)},startOperation:function(){return nr(this)},endOperation:function(){return nn(this)},refresh:ns(function(){var e=this.display.cachedTextHeight;rW(this),this.curOp.forceUpdate=!0,rc(this),rQ(this,this.doc.scrollLeft,this.doc.scrollTop),np(this.display),(null==e||Math.abs(e-rk(this.display))>.5||this.options.lineWrapping)&&rD(this),eM(this,"refresh",this)}),swapDoc:ns(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),nR(this,e),rc(this),this.display.input.reset(),rQ(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,tY(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},eA(or),or.registerHelper=function(e,t,n){r.hasOwnProperty(e)||(r[e]=or[e]={_global:[]}),r[e][t]=n},or.registerGlobalHelper=function(e,t,n,i){or.registerHelper(e,t,i),r[e]._global.push({pred:n,val:i})};var ow="iter insert remove copy getEditor constructor".split(" ");for(var oC in iC.prototype)iC.prototype.hasOwnProperty(oC)&&0>J(ow,oC)&&(or.prototype[oC]=function(e){return function(){return e.apply(this.doc,arguments)}}(iC.prototype[oC]));return eA(iC),or.inputStyles={textarea:oy,contenteditable:op},or.defineMode=function(e){or.defaults.mode||"null"==e||(or.defaults.mode=e),ej.apply(this,arguments)},or.defineMIME=function(e,t){eK[e]=t},or.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),or.defineMIME("text/plain","null"),or.defineExtension=function(e,t){or.prototype[e]=t},or.defineDocExtension=function(e,t){iC.prototype[e]=t},or.fromTextArea=function(e,t){if((t=t?$(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r,n=U(X(e));t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=l.getValue()}if(e.form&&(ek(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var o=e.form;r=o.submit;try{var s=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=s}}catch(e){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(eT(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var l=or(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return l},or.off=eT,or.on=ek,or.wheelEventPixels=function(e){var t=nk(e);return t.x*=nS,t.y*=nS,t},or.Doc=iC,or.splitLines=eR,or.countColumn=Z,or.findColumn=ei,or.isWordChar=ed,or.Pass=ee,or.signal=eM,or.Line=tz,or.changeEnd=nO,or.scrollbarModel=r4,or.Pos=e8,or.cmpPos=e7,or.modes=eV,or.mimeModes=eK,or.resolveMode=e_,or.getMode=eX,or.modeExtensions=eq,or.extendMode=function(e,t){$(t,eq.hasOwnProperty(e)?eq[e]:eq[e]={})},or.copyState=eY,or.startState=eZ,or.innerMode=e$,or.commands=iK,or.keyMap=iH,or.keyName=iz,or.isModifierKey=iF,or.lookupKey=iE,or.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=ea(r.split(" "),iP),o=0;o<i.length;o++){var s=void 0,l=void 0;o==i.length-1?(l=i.join(" "),s=n):(l=i.slice(0,o+1).join(" "),s="...");var a=t[l];if(a){if(a!=s)throw Error("Inconsistent bindings for "+l)}else t[l]=s}delete e[r]}for(var u in t)e[u]=t[u];return e},or.StringStream=eQ,or.SharedTextMarker=ib,or.TextMarker=iv,or.LineWidget=ip,or.e_preventDefault=eW,or.e_stopPropagation=eH,or.e_stop=eE,or.addClass=G,or.contains=B,or.rmClass=E,or.keyNames=iD,or.version="5.65.21",or}()}(s),function(){var e=s.exports,t={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}
1,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},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",function(n,i){var o,s,l=n.indentUnit,a={},u=i.htmlMode?t:r;for(var c in u)a[c]=u[c];for(var c in i)a[c]=i[c];function h(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)if(e.eat("!"))if(e.eat("["))if(e.match("CDATA["))return r(f("atom","]]>"));else return null;else if(e.match("--"))return r(f("comment","--\x3e"));else if(e.match("DOCTYPE",!0,!0))return e.eatWhile(/[\w\._\-]/),r(function e(t){return function(r,n){for(var i;null!=(i=r.next());)if("<"==i)return n.tokenize=e(t+1),n.tokenize(r,n);else if(">"==i)if(1!=t)return n.tokenize=e(t-1),n.tokenize(r,n);else{n.tokenize=h;break}return"meta"}}(1));else return null;else if(e.eat("?"))return e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta";else return o=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket";return"&"==n?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function d(e,t){var r,n,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=h,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){t.tokenize=h,t.state=y,t.tagName=t.tagStart=null;var s=t.tokenize(e,t);return s?s+" tag error":"tag error"}if(!/[\'\"]/.test(i))return e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word";return r=i,(n=function(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=d;break}return"string"}).isInAttribute=!0,t.tokenize=n,t.stringStartCol=e.column(),t.tokenize(e,t)}function f(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=h;break}r.next()}return e}}function p(e){return e&&e.toLowerCase()}function g(e,t,r){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=r,(a.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function v(e,t){for(var r;;){if(!e.context||(r=e.context.tagName,!a.contextGrabbers.hasOwnProperty(p(r))||!a.contextGrabbers[p(r)].hasOwnProperty(p(t))))return;m(e)}}function y(e,t,r){return"openTag"==e?(r.tagStart=t.column(),b):"closeTag"==e?x:y}function b(e,t,r){return"word"==e?(r.tagName=t.current(),s="tag",S):a.allowMissingTagName&&"endTag"==e?(s="tag bracket",S(e,t,r)):(s="error",b)}function x(e,t,r){if("word"==e){var n=t.current();return(r.context&&r.context.tagName!=n&&a.implicitlyClosed.hasOwnProperty(p(r.context.tagName))&&m(r),r.context&&r.context.tagName==n||!1===a.matchClosing)?(s="tag",w):(s="tag error",C)}return a.allowMissingTagName&&"endTag"==e?(s="tag bracket",w(e,t,r)):(s="error",C)}function w(e,t,r){return"endTag"!=e?(s="error",w):(m(r),y)}function C(e,t,r){return s="error",w(e,t,r)}function S(e,t,r){if("word"==e)return s="attribute",k;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||a.autoSelfClosers.hasOwnProperty(p(n))?v(r,n):(v(r,n),r.context=new g(r,n,i==r.indented)),y}return s="error",S}function k(e,t,r){return"equals"==e?L:(a.allowMissing||(s="error"),S(e,t,r))}function L(e,t,r){return"string"==e?T:"word"==e&&a.allowUnquoted?(s="string",S):(s="error",S(e,t,r))}function T(e,t,r){return"string"==e?T:S(e,t,r)}return h.isInText=!0,{startState:function(e){var t={tokenize:h,state:y,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var r=t.tokenize(e,t);return(r||o)&&"comment"!=r&&(s=null,t.state=t.state(o||r,e,t),s&&(r="error"==s?r+" error":s)),r},indent:function(t,r,n){var i=t.context;
1if(t.tokenize.isInAttribute)if(t.tagStart==t.indented)return t.stringStartCol+1;else return t.indented+l;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=d&&t.tokenize!=h)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)if(!1!==a.multilineTagIndentPastTag)return t.tagStart+t.tagName.length+2;else return t.tagStart+l*(a.multilineTagIndentFactor||1);if(a.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var o=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(o&&o[1])for(;i;)if(i.tagName==o[2]){i=i.prev;break}else if(a.implicitlyClosed.hasOwnProperty(p(i.tagName)))i=i.prev;else break;else if(o)for(;i;){var s=a.contextGrabbers[p(i.tagName)];if(s&&s.hasOwnProperty(p(o[2])))i=i.prev;else break}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+l:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:a.htmlMode?"html":"xml",helperType:a.htmlMode?"html":"xml",skipAttribute:function(e){e.state==L&&(e.state=S)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],r=e.context;r;r=r.prev)t.push(r.tagName);return t.reverse()}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}();var l={};function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var c=function(){var e=function(t,r){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(l,"__esModule",{value:!0}),l.UnControlled=p=l.Controlled=void 0;var h="undefined"==typeof navigator||void 0!==o.c&&!0===o.c.PREVENT_CODEMIRROR_RENDER;h||(n=s.exports);var d=function(){function e(){}return e.equals=function(e,t){var r=this,n=Object.keys,i=u(e),o=u(t);return e&&t&&"object"===i&&i===o?n(e).length===n(t).length&&n(e).every(function(n){return r.equals(e[n],t[n])}):e===t},e}(),f=function(){function e(e,t){this.editor=e,this.props=t}return e.prototype.delegateCursor=function(e,t,r){var n=this.editor.getDoc();r&&this.editor.focus(),t?n.setCursor(e):n.setCursor(e,null,{scroll:!1})},e.prototype.delegateScroll=function(e){this.editor.scrollTo(e.x,e.y)},e.prototype.delegateSelection=function(e,t){this.editor.getDoc().setSelections(e),t&&this.editor.focus()},e.prototype.apply=function(e){e&&e.selection&&e.selection.ranges&&this.delegateSelection(e.selection.ranges,e.selection.focus||!1),e&&e.cursor&&this.delegateCursor(e.cursor,e.autoScroll||!1,this.editor.getOption("autofocus")||!1),e&&e.scroll&&this.delegateScroll(e.scroll)},e.prototype.applyNext=function(e,t,r){e&&e.selection&&e.selection.ranges&&t&&t.selection&&t.selection.ranges&&!d.equals(e.selection.ranges,t.selection.ranges)&&this.delegateSelection(t.selection.ranges,t.selection.focus||!1),e&&e.cursor&&t&&t.cursor&&!d.equals(e.cursor,t.cursor)&&this.delegateCursor(r.cursor||t.cursor,t.autoScroll||!1,t.autoCursor||!1),e&&e.scroll&&t&&t.scroll&&!d.equals(e.scroll,t.scroll)&&this.delegateScroll(t.scroll)},e.prototype.applyUserDefined=function(e,t){t&&t.cursor&&this.delegateCursor(t.cursor,e.autoScroll||!1,this.editor.getOption("autofocus")||!1)},e.prototype.wire=function(e){var t=this;Object.keys(e||{}).filter(function(e){return/^on/.test(e)}).forEach(function(e){switch(e){case"onBlur":t.editor.on("blur",function(e,r){t.props.onBlur(t.editor,r)});break;case"onContextMenu":t.editor.on("contextmenu",function(e,r){t.props.onContextMenu(t.editor,r)});break;case"onCopy":t.editor.on("copy",function(e,r){t.props.onCopy(t.editor,r)});break;case"onCursor":t.editor.on("cursorActivity",function(e){t.props.onCursor(t.editor,t.editor.getDoc().getCursor())});break;case"onCursorActivity":t.editor.on("cursorActivity",function(e){t.props.onCursorActivity(t.editor)});break;case"onCut":t.editor.on("cut",function(e,r){t.props.onCut(t.editor,r)});break;case"onDblClick":t.editor.on("dblclick",function(e,r){t.props.onDblClick(t.editor,r)});break;case"onDragEnter":t.editor.on("dragenter",function(e,r){t.props.onDragEnter(t.editor,r)});break;case"onDragLeave":t.editor.on("dragleave",function(e,r){t.props.onDragLeave(t.editor,r)});break;case"onDragOver":t.editor.on("dragover",function(e,r){t.props.onDragOver(t.editor,r)});break;case"onDragStart":t.editor.on("dragstart",function(e,r){t.props.onDragStart(t.editor,r)});break;case"onDrop":t.editor.on("drop",function(e,r){t.props.onDrop(t.editor,r)});break;case"onFocus":t.editor.on("focus",function(e,r){t.props.onFocus(t.editor,r)});break;case"onGutterClick":t.editor.on("gutterClick",function(e,r,n,i){t.props.onGutterClick(t.editor,r,n,i)});break;case"onInputRead":t.editor.on("inputRead",function(e,r){t.props.onInputRead(t.editor,r)});break;
1case"onKeyDown":t.editor.on("keydown",function(e,r){t.props.onKeyDown(t.editor,r)});break;case"onKeyHandled":t.editor.on("keyHandled",function(e,r,n){t.props.onKeyHandled(t.editor,r,n)});break;case"onKeyPress":t.editor.on("keypress",function(e,r){t.props.onKeyPress(t.editor,r)});break;case"onKeyUp":t.editor.on("keyup",function(e,r){t.props.onKeyUp(t.editor,r)});break;case"onMouseDown":t.editor.on("mousedown",function(e,r){t.props.onMouseDown(t.editor,r)});break;case"onPaste":t.editor.on("paste",function(e,r){t.props.onPaste(t.editor,r)});break;case"onRenderLine":t.editor.on("renderLine",function(e,r,n){t.props.onRenderLine(t.editor,r,n)});break;case"onScroll":t.editor.on("scroll",function(e){t.props.onScroll(t.editor,t.editor.getScrollInfo())});break;case"onSelection":t.editor.on("beforeSelectionChange",function(e,r){t.props.onSelection(t.editor,r)});break;case"onTouchStart":t.editor.on("touchstart",function(e,r){t.props.onTouchStart(t.editor,r)});break;case"onUpdate":t.editor.on("update",function(e){t.props.onUpdate(t.editor)});break;case"onViewportChange":t.editor.on("viewportChange",function(e,r,n){t.props.onViewportChange(t.editor,r,n)})}})},e}(),p=l.Controlled=function(e){function t(t){var r=e.call(this,t)||this;return h||(r.applied=!1,r.appliedNext=!1,r.appliedUserDefined=!1,r.deferred=null,r.emulating=!1,r.hydrated=!1,r.initCb=function(){r.props.editorDidConfigure&&r.props.editorDidConfigure(r.editor)},r.mounted=!1),r}return c(t,e),t.prototype.hydrate=function(e){var t=this,r=e&&e.options?e.options:{},i=a({},n.defaults,this.editor.options,r);Object.keys(i).some(function(e){return t.editor.getOption(e)!==i[e]}
1)&&Object.keys(i).forEach(function(e){r.hasOwnProperty(e)&&t.editor.getOption(e)!==i[e]&&(t.editor.setOption(e,i[e]),t.mirror.setOption(e,i[e]))}),this.hydrated||(this.deferred?this.resolveChange(e.value):this.initChange(e.value||"")),this.hydrated=!0},t.prototype.initChange=function(e){this.emulating=!0;var t=this.editor.getDoc(),r=t.lastLine(),n=t.getLine(t.lastLine()).length;t.replaceRange(e||"",{line:0,ch:0},{line:r,ch:n}),this.mirror.setValue(e),t.clearHistory(),this.mirror.clearHistory(),this.emulating=!1},t.prototype.resolveChange=function(e){this.emulating=!0;var t=this.editor.getDoc();if("undo"===this.deferred.origin?t.undo():"redo"===this.deferred.origin?t.redo():t.replaceRange(this.deferred.text,this.deferred.from,this.deferred.to,this.deferred.origin),e&&e!==t.getValue()){var r=t.getCursor();t.setValue(e),t.setCursor(r)}this.emulating=!1,this.deferred=null},t.prototype.mirrorChange=function(e){var t=this.editor.getDoc();return"undo"===e.origin?(t.setHistory(this.mirror.getHistory()),this.mirror.undo()):"redo"===e.origin?(t.setHistory(this.mirror.getHistory()),this.mirror.redo()):this.mirror.replaceRange(e.text,e.from,e.to,e.origin),this.mirror.getValue()},t.prototype.componentDidMount=function(){var e=this;!h&&(this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&n.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=n(this.ref,this.props.options),this.shared=new f(this.editor,this.props),this.mirror=n(function(){},this.props.options),this.editor.on("electricInput",function(){e.mirror.setHistory(e.editor.getDoc().getHistory())}),this.editor.on("cursorActivity",function(){e.mirror.setCursor(e.editor.getDoc().getCursor())}),this.editor.on("beforeChange",function(t,r){if(!e.emulating){r.cancel(),e.deferred=r;var n=e.mirrorChange(e.deferred);e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,e.deferred,n)}}),this.editor.on("change",function(t,r){e.mounted&&e.props.onChange&&e.props.onChange(e.editor,r,e.editor.getValue())}),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getOption("autofocus")&&this.editor.focus(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},t.prototype.componentDidUpdate=function(e){if(!h){var t={cursor:null};this.props.value!==e.value&&(this.hydrated=!1),this.props.autoCursor||void 0===this.props.autoCursor||(t.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.appliedNext||(this.shared.applyNext(e,this.props,t),this.appliedNext=!0),this.shared.applyUserDefined(e,t),this.appliedUserDefined=!0}},t.prototype.componentWillUnmount=function(){!h&&this.props.editorWillUnmount&&this.props.editorWillUnmount(n)},t.prototype.shouldComponentUpdate=function(e,t){return!h},t.prototype.render=function(){var e=this;if(h)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return i.createElement("div",{className:t,ref:function(t){return e.ref=t}})},t}(i.Component);l.UnControlled=function(e){function t(t){var r=e.call(this,t)||this;return h||(r.applied=!1,r.appliedUserDefined=!1,r.continueChange=!1,r.detached=!1,r.hydrated=!1,r.initCb=function(){r.props.editorDidConfigure&&r.props.editorDidConfigure(r.editor)},r.mounted=!1,r.onBeforeChangeCb=function(){r.continueChange=!0}),r}return c(t,e),t.prototype.hydrate=function(e){var t=this,r=e&&e.options?e.options:{},i=a({},n.defaults,this.editor.options,r);if(Object.keys(i).some(function(e){return t.editor.getOption(e)!==i[e]}
1)&&Object.keys(i).forEach(function(e){r.hasOwnProperty(e)&&t.editor.getOption(e)!==i[e]&&t.editor.setOption(e,i[e])}),!this.hydrated){var o=this.editor.getDoc(),s=o.lastLine(),l=o.getLine(o.lastLine()).length;o.replaceRange(e.value||"",{line:0,ch:0},{line:s,ch:l})}this.hydrated=!0},t.prototype.componentDidMount=function(){var e=this;!h&&(this.detached=!0===this.props.detach,this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&n.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=n(this.ref,this.props.options),this.shared=new f(this.editor,this.props),this.editor.on("beforeChange",function(t,r){e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,r,e.editor.getValue(),e.onBeforeChangeCb)}),this.editor.on("change",function(t,r){e.mounted&&e.props.onChange&&(e.props.onBeforeChange?e.continueChange&&e.props.onChange(e.editor,r,e.editor.getValue()):e.props.onChange(e.editor,r,e.editor.getValue()))}),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getDoc().clearHistory(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},t.prototype.componentDidUpdate=function(e){if(this.detached&&!1===this.props.detach&&(this.detached=!1,e.editorDidAttach&&e.editorDidAttach(this.editor)),!this.detached&&!0===this.props.detach&&(this.detached=!0,e.editorDidDetach&&e.editorDidDetach(this.editor)),!h&&!this.detached){var t={cursor:null};this.props.value!==e.value&&(this.hydrated=!1,this.applied=!1,this.appliedUserDefined=!1),e.autoCursor||void 0===e.autoCursor||(t.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.applied||(this.shared.apply(e),this.applied=!0),this.appliedUserDefined||(this.shared.applyUserDefined(e,t),this.appliedUserDefined=!0)}},t.prototype.componentWillUnmount=function(){!h&&this.props.editorWillUnmount&&this.props.editorWillUnmount(n)},t.prototype.shouldComponentUpdate=function(e,t){var r=!0;return h&&(r=!1),this.detached&&e.detach&&(r=!1),r},t.prototype.render=function(){var e=this;if(h)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return i.createElement("div",{className:t,ref:function(t){return e.ref=t}})},t}(i.Component);var g={container:"_container_13rz9_1"};function m(e){let{value:t,onChange:r}=e;return i.createElement(p,{className:g.container,value:t,onBeforeChange:(e,t,n)=>r(n),options:{mode:"xml",theme:"material",lineNumbers:!0,autofocus:!0,styleActiveLine:!0,smartIndent:!0,lineWrapping:!0,foldGutter:!0}})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.