123 |
- package assets
- var CpCodeMirrorJs = []byte(`!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,function(){"use strict";var e=navigator.userAgent,t=navigator.platform,m=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),i=/Edge\/(\d+)/.exec(e),x=r||n||i,k=x&&(r?document.documentMode||6:+(i||n)[1]),b=!i&&/WebKit\//.test(e),o=b&&/Qt\/\d+\.\d+/.test(e),a=!i&&/Chrome\//.test(e),g=/Opera\//.test(e),s=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),c=/PhantomJS/.test(e),u=!i&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),d=/Android/.test(e),f=u||d||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),w=u||/Mac/.test(t),h=/\bCrOS\b/.test(e),p=/win/i.test(t),v=g&&e.match(/Version\/(\d*\.\d*)/);v&&(v=Number(v[1])),v&&15<=v&&(b=!(g=!1));var y=w&&(o||g&&(null==v||v<12.11)),C=m||x&&9<=k;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,T=function(e,t){var r=e.className,n=S(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 M(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function N(e,t){return M(e).appendChild(t)}function A(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 O(e,t,r,n){var i=A(e,t,r,n);return i.setAttribute("role","presentation"),i}function D(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 W(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function z(e,t){var r=e.className;S(t).test(r)||(e.className+=(r?" ":"")+t)}function P(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!S(r[n]).test(t)&&(t+=" "+r[n]);return t}L=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 I=function(e){e.select()};function E(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function H(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function F(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||t<=l)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}u?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:x&&(I=function(e){try{e.select()}catch(e){}});var R=function(){this.id=null};function B(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}R.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var j=30,V={toString:function(){return"CodeMirror.Pass"}},K={scroll:!1},U={origin:"*mouse"},G={origin:"+move"};function q(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||t<=i+a)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,t<=(i+=r-i%r))return n}}var $=[""];function X(e){for(;$.length<=e;)$.push(Y($)+" ");return $[e]}function Y(e){return e[e.length-1]}function _(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Z(){}function J(e,t){var r;return r=Object.create?Object.create(e):(Z.prototype=e,new Z),t&&H(t,r),r}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||""<e&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function te(e,t){return t?!!(-1<t.source.indexOf("\\w")&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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 ie(e){return 768<=e.charCodeAt(0)&&ne.test(e)}function oe(e,t,r){for(;(r<0?0<t:t<e.length)&&ie(e.charAt(t));)t+=r;return t}function ae(e,t,r){for(var n=r<t?-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 le=null;function se(e,t,r){var n;le=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:le=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:le=i)}return null!=n?n:le}var ce,ue,de,fe,he,pe,me,ge=(ce="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",ue="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",de=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,fe=/[stwN]/,he=/[LRr]/,pe=/[Lb1n]/,me=/[1n]/,function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!de.test(e))return!1;for(var n,i=e.length,o=[],a=0;a<i;++a)o.push((n=e.charCodeAt(a))<=247?ce.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?ue.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L");for(var l=0,s=r;l<i;++l){var c=o[l];"m"==c?o[l]=s:s=c}for(var u=0,d=r;u<i;++u){var f=o[u];"1"==f&&"r"==d?o[u]="n":he.test(f)&&"r"==(d=f)&&(o[u]="R")}for(var h=1,p=o[0];h<i-1;++h){var m=o[h];"+"==m&&"1"==p&&"1"==o[h+1]?o[h]="1":","!=m||p!=o[h+1]||"1"!=p&&"n"!=p||(o[h]=p),p=m}for(var g=0;g<i;++g){var v=o[g];if(","==v)o[g]="N";else if("%"==v){var y=void 0;for(y=g+1;y<i&&"%"==o[y];++y);for(var b=g&&"!"==o[g-1]||y<i&&"1"==o[y]?"1":"N",w=g;w<y;++w)o[w]=b;g=y-1}}for(var x=0,k=r;x<i;++x){var C=o[x];"L"==k&&"1"==C?o[x]="L":he.test(C)&&(k=C)}for(var S=0;S<i;++S)if(fe.test(o[S])){var L=void 0;for(L=S+1;L<i&&fe.test(o[L]);++L);for(var T="L"==(S?o[S-1]:r),M=T==("L"==(L<i?o[L]:r))?T?"L":"R":r,N=S;N<L;++N)o[N]=M;S=L-1}for(var O,A=[],D=0;D<i;)if(pe.test(o[D])){var W=D;for(++D;D<i&&pe.test(o[D]);++D);A.push(new ve(0,W,D))}else{var z=D,P=A.length;for(++D;D<i&&"L"!=o[D];++D);for(var I=z;I<D;)if(me.test(o[I])){z<I&&A.splice(P,0,new ve(1,z,I));var E=I;for(++I;I<D&&me.test(o[I]);++I);A.splice(P,0,new ve(2,E,I)),z=I}else++I;z<D&&A.splice(P,0,new ve(1,z,D))}return"ltr"==t&&(1==A[0].level&&(O=e.match(/^\s+/))&&(A[0].from=O[0].length,A.unshift(new ve(0,0,O[0].length))),1==Y(A).level&&(O=e.match(/\s+$/))&&(Y(A).to-=O[0].length,A.push(new ve(0,i-O[0].length,i)))),"rtl"==t?A.reverse():A});function ve(e,t,r){this.level=e,this.from=t,this.to=r}function ye(e,t){var r=e.order;return null==r&&(r=e.order=ge(e.text,t)),r}var be=[],we=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]||be).concat(r)}};function xe(e,t){return e._handlers&&e._handlers[t]||be}function ke(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=B(i,r);-1<o&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ce(e,t){var r=xe(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 Se(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ce(e,r||t.type,e,t),Ae(t)||t.codemirrorIgnore}function Le(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==B(r,t[n])&&r.push(t[n])}function Te(e,t){return 0<xe(e,t).length}function Me(e){e.prototype.on=function(e,t){we(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}function Ne(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ae(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function De(e){Ne(e),Oe(e)}function We(e){return e.target||e.srcElement}function ze(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),w&&e.ctrlKey&&1==t&&(t=3),t}var Pe,Ie,Ee=function(){if(x&&k<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function He(e){if(null==Pe){var t=A("span","");N(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Pe=t.offsetWidth<=1&&2<t.offsetHeight&&!(x&&k<8))}var r=Pe?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Fe(e){if(null!=Ie)return Ie;var t=N(e,document.createTextNode("AخA")),r=L(t,0,1).getBoundingClientRect(),n=L(t,1,2).getBoundingClientRect();return M(e),!(!r||r.left==r.right)&&(Ie=n.right-r.right<3)}var Re,Be=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),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},je=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)},Ve="oncopy"in(Re=A("div"))||(Re.setAttribute("oncopy","return;"),"function"==typeof Re.oncopy),Ke=null;var Ue={},Ge={};function qe(e){if("string"==typeof e&&Ge.hasOwnProperty(e))e=Ge[e];else if(e&&"string"==typeof e.name&&Ge.hasOwnProperty(e.name)){var t=Ge[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return qe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return qe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function $e(e,t){t=qe(t);var r=Ue[t.name];if(!r)return $e(e,"text/plain");var n=r(e,t);if(Xe.hasOwnProperty(t.name)){var i=Xe[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 a in t.modeProps)n[a]=t.modeProps[a];return n}var Xe={};function Ye(e,t){H(t,Xe.hasOwnProperty(e)?Xe[e]:Xe[e]={})}function _e(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 Ze(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 Je(e,t,r){return!e.startState||e.startState(t,r)}var Qe=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 et(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function tt(e,r,n){var i=[],o=r.line;return e.iter(r.line,n.line+1,function(e){var t=e.text;o==n.line&&(t=t.slice(0,n.ch)),o==r.line&&(t=t.slice(r.ch)),i.push(t),++o}),i}function rt(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function nt(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function it(e){if(null==e.parent)return null;for(var t=e.parent,r=B(t.lines,e),n=t.parent;n;n=(t=n).parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function ot(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 a=0;a<e.lines.length;++a){var l=e.lines[a].height;if(t<l)break;t-=l}return r+a}function at(e,t){return t>=e.first&&t<e.first+e.size}function lt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function st(e,t,r){if(void 0===r&&(r=null),!(this instanceof st))return new st(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ct(e,t){return e.line-t.line||e.ch-t.ch}function ut(e,t){return e.sticky==t.sticky&&0==ct(e,t)}function dt(e){return st(e.line,e.ch)}function ft(e,t){return ct(e,t)<0?t:e}function ht(e,t){return ct(e,t)<0?e:t}function pt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function mt(e,t){if(t.line<e.first)return st(e.first,0);var r=e.first+e.size-1;return t.line>r?st(r,et(e,r).text.length):function(e,t){var r=e.ch;return null==r||t<r?st(e.line,t):r<0?st(e.line,0):e}(t,et(e,t.line).text.length)}function gt(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=mt(e,t[n]);return r}Qe.prototype.eol=function(){return this.pos>=this.string.length},Qe.prototype.sol=function(){return this.pos==this.lineStart},Qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Qe.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},Qe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Qe.prototype.skipToEnd=function(){this.pos=this.string.length},Qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},Qe.prototype.backUp=function(e){this.pos-=e},Qe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Qe.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Qe.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&0<n.index?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}function i(e){return r?e.toLowerCase():e}if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var vt=function(e,t){this.state=e,this.lookAhead=t},yt=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 bt(t,r,n,e){var s=[t.state.modeGen],i={};Nt(t,r.text,t.doc.mode,n,function(e,t){return s.push(e,t)},i,e);for(var c=n.state,o=function(e){n.baseTokens=s;var o=t.state.overlays[e],a=1,l=0;n.state=!0,Nt(t,r.text,o.mode,n,function(e,t){for(var r=a;l<e;){var n=s[a];e<n&&s.splice(a,1,e,s[a+1],n),a+=2,l=Math.min(e,n)}if(t)if(o.opaque)s.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var i=s[r+1];s[r+1]=(i?i+" ":"")+"overlay "+t}},i),n.state=c,n.baseTokens=null,n.baseTokenPos=1},a=0;a<t.state.overlays.length;++a)o(a);return{styles:s,classes:i.bgClass||i.textClass?i:null}}function wt(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=xt(e,it(t)),i=t.text.length>e.options.maxHighlightLength&&_e(e.doc.mode,n.state),o=bt(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 xt(r,n,e){var t=r.doc,i=r.display;if(!t.mode.startState)return new yt(t,!0,n);var o=function(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;a<l;--l){if(l<=o.first)return o.first;var s=et(o,l-1),c=s.stateAfter;if(c&&(!r||l+(c instanceof vt?c.lookAhead:0)<=o.modeFrontier))return l;var u=F(s.text,null,e.options.tabSize);(null==i||u<n)&&(i=l-1,n=u)}return i}(r,n,e),a=o>t.first&&et(t,o-1).stateAfter,l=a?yt.fromSaved(t,a,o):new yt(t,Je(t.mode),o);return t.iter(o,n,function(e){kt(r,e.text,l);var t=l.line;e.stateAfter=t==n-1||t%5==0||t>=i.viewFrom&&t<i.viewTo?l.save():null,l.nextLine()}),e&&(t.modeFrontier=l.line),l}function kt(e,t,r,n){var i=e.doc.mode,o=new Qe(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&Ct(i,r.state);!o.eol();)St(i,o,r.state),o.start=o.pos}function Ct(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ze(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function St(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ze(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}yt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},yt.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}},yt.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},yt.fromSaved=function(e,t,r){return t instanceof vt?new yt(e,_e(e.mode,t.state),r,t.lookAhead):new yt(e,_e(e.mode,t),r)},yt.prototype.save=function(e){var t=!1!==e?_e(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new vt(t,this.maxLookAhead):t};var Lt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Tt(e,t,r,n){var i,o,a=e.doc,l=a.mode,s=et(a,(t=mt(a,t)).line),c=xt(e,t.line,r),u=new Qe(s.text,e.options.tabSize,c);for(n&&(o=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=St(l,u,c.state),n&&o.push(new Lt(u,i,_e(a.mode,c.state)));return n?o:new Lt(u,i,c.state)}function Mt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Nt(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new Qe(t,e.options.tabSize,n),f=e.options.addModeClass&&[null];for(""==t&&Mt(Ct(r,n.state),o);!d.eol();){if(s=d.pos>e.options.maxHighlightLength?(l=!1,a&&kt(e,t,n,d.pos),d.pos=t.length,null):Mt(St(r,d,n.state,f),o),f){var h=f[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!l||u!=s){for(;c<d.start;)i(c=Math.min(d.start,c+5e3),u);u=s}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e3);i(p,u),c=p}}var Ot=!1,At=!1;function Dt(e,t,r){this.marker=e,this.from=t,this.to=r}function Wt(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function zt(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Pt(e,t){if(t.full)return null;var r=at(e,t.from.line)&&et(e,t.from.line).markedSpans,n=at(e,t.to.line)&&et(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==ct(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],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Dt(a,o.from,l?null:o.to))}}return n}(r,i,a),s=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Dt(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,a),c=1==t.text.length,u=Y(t.text).length+(c?i:0);if(l)for(var d=0;d<l.length;++d){var f=l[d];if(null==f.to){var h=Wt(s,f.marker);h?c&&(f.to=null==h.to?null:h.to+u):f.to=i}}if(s)for(var p=0;p<s.length;++p){var m=s[p];if(null!=m.to&&(m.to+=u),null==m.from)Wt(l,m.marker)||(m.from=u,c&&(l||(l=[])).push(m));else m.from+=u,c&&(l||(l=[])).push(m)}l&&(l=It(l)),s&&s!=l&&(s=It(s));var g=[l];if(!c){var v,y=t.text.length-2;if(0<y&&l)for(var b=0;b<l.length;++b)null==l[b].to&&(v||(v=[])).push(new Dt(l[b].marker,null,null));for(var w=0;w<y;++w)g.push(v);g.push(s)}return g}function It(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 Et(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Ht(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Ft(e){return e.inclusiveLeft?-1:0}function Rt(e){return e.inclusiveRight?1:0}function Bt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=ct(n.from,i.from)||Ft(e)-Ft(t);if(o)return-o;var a=ct(n.to,i.to)||Rt(e)-Rt(t);return a||t.id-e.id}function jt(e,t){var r,n=At&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||Bt(r,i.marker)<0)&&(r=i.marker);return r}function Vt(e){return jt(e,!0)}function Kt(e){return jt(e,!1)}function Ut(e,t){var r,n=At&&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||Bt(r,o.marker)<0)&&(r=o.marker)}return r}function Gt(e,t,r,n,i){var o=et(e,t),a=At&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=ct(c.from,r)||Ft(s.marker)-Ft(i),d=ct(c.to,n)||Rt(s.marker)-Rt(i);if(!(0<=u&&d<=0||u<=0&&0<=d)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?0<=ct(c.to,r):0<ct(c.to,r))||0<=u&&(s.marker.inclusiveRight&&i.inclusiveLeft?ct(c.from,n)<=0:ct(c.from,n)<0)))return!0}}}function qt(e){for(var t;t=Vt(e);)e=t.find(-1,!0).line;return e}function $t(e,t){var r=et(e,t),n=qt(r);return r==n?t:it(n)}function Xt(e,t){if(t>e.lastLine())return t;var r,n=et(e,t);if(!Yt(e,n))return t;for(;r=Kt(n);)n=r.find(1,!0).line;return it(n)+1}function Yt(e,t){var r=At&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&_t(e,t,n))return!0}}function _t(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return _t(e,n.line,Wt(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&_t(e,t,i))return!0}function Zt(e){for(var t=0,r=(e=qt(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 a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function Jt(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Vt(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=Kt(n);){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 Qt(e){var r=e.display,t=e.doc;r.maxLine=et(t,t.first),r.maxLineLength=Jt(r.maxLine),r.maxLineChanged=!0,t.iter(function(e){var t=Jt(e);t>r.maxLineLength&&(r.maxLineLength=t,r.maxLine=e)})}var er=function(e,t,r){this.text=e,Ht(this,t),this.height=r?r(this):1};er.prototype.lineNo=function(){return it(this)},Me(er);var tr={},rr={};function nr(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?rr:tr;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function ir(e,t){var r=O("span",null,null,b?"padding-right: .1px":null),n={pre:O("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;n.pos=0,n.addToken=ar,Fe(e.display.measure)&&(a=ye(o,e.doc.direction))&&(n.addToken=lr(n.addToken,a)),n.map=[],cr(o,n,wt(e,o,t!=e.display.externalMeasured&&it(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=P(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=P(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(He(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(b){var l=n.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Ce(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=P(n.pre.className,n.textClass||"")),n}function or(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ar(e,t,r,n,i,o,a){if(t){var l,s=e.splitSpaces?function(e,t){if(1<e.length&&!/ /.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=" "),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,c=e.cm.state.specialChars,u=!1;if(c.test(t)){l=document.createDocumentFragment();for(var d=0;;){c.lastIndex=d;var f=c.exec(t),h=f?f.index-d:t.length-d;if(h){var p=document.createTextNode(s.slice(d,d+h));x&&k<9?l.appendChild(A("span",[p])):l.appendChild(p),e.map.push(e.pos,e.pos+h,p),e.col+=h,e.pos+=h}if(!f)break;d+=1+h;var m=void 0;if("\t"==f[0]){var g=e.cm.options.tabSize,v=g-e.col%g;(m=l.appendChild(A("span",X(v),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=v}else"\r"==f[0]||"\n"==f[0]?(m=l.appendChild(A("span","\r"==f[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",f[0]):((m=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),x&&k<9?l.appendChild(A("span",[m])):l.appendChild(m)),e.col+=1;e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,l=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,l),x&&k<9&&(u=!0),e.pos+=t.length;if(e.trailingSpace=32==s.charCodeAt(t.length-1),r||n||i||u||o){var y=r||"";n&&(y+=n),i&&(y+=i);var b=A("span",[l],y,o);if(a)for(var w in a)a.hasOwnProperty(w)&&"style"!=w&&"class"!=w&&b.setAttribute(w,a[w]);return e.content.appendChild(b)}e.content.appendChild(l)}}function lr(d,f){return function(e,t,r,n,i,o,a){r=r?r+" cm-force-border":"cm-force-border";for(var l=e.pos,s=l+t.length;;){for(var c=void 0,u=0;u<f.length&&!((c=f[u]).to>l&&c.from<=l);u++);if(c.to>=s)return d(e,t,r,n,i,o,a);d(e,t.slice(0,c.to-l),r,n,null,o,a),n=null,t=t.slice(c.to-l),l=c.to}}}function sr(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 cr(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=l="",d=f=null,v=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],k=x.marker;if("bookmark"==k.type&&x.from==p&&k.widgetNode)y.push(k);else if(x.from<=p&&(null==x.to||x.to>p||k.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&x.from==p&&(u+=" "+k.startStyle),k.endStyle&&x.to==v&&(b||(b=[])).push(k.endStyle,x.to),k.title&&((f||(f={})).title=k.title),k.attributes)for(var C in k.attributes)(f||(f={}))[C]=k.attributes[C];k.collapsed&&(!d||Bt(d.marker,k)<0)&&(d=x)}else x.from>p&&v>x.from&&(v=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==v&&(c+=" "+b[S]);if(!d||d.from==p)for(var L=0;L<y.length;++L)sr(t,0,y[L]);if(d&&(d.from||0)==p){if(sr(t,(null==d.to?h+1:d.to)-p,d.marker,null==d.from),null==d.to)return;d.to==p&&(d=!1)}}if(h<=p)break;for(var T=Math.min(h,v);;){if(g){var M=p+g.length;if(!d){var N=T<M?g.slice(0,T-p):g;t.addToken(t,N,a?a+s:s,u,p+N.length==v?c:"",l,f)}if(T<=M){g=g.slice(T-p),p=T;break}p=M,u=""}g=i.slice(o,o=r[m++]),a=nr(r[m++],t.cm.options)}}else for(var O=1;O<r.length;O+=2)t.addToken(t,i.slice(o,o=r[O]),nr(r[O+1],t.cm.options))}function ur(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=Kt(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?it(Y(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Yt(e,t)}function dr(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new ur(e.doc,et(e.doc,o),o);n=o+a.size,i.push(a)}return i}var fr=null;var hr=null;function pr(e,t){var r=xe(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);fr?n=fr.delayedCallbacks:hr?n=hr:(n=hr=[],setTimeout(mr,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},a=0;a<r.length;++a)o(a)}}function mr(){var e=hr;hr=null;for(var t=0;t<e.length;++t)e[t]()}function gr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?br(e,t):"gutter"==o?xr(e,t,r,n):"class"==o?wr(e,t):"widget"==o&&kr(e,t,n)}t.changes=null}function vr(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),x&&k<8&&(e.node.style.zIndex=2)),e.node}function yr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):ir(e,t)}function br(e,t){var r=t.text.className,n=yr(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,wr(e,t)):r&&(t.text.className=r)}function wr(e,t){!function(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=vr(t);t.background=n.insertBefore(A("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?vr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function xr(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=vr(t);t.gutterBackground=A("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 a=vr(t),l=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(A("div",lt(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var c=e.display.gutterSpecs[s].className,u=o.hasOwnProperty(c)&&o[c];u&&l.appendChild(A("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[c]+"px; width: "+n.gutterWidth[c]+"px"))}}}function kr(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);Cr(e,t,r)}function Cr(e,t,r){if(Sr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Sr(e,t.rest[n],t,r,!1)}function Sr(e,t,r,n,i){if(t.widgets)for(var o=vr(r),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=A("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Lr(s,c,r,n),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,r.gutter||r.text):o.appendChild(c),pr(s,"redraw")}}function Lr(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Tr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!D(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;"),N(t.display.measure,A("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Mr(e,t){for(var r=We(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 Nr(e){return e.lineSpace.offsetTop}function Or(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ar(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=N(e.measure,A("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Dr(e){return j-e.display.nativeBarWidth}function Wr(e){return e.display.scroller.clientWidth-Dr(e)-e.display.barWidth}function zr(e){return e.display.scroller.clientHeight-Dr(e)-e.display.barHeight}function Pr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(it(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ir(e,t,r,n){return Fr(e,Hr(e,t),r,n)}function Er(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[pn(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Hr(e,t){var r=it(t),n=Er(e,r);n&&!n.text?n=null:n&&n.changes&&(gr(e,n,r,cn(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=it(t=qt(t)),n=e.display.externalMeasured=new ur(e.doc,t,r);n.lineN=r;var i=n.built=ir(e,n);return n.text=i.pre,N(e.display.lineMeasure,i.pre),n}(e,t));var i=Pr(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Fr(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var n=e.options.lineWrapping,i=n&&Wr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];2<Math.abs(s.bottom-c.bottom)&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=jr(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;l&&ie(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+s));)++s;if((i=x&&k<9&&0==l&&s==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Vr(L(a,l,s).getClientRects(),n)).left||i.right||0==l)break;s=l,l-=1,c="right"}x&&k<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Ke)return Ke;var t=N(e,A("span","x")),r=t.getBoundingClientRect(),n=L(t,0,1).getBoundingClientRect();return Ke=1<Math.abs(r.left-n.left)}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var d;0<l&&(c=n="right"),i=e.options.lineWrapping&&1<(d=a.getClientRects()).length?d["right"==n?d.length-1:0]:a.getBoundingClientRect()}if(x&&k<9&&!l&&(!i||!i.left&&!i.right)){var f=a.parentNode.getClientRects()[0];i=f?{left:f.left,right:f.left+sn(e.display),top:f.top,bottom:f.bottom}:Br}for(var h=i.top-t.rect.top,p=i.bottom-t.rect.top,m=(h+p)/2,g=t.view.measure.heights,v=0;v<g.length-1&&!(m<g[v]);v++);var y=v?g[v-1]:0,b=g[v],w={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:y,bottom:b};i.left||i.right||(w.bogus=!0);e.options.singleCursorHeightPerLine||(w.rtop=h,w.rbottom=p);return w}(e,t,r,n)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Rr,Br={left:0,right:0,top:0,bottom:0};function jr(e,t,r){for(var n,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?o=(i=t-l)+1:(c==e.length-3||t==s&&e[c+3]>t)&&(i=(o=s-l)-1,s<=t&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],a="left";if("right"==r&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Vr(e,t){var r=Br;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;0<=i&&(r=e[i]).left==r.right;i--);return r}function Kr(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 Ur(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Kr(e.display.view[t])}function Gr(e){Ur(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function qr(){return a&&d?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function $r(){return a&&d?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Xr(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=Tr(e.widgets[r]));return t}function Yr(e,t,r,n,i){if(!i){var o=Xr(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=Zt(t);if("local"==n?a+=Nr(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==n?0:$r());var s=l.left+("window"==n?0:qr());r.left+=s,r.right+=s}return r.top+=a,r.bottom+=a,r}function _r(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=qr(),i-=$r();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function Zr(e,t,r,n,i){return n||(n=et(e.doc,t.line)),Yr(e,n,Ir(e,n,t.ch,i),r)}function Jr(n,e,i,o,a,l){function s(e,t){var r=Fr(n,a,e,t?"right":"left",l);return t?r.left=r.right:r.right=r.left,Yr(n,o,r,i)}o=o||et(n.doc,e.line),a||(a=Hr(n,o));var c=ye(o,n.doc.direction),t=e.ch,r=e.sticky;if(t>=o.text.length?(t=o.text.length,r="before"):t<=0&&(t=0,r="after"),!c)return s("before"==r?t-1:t,"before"==r);function u(e,t,r){return s(r?e-1:e,1==c[t].level!=r)}var d=se(c,t,r),f=le,h=u(t,d,"before"==r);return null!=f&&(h.other=u(t,f,"before"!=r)),h}function Qr(e,t){var r=0;t=mt(e.doc,t),e.options.lineWrapping||(r=sn(e.display)*t.ch);var n=et(e.doc,t.line),i=Zt(n)+Nr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function en(e,t,r,n,i){var o=st(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function tn(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return en(n.first,0,null,!0,-1);var i=ot(n,r),o=n.first+n.size-1;if(o<i)return en(n.first+n.size-1,et(n,o).text.length,null,!0,1);t<0&&(t=0);for(var a=et(n,i);;){var l=an(e,a,i,t,r),s=Ut(a,l.ch+(0<l.xRel?1:0));if(!s)return l;var c=s.find(1);if(c.line==i)return c;a=et(n,i=c.line)}}function rn(t,e,r,n){n-=Xr(e);var i=e.text.length,o=ae(function(e){return Fr(t,r,e-1).bottom<=n},i,0);return{begin:o,end:i=ae(function(e){return Fr(t,r,e).top>n},o,i)}}function nn(e,t,r,n){return r||(r=Hr(e,t)),rn(e,t,r,Yr(e,t,Fr(e,r,n),"line").top)}function on(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function an(r,e,t,n,i){i-=Zt(e);var o=Hr(r,e),a=Xr(e),l=0,s=e.text.length,c=!0,u=ye(e,r.doc.direction);if(u){var d=(r.options.lineWrapping?function(e,t,r,n,i,o,a){var l=rn(e,t,n,a),s=l.begin,c=l.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,f=0;f<i.length;f++){var h=i[f];if(!(h.from>=c||h.to<=s)){var p=1!=h.level,m=Fr(e,n,p?Math.min(c,h.to)-1:Math.max(s,h.from)).right,g=m<o?o-m+1e9:m-o;(!u||g<d)&&(u=h,d=g)}}u||(u=i[i.length-1]);u.from<s&&(u={from:s,to:u.to,level:u.level});u.to>c&&(u={from:u.from,to:c,level:u.level});return u}:function(n,i,o,a,l,s,c){var e=ae(function(e){var t=l[e],r=1!=t.level;return on(Jr(n,st(o,r?t.to:t.from,r?"before":"after"),"line",i,a),s,c,!0)},0,l.length-1),t=l[e];if(0<e){var r=1!=t.level,u=Jr(n,st(o,r?t.from:t.to,r?"after":"before"),"line",i,a);on(u,s,c,!0)&&u.top>c&&(t=l[e-1])}return t})(r,e,t,o,u,n,i);l=(c=1!=d.level)?d.from:d.to-1,s=c?d.to:d.from-1}var f,h,p=null,m=null,g=ae(function(e){var t=Fr(r,o,e);return t.top+=a,t.bottom+=a,!!on(t,n,i,!1)&&(t.top<=i&&t.left<=n&&(p=e,m=t),!0)},l,s),v=!1;if(m){var y=n-m.left<m.right-n,b=y==c;g=p+(b?0:1),h=b?"after":"before",f=y?m.left:m.right}else{c||g!=s&&g!=l||g++,h=0==g?"after":g==e.text.length?"before":Fr(r,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var w=Jr(r,st(t,g,h),"line",e,o);f=w.left,v=i<w.top||i>=w.bottom}return en(t,g=oe(e.text,g,1),h,v,n-f)}function ln(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Rr){Rr=A("pre");for(var t=0;t<49;++t)Rr.appendChild(document.createTextNode("x")),Rr.appendChild(A("br"));Rr.appendChild(document.createTextNode("x"))}N(e.measure,Rr);var r=Rr.offsetHeight/50;return 3<r&&(e.cachedTextHeight=r),M(e.measure),r||1}function sn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),r=A("pre",[t]);N(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return 2<i&&(e.cachedCharWidth=i),i||10}function cn(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;r[l]=o.offsetLeft+o.clientLeft+i,n[l]=o.clientWidth}return{fixedPos:un(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function un(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function dn(n){var i=ln(n.display),o=n.options.lineWrapping,a=o&&Math.max(5,n.display.scroller.clientWidth/sn(n.display)-3);return function(e){if(Yt(n.doc,e))return 0;var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;r++)e.widgets[r].height&&(t+=e.widgets[r].height);return o?t+(Math.ceil(e.text.length/a)||1)*i:t+i}}function fn(e){var t=e.doc,r=dn(e);t.iter(function(e){var t=r(e);t!=e.height&&nt(e,t)})}function hn(e,t,r,n){var i=e.display;if(!r&&"true"==We(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=tn(e,o,a);if(n&&1==c.xRel&&(s=et(e.doc,c.line).text).length==c.ch){var u=F(s,s.length,e.options.tabSize)-s.length;c=st(c.line,Math.max(0,Math.round((o-Ar(e.display).left)/sn(e.display))-u))}return c}function pn(e,t){if(t>=e.display.viewTo)return null;if((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 mn(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)At&&$t(e.doc,t)<i.viewTo&&vn(e);else if(r<=i.viewFrom)At&&Xt(e.doc,r+n)>i.viewFrom?vn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)vn(e);else if(t<=i.viewFrom){var o=yn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):vn(e)}else if(r>=i.viewTo){var a=yn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):vn(e)}else{var l=yn(e,t,t,-1),s=yn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(dr(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):vn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function gn(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[pn(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==B(a,r)&&a.push(r)}}}function vn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function yn(e,t,r,n){var i,o=pn(e,t),a=e.display.view;if(!At||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(0<n){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;$t(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function bn(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 wn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function xn(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t||a!=r.sel.primIndex){var l=r.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&kn(e,l.head,i),s||Sn(e,l,o)}}return n}function kn(e,t,r){var n=Jr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(A("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function Cn(e,t){return e.top-t.top||e.left-t.left}function Sn(a,e,t){var r=a.display,n=a.doc,i=document.createDocumentFragment(),o=Ar(a.display),T=o.left,M=Math.max(r.sizerWidth,Wr(a)-r.sizer.offsetLeft)-o.right,N="ltr"==n.direction;function O(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),i.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?M-e:r)+"px;\n height: "+(n-t)+"px"))}function l(r,y,b){var w,x,o=et(n,r),k=o.text.length;function C(e,t){return Zr(a,st(r,e),"div",o,t)}function S(e,t,r){var n=nn(a,o,null,e),i="ltr"==t==("after"==r)?"left":"right";return C("after"==r?n.begin:n.end-(/\s/.test(o.text.charAt(n.end-1))?2:1),i)[i]}var L=ye(o,n.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 a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(L,y||0,null==b?k:b,function(e,t,r,n){var i="ltr"==r,o=C(e,i?"left":"right"),a=C(t-1,i?"right":"left"),l=null==y&&0==e,s=null==b&&t==k,c=0==n,u=!L||n==L.length-1;if(a.top-o.top<=3){var d=(N?s:l)&&u,f=(N?l:s)&&c?T:(i?o:a).left,h=d?M:(i?a:o).right;O(f,o.top,h-f,o.bottom)}else{var p,m,g,v;v=i?(p=N&&l&&c?T:o.left,m=N?M:S(e,r,"before"),g=N?T:S(t,r,"after"),N&&s&&u?M:a.right):(p=N?S(e,r,"before"):T,m=!N&&l&&c?M:o.right,g=!N&&s&&u?T:a.left,N?S(t,r,"after"):M),O(p,o.top,m-p,o.bottom),o.bottom<a.top&&O(T,o.bottom,null,a.top),O(g,a.top,v-g,a.bottom)}(!w||Cn(o,w)<0)&&(w=o),Cn(a,w)<0&&(w=a),(!x||Cn(o,x)<0)&&(x=o),Cn(a,x)<0&&(x=a)}),{start:w,end:x}}var s=e.from(),c=e.to();if(s.line==c.line)l(s.line,s.ch,c.ch);else{var u=et(n,s.line),d=et(n,c.line),f=qt(u)==qt(d),h=l(s.line,s.ch,f?u.text.length+1:null).end,p=l(c.line,f?0:null,c.ch).start;f&&(h.top<p.top-2?(O(h.right,h.top,null,h.bottom),O(T,p.top,p.left,p.bottom)):O(h.right,h.top,p.left-h.right,h.bottom)),h.bottom<p.top&&O(T,h.bottom,null,p.top)}t.appendChild(i)}function Ln(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Tn(e){e.state.focused||(e.display.input.focus(),Nn(e))}function Mn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,On(e))},100)}function Nn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ce(e,"focus",e,t),e.state.focused=!0,z(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),b&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ln(e))}function On(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ce(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function An(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=e.options.lineWrapping,a=void 0,l=0;if(!i.hidden){if(x&&k<8){var s=i.node.offsetTop+i.node.offsetHeight;a=s-r,r=s}else{var c=i.node.getBoundingClientRect();a=c.bottom-c.top,!o&&i.text.firstChild&&(l=i.text.firstChild.getBoundingClientRect().right-c.left-1)}var u=i.line.height-a;if((.005<u||u<-.005)&&(nt(i.line,a),Dn(i.line),i.rest))for(var d=0;d<i.rest.length;d++)Dn(i.rest[d]);if(l>e.display.sizerWidth){var f=Math.ceil(l/sn(e.display));f>e.display.maxLineLength&&(e.display.maxLineLength=f,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Dn(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 Wn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Nr(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=ot(t,n),a=ot(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?a=ot(t,Zt(et(t,o=l))+e.wrapper.clientHeight):Math.min(s,t.lastLine())>=a&&(o=ot(t,Zt(et(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function zn(e,t){var r=e.display,n=ln(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=zr(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Or(r),s=t.top<n,c=t.bottom>l-n;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?l:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,f=Wr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function Pn(e,t){null!=t&&(Hn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function In(e){Hn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function En(e,t,r){null==t&&null==r||Hn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Hn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Fn(e,Qr(e,t.from),Qr(e,t.to),t.margin))}function Fn(e,t,r,n){var i=zn(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});En(e,i.scrollLeft,i.scrollTop)}function Rn(e,t){Math.abs(e.doc.scrollTop-t)<2||(m||di(e,{top:t}),Bn(e,t,!0),m&&di(e),ai(e,100))}function Bn(e,t,r){t=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 jn(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,pi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Vn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Or(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+Dr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function Kn(e,t,r){this.cm=r;var n=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),we(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),we(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,x&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}Kn.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.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&&0<e.clientHeight&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Kn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Kn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Kn.prototype.zeroWidthHack=function(){var e=w&&!l?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new R,this.disableVert=new R},Kn.prototype.enableZeroWidthBar=function(r,n,i){r.style.pointerEvents="auto",n.set(1e3,function e(){var t=r.getBoundingClientRect();("vert"==i?document.elementFromPoint(t.right-1,(t.top+t.bottom)/2):document.elementFromPoint((t.right+t.left)/2,t.bottom-1))!=r?r.style.pointerEvents="none":n.set(1e3,e)})},Kn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};function Un(){}function Gn(e,t){t||(t=Vn(e));var r=e.display.barWidth,n=e.display.barHeight;qn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&An(e),qn(e,Vn(e)),r=e.display.barWidth,n=e.display.barHeight}function qn(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=""}Un.prototype.update=function(){return{bottom:0,right:0}},Un.prototype.setScrollLeft=function(){},Un.prototype.setScrollTop=function(){},Un.prototype.clear=function(){};var $n={native:Kn,null:Un};function Xn(r){r.display.scrollbars&&(r.display.scrollbars.clear(),r.display.scrollbars.addClass&&T(r.display.wrapper,r.display.scrollbars.addClass)),r.display.scrollbars=new $n[r.options.scrollbarStyle](function(e){r.display.wrapper.insertBefore(e,r.display.scrollbarFiller),we(e,"mousedown",function(){r.state.focused&&setTimeout(function(){return r.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){"horizontal"==t?jn(r,e):Rn(r,e)},r),r.display.scrollbars.addClass&&z(r.display.wrapper,r.display.scrollbars.addClass)}var Yn=0;function _n(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Yn},function(e){fr?fr.ops.push(e):e.ownsGroup=fr={ops:[e],delayedCallbacks:[]}}(e.curOp)}function Zn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(r)}finally{fr=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=e.ops,r=0;r<t.length;r++)Jn(t[r]);for(var n=0;n<t.length;n++)(i=t[n]).updatedDisplay=i.mustUpdate&&ci(i.cm,i.update);var i;for(var o=0;o<t.length;o++)Qn(t[o]);for(var a=0;a<t.length;a++)ei(t[a]);for(var l=0;l<t.length;l++)ti(t[l])}(e)})}function Jn(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=Dr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Dr(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Qt(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 si(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qn(e){var t=e.cm,r=t.display;e.updatedDisplay&&An(t),e.barMeasure=Vn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ir(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Dr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Wr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function ei(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&jn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==W();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),!e.updatedDisplay&&e.startHeight==t.doc.height||Gn(t,e.barMeasure),e.updatedDisplay&&hi(t,e.barMeasure),e.selectionChanged&&Ln(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Tn(e.cm)}function ti(e){var t=e.cm,r=t.display,n=t.doc;e.updatedDisplay&&ui(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&Bn(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&jn(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!Se(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!c){var o=A("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Nr(e.display))+"px;\n height: "+(t.bottom-t.top+Dr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?st(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?st(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,l=Jr(e,t),s=r&&r!=t?Jr(e,r):l,c=zn(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Rn(e,c.scrollTop),1<Math.abs(e.doc.scrollTop-u)&&(a=!0)),null!=c.scrollLeft&&(jn(e,c.scrollLeft),1<Math.abs(e.doc.scrollLeft-d)&&(a=!0)),!a)break}return i}(t,mt(n,e.scrollToPos.from),mt(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||Ce(i[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&Ce(o[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ce(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ri(e,t){if(e.curOp)return t();_n(e);try{return t()}finally{Zn(e)}}function ni(e,t){return function(){if(e.curOp)return t.apply(e,arguments);_n(e);try{return t.apply(e,arguments)}finally{Zn(e)}}}function ii(e){return function(){if(this.curOp)return e.apply(this,arguments);_n(this);try{return e.apply(this,arguments)}finally{Zn(this)}}}function oi(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);_n(e);try{return t.apply(this,arguments)}finally{Zn(e)}}}function ai(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,E(li,e))}function li(s){var c=s.doc;if(!(c.highlightFrontier>=s.display.viewTo)){var u=+new Date+s.options.workTime,d=xt(s,c.highlightFrontier),f=[];c.iter(d.line,Math.min(c.first+c.size,s.display.viewTo+500),function(e){if(d.line>=s.display.viewFrom){var t=e.styles,r=e.text.length>s.options.maxHighlightLength?_e(c.mode,d.state):null,n=bt(s,e,d,!0);r&&(d.state=r),e.styles=n.styles;var i=e.styleClasses,o=n.classes;o?e.styleClasses=o:i&&(e.styleClasses=null);for(var a=!t||t.length!=e.styles.length||i!=o&&(!i||!o||i.bgClass!=o.bgClass||i.textClass!=o.textClass),l=0;!a&&l<t.length;++l)a=t[l]!=e.styles[l];a&&f.push(d.line),e.stateAfter=d.save(),d.nextLine()}else e.text.length<=s.options.maxHighlightLength&&kt(s,e.text,d),e.stateAfter=d.line%5==0?d.save():null,d.nextLine();if(+new Date>u)return ai(s,s.options.workDelay),!0}),c.highlightFrontier=d.line,c.modeFrontier=Math.max(c.modeFrontier,d.line),f.length&&ri(s,function(){for(var e=0;e<f.length;e++)gn(s,f[e],"text")})}}var si=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Wn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Wr(e),this.force=r,this.dims=cn(e),this.events=[]};function ci(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return vn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==bn(e))return!1;mi(e)&&(vn(e),t.dims=cn(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),At&&(o=$t(e.doc,o),a=Xt(e.doc,a));var l=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=dr(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=dr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(pn(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(dr(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,pn(e,r)))),n.viewTo=r}(e,o,a),r.viewOffset=Zt(et(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var s=bn(e);if(!l&&0==s&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=W();if(!t||!D(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&D(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return 4<s&&(r.lineDiv.style.display="none"),function(r,e,t){var n=r.display,i=r.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function l(e){var t=e.nextSibling;return b&&w&&r.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),t}for(var s=n.view,c=n.viewFrom,u=0;u<s.length;u++){var d=s[u];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=l(a);var f=i&&null!=e&&e<=c&&d.lineNumber;d.changes&&(-1<B(d.changes,"gutter")&&(f=!1),gr(r,d,c,t)),f&&(M(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(lt(r.options,c)))),a=d.node.nextSibling}else{var h=(g=c,v=t,void 0,y=yr(p=r,m=d),m.text=m.node=y.pre,y.bgClass&&(m.bgClass=y.bgClass),y.textClass&&(m.textClass=y.textClass),wr(p,m),xr(p,m,g,v),Cr(p,m,v),m.node);o.insertBefore(h,a)}c+=d.size}var p,m,g,v,y;for(;a;)a=l(a)}(e,r.updateLineNumbers,t.dims),4<s&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=W()&&(e.activeElt.focus(),e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(c),M(r.cursorDiv),M(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ai(e,400)),!(r.updateLineNumbers=null)}function ui(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Wr(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Or(e.display)-zr(e),r.top)}),t.visible=Wn(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ci(e,t);n=!1){An(e);var i=Vn(e);wn(e),Gn(e,i),hi(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 di(e,t){var r=new si(e,t);if(ci(e,r)){An(e),ui(e,r);var n=Vn(e);wn(e),Gn(e,n),hi(e,n),r.finish()}}function fi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function hi(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+Dr(e)+"px"}function pi(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=un(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function mi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=lt(e.options,t.first+t.size-1),n=e.display;if(r.length==n.lineNumChars)return!1;var i=n.measure.appendChild(A("div",[A("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",fi(e.display),!0}function gi(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;n=!0}r.push({className:o,style:a})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function vi(e){var t=e.gutters,r=e.gutterSpecs;M(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],o=i.className,a=i.style,l=t.appendChild(A("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),"CodeMirror-linenumbers"==o&&((e.lineGutter=l).style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",fi(e)}function yi(e){vi(e.display),mn(e),pi(e)}function bi(e,t,r,n){var i=this;this.input=r,i.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=O("div",null,"CodeMirror-code"),i.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=A("div",null,"CodeMirror-cursors"),i.measure=A("div",null,"CodeMirror-measure"),i.lineMeasure=A("div",null,"CodeMirror-measure"),i.lineSpace=O("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=O("div",[i.lineSpace],"CodeMirror-lines");i.mover=A("div",[o],null,"position: relative"),i.sizer=A("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=A("div",null,null,"position: absolute; height: "+j+"px; width: 1px;"),i.gutters=A("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=A("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=A("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),x&&k<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),b||m&&f||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=gi(n.gutters,n.lineNumbers),vi(i),r.init(i)}si.prototype.signal=function(e,t){Te(e,t)&&this.events.push(arguments)},si.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ce.apply(null,this.events[e])};var wi=0,xi=null;function ki(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 Ci(e){var t=ki(e);return t.x*=xi,t.y*=xi,t}function Si(e,t){var r=ki(t),n=r.x,i=r.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(n&&l||i&&s){if(i&&w&&b)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){e.display.currentWheelTarget=c;break e}if(n&&!m&&!g&&null!=xi)return i&&s&&Rn(e,Math.max(0,a.scrollTop+i*xi)),jn(e,Math.max(0,a.scrollLeft+n*xi)),(!i||i&&s)&&Ne(t),void(o.wheelStartX=null);if(i&&null!=xi){var f=i*xi,h=e.doc.scrollTop,p=h+o.wrapper.clientHeight;f<0?h=Math.max(0,h+f-50):p=Math.min(e.doc.height,p+f+50),di(e,{top:h,bottom:p})}wi<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(xi=(xi*wi+r)/(wi+1),++wi)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}x?xi=-.53:m?xi=15:a?xi=-.7:s&&(xi=-1/3);var Li=function(e,t){this.ranges=e,this.primIndex=t};Li.prototype.primary=function(){return this.ranges[this.primIndex]},Li.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!ut(r.anchor,n.anchor)||!ut(r.head,n.head))return!1}return!0},Li.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ti(dt(this.ranges[t].anchor),dt(this.ranges[t].head));return new Li(e,this.primIndex)},Li.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Li.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(0<=ct(t,n.from())&&ct(e,n.to())<=0)return r}return-1};var Ti=function(e,t){this.anchor=e,this.head=t};function Mi(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(e,t){return ct(e.from(),t.from())}),r=B(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=ct(l.to(),a.from());if(n&&!a.empty()?0<s:0<=s){var c=ht(l.from(),a.from()),u=ft(l.to(),a.to()),d=l.empty()?a.from()==a.head:l.from()==l.head;o<=r&&--r,t.splice(--o,2,new Ti(d?u:c,d?c:u))}}return new Li(t,r)}function Ni(e,t){return new Li([new Ti(e,t||e)],0)}function Oi(e){return e.text?st(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ai(e,t){if(ct(e,t.from)<0)return e;if(ct(e,t.to)<=0)return Oi(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+=Oi(t).ch-t.to.ch),st(r,n)}function Di(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new Ti(Ai(i.anchor,t),Ai(i.head,t)))}return Mi(e.cm,r,e.sel.primIndex)}function Wi(e,t,r){return e.line==t.line?st(r.line,e.ch-t.ch+r.ch):st(r.line+(e.line-t.line),e.ch)}function zi(e){e.doc.mode=$e(e.options,e.doc.modeOption),Pi(e)}function Pi(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,ai(e,100),e.state.modeGen++,e.curOp&&mn(e)}function Ii(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ei(e,n,t,i){function o(e){return t?t[e]:null}function r(e,t,r){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Et(e),Ht(e,r);var i=n?n(e):1;i!=e.height&&nt(e,i)}(e,t,r,i),pr(e,"change",e,n)}function a(e,t){for(var r=[],n=e;n<t;++n)r.push(new er(c[n],o(n),i));return r}var l=n.from,s=n.to,c=n.text,u=et(e,l.line),d=et(e,s.line),f=Y(c),h=o(c.length-1),p=s.line-l.line;if(n.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Ii(e,n)){var m=a(0,c.length-1);r(d,d.text,h),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(u==d)if(1==c.length)r(u,u.text.slice(0,l.ch)+f+u.text.slice(s.ch),h);else{var g=a(1,c.length-1);g.push(new er(f+u.text.slice(s.ch),h,i)),r(u,u.text.slice(0,l.ch)+c[0],o(0)),e.insert(l.line+1,g)}else if(1==c.length)r(u,u.text.slice(0,l.ch)+c[0]+d.text.slice(s.ch),o(0)),e.remove(l.line+1,p);else{r(u,u.text.slice(0,l.ch)+c[0],o(0)),r(d,f+d.text.slice(s.ch),h);var v=a(1,c.length-1);1<p&&e.remove(l.line+1,p-1),e.insert(l.line+1,v)}pr(e,"change",e,n)}function Hi(e,l,s){!function e(t,r,n){if(t.linked)for(var i=0;i<t.linked.length;++i){var o=t.linked[i];if(o.doc!=r){var a=n&&o.sharedHist;s&&!a||(l(o.doc,a),e(o.doc,t,a))}}}(e,null,!0)}function Fi(e,t){if(t.cm)throw new Error("This document is already in use.");fn((e.doc=t).cm=e),zi(e),Ri(e),e.options.lineWrapping||Qt(e),e.options.mode=t.modeOption,mn(e)}function Ri(e){("rtl"==e.doc.direction?z:T)(e.display.lineDiv,"CodeMirror-rtl")}function Bi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ji(e,t){var r={from:dt(t.from),to:Oi(t),text:tt(e,t.from,t.to)};return qi(e,r,t.from.line,t.to.line+1),Hi(e,function(e){return qi(e,r,t.from.line,t.to.line+1)},!0),r}function Vi(e){for(;e.length;){if(!Y(e).ranges)break;e.pop()}}function Ki(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Vi(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):1<e.done.length&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}(i,i.lastOp==n)))a=Y(o.changes),0==ct(t.from,t.to)&&0==ct(t.from,a.to)?a.to=Oi(t):o.changes.push(ji(e,t));else{var s=Y(i.done);for(s&&s.ranges||Gi(e.sel,i.done),o={changes:[ji(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ce(e,"historyAdded")}function Ui(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Y(i.done),t))?i.done[i.done.length-1]=t:Gi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Vi(i.undone)}function Gi(e,t){var r=Y(t);r&&r.ranges&&r.equals(e)||t.push(e)}function qi(t,r,e,n){var i=r["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,n),function(e){e.markedSpans&&((i||(i=r["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function $i(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function Xi(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($i(r[i]));return n}(e,t),n=Pt(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function Yi(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?Li.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];n.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&-1<B(t,Number(u[1]))&&(Y(l)[d]=c[d],delete c[d])}}}return n}function _i(e,t,r,n){if(n){var i=e.anchor;if(r){var o=ct(t,i)<0;o!=ct(r,i)<0?(i=t,t=r):o!=ct(t,r)<0&&(t=r)}return new Ti(i,t)}return new Ti(r||t,t)}function Zi(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),ro(e,new Li([_i(e.sel.primary(),t,r,i)],0),n)}function Ji(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]=_i(e.sel.ranges[o],t[o],null,i);ro(e,Mi(e.cm,n,e.sel.primIndex),r)}function Qi(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,ro(e,Mi(e.cm,i,e.sel.primIndex),n)}function eo(e,t,r,n){ro(e,Ni(t,r),n)}function to(e,t,r){var n=e.history.done,i=Y(n);i&&i.ranges?no(e,n[n.length-1]=t,r):ro(e,t,r)}function ro(e,t,r){no(e,t,r),Ui(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function no(e,t,r){(Te(e,"beforeSelectionChange")||e.cm&&Te(e.cm,"beforeSelectionChange"))&&(t=function(r,e,t){var n={ranges:e.ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new Ti(mt(r,e[t].anchor),mt(r,e[t].head))},origin:t&&t.origin};return Ce(r,"beforeSelectionChange",r,n),r.cm&&Ce(r.cm,"beforeSelectionChange",r.cm,n),n.ranges!=e.ranges?Mi(r.cm,n.ranges,n.ranges.length-1):e}(e,t,r));var n=r&&r.bias||(ct(t.primary().head,e.sel.primary().head)<0?-1:1);io(e,ao(e,t,n,!0)),r&&!1===r.scroll||!e.cm||In(e.cm)}function io(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Le(e.cm)),pr(e,"cursorActivity",e))}function oo(e){io(e,ao(e,e.sel,null,!1))}function ao(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=so(e,a.anchor,l&&l.anchor,r,n),c=so(e,a.head,l&&l.head,r,n);!i&&s==a.anchor&&c==a.head||(i||(i=t.ranges.slice(0,o)),i[o]=new Ti(s,c))}return i?Mi(e.cm,i,t.primIndex):t}function lo(e,t,r,n,i){var o=et(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,c="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,u="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==l.from||(c?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(u?l.to>=t.ch:l.to>t.ch))){if(i&&(Ce(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var d=s.find(n<0?1:-1),f=void 0;if((n<0?u:c)&&(d=co(e,d,-n,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=ct(d,r))&&(n<0?f<0:0<f))return lo(e,d,t,n,i)}var h=s.find(n<0?-1:1);return(n<0?c:u)&&(h=co(e,h,n,h.line==t.line?o:null)),h?lo(e,h,t,n,i):null}}return t}function so(e,t,r,n,i){var o=n||1,a=lo(e,t,r,o,i)||!i&&lo(e,t,r,o,!0)||lo(e,t,r,-o,i)||!i&&lo(e,t,r,-o,!0);return a||(e.cantEdit=!0,st(e.first,0))}function co(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?mt(e,st(t.line-1)):null:0<r&&t.ch==(n||et(e,t.line)).text.length?t.line<e.first+e.size-1?st(t.line+1,0):null:new st(t.line,t.ch+r)}function uo(e){e.setSelection(st(e.firstLine(),0),st(e.lastLine()),K)}function fo(i,e,t){var o={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return o.canceled=!0}};return t&&(o.update=function(e,t,r,n){e&&(o.from=mt(i,e)),t&&(o.to=mt(i,t)),r&&(o.text=r),void 0!==n&&(o.origin=n)}),Ce(i,"beforeChange",i,o),i.cm&&Ce(i.cm,"beforeChange",i.cm,o),o.canceled?(i.cm&&(i.cm.curOp.updateInput=2),null):{from:o.from,to:o.to,text:o.text,origin:o.origin}}function ho(e,t,r){if(e.cm){if(!e.cm.curOp)return ni(e.cm,ho)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Te(e,"beforeChange")||e.cm&&Te(e.cm,"beforeChange"))||(t=fo(e,t,!0))){var n=Ot&&!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!=B(n,r)||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(ct(c.to,l.from)<0||0<ct(c.from,l.to))){var u=[s,1],d=ct(c.from,l.from),f=ct(c.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(0<f||!a.inclusiveRight&&!f)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;0<=i;--i)po(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else po(e,t)}}function po(e,r){if(1!=r.text.length||""!=r.text[0]||0!=ct(r.from,r.to)){var t=Di(e,r);Ki(e,r,t,e.cm?e.cm.curOp.id:NaN),vo(e,r,t,Pt(e,r));var n=[];Hi(e,function(e,t){t||-1!=B(n,e.history)||(xo(e.history,r),n.push(e.history)),vo(e,r,null,Pt(e,r))})}}function mo(i,o,e){var t=i.cm&&i.cm.state.suppressEdits;if(!t||e){for(var a,r=i.history,n=i.sel,l="undo"==o?r.done:r.undone,s="undo"==o?r.undone:r.done,c=0;c<l.length&&(a=l[c],e?!a.ranges||a.equals(i.sel):a.ranges);c++);if(c!=l.length){for(r.lastOrigin=r.lastSelOrigin=null;;){if(!(a=l.pop()).ranges){if(t)return void l.push(a);break}if(Gi(a,s),e&&!a.equals(i.sel))return void ro(i,a,{clearRedo:!1});n=a}var u=[];Gi(n,s),s.push({changes:u,generation:r.generation}),r.generation=a.generation||++r.maxGeneration;for(var d=Te(i,"beforeChange")||i.cm&&Te(i.cm,"beforeChange"),f=function(e){var r=a.changes[e];if(r.origin=o,d&&!fo(i,r,!1))return l.length=0,{};u.push(ji(i,r));var t=e?Di(i,r):Y(l);vo(i,r,t,Xi(i,r)),!e&&i.cm&&i.cm.scrollIntoView({from:r.from,to:Oi(r)});var n=[];Hi(i,function(e,t){t||-1!=B(n,e.history)||(xo(e.history,r),n.push(e.history)),vo(e,r,null,Xi(e,r))})},h=a.changes.length-1;0<=h;--h){var p=f(h);if(p)return p.v}}}}function go(e,t){if(0!=t&&(e.first+=t,e.sel=new Li(_(e.sel.ranges,function(e){return new Ti(st(e.anchor.line+t,e.anchor.ch),st(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){mn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)gn(e.cm,n,"gutter")}}function vo(e,t,r,n){if(e.cm&&!e.cm.curOp)return ni(e.cm,vo)(e,t,r,n);if(t.to.line<e.first)go(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);go(e,i),t={from:st(e.first,0),to:st(t.to.line+i,t.to.ch),text:[Y(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:st(o,et(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=tt(e,t.from,t.to),r||(r=Di(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=it(qt(et(n,o.line))),n.iter(s,a.line+1,function(e){if(e==i.maxLine)return l=!0}));-1<n.sel.contains(t.from,t.to)&&Le(e);Ei(n,t,r,dn(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=Jt(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;r<n;n--){var i=et(e,n).stateAfter;if(i&&(!(i instanceof vt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}})(n,o.line),ai(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?mn(e):o.line!=a.line||1!=t.text.length||Ii(e.doc,t)?mn(e,o.line,a.line+1,c):gn(e,o.line,"text");var u=Te(e,"changes"),d=Te(e,"change");if(d||u){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&pr(e,"change",e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}(e.cm,t,n):Ei(e,t,n),no(e,r,K)}}function yo(e,t,r,n,i){var o;n||(n=r),ct(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),ho(e,{from:r,to:n,text:t,origin:i})}function bo(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function wo(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)bo(o.ranges[l].anchor,t,r,n),bo(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(r<c.from.line)c.from=st(c.from.line+n,c.from.ch),c.to=st(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function xo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;wo(e.done,r,n,i),wo(e.undone,r,n,i)}function ko(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=et(e,pt(e,t)):i=it(t),null==i?null:(n(o,i)&&e.cm&&gn(e.cm,i,r),o)}function Co(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 So(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}Ti.prototype.from=function(){return ht(this.anchor,this.head)},Ti.prototype.to=function(){return ft(this.anchor,this.head)},Ti.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Co.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r,n=e,i=e+t;n<i;++n){var o=this.lines[n];this.height-=o.height,(r=o).parent=null,Et(r),pr(o,"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}},So.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),a=n.height;if(n.removeInner(e,o),this.height-=a-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof Co))){var l=[];this.collapse(l),this.children=[new Co(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&&50<i.lines.length){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new Co(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++n,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new So(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=B(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new So(e.children);(n.parent=e).children=[n,t],e=n}t.parent=e.parent}while(10<e.children.length);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 a=Math.min(t,o-e);if(i.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}};function Lo(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t}function To(e,t,r){Zt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Pn(e,r)}Lo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=it(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=Tr(this);nt(r,Math.max(0,r.height-o)),e&&(ri(e,function(){To(e,r,-o),gn(e,n,"widget")}),pr(e,"lineWidgetCleared",e,this,n))}},Lo.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Tr(this)-t;i&&(Yt(this.doc,n)||nt(n,n.height+i),r&&ri(r,function(){r.curOp.forceUpdate=!0,To(r,n,i),pr(r,"lineWidgetChanged",r,e,it(n))}))},Me(Lo);var Mo=0,No=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Mo};function Oo(t,r,n,e,i){if(e&&e.shared)return function(e,r,n,i,o){(i=H(i)).shared=!1;var a=[Oo(e,r,n,i,o)],l=a[0],s=i.widgetNode;return Hi(e,function(e){s&&(i.widgetNode=s.cloneNode(!0)),a.push(Oo(e,mt(e,r),mt(e,n),i,o));for(var t=0;t<e.linked.length;++t)if(e.linked[t].isParent)return;l=Y(a)}),new Ao(a,l)}(t,r,n,e,i);if(t.cm&&!t.cm.curOp)return ni(t.cm,Oo)(t,r,n,e,i);var o=new No(t,i),a=ct(r,n);if(e&&H(e,o,!1),0<a||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=O("span",[o.replacedWith],"CodeMirror-widget"),e.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),e.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Gt(t,r.line,r,n,o)||r.line!=n.line&&Gt(t,n.line,r,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");At=!0}o.addToHistory&&Ki(t,{from:r,to:n,origin:"markText"},t.sel,NaN);var l,s=r.line,c=t.cm;if(t.iter(s,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&qt(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=r.line&&nt(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Dt(o,s==r.line?r.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&t.iter(r.line,n.line+1,function(e){Yt(t,e)&&nt(e,0)}),o.clearOnEnter&&we(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Ot=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++Mo,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)mn(c,r.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=r.line;u<=n.line;u++)gn(c,u,"text");o.atomic&&oo(c.doc),pr(c,"markerAdded",c,o)}return o}No.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&_n(t),Te(this,"clear")){var n=this.find();n&&pr(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=Wt(l.markedSpans,e);t&&!e.collapsed?gn(t,it(l),"text"):t&&(null!=s.to&&(o=it(l)),null!=s.from&&(i=it(l))),l.markedSpans=zt(l.markedSpans,s),null==s.from&&e.collapsed&&!Yt(e.doc,l)&&t&&nt(l,ln(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=qt(e.lines[c]),d=Jt(u);d>t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=d,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&mn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&oo(t.doc)),t&&pr(t,"markerCleared",t,this,i,o),r&&Zn(t),this.parent&&this.parent.clear()}},No.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Wt(o.markedSpans,this);if(null!=a.from&&(r=st(t?o:it(o),a.from),-1==e))return r;if(null!=a.to&&(n=st(t?o:it(o),a.to),1==e))return n}return r&&{from:r,to:n}},No.prototype.changed=function(){var o=this,a=this.find(-1,!0),l=this,s=this.doc.cm;a&&s&&ri(s,function(){var e=a.line,t=it(a.line),r=Er(s,t);if(r&&(Kr(r),s.curOp.selectionChanged=s.curOp.forceUpdate=!0),s.curOp.updateMaxLine=!0,!Yt(l.doc,e)&&null!=l.height){var n=l.height;l.height=null;var i=Tr(l)-n;i&&nt(e,e.height+i)}pr(s,"markerChanged",s,o)})},No.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},No.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Me(No);var Ao=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function Do(e){return e.findMarks(st(e.first,0),e.clipPos(st(e.lastLine())),function(e){return e.parent})}function Wo(o){for(var e=function(e){var t=o[e],r=[t.primary.doc];Hi(t.primary.doc,function(e){return r.push(e)});for(var n=0;n<t.markers.length;n++){var i=t.markers[n];-1==B(r,i.doc)&&(i.parent=null,t.markers.splice(n--,1))}},t=0;t<o.length;t++)e(t)}Ao.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();pr(this,"clear")}},Ao.prototype.find=function(e,t){return this.primary.find(e,t)},Me(Ao);var zo=0,Po=function(e,t,r,n,i){if(!(this instanceof Po))return new Po(e,t,r,n,i);null==r&&(r=0),So.call(this,[new Co([new er("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=st(r,0);this.sel=Ni(o),this.history=new Bi(null),this.id=++zo,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Ei(this,{from:o,to:o,text:e}),ro(this,Ni(o),K)};Po.prototype=J(So.prototype,{constructor:Po,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=rt(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:oi(function(e){var t=st(this.first,0),r=this.first+this.size-1;ho(this,{from:t,to:st(r,et(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&En(this.cm,0,0),ro(this,Ni(t),K)}),replaceRange:function(e,t,r,n){yo(this,e,t=mt(this,t),r=r?mt(this,r):t,n)},getRange:function(e,t,r){var n=tt(this,mt(this,e),mt(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(at(this,e))return et(this,e)},getLineNumber:function(e){return it(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=et(this,e)),qt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return mt(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:oi(function(e,t,r){eo(this,mt(this,"number"==typeof e?st(e,t||0):e),null,r)}),setSelection:oi(function(e,t,r){eo(this,mt(this,e),mt(this,t||e),r)}),extendSelection:oi(function(e,t,r){Zi(this,mt(this,e),t&&mt(this,t),r)}),extendSelections:oi(function(e,t){Ji(this,gt(this,e),t)}),extendSelectionsBy:oi(function(e,t){Ji(this,gt(this,_(this.sel.ranges,e)),t)}),setSelections:oi(function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new Ti(mt(this,e[i].anchor),mt(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ro(this,Mi(this.cm,n,t),r)}}),addSelection:oi(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Ti(mt(this,e),mt(this,t||e))),ro(this,Mi(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=tt(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=tt(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:oi(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}for(var l=t&&"end"!=t&&function(e,t,r){for(var n=[],i=st(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Wi(l.from,i,o),c=Wi(Oi(l),i,o);if(i=l.to,o=c,"around"==r){var u=e.sel.ranges[a],d=ct(u.head,u.anchor)<0;n[a]=new Ti(d?c:s,d?s:c)}else n[a]=new Ti(s,s)}return new Li(n,e.sel.primIndex)}(this,n,t),s=n.length-1;0<=s;s--)ho(this,n[s]);l?to(this,l):this.cm&&In(this.cm)}),undo:oi(function(){mo(this,"undo")}),redo:oi(function(){mo(this,"redo")}),undoSelection:oi(function(){mo(this,"undo",!0)}),redoSelection:oi(function(){mo(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(){this.history=new Bi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Yi(this.history.done),undone:Yi(this.history.undone)}},setHistory:function(e){var t=this.history=new Bi(this.history.maxGeneration);t.done=Yi(e.done.slice(0),null,!0),t.undone=Yi(e.undone.slice(0),null,!0)},setGutterMarker:oi(function(e,r,n){return ko(this,e,"gutter",function(e){var t=e.gutterMarkers||(e.gutterMarkers={});return!(t[r]=n)&&re(t)&&(e.gutterMarkers=null),!0})}),clearGutter:oi(function(t){var r=this;this.iter(function(e){e.gutterMarkers&&e.gutterMarkers[t]&&ko(r,e,"gutter",function(){return e.gutterMarkers[t]=null,re(e.gutterMarkers)&&(e.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!at(this,e))return null;if(!(e=et(this,t=e)))return null}else if(null==(t=it(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:oi(function(e,r,n){return ko(this,e,"gutter"==r?"gutter":"class",function(e){var t="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(e[t]){if(S(n).test(e[t]))return!1;e[t]+=" "+n}else e[t]=n;return!0})}),removeLineClass:oi(function(e,o,a){return ko(this,e,"gutter"==o?"gutter":"class",function(e){var t="text"==o?"textClass":"background"==o?"bgClass":"gutter"==o?"gutterClass":"wrapClass",r=e[t];if(!r)return!1;if(null==a)e[t]=null;else{var n=r.match(S(a));if(!n)return!1;var i=n.index+n[0].length;e[t]=r.slice(0,n.index)+(n.index&&i!=r.length?" ":"")+r.slice(i)||null}return!0})}),addLineWidget:oi(function(e,t,r){return function(n,e,t,r){var i=new Lo(n,t,r),o=n.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),ko(n,e,"widget",function(e){var t=e.widgets||(e.widgets=[]);if(null==i.insertAt?t.push(i):t.splice(Math.min(t.length-1,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!Yt(n,e)){var r=Zt(e)<n.scrollTop;nt(e,e.height+Tr(i)),r&&Pn(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&pr(o,"lineWidgetAdded",o,i,"number"==typeof e?e:it(e)),i}(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Oo(this,mt(this,e),mt(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 Oo(this,e=mt(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=et(this,(e=mt(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(i,o,a){i=mt(this,i),o=mt(this,o);var l=[],s=i.line;return this.iter(i.line,o.line+1,function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;r++){var n=t[r];null!=n.to&&s==i.line&&i.ch>=n.to||null==n.from&&s!=i.line||null!=n.from&&s==o.line&&n.from>=o.ch||a&&!a(n.marker)||l.push(n.marker.parent||n.marker)}++s}),l},getAllMarks:function(){var n=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var r=0;r<t.length;++r)null!=t[r].from&&n.push(t[r].marker)}),n},posFromIndex:function(r){var n,i=this.first,o=this.lineSeparator().length;return this.iter(function(e){var t=e.text.length+o;if(r<t)return n=r,!0;r-=t,++i}),mt(this,st(i,n))},indexFromPos:function(e){var t=(e=mt(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 Po(rt(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 Po(rt(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),a=e.clipPos(i.to);if(ct(o,a)){var l=Oo(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}(n,Do(this)),n},unlinkDoc:function(e){if(e instanceof Aa&&(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),Wo(Do(this));break}}if(e.history==this.history){var r=[e.id];Hi(e,function(e){return r.push(e.id)},!0),e.history=new Bi(null),e.history.done=Yi(this.history.done,r),e.history.undone=Yi(this.history.undone,r)}},iterLinkedDocs:function(e){Hi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Be(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:oi(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&function(e){ri(e,function(){Ri(e),mn(e)})}(this.cm))})}),Po.prototype.eachLine=Po.prototype.iter;var Io=0;function Eo(e){var i=this;if(Ho(i),!Se(i,e)&&!Mr(i.display,e)){Ne(e),x&&(Io=+new Date);var o=hn(i,e,!0),t=e.dataTransfer.files;if(o&&!i.isReadOnly())if(t&&t.length&&window.FileReader&&window.File)for(var a=t.length,l=Array(a),s=0,r=function(e,r){if(!i.options.allowDropFileTypes||-1!=B(i.options.allowDropFileTypes,e.type)){var n=new FileReader;n.onload=ni(i,function(){var e=n.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),l[r]=e,++s==a){var t={from:o=mt(i.doc,o),to:o,text:i.doc.splitLines(l.join(i.doc.lineSeparator())),origin:"paste"};ho(i.doc,t),to(i.doc,Ni(o,Oi(t)))}}),n.readAsText(e)}},n=0;n<a;++n)r(t[n],n);else{if(i.state.draggingText&&-1<i.doc.sel.contains(o))return i.state.draggingText(e),void setTimeout(function(){return i.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var u;if(i.state.draggingText&&!i.state.draggingText.copy&&(u=i.listSelections()),no(i.doc,Ni(o,o)),u)for(var d=0;d<u.length;++d)yo(i.doc,"",u[d].anchor,u[d].head,"drag");i.replaceSelection(c,"around","paste"),i.display.input.focus()}}catch(e){}}}}function Ho(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Fo(t){if(document.getElementsByClassName){for(var e=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<e.length;n++){var i=e[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var e=0;e<r.length;e++)t(r[e])})}}var Ro=!1;function Bo(){Ro||(function(){var e;we(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Fo(jo)},100))}),we(window,"blur",function(){return Fo(On)})}(),Ro=!0)}function jo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Vo={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:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ko=0;Ko<10;Ko++)Vo[Ko+48]=Vo[Ko+96]=String(Ko);for(var Uo=65;Uo<=90;Uo++)Vo[Uo]=String.fromCharCode(Uo);for(var Go=1;Go<=12;Go++)Vo[Go+111]=Vo[Go+63235]="F"+Go;var qo={};function $o(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Xo(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=_(r.split(" "),$o),o=0;o<i.length;o++){var a=void 0,l=void 0;a=o==i.length-1?(l=i.join(" "),n):(l=i.slice(0,o+1).join(" "),"...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function Yo(e,t,r,n){var i=(t=Qo(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 Yo(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=Yo(e,t.fallthrough[o],r,n);if(a)return a}}}function _o(e){var t="string"==typeof e?e:Vo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Zo(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(y?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(y?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function Jo(e,t){if(g&&34==e.keyCode&&e.char)return!1;var r=Vo[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),Zo(r,e,t))}function Qo(e){return"string"==typeof e?qo[e]:e}function ea(t,e){for(var r=t.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=e(r[i]);n.length&&ct(o.from,Y(n).to)<=0;){var a=n.pop();if(ct(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}ri(t,function(){for(var e=n.length-1;0<=e;e--)yo(t.doc,"",n[e].from,n[e].to,"+delete");In(t)})}function ta(e,t,r){var n=oe(e.text,t+r,r);return n<0||n>e.text.length?null:n}function ra(e,t,r){var n=ta(e,t.ch,r);return null==n?null:new st(t.line,n,r<0?"after":"before")}function na(e,t,r,n,i){if(e){var o=ye(r,t.doc.direction);if(o){var a,l=i<0?Y(o):o[0],s=i<0==(1==l.level)?"after":"before";if(0<l.level||"rtl"==t.doc.direction){var c=Hr(t,r);a=i<0?r.text.length-1:0;var u=Fr(t,c,a).top;a=ae(function(e){return Fr(t,c,e).top==u},i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=ta(r,a,1))}else a=i<0?l.to:l.from;return new st(n,a,s)}}return new st(n,i<0?r.text.length:0,i<0?"before":"after")}qo.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"},qo.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"},qo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},qo.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"]},qo.default=w?qo.macDefault:qo.pcDefault;var ia={selectAll:uo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),K)},killLine:function(r){return ea(r,function(e){if(e.empty()){var t=et(r.doc,e.head.line).text.length;return e.head.ch==t&&e.head.line<r.lastLine()?{from:e.head,to:st(e.head.line+1,0)}:{from:e.head,to:st(e.head.line,t)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){return ea(t,function(e){return{from:st(e.from().line,0),to:mt(t.doc,st(e.to().line+1,0))}})},delLineLeft:function(e){return ea(e,function(e){return{from:st(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(r){return ea(r,function(e){var t=r.charCoords(e.head,"div").top+5;return{from:r.coordsChar({left:0,top:t},"div"),to:e.from()}})},delWrappedLineRight:function(n){return ea(n,function(e){var t=n.charCoords(e.head,"div").top+5,r=n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:r}})},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(st(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(st(e.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(e){return oa(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(e){return aa(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy(function(e){return function(e,t){var r=et(e.doc,t),n=function(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}(r);n!=r&&(t=it(n));return na(!0,e,r,t,-1)}(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div")},G)},goLineLeft:function(r){return r.extendSelectionsBy(function(e){var t=r.cursorCoords(e.head,"div").top+5;return r.coordsChar({left:0,top:t},"div")},G)},goLineLeftSmart:function(n){return n.extendSelectionsBy(function(e){var t=n.cursorCoords(e.head,"div").top+5,r=n.coordsChar({left:0,top:t},"div");return r.ch<n.getLine(r.line).search(/\S/)?aa(n,e.head):r},G)},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,"char")},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("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=F(e.getLine(o.line),o.ch,n);t.push(X(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(a){return ri(a,function(){for(var e=a.listSelections(),t=[],r=0;r<e.length;r++)if(e[r].empty()){var n=e[r].head,i=et(a.doc,n.line).text;if(i)if(n.ch==i.length&&(n=new st(n.line,n.ch-1)),0<n.ch)n=new st(n.line,n.ch+1),a.replaceRange(i.charAt(n.ch-1)+i.charAt(n.ch-2),st(n.line,n.ch-2),n,"+transpose");else if(n.line>a.doc.first){var o=et(a.doc,n.line-1).text;o&&(n=new st(n.line,1),a.replaceRange(i.charAt(0)+a.doc.lineSeparator()+o.charAt(o.length-1),st(n.line-1,o.length-1),n,"+transpose"))}t.push(new Ti(n,n))}a.setSelections(t)})},newlineAndIndent:function(n){return ri(n,function(){for(var e=n.listSelections(),t=e.length-1;0<=t;t--)n.replaceRange(n.doc.lineSeparator(),e[t].anchor,e[t].head,"+input");e=n.listSelections();for(var r=0;r<e.length;r++)n.indentLine(e[r].from().line,null,!0);In(n)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function oa(e,t){var r=et(e.doc,t),n=qt(r);return n!=r&&(t=it(n)),na(!0,e,n,t,1)}function aa(e,t){var r=oa(e,t.line),n=et(e.doc,r.line),i=ye(n,e.doc.direction);if(i&&0!=i[0].level)return r;var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return st(r.line,a?0:o,r.sticky)}function la(e,t,r){if("string"==typeof t&&!(t=ia[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)!=V}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var sa=new R;function ca(e,t,r,n){var i=e.state.keySeq;if(i){if(_o(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:sa.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ua(e,i+" "+t,r,n))return!0}return ua(e,t,r,n)}function ua(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Yo(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Yo(t,e.options.extraKeys,r,e)||Yo(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&pr(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(Ne(r),Ln(e)),!!i}function da(t,e){var r=Jo(e,!0);return!!r&&(e.shiftKey&&!t.state.keySeq?ca(t,"Shift-"+r,e,function(e){return la(t,e,!0)})||ca(t,r,e,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return la(t,e)}):ca(t,r,e,function(e){return la(t,e)}))}var fa=null;function ha(e){var t=this;if(t.curOp.focus=W(),!Se(t,e)){x&&k<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=da(t,e);g&&(fa=n?r:null,!n&&88==r&&!Ve&&(w?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(T(t,"CodeMirror-crosshair"),ke(document,"keyup",r),ke(document,"mouseover",r))}z(t,"CodeMirror-crosshair"),we(document,"keyup",r),we(document,"mouseover",r)}(t)}}function pa(e){16==e.keyCode&&(this.doc.sel.shift=!1),Se(this,e)}function ma(e){var t=this;if(!(Mr(t.display,e)||Se(t,e)||e.ctrlKey&&!e.altKey||w&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(g&&r==fa)return fa=null,void Ne(e);if(!g||e.which&&!(e.which<10)||!da(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"==i||function(t,e,r){return ca(t,"'"+r+"'",e,function(e){return la(t,e,!0)})}(t,e,i)||t.display.input.onKeyPress(e)}}}var ga,va,ya=function(e,t,r){this.time=e,this.pos=t,this.button=r};function ba(e){var t=this,r=t.display;if(!(Se(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,Mr(r,e))b||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));else if(!ka(t,e)){var n=hn(t,e),i=ze(e),o=n?function(e,t){var r=+new Date;return va&&va.compare(r,e,t)?(ga=va=null,"triple"):ga&&ga.compare(r,e,t)?(va=new ya(r,e,t),ga=null,"double"):(ga=new ya(r,e,t),va=null,"single")}(n,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),n&&function(r,e,n,t,i){var o="Click";"double"==t?o="Double"+o:"triple"==t&&(o="Triple"+o);return ca(r,Zo(o=(1==e?"Left":2==e?"Middle":"Right")+o,i),i,function(e){if("string"==typeof e&&(e=ia[e]),!e)return!1;var t=!1;try{r.isReadOnly()&&(r.state.suppressEdits=!0),t=e(r,n)!=V}finally{r.state.suppressEdits=!1}return t})}(t,i,n,o,e)||(1==i?n?function(e,t,r,n){x?setTimeout(E(Tn,e),0):e.curOp.focus=W();var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=h?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}null!=i.extend&&!e.doc.extend||(i.extend=e.doc.extend||r.shiftKey);null==i.addNew&&(i.addNew=w?r.metaKey:r.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(w?r.altKey:r.ctrlKey));return i}(e,r,n),a=e.doc.sel;e.options.dragDrop&&Ee&&!e.isReadOnly()&&"single"==r&&-1<(i=a.contains(t))&&(ct((i=a.ranges[i]).from(),t)<0||0<t.xRel)&&(0<ct(i.to(),t)||t.xRel<0)?function(t,r,n,i){var o=t.display,a=!1,l=ni(t,function(e){b&&(o.scroller.draggable=!1),t.state.draggingText=!1,ke(o.wrapper.ownerDocument,"mouseup",l),ke(o.wrapper.ownerDocument,"mousemove",s),ke(o.scroller,"dragstart",c),ke(o.scroller,"drop",l),a||(Ne(e),i.addNew||Zi(t.doc,n,null,null,i.extend),b||x&&9==k?setTimeout(function(){o.wrapper.ownerDocument.body.focus(),o.input.focus()},20):o.input.focus())}),s=function(e){a=a||10<=Math.abs(r.clientX-e.clientX)+Math.abs(r.clientY-e.clientY)},c=function(){return a=!0};b&&(o.scroller.draggable=!0);(t.state.draggingText=l).copy=!i.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop();we(o.wrapper.ownerDocument,"mouseup",l),we(o.wrapper.ownerDocument,"mousemove",s),we(o.scroller,"dragstart",c),we(o.scroller,"drop",l),Mn(t),setTimeout(function(){return o.input.focus()},20)}(e,n,t,o):function(g,e,v,y){var a=g.display,b=g.doc;Ne(e);var w,x,k=b.sel,t=k.ranges;y.addNew&&!y.extend?(x=b.sel.contains(v),w=-1<x?t[x]:new Ti(v,v)):(w=b.sel.primary(),x=b.sel.primIndex);if("rectangle"==y.unit)y.addNew||(w=new Ti(v,v)),v=hn(g,e,!0,!0),x=-1;else{var r=wa(g,v,y.unit);w=y.extend?_i(w,r.anchor,r.head,y.extend):r}y.addNew?-1==x?(x=t.length,ro(b,Mi(g,t.concat([w]),x),{scroll:!1,origin:"*mouse"})):1<t.length&&t[x].empty()&&"char"==y.unit&&!y.extend?(ro(b,Mi(g,t.slice(0,x).concat(t.slice(x+1)),0),{scroll:!1,origin:"*mouse"}),k=b.sel):Qi(b,x,w,U):(ro(b,new Li([w],x=0),U),k=b.sel);var C=v;function l(e){if(0!=ct(C,e))if(C=e,"rectangle"==y.unit){for(var t=[],r=g.options.tabSize,n=F(et(b,v.line).text,v.ch,r),i=F(et(b,e.line).text,e.ch,r),o=Math.min(n,i),a=Math.max(n,i),l=Math.min(v.line,e.line),s=Math.min(g.lastLine(),Math.max(v.line,e.line));l<=s;l++){var c=et(b,l).text,u=q(c,o,r);o==a?t.push(new Ti(st(l,u),st(l,u))):c.length>u&&t.push(new Ti(st(l,u),st(l,q(c,a,r))))}t.length||t.push(new Ti(v,v)),ro(b,Mi(g,k.ranges.slice(0,x).concat(t),x),{origin:"*mouse",scroll:!1}),g.scrollIntoView(e)}else{var d,f=w,h=wa(g,e,y.unit),p=f.anchor;p=0<ct(h.anchor,p)?(d=h.head,ht(f.from(),h.anchor)):(d=h.anchor,ft(f.to(),h.head));var m=k.ranges.slice(0);m[x]=function(e,t){var r=t.anchor,n=t.head,i=et(e.doc,r.line);if(0==ct(r,n)&&r.sticky==n.sticky)return t;var o=ye(i);if(!o)return t;var a=se(o,r.ch,r.sticky),l=o[a];if(l.from!=r.ch&&l.to!=r.ch)return t;var s,c=a+(l.from==r.ch==(1!=l.level)?0:1);if(0==c||c==o.length)return t;if(n.line!=r.line)s=0<(n.line-r.line)*("ltr"==e.doc.direction?1:-1);else{var u=se(o,n.ch,n.sticky),d=u-a||(n.ch-r.ch)*(1==l.level?-1:1);s=u==c-1||u==c?d<0:0<d}var f=o[c+(s?-1:0)],h=s==(1==f.level),p=h?f.from:f.to,m=h?"after":"before";return r.ch==p&&r.sticky==m?t:new Ti(new st(r.line,p,m),n)}(g,new Ti(mt(b,p),d)),ro(b,Mi(g,m,x),U)}}var s=a.wrapper.getBoundingClientRect(),c=0;function n(e){g.state.selectingText=!1,c=1/0,e&&(Ne(e),a.input.focus()),ke(a.wrapper.ownerDocument,"mousemove",i),ke(a.wrapper.ownerDocument,"mouseup",o),b.history.lastSelOrigin=null}var i=ni(g,function(e){0!==e.buttons&&ze(e)?function e(t){var r=++c,n=hn(g,t,!0,"rectangle"==y.unit);if(n)if(0!=ct(n,C)){g.curOp.focus=W(),l(n);var i=Wn(a,b);(n.line>=i.to||n.line<i.from)&&setTimeout(ni(g,function(){c==r&&e(t)}),150)}else{var o=t.clientY<s.top?-20:t.clientY>s.bottom?20:0;o&&setTimeout(ni(g,function(){c==r&&(a.scroller.scrollTop+=o,e(t))}),50)}}(e):n(e)}),o=ni(g,n);g.state.selectingText=o,we(a.wrapper.ownerDocument,"mousemove",i),we(a.wrapper.ownerDocument,"mouseup",o)}(e,n,t,o)}(t,n,o,e):We(e)==r.scroller&&Ne(e):2==i?(n&&Zi(t.doc,n),setTimeout(function(){return r.input.focus()},20)):3==i&&(C?t.display.input.onContextMenu(e):Mn(t)))}}function wa(e,t,r){if("char"==r)return new Ti(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Ti(st(t.line,0),mt(e.doc,st(t.line+1,0)));var n=r(e,t);return new Ti(n.from,n.to)}function xa(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Ne(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Te(e,r))return Ae(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i)return Ce(e,r,e,ot(e.doc,o),e.display.gutterSpecs[s].className,t),Ae(t)}}function ka(e,t){return xa(e,t,"gutterClick",!0)}function Ca(e,t){Mr(e.display,t)||function(e,t){return!!Te(e,"gutterContextMenu")&&xa(e,t,"gutterContextMenu",!1)}(e,t)||Se(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function Sa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Gr(e)}ya.prototype.compare=function(e,t,r){return this.time+400>e&&0==ct(t,this.pos)&&r==this.button};var La={toString:function(){return"CodeMirror.Init"}},Ta={},Ma={};function Na(e,t,r){if(!t!=!(r&&r!=La)){var n=e.display.dragFunctions,i=t?we:ke;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)}}function Oa(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),Qt(e)),fn(e),mn(e),Gr(e),setTimeout(function(){return Gn(e)},100)}function Aa(e,t){var r=this;if(!(this instanceof Aa))return new Aa(e,t);this.options=t=t?H(t):{},H(Ta,t,!1);var n=t.value;"string"==typeof n?n=new Po(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Aa.inputStyles[t.inputStyle](this),o=this.display=new bi(e,n,i,t);for(var a in Sa(o.wrapper.CodeMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Xn(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 R,keySeq:null,specialChars:null},t.autofocus&&!f&&o.input.focus(),x&&k<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(i){var o=i.display;we(o.scroller,"mousedown",ni(i,ba)),we(o.scroller,"dblclick",x&&k<11?ni(i,function(e){if(!Se(i,e)){var t=hn(i,e);if(t&&!ka(i,e)&&!Mr(i.display,e)){Ne(e);var r=i.findWordAt(t);Zi(i.doc,r.anchor,r.head)}}}):function(e){return Se(i,e)||Ne(e)});we(o.scroller,"contextmenu",function(e){return Ca(i,e)});var r,n={end:0};function a(){o.activeTouch&&(r=setTimeout(function(){return o.activeTouch=null},1e3),(n=o.activeTouch).end=+new Date)}function l(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return 400<r*r+n*n}we(o.scroller,"touchstart",function(e){if(!Se(i,e)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(e)&&!ka(i,e)){o.input.ensurePolled(),clearTimeout(r);var t=+new Date;o.activeTouch={start:t,moved:!1,prev:t-n.end<=300?n:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY)}}),we(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),we(o.scroller,"touchend",function(e){var t=o.activeTouch;if(t&&!Mr(o,e)&&null!=t.left&&!t.moved&&new Date-t.start<300){var r,n=i.coordsChar(o.activeTouch,"page");r=!t.prev||l(t,t.prev)?new Ti(n,n):!t.prev.prev||l(t,t.prev.prev)?i.findWordAt(n):new Ti(st(n.line,0),mt(i.doc,st(n.line+1,0))),i.setSelection(r.anchor,r.head),i.focus(),Ne(e)}a()}),we(o.scroller,"touchcancel",a),we(o.scroller,"scroll",function(){o.scroller.clientHeight&&(Rn(i,o.scroller.scrollTop),jn(i,o.scroller.scrollLeft,!0),Ce(i,"scroll",i))}),we(o.scroller,"mousewheel",function(e){return Si(i,e)}),we(o.scroller,"DOMMouseScroll",function(e){return Si(i,e)}),we(o.wrapper,"scroll",function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),o.dragFunctions={enter:function(e){Se(i,e)||De(e)},over:function(e){Se(i,e)||(function(e,t){var r=hn(e,t);if(r){var n=document.createDocumentFragment();kn(e,r,n),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,n)}}(i,e),De(e))},start:function(e){return function(e,t){if(x&&(!e.state.draggingText||+new Date-Io<100))De(t);else if(!Se(e,t)&&!Mr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!s)){var r=A("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),g&&r.parentNode.removeChild(r)}}(i,e)},drop:ni(i,Eo),leave:function(e){Se(i,e)||Ho(i)}};var e=o.input.getField();we(e,"keyup",function(e){return pa.call(i,e)}),we(e,"keydown",ni(i,ha)),we(e,"keypress",ni(i,ma)),we(e,"focus",function(e){return Nn(i,e)}),we(e,"blur",function(e){return On(i,e)})}(this),Bo(),_n(this),this.curOp.forceUpdate=!0,Fi(this,n),t.autofocus&&!f||this.hasFocus()?setTimeout(E(Nn,this),20):On(this),Ma)Ma.hasOwnProperty(a)&&Ma[a](r,t[a],La);mi(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Da.length;++l)Da[l](r);Zn(this),b&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Aa.defaults=Ta,Aa.optionHandlers=Ma;var Da=[];function Wa(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=xt(e,t).state:r="prev");var a=e.options.tabSize,l=et(o,t),s=F(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&((c=o.mode.indent(i,l.text.slice(u.length),l.text))==V||150<c)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?F(et(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)f+=a,d+="\t";if(f<c&&(d+=X(c-f)),d!=u)return yo(o,d,st(t,0),st(t,u.length),"+input"),!(l.stateAfter=null);for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<u.length){var g=st(t,u.length);Qi(o,p,new Ti(g,g));break}}}Aa.defineInitHook=function(e){return Da.push(e)};var za=null;function Pa(e){za=e}function Ia(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=+new Date-200,l="paste"==i||e.state.pasteIncoming>a,s=Be(t),c=null;if(l&&1<n.ranges.length)if(za&&za.text.join("\n")==t){if(n.ranges.length%za.text.length==0){c=[];for(var u=0;u<za.text.length;u++)c.push(o.splitLines(za.text[u]))}}else s.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(c=_(s,function(e){return[e]}));for(var d=e.curOp.updateInput,f=n.ranges.length-1;0<=f;f--){var h=n.ranges[f],p=h.from(),m=h.to();h.empty()&&(r&&0<r?p=st(p.line,p.ch-r):e.state.overwrite&&!l?m=st(m.line,Math.min(et(o,m.line).text.length,m.ch+Y(s).length)):l&&za&&za.lineWise&&za.text.join("\n")==t&&(p=m=st(p.line,0)));var g={from:p,to:m,text:c?c[f%c.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};ho(e.doc,g),pr(e,"inputRead",e,g)}t&&!l&&Ha(e,t),In(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ea(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||ri(t,function(){return Ia(t,r,0,null,"paste")}),!0}function Ha(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;0<=n;n--){var i=r.ranges[n];if(!(100<i.head.ch||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(-1<t.indexOf(o.electricChars.charAt(l))){a=Wa(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(et(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Wa(e,i.head.line,"smart"));a&&pr(e,"electricInput",e,i.head.line)}}}function Fa(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:st(i,0),head:st(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Ra(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ba(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return b?e.style.width="1000px":e.setAttribute("wrap","off"),u&&(e.style.border="1px solid black"),Ra(e),t}function ja(r,n,i,e,o){var t=n,a=i,l=et(r,n.line);function s(e){var t;if(null==(t=o?function(t,r,l,e){var s=ye(r,t.doc.direction);if(!s)return ra(r,l,e);l.ch>=r.text.length?(l.ch=r.text.length,l.sticky="before"):l.ch<=0&&(l.ch=0,l.sticky="after");var n=se(s,l.ch,l.sticky),i=s[n];if("ltr"==t.doc.direction&&i.level%2==0&&(0<e?i.to>l.ch:i.from<l.ch))return ra(r,l,e);function c(e,t){return ta(r,e instanceof st?e.ch:e,t)}function o(e){return t.options.lineWrapping?(a=a||Hr(t,r),nn(t,r,a,e)):{begin:0,end:r.text.length}}var a,u=o("before"==l.sticky?c(l,-1):l.ch);if("rtl"==t.doc.direction||1==i.level){var d=1==i.level==e<0,f=c(l,d?1:-1);if(null!=f&&(d?f<=i.to&&f<=u.end:f>=i.from&&f>=u.begin)){var h=d?"before":"after";return new st(l.line,f,h)}}function p(e,t,r){for(var n=function(e,t){return t?new st(l.line,c(e,1),"before"):new st(l.line,e,"after")};0<=e&&e<s.length;e+=t){var i=s[e],o=0<t==(1!=i.level),a=o?r.begin:c(r.end,-1);if(i.from<=a&&a<i.to)return n(a,o);if(a=o?i.from:c(i.to,-1),r.begin<=a&&a<r.end)return n(a,o)}}var m=p(n+e,e,u);if(m)return m;var g=0<e?u.end:c(u.begin,-1);return null==g||0<e&&g==r.text.length||!(m=p(0<e?0:s.length-1,e,o(g)))?null:m}(r.cm,l,n,i):ra(l,n,i))){if(e||!function(){var e=n.line+i;return!(e<r.first||e>=r.first+r.size)&&(n=new st(e,n.ch,n.sticky),l=et(r,e))}())return!1;n=na(o,r.cm,l,n.line,i)}else n=t;return!0}if("char"==e)s();else if("column"==e)s(!0);else if("word"==e||"group"==e)for(var c=null,u="group"==e,d=r.cm&&r.cm.getHelper(n,"wordChars"),f=!0;!(i<0)||s(!f);f=!1){var h=l.text.charAt(n.ch)||"\n",p=te(h,d)?"w":u&&"\n"==h?"n":!u||/\s/.test(h)?null:"p";if(!u||f||p||(p="s"),c&&c!=p){i<0&&(i=1,s(),n.sticky="after");break}if(p&&(c=p),0<i&&!s(!f))break}var m=so(r,n,t,a,!0);return ut(t,m)&&(m.hitSide=!0),m}function Va(e,t,r,n){var i,o,a=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*ln(e.display),3);i=(0<r?t.bottom:t.top)+r*c}else"line"==n&&(i=0<r?t.bottom+3:t.top-3);for(;(o=tn(e,l,i)).outside;){if(r<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*r}return o}function Ka(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}function Ua(e,t){var r=Er(e,t.line);if(!r||r.hidden)return null;var n=et(e.doc,t.line),i=Pr(r,n,t.line),o=ye(n,e.doc.direction),a="left";o&&(a=se(o,t.ch)%2?"right":"left");var l=jr(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Ga(e,t){return t&&(e.bad=!0),e}function qa(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Ga(e.clipPos(st(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 $a(o,t,r)}}function $a(c,e,t){var r=c.text.firstChild,n=!1;if(!e||!D(r,e))return Ga(st(it(c.line),0),!0);if(e==r&&(n=!0,e=r.childNodes[t],t=0,!e)){var i=c.rest?Y(c.rest):c.line;return Ga(st(it(i),i.text.length),n)}var o=3==e.nodeType?e:null,a=e;for(o||1!=e.childNodes.length||3!=e.firstChild.nodeType||(o=e.firstChild,t&&(t=o.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var u=c.measure,d=u.maps;function l(e,t,r){for(var n=-1;n<(d?d.length:0);n++)for(var i=n<0?u.map:d[n],o=0;o<i.length;o+=3){var a=i[o+2];if(a==e||a==t){var l=it(n<0?c.line:c.rest[n]),s=i[o]+r;return(r<0||a!=e)&&(s=i[o+(r?1:0)]),st(l,s)}}}var s=l(o,a,t);if(s)return Ga(s,n);for(var f=a.nextSibling,h=o?o.nodeValue.length-t:0;f;f=f.nextSibling){if(s=l(f,f.firstChild,0))return Ga(st(s.line,s.ch-h),n);h+=f.textContent.length}for(var p=a.previousSibling,m=t;p;p=p.previousSibling){if(s=l(p,p.firstChild,-1))return Ga(st(s.line,s.ch+m),n);m+=p.textContent.length}}Ka.prototype.init=function(e){var t=this,a=this,l=a.cm,s=a.div=e.lineDiv;function r(e){if(!Se(l,e)){if(l.somethingSelected())Pa({lineWise:!1,text:l.getSelections()}),"cut"==e.type&&l.replaceSelection("",null,"cut");else{if(!l.options.lineWiseCopyCut)return;var t=Fa(l);Pa({lineWise:!0,text:t.text}),"cut"==e.type&&l.operation(function(){l.setSelections(t.ranges,0,K),l.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=za.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var n=Ba(),i=n.firstChild;l.display.lineSpace.insertBefore(n,l.display.lineSpace.firstChild),i.value=za.text.join("\n");var o=document.activeElement;I(i),setTimeout(function(){l.display.lineSpace.removeChild(n),o.focus(),o==s&&a.showPrimarySelection()},50)}}Ra(s,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize),we(s,"paste",function(e){Se(l,e)||Ea(e,l)||k<=11&&setTimeout(ni(l,function(){return t.updateFromDOM()}),20)}),we(s,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),we(s,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),we(s,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),we(s,"touchstart",function(){return a.forceCompositionEnd()}),we(s,"input",function(){t.composing||t.readFromDOMSoon()}),we(s,"copy",r),we(s,"cut",r)},Ka.prototype.prepareSelection=function(){var e=xn(this.cm,!1);return e.focus=this.cm.state.focused,e},Ka.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ka.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ka.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var o=qa(t,e.anchorNode,e.anchorOffset),a=qa(t,e.focusNode,e.focusOffset);if(!o||o.bad||!a||a.bad||0!=ct(ht(o,a),n)||0!=ct(ft(o,a),i)){var l=t.display.view,s=n.line>=t.display.viewFrom&&Ua(t,n)||{node:l[0].measure.map[2],offset:0},c=i.line<t.display.viewTo&&Ua(t,i);if(!c){var u=l[l.length-1].measure,d=u.maps?u.maps[u.maps.length-1]:u.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(s&&c){var f,h=e.rangeCount&&e.getRangeAt(0);try{f=L(s.node,s.offset,c.offset,c.node)}catch(e){}f&&(!m&&t.state.focused?(e.collapse(s.node,s.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),h&&null==e.anchorNode?e.addRange(h):m&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ka.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)},Ka.prototype.showMultipleSelections=function(e){N(this.cm.display.cursorDiv,e.cursors),N(this.cm.display.selectionDiv,e.selection)},Ka.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ka.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return D(this.div,t)},Ka.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ka.prototype.blur=function(){this.div.blur()},Ka.prototype.getField=function(){return this.div},Ka.prototype.supportsTouch=function(){return!0},Ka.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():ri(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))})},Ka.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ka.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(d&&a&&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))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=qa(t,e.anchorNode,e.anchorOffset),n=qa(t,e.focusNode,e.focusOffset);r&&n&&ri(t,function(){ro(t.doc,Ni(r,n),K),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},Ka.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>n.firstLine()&&(a=st(a.line-1,et(n.doc,a.line-1).length)),l.ch==et(n.doc,l.line).text.length&&l.line<n.lastLine()&&(l=st(l.line+1,0)),a.line<i.viewFrom||l.line>i.viewTo-1)return!1;r=a.line==i.viewFrom||0==(e=pn(n,a.line))?(t=it(i.view[0].line),i.view[0].node):(t=it(i.view[e].line),i.view[e-1].node.nextSibling);var s,c,u=pn(n,l.line);if(c=u==i.view.length-1?(s=i.viewTo-1,i.lineDiv.lastChild):(s=it(i.view[u+1].line)-1,i.view[u+1].node.previousSibling),!r)return!1;for(var d=n.doc.splitLines(function(l,e,t,s,c){var r="",u=!1,d=l.doc.lineSeparator(),f=!1;function h(){u&&(r+=d,f&&(r+=d),u=f=!1)}function p(e){e&&(h(),r+=e)}function m(e){if(1==e.nodeType){var t=e.getAttribute("cm-text");if(t)return void p(t);var r,n=e.getAttribute("cm-marker");if(n){var i=l.findMarks(st(s,0),st(c+1,0),function(t){return function(e){return e.id==t}}(+n));return void(i.length&&(r=i[0].find(0))&&p(tt(l.doc,r.from,r.to).join(d)))}if("false"==e.getAttribute("contenteditable"))return;var o=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;o&&h();for(var a=0;a<e.childNodes.length;a++)m(e.childNodes[a]);/^(pre|p)$/i.test(e.nodeName)&&(f=!0),o&&(u=!0)}else 3==e.nodeType&&p(e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;m(e),e!=t;)e=e.nextSibling,f=!1;return r}(n,r,c,t,s)),f=tt(n.doc,st(t,0),st(s,et(n.doc,s).text.length));1<d.length&&1<f.length;)if(Y(d)==Y(f))d.pop(),f.pop(),s--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);h<v&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(var y=Y(d),b=Y(f),w=Math.min(y.length-(1==d.length?h:0),b.length-(1==f.length?h:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==d.length&&1==f.length&&t==a.line)for(;h&&h>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var x=st(t,h),k=st(s,f.length?Y(f).length-p:0);return 1<d.length||d[0]||ct(x,k)?(yo(n.doc,d,x,k,"+input"),!0):void 0},Ka.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ka.prototype.reset=function(){this.forceCompositionEnd()},Ka.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ka.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},Ka.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||ri(this.cm,function(){return mn(e.cm)})},Ka.prototype.setUneditable=function(e){e.contentEditable="false"},Ka.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ni(this.cm,Ia)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ka.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ka.prototype.onContextMenu=function(){},Ka.prototype.resetPosition=function(){},Ka.prototype.needsContentAttribute=!0;function Xa(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.hasSelection=!1,this.composing=null}var Ya,_a,Za,Ja,Qa;function el(e,t,n,r){Ya.defaults[e]=t,n&&(_a[e]=r?function(e,t,r){r!=La&&n(e,t,r)}:n)}Xa.prototype.init=function(r){var e=this,n=this,i=this.cm;this.createField(r);var o=this.textarea;function t(e){if(!Se(i,e)){if(i.somethingSelected())Pa({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Fa(i);Pa({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,K):(n.prevInput="",o.value=t.text.join("\n"),I(o))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}r.wrapper.insertBefore(this.wrapper,r.wrapper.firstChild),u&&(o.style.width="0px"),we(o,"input",function(){x&&9<=k&&e.hasSelection&&(e.hasSelection=null),n.poll()}),we(o,"paste",function(e){Se(i,e)||Ea(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())}),we(o,"cut",t),we(o,"copy",t),we(r.scroller,"paste",function(e){if(!Mr(r,e)&&!Se(i,e)){if(!o.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var t=new Event("paste");t.clipboardData=e.clipboardData,o.dispatchEvent(t)}}),we(r.lineSpace,"selectstart",function(e){Mr(r,e)||Ne(e)}),we(o,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),we(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Xa.prototype.createField=function(e){this.wrapper=Ba(),this.textarea=this.wrapper.firstChild},Xa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=xn(e);if(e.options.moveInputWithCursor){var i=Jr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},Xa.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Xa.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&I(this.textarea),x&&9<=k&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",x&&9<=k&&(this.hasSelection=null))}},Xa.prototype.getField=function(){return this.textarea},Xa.prototype.supportsTouch=function(){return!1},Xa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!f||W()!=this.textarea))try{this.textarea.focus()}catch(e){}},Xa.prototype.blur=function(){this.textarea.blur()},Xa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Xa.prototype.receivedFocus=function(){this.slowPoll()},Xa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Xa.prototype.fastPoll=function(){var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))})},Xa.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||je(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(x&&9<=k&&this.hasSelection===i||w&&/[\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 a=0,l=Math.min(n.length,i.length);a<l&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return ri(t,function(){Ia(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),1e3<i.length||-1<i.indexOf("\n")?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},Xa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Xa.prototype.onKeyPress=function(){x&&9<=k&&(this.hasSelection=null),this.fastPoll()},Xa.prototype.onContextMenu=function(e){var r=this,n=r.cm,i=n.display,o=r.textarea;r.contextMenuPending&&r.contextMenuPending();var t=hn(n,e),a=i.scroller.scrollTop;if(t&&!g){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(t)&&ni(n,ro)(n.doc,Ni(t),K);var l,s=o.style.cssText,c=r.wrapper.style.cssText,u=r.wrapper.offsetParent.getBoundingClientRect();if(r.wrapper.style.cssText="position: static",o.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-u.top-5)+"px; left: "+(e.clientX-u.left-5)+"px;\n z-index: 1000; background: "+(x?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",b&&(l=window.scrollY),i.input.focus(),b&&window.scrollTo(null,l),i.input.reset(),n.somethingSelected()||(o.value=r.prevInput=" "),r.contextMenuPending=h,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),x&&9<=k&&f(),C){De(e);var d=function(){ke(window,"mouseup",d),setTimeout(h,20)};we(window,"mouseup",d)}else setTimeout(h,50)}function f(){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 h(){if(r.contextMenuPending==h&&(r.contextMenuPending=!1,r.wrapper.style.cssText=c,o.style.cssText=s,x&&k<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=a),null!=o.selectionStart)){(!x||x&&k<9)&&f();var e=0,t=function(){i.selForContextMenu==n.doc.sel&&0==o.selectionStart&&0<o.selectionEnd&&""==r.prevInput?ni(n,uo)(n):e++<10?i.detectingSelectAll=setTimeout(t,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(t,200)}}},Xa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Xa.prototype.setUneditable=function(){},Xa.prototype.needsContentAttribute=!1,_a=(Ya=Aa).optionHandlers,Ya.defineOption=el,Ya.Init=La,el("value","",function(e,t){return e.setValue(t)},!0),el("mode",null,function(e,t){e.doc.modeOption=t,zi(e)},!0),el("indentUnit",2,zi,!0),el("indentWithTabs",!1),el("smartIndent",!0),el("tabSize",4,function(e){Pi(e),Gr(e),mn(e)},!0),el("lineSeparator",null,function(e,n){if(e.doc.lineSep=n){var i=[],o=e.doc.first;e.doc.iter(function(e){for(var t=0;;){var r=e.text.indexOf(n,t);if(-1==r)break;t=r+n.length,i.push(st(o,r))}o++});for(var t=i.length-1;0<=t;t--)yo(e.doc,n,i[t],st(i[t].line,i[t].ch+n.length))}}),el("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=La&&e.refresh()}),el("specialCharPlaceholder",or,function(e){return e.refresh()},!0),el("electricChars",!0),el("inputStyle",f?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),el("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),el("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),el("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),el("rtlMoveVisually",!p),el("wholeLineUpdateBefore",!0),el("theme","default",function(e){Sa(e),yi(e)},!0),el("keyMap","default",function(e,t,r){var n=Qo(t),i=r!=La&&Qo(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),el("extraKeys",null),el("configureMouse",null),el("lineWrapping",!1,Oa,!0),el("gutters",[],function(e,t){e.display.gutterSpecs=gi(t,e.options.lineNumbers),yi(e)},!0),el("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?un(e.display)+"px":"0",e.refresh()},!0),el("coverGutterNextToScrollbar",!1,function(e){return Gn(e)},!0),el("scrollbarStyle","native",function(e){Xn(e),Gn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),el("lineNumbers",!1,function(e,t){e.display.gutterSpecs=gi(e.options.gutters,t),yi(e)},!0),el("firstLineNumber",1,yi,!0),el("lineNumberFormatter",function(e){return e},yi,!0),el("showCursorWhenSelecting",!1,wn,!0),el("resetSelectionOnContextMenu",!0),el("lineWiseCopyCut",!0),el("pasteLinesPerSelection",!0),el("selectionsMayTouch",!1),el("readOnly",!1,function(e,t){"nocursor"==t&&(On(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),el("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),el("dragDrop",!0,Na),el("allowDropFileTypes",null),el("cursorBlinkRate",530),el("cursorScrollMargin",0),el("cursorHeight",1,wn,!0),el("singleCursorHeightPerLine",!0,wn,!0),el("workTime",100),el("workDelay",100),el("flattenSpans",!0,Pi,!0),el("addModeClass",!1,Pi,!0),el("pollInterval",100),el("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),el("historyEventDelay",1250),el("viewportMargin",10,function(e){return e.refresh()},!0),el("maxHighlightLength",1e4,Pi,!0),el("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),el("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),el("autofocus",null),el("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),el("phrases",null),Ja=(Za=Aa).optionHandlers,Qa=Za.helpers={},Za.prototype={constructor:Za,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];r[e]==t&&"mode"!=e||(r[e]=t,Ja.hasOwnProperty(e)&&ni(this,Ja[e])(this,t,n),Ce(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"](Qo(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:ii(function(e,t){var r=e.token?e:Za.getMode(this.options,e);if(r.startState)throw new 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++,mn(this)}),removeOverlay:ii(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void mn(this)}}),indentLine:ii(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),at(this.doc,e)&&Wa(this,e,t,r)}),indentSelection:ii(function(e){for(var t=this,r=this.doc.sel.ranges,n=-1,i=0;i<r.length;i++){var o=r[i];if(o.empty())o.head.line>n&&(Wa(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&In(t));else{var a=o.from(),l=o.to(),s=Math.max(n,a.line);n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c<n;++c)Wa(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&r.length==u.length&&0<u[i].from().ch&&Qi(t.doc,i,new Ti(a,u[i].to()),K)}}}),getTokenAt:function(e,t){return Tt(this,e,t)},getLineTokens:function(e,t){return Tt(this,st(e),t,!0)},getTokenTypeAt:function(e){e=mt(this.doc,e);var t,r=wt(this,et(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=1+a}}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?Za.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Qa.hasOwnProperty(t))return r;var n=Qa[t],i=this.getModeAt(e);if("string"==typeof i[t])n[i[t]]&&r.push(n[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=n[i[t][o]];a&&r.push(a)}else i.helperType&&n[i.helperType]?r.push(n[i.helperType]):n[i.name]&&r.push(n[i.name]);for(var l=0;l<n._global.length;l++){var s=n._global[l];s.pred(i,this)&&-1==B(r,s.val)&&r.push(s.val)}return r},getStateAfter:function(e,t){var r=this.doc;return xt(this,(e=pt(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Jr(this,null==e?r.head:"object"==typeof e?mt(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Zr(this,mt(this.doc,e),t||"page")},coordsChar:function(e,t){return tn(this,(e=_r(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=_r(this,{top:e,left:0},t||"page").top,ot(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:o<e&&(e=o,i=!0),n=et(this.doc,e)}else n=e;return Yr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Zt(n):0)},defaultTextHeight:function(){return ln(this.display)},defaultCharWidth:function(){return sn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display,a=(e=Jr(this,mt(this.doc,e))).bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)a=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),r&&function(e,t){var r=zn(e,t);null!=r.scrollTop&&Rn(e,r.scrollTop),null!=r.scrollLeft&&jn(e,r.scrollLeft)}(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:ii(ha),triggerOnKeyPress:ii(ma),triggerOnKeyUp:pa,triggerOnMouseDown:ii(ba),execCommand:function(e){if(ia.hasOwnProperty(e))return ia[e].call(null,this)},triggerElectric:ii(function(e){Ha(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=mt(this.doc,e),a=0;a<t&&!(o=ja(this.doc,o,i,r,n)).hitSide;++a);return o},moveH:ii(function(t,r){var n=this;this.extendSelectionsBy(function(e){return n.display.shift||n.doc.extend||e.empty()?ja(n.doc,e.head,t,r,n.options.rtlMoveVisually):t<0?e.from():e.to()},G)}),deleteH:ii(function(r,n){var e=this.doc.sel,i=this.doc;e.somethingSelected()?i.replaceSelection("",null,"+delete"):ea(this,function(e){var t=ja(i,e.head,r,n,!1);return r<0?{from:t,to:e.head}:{from:e.head,to:t}})}),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var a=mt(this.doc,e),l=0;l<t;++l){var s=Jr(this,a,"div");if(null==o?o=s.left:s.left=o,(a=Va(this,s,i,r)).hitSide)break}return a},moveV:ii(function(n,i){var o=this,a=this.doc,l=[],s=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(e){if(s)return n<0?e.from():e.to();var t=Jr(o,e.head,"div");null!=e.goalColumn&&(t.left=e.goalColumn),l.push(t.left);var r=Va(o,t,n,i);return"page"==i&&e==a.sel.primary()&&Pn(o,Zr(o,r,"div").top-t.top),r},G),l.length)for(var e=0;e<a.sel.ranges.length;e++)a.sel.ranges[e].goalColumn=l[e]}),findWordAt:function(e){var t=et(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?++n:--r;for(var o=t.charAt(r),a=te(o,i)?function(e){return te(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};0<r&&a(t.charAt(r-1));)--r;for(;n<t.length&&a(t.charAt(n));)++n}return new Ti(st(e.line,r),st(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),Ce(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==W()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ii(function(e,t){En(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Dr(this)-this.display.barHeight,width:e.scrollWidth-Dr(this)-this.display.barWidth,clientHeight:zr(this),clientWidth:Wr(this)}},scrollIntoView:ii(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:st(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?function(e,t){Hn(e),e.curOp.scrollToPos=t}(this,e):Fn(this,e.from,e.to,e.margin)}),setSize:ii(function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var n=this;null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Ur(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){gn(n,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Ce(this,"refresh",this)}),operation:function(e){return ri(this,e)},startOperation:function(){return _n(this)},endOperation:function(){return Zn(this)},refresh:ii(function(){var e=this.display.cachedTextHeight;mn(this),this.curOp.forceUpdate=!0,Gr(this),En(this,this.doc.scrollLeft,this.doc.scrollTop),fi(this.display),(null==e||.5<Math.abs(e-ln(this.display)))&&fn(this),Ce(this,"refresh",this)}),swapDoc:ii(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Fi(this,e),Gr(this),this.display.input.reset(),En(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,pr(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}},Me(Za),Za.registerHelper=function(e,t,r){Qa.hasOwnProperty(e)||(Qa[e]=Za[e]={_global:[]}),Qa[e][t]=r},Za.registerGlobalHelper=function(e,t,r,n){Za.registerHelper(e,t,n),Qa[e]._global.push({pred:r,val:n})};var tl,rl="iter insert remove copy getEditor constructor".split(" ");for(var nl in Po.prototype)Po.prototype.hasOwnProperty(nl)&&B(rl,nl)<0&&(Aa.prototype[nl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Po.prototype[nl]));return Me(Po),Aa.inputStyles={textarea:Xa,contenteditable:Ka},Aa.defineMode=function(e){Aa.defaults.mode||"null"==e||(Aa.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ue[e]=t}.apply(this,arguments)},Aa.defineMIME=function(e,t){Ge[e]=t},Aa.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Aa.defineMIME("text/plain","null"),Aa.defineExtension=function(e,t){Aa.prototype[e]=t},Aa.defineDocExtension=function(e,t){Po.prototype[e]=t},Aa.fromTextArea=function(t,e){if((e=e?H(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var r=W();e.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==document.body}function n(){t.value=l.getValue()}var i;if(t.form&&(we(t.form,"submit",n),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}e.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(ke(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=i))}},t.style.display="none";var l=Aa(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return l},(tl=Aa).off=ke,tl.on=we,tl.wheelEventPixels=Ci,tl.Doc=Po,tl.splitLines=Be,tl.countColumn=F,tl.findColumn=q,tl.isWordChar=ee,tl.Pass=V,tl.signal=Ce,tl.Line=er,tl.changeEnd=Oi,tl.scrollbarModel=$n,tl.Pos=st,tl.cmpPos=ct,tl.modes=Ue,tl.mimeModes=Ge,tl.resolveMode=qe,tl.getMode=$e,tl.modeExtensions=Xe,tl.extendMode=Ye,tl.copyState=_e,tl.startState=Je,tl.innerMode=Ze,tl.commands=ia,tl.keyMap=qo,tl.keyName=Jo,tl.isModifierKey=_o,tl.lookupKey=Yo,tl.normalizeKeyMap=Xo,tl.StringStream=Qe,tl.SharedTextMarker=Ao,tl.TextMarker=No,tl.LineWidget=Lo,tl.e_preventDefault=Ne,tl.e_stopPropagation=Oe,tl.e_stop=De,tl.addClass=z,tl.contains=D,tl.rmClass=T,tl.keyNames=Vo,Aa.version="5.48.1",Aa}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(n){"use strict";function i(e){e.state.selectionPointer.rects=null,o(e)}function o(e){e.state.selectionPointer.willUpdate||(e.state.selectionPointer.willUpdate=!0,setTimeout(function(){!function(e){var t=e.state.selectionPointer;if(!t)return;if(null==t.rects&&null!=t.mouseX&&(t.rects=[],e.somethingSelected()))for(var r=e.display.selectionDiv.firstChild;r;r=r.nextSibling)t.rects.push(r.getBoundingClientRect());var n=!1;if(null!=t.mouseX)for(var i=0;i<t.rects.length;i++){var o=t.rects[i];o.left<=t.mouseX&&o.right>=t.mouseX&&o.top<=t.mouseY&&o.bottom>=t.mouseY&&(n=!0)}var a=n?t.value:"";e.display.lineDiv.style.cursor!=a&&(e.display.lineDiv.style.cursor=a)}(e),e.state.selectionPointer.willUpdate=!1},50))}n.defineOption("selectionPointer",!1,function(t,e){var r=t.state.selectionPointer;r&&(n.off(t.getWrapperElement(),"mousemove",r.mousemove),n.off(t.getWrapperElement(),"mouseout",r.mouseout),n.off(window,"scroll",r.windowScroll),t.off("cursorActivity",i),t.off("scroll",i),t.state.selectionPointer=null,t.display.lineDiv.style.cursor=""),e&&(r=t.state.selectionPointer={value:"string"==typeof e?e:"default",mousemove:function(e){!function(e,t){var r=e.state.selectionPointer;(null==t.buttons?t.which:t.buttons)?r.mouseX=r.mouseY=null:(r.mouseX=t.clientX,r.mouseY=t.clientY);o(e)}(t,e)},mouseout:function(e){!function(e,t){if(!e.getWrapperElement().contains(t.relatedTarget)){var r=e.state.selectionPointer;r.mouseX=r.mouseY=null,o(e)}}(t,e)},windowScroll:function(){i(t)},rects:null,mouseX:null,mouseY:null,willUpdate:!1},n.on(t.getWrapperElement(),"mousemove",r.mousemove),n.on(t.getWrapperElement(),"mouseout",r.mouseout),n.on(window,"scroll",r.windowScroll),t.on("cursorActivity",i),t.on("scroll",i))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(C){"use strict";var S={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},L={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};C.defineMode("xml",function(e,t){var i,o,a=e.indentUnit,l={},r=t.htmlMode?S:L;for(var n in r)l[n]=r[n];for(var n in t)l[n]=t[n];function s(t,r){function e(e){return(r.tokenize=e)(t,r)}var n=t.next();return"<"==n?t.eat("!")?t.eat("[")?t.match("CDATA[")?e(u("atom","]]>")):null:t.match("--")?e(u("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function n(i){return function(e,t){for(var r;null!=(r=e.next());){if("<"==r)return t.tokenize=n(i+1),t.tokenize(e,t);if(">"==r){if(1!=i)return t.tokenize=n(i-1),t.tokenize(e,t);t.tokenize=s;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),r.tokenize=u("meta","?>"),"meta"):(i=t.eat("/")?"closeTag":"openTag",r.tokenize=c,"tag bracket"):"&"!=n?(t.eatWhile(/[^&<]/),null):(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error"}function c(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=s,i=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return i="equals",null;if("<"!=r)return/[\'\"]/.test(r)?(t.tokenize=function(r){function e(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=c;break}return"string"}return e.isInAttribute=!0,e}(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word");t.tokenize=s,t.state=p,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}function u(r,n){return function(e,t){for(;!e.eol();){if(e.match(n)){t.tokenize=s;break}e.next()}return r}}function d(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!l.contextGrabbers.hasOwnProperty(r)||!l.contextGrabbers[r].hasOwnProperty(t))return;f(e)}}function p(e,t,r){return"openTag"==e?(r.tagStart=t.column(),m):"closeTag"==e?g:p}function m(e,t,r){return"word"==e?(r.tagName=t.current(),o="tag",b):l.allowMissingTagName&&"endTag"==e?(o="tag bracket",b(e,t,r)):(o="error",m)}function g(e,t,r){if("word"!=e)return l.allowMissingTagName&&"endTag"==e?(o="tag bracket",v(e,t,r)):(o="error",y);var n=t.current();return r.context&&r.context.tagName!=n&&l.implicitlyClosed.hasOwnProperty(r.context.tagName)&&f(r),r.context&&r.context.tagName==n||!1===l.matchClosing?(o="tag",v):(o="tag error",y)}function v(e,t,r){return"endTag"!=e?(o="error",v):(f(r),p)}function y(e,t,r){return o="error",v(e,0,r)}function b(e,t,r){if("word"==e)return o="attribute",w;if("endTag"!=e&&"selfcloseTag"!=e)return o="error",b;var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(n)?h(r,n):(h(r,n),r.context=new d(r,n,i==r.indented)),p}function w(e,t,r){return"equals"==e?x:(l.allowMissing||(o="error"),b(e,0,r))}function x(e,t,r){return"string"==e?k:"word"==e&&l.allowUnquoted?(o="string",b):(o="error",b(e,0,r))}function k(e,t,r){return"string"==e?k:b(e,0,r)}return s.isInText=!0,{startState:function(e){var t={tokenize:s,state:p,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;i=null;var r=t.tokenize(e,t);return(r||i)&&"comment"!=r&&(o=null,t.state=t.state(i||r,e,t),o&&(r="error"==o?r+" error":o)),r},indent:function(e,t,r){var n=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+a;if(n&&n.noIndent)return C.Pass;if(e.tokenize!=c&&e.tokenize!=s)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+a*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var i=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;n;){if(n.tagName==i[2]){n=n.prev;break}if(!l.implicitlyClosed.hasOwnProperty(n.tagName))break;n=n.prev}else if(i)for(;n;){var o=l.contextGrabbers[n.tagName];if(!o||!o.hasOwnProperty(i[2]))break;n=n.prev}for(;n&&n.prev&&!n.startOfLine;)n=n.prev;return n?n.indent+a:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=b)}}}),C.defineMIME("text/xml","xml"),C.defineMIME("application/xml","xml"),C.mimeModes.hasOwnProperty("text/html")||C.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(tt){"use strict";tt.defineMode("javascript",function(e,c){var t,r,n,i,o,a,u=e.indentUnit,d=c.statementIndent,l=c.jsonld,s=c.json||l,f=c.typescript,h=c.wordCharacters||/[\w$\xa1-\uffff]/,p=(t=m("keyword a"),r=m("keyword b"),n=m("keyword c"),i=m("keyword d"),o=m("operator"),a={type:"atom",style:"atom"},{if:m("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:m("new"),delete:n,void:n,throw:n,debugger:m("debugger"),var:m("var"),const:m("var"),let:m("var"),function:m("function"),catch:m("catch"),for:m("for"),switch:m("switch"),case:m("case"),default:m("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:m("this"),class:m("class"),super:m("atom"),yield:n,export:m("export"),import:m("import"),extends:n,await:n});function m(e){return{type:e,style:"keyword"}}var g,v,y=/[+\-*&%=<>!?|~^@]/,b=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function w(e,t,r){return g=e,v=r,t}function x(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=function(i){return function(e,t){var r,n=!1;if(l&&"@"==e.peek()&&e.match(b))return t.tokenize=x,w("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=i||n);)n=!n&&"\\"==r;return n||(t.tokenize=x),w("string","string")}}(r),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return w("number","number");if("."==r&&e.match(".."))return w("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return w(r);if("="==r&&e.eat(">"))return w("=>","operator");if("0"==r&&e.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return w("number","number");if(/\d/.test(r))return e.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),w("number","number");if("/"==r)return e.eat("*")?(t.tokenize=k)(e,t):e.eat("/")?(e.skipToEnd(),w("comment","comment")):et(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),w("regexp","string-2")):(e.eat("="),w("operator","operator",e.current()));if("` + "`" + `"==r)return(t.tokenize=C)(e,t);if("#"==r)return e.skipToEnd(),w("error","error");if(y.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),w("operator","operator",e.current());if(h.test(r)){e.eatWhile(h);var n=e.current();if("."!=t.lastType){if(p.propertyIsEnumerable(n)){var i=p[n];return w(i.type,i.style,n)}if("async"==n&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return w("async","keyword",n)}return w("variable","variable",n)}}function k(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=x;break}n="*"==r}return w("comment","comment")}function C(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("` + "`" + `"==r||"$"==r&&e.eat("{"))){t.tokenize=x;break}n=!n&&"\\"==r}return w("quasi","string-2",e.current())}var S="([{}])";function L(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(f){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;0<=a;--a){var l=e.string.charAt(a),s=S.indexOf(l);if(0<=s&&s<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(3<=s&&s<6)++i;else if(h.test(l))o=!0;else{if(/["'\/]/.test(l))return;if(o&&!i){++a;break}}}o&&!i&&(t.fatArrowAt=a)}}var T={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function M(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function N(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}var O={state:null,column:null,marked:null,cc:null};function A(){for(var e=arguments.length-1;0<=e;e--)O.cc.push(arguments[e])}function D(){return A.apply(null,arguments),!0}function W(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function z(e){var t=O.state;if(O.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,r){{if(r){if(r.block){var n=e(t,r.prev);return n?n==r.prev?r:new I(n,r.vars,!0):null}return W(t,r.vars)?r:new I(r.prev,new E(t,r.vars),!1)}return null}}(e,t.context);if(null!=r)return void(t.context=r)}else if(!W(e,t.localVars))return void(t.localVars=new E(e,t.localVars));c.globalVars&&!W(e,t.globalVars)&&(t.globalVars=new E(e,t.globalVars))}function P(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function I(e,t,r){this.prev=e,this.vars=t,this.block=r}function E(e,t){this.name=e,this.next=t}var H=new E("this",new E("arguments",null));function F(){O.state.context=new I(O.state.context,O.state.localVars,!1),O.state.localVars=H}function R(){O.state.context=new I(O.state.context,O.state.localVars,!0),O.state.localVars=null}function B(){O.state.localVars=O.state.context.vars,O.state.context=O.state.context.prev}function j(n,i){function e(){var e=O.state,t=e.indented;if("stat"==e.lexical.type)t=e.lexical.indented;else for(var r=e.lexical;r&&")"==r.type&&r.align;r=r.prev)t=r.indented;e.lexical=new M(t,O.stream.column(),n,null,e.lexical,i)}return e.lex=!0,e}function V(){var e=O.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function K(r){return function e(t){return t==r?D():";"==r||"}"==t||")"==t||"]"==t?A():D(e)}}function U(e,t){return"var"==e?D(j("vardef",t),Le,K(";"),V):"keyword a"==e?D(j("form"),X,U,V):"keyword b"==e?D(j("form"),U,V):"keyword d"==e?O.stream.match(/^\s*$/,!1)?D():D(j("stat"),_,K(";"),V):"debugger"==e?D(K(";")):"{"==e?D(j("}"),R,fe,V,B):";"==e?D():"if"==e?("else"==O.state.lexical.info&&O.state.cc[O.state.cc.length-1]==V&&O.state.cc.pop()(),D(j("form"),X,U,V,De)):"function"==e?D(Ie):"for"==e?D(j("form"),We,U,V):"class"==e||f&&"interface"==t?(O.marked="keyword",D(j("form","class"==e?e:t),Be,V)):"variable"==e?f&&"declare"==t?(O.marked="keyword",D(U)):f&&("module"==t||"enum"==t||"type"==t)&&O.stream.match(/^\s*\w/,!1)?(O.marked="keyword","enum"==t?D(Je):"type"==t?D(He,K("operator"),ve,K(";")):D(j("form"),Te,K("{"),j("}"),fe,V,V)):f&&"namespace"==t?(O.marked="keyword",D(j("form"),q,U,V)):f&&"abstract"==t?(O.marked="keyword",D(U)):D(j("stat"),oe):"switch"==e?D(j("form"),X,K("{"),j("}","switch"),R,fe,V,V,B):"case"==e?D(q,K(":")):"default"==e?D(K(":")):"catch"==e?D(j("form"),F,G,U,V,B):"export"==e?D(j("stat"),Ue,V):"import"==e?D(j("stat"),qe,V):"async"==e?D(U):"@"==t?D(q,U):A(j("stat"),q,K(";"),V)}function G(e){if("("==e)return D(Fe,K(")"))}function q(e,t){return Y(e,t,!1)}function $(e,t){return Y(e,t,!0)}function X(e){return"("!=e?A():D(j(")"),q,K(")"),V)}function Y(e,t,r){if(O.state.fatArrowAt==O.stream.start){var n=r?re:te;if("("==e)return D(F,j(")"),ue(Fe,")"),V,K("=>"),n,B);if("variable"==e)return A(F,Te,K("=>"),n,B)}var i=r?J:Z;return T.hasOwnProperty(e)?D(i):"function"==e?D(Ie,i):"class"==e||f&&"interface"==t?(O.marked="keyword",D(j("form"),Re,V)):"keyword c"==e||"async"==e?D(r?$:q):"("==e?D(j(")"),_,K(")"),V,i):"operator"==e||"spread"==e?D(r?$:q):"["==e?D(j("]"),Ze,V,i):"{"==e?de(le,"}",null,i):"quasi"==e?A(Q,i):"new"==e?D(function(t){return function(e){return"."==e?D(t?ie:ne):"variable"==e&&f?D(ke,t?J:Z):A(t?$:q)}}(r)):"import"==e?D(q):D()}function _(e){return e.match(/[;\}\)\],]/)?A():A(q)}function Z(e,t){return","==e?D(q):J(e,t,!1)}function J(e,t,r){var n=0==r?Z:J,i=0==r?q:$;return"=>"==e?D(F,r?re:te,B):"operator"==e?/\+\+|--/.test(t)||f&&"!"==t?D(n):f&&"<"==t&&O.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?D(j(">"),ue(ve,">"),V,n):"?"==t?D(q,K(":"),i):D(i):"quasi"==e?A(Q,n):";"!=e?"("==e?de($,")","call",n):"."==e?D(ae,n):"["==e?D(j("]"),_,K("]"),V,n):f&&"as"==t?(O.marked="keyword",D(ve,n)):"regexp"==e?(O.state.lastType=O.marked="operator",O.stream.backUp(O.stream.pos-O.stream.start-1),D(i)):void 0:void 0}function Q(e,t){return"quasi"!=e?A():"${"!=t.slice(t.length-2)?D(Q):D(q,ee)}function ee(e){if("}"==e)return O.marked="string-2",O.state.tokenize=C,D(Q)}function te(e){return L(O.stream,O.state),A("{"==e?U:q)}function re(e){return L(O.stream,O.state),A("{"==e?U:$)}function ne(e,t){if("target"==t)return O.marked="keyword",D(Z)}function ie(e,t){if("target"==t)return O.marked="keyword",D(J)}function oe(e){return":"==e?D(V,U):A(Z,K(";"),V)}function ae(e){if("variable"==e)return O.marked="property",D()}function le(e,t){if("async"==e)return O.marked="property",D(le);if("variable"==e||"keyword"==O.style){return O.marked="property","get"==t||"set"==t?D(se):(f&&O.state.fatArrowAt==O.stream.start&&(r=O.stream.match(/^\s*:\s*/,!1))&&(O.state.fatArrowAt=O.stream.pos+r[0].length),D(ce));var r}else{if("number"==e||"string"==e)return O.marked=l?"property":O.style+" property",D(ce);if("jsonld-keyword"==e)return D(ce);if(f&&P(t))return O.marked="keyword",D(le);if("["==e)return D(q,pe,K("]"),ce);if("spread"==e)return D($,ce);if("*"==t)return O.marked="keyword",D(le);if(":"==e)return A(ce)}}function se(e){return"variable"!=e?A(ce):(O.marked="property",D(Ie))}function ce(e){return":"==e?D($):"("==e?A(Ie):void 0}function ue(n,i,o){function a(e,t){if(o?-1<o.indexOf(e):","==e){var r=O.state.lexical;return"call"==r.info&&(r.pos=(r.pos||0)+1),D(function(e,t){return e==i||t==i?A():A(n)},a)}return e==i||t==i?D():o&&-1<o.indexOf(";")?A(n):D(K(i))}return function(e,t){return e==i||t==i?D():A(n,a)}}function de(e,t,r){for(var n=3;n<arguments.length;n++)O.cc.push(arguments[n]);return D(j(t,r),ue(e,t),V)}function fe(e){return"}"==e?D():A(U,fe)}function he(e,t){if(f){if(":"==e)return D(ve);if("?"==t)return D(he)}}function pe(e,t){if(f&&(":"==e||"in"==t))return D(ve)}function me(e){if(f&&":"==e)return O.stream.match(/^\s*\w+\s+is\b/,!1)?D(q,ge,ve):D(ve)}function ge(e,t){if("is"==t)return O.marked="keyword",D()}function ve(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(O.marked="keyword",D("typeof"==t?$:ve)):"variable"==e||"void"==t?(O.marked="type",D(xe)):"|"==t||"&"==t?D(ve):"string"==e||"number"==e||"atom"==e?D(xe):"["==e?D(j("]"),ue(ve,"]",","),V,xe):"{"==e?D(j("}"),ue(be,"}",",;"),V,xe):"("==e?D(ue(we,")"),ye,xe):"<"==e?D(ue(ve,">"),ve):void 0}function ye(e){if("=>"==e)return D(ve)}function be(e,t){return"variable"==e||"keyword"==O.style?(O.marked="property",D(be)):"?"==t||"number"==e||"string"==e?D(be):":"==e?D(ve):"["==e?D(K("variable"),he,K("]"),be):"("==e?A(Ee,be):void 0}function we(e,t){return"variable"==e&&O.stream.match(/^\s*[?:]/,!1)||"?"==t?D(we):":"==e?D(ve):"spread"==e?D(we):A(ve)}function xe(e,t){return"<"==t?D(j(">"),ue(ve,">"),V,xe):"|"==t||"."==e||"&"==t?D(ve):"["==e?D(ve,K("]"),xe):"extends"==t||"implements"==t?(O.marked="keyword",D(ve)):"?"==t?D(ve,K(":"),ve):void 0}function ke(e,t){if("<"==t)return D(j(">"),ue(ve,">"),V,xe)}function Ce(){return A(ve,Se)}function Se(e,t){if("="==t)return D(ve)}function Le(e,t){return"enum"==t?(O.marked="keyword",D(Je)):A(Te,he,Oe,Ae)}function Te(e,t){return f&&P(t)?(O.marked="keyword",D(Te)):"variable"==e?(z(t),D()):"spread"==e?D(Te):"["==e?de(Ne,"]"):"{"==e?de(Me,"}"):void 0}function Me(e,t){return"variable"!=e||O.stream.match(/^\s*:/,!1)?("variable"==e&&(O.marked="property"),"spread"==e?D(Te):"}"==e?A():"["==e?D(q,K("]"),K(":"),Me):D(K(":"),Te,Oe)):(z(t),D(Oe))}function Ne(){return A(Te,Oe)}function Oe(e,t){if("="==t)return D($)}function Ae(e){if(","==e)return D(Le)}function De(e,t){if("keyword b"==e&&"else"==t)return D(j("form","else"),U,V)}function We(e,t){return"await"==t?D(We):"("==e?D(j(")"),ze,V):void 0}function ze(e){return"var"==e?D(Le,Pe):"variable"==e?D(Pe):A(Pe)}function Pe(e,t){return")"==e?D():";"==e?D(Pe):"in"==t||"of"==t?(O.marked="keyword",D(q,Pe)):A(q,Pe)}function Ie(e,t){return"*"==t?(O.marked="keyword",D(Ie)):"variable"==e?(z(t),D(Ie)):"("==e?D(F,j(")"),ue(Fe,")"),V,me,U,B):f&&"<"==t?D(j(">"),ue(Ce,">"),V,Ie):void 0}function Ee(e,t){return"*"==t?(O.marked="keyword",D(Ee)):"variable"==e?(z(t),D(Ee)):"("==e?D(F,j(")"),ue(Fe,")"),V,me,B):f&&"<"==t?D(j(">"),ue(Ce,">"),V,Ee):void 0}function He(e,t){return"keyword"==e||"variable"==e?(O.marked="type",D(He)):"<"==t?D(j(">"),ue(Ce,">"),V):void 0}function Fe(e,t){return"@"==t&&D(q,Fe),"spread"==e?D(Fe):f&&P(t)?(O.marked="keyword",D(Fe)):f&&"this"==e?D(he,Oe):A(Te,he,Oe)}function Re(e,t){return"variable"==e?Be(e,t):je(e,t)}function Be(e,t){if("variable"==e)return z(t),D(je)}function je(e,t){return"<"==t?D(j(">"),ue(Ce,">"),V,je):"extends"==t||"implements"==t||f&&","==e?("implements"==t&&(O.marked="keyword"),D(f?ve:q,je)):"{"==e?D(j("}"),Ve,V):void 0}function Ve(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||f&&P(t))&&O.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(O.marked="keyword",D(Ve)):"variable"==e||"keyword"==O.style?(O.marked="property",D(f?Ke:Ie,Ve)):"number"==e||"string"==e?D(f?Ke:Ie,Ve):"["==e?D(q,he,K("]"),f?Ke:Ie,Ve):"*"==t?(O.marked="keyword",D(Ve)):f&&"("==e?A(Ee,Ve):";"==e||","==e?D(Ve):"}"==e?D():"@"==t?D(q,Ve):void 0}function Ke(e,t){if("?"==t)return D(Ke);if(":"==e)return D(ve,Oe);if("="==t)return D($);var r=O.state.lexical.prev;return A(r&&"interface"==r.info?Ee:Ie)}function Ue(e,t){return"*"==t?(O.marked="keyword",D(_e,K(";"))):"default"==t?(O.marked="keyword",D(q,K(";"))):"{"==e?D(ue(Ge,"}"),_e,K(";")):A(U)}function Ge(e,t){return"as"==t?(O.marked="keyword",D(K("variable"))):"variable"==e?A($,Ge):void 0}function qe(e){return"string"==e?D():"("==e?A(q):A($e,Xe,_e)}function $e(e,t){return"{"==e?de($e,"}"):("variable"==e&&z(t),"*"==t&&(O.marked="keyword"),D(Ye))}function Xe(e){if(","==e)return D($e,Xe)}function Ye(e,t){if("as"==t)return O.marked="keyword",D($e)}function _e(e,t){if("from"==t)return O.marked="keyword",D(q)}function Ze(e){return"]"==e?D():A(ue($,"]"))}function Je(){return A(j("form"),Te,K("{"),j("}"),ue(Qe,"}"),V,V)}function Qe(){return A(Te,Oe)}function et(e,t,r){return t.tokenize==x&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return V.lex=B.lex=!0,{startState:function(e){var t={tokenize:x,lastType:"sof",cc:[],lexical:new M((e||0)-u,0,"block",!1),localVars:c.localVars,context:c.localVars&&new I(null,null,!1),indented:e||0};return c.globalVars&&"object"==typeof c.globalVars&&(t.globalVars=c.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),L(e,t)),t.tokenize!=k&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==g?r:(t.lastType="operator"!=g||"++"!=v&&"--"!=v?g:"incdec",function(e,t,r,n,i){var o=e.cc;for(O.state=e,O.stream=i,O.marked=null,O.cc=o,O.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((o.length?o.pop():s?q:U)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return O.marked?O.marked:"variable"==r&&N(e,n)?"variable-2":t}}}(t,r,g,v,e))},indent:function(e,t){if(e.tokenize==k)return tt.Pass;if(e.tokenize!=x)return 0;var r,n=t&&t.charAt(0),i=e.lexical;if(!/^\s*else\b/.test(t))for(var o=e.cc.length-1;0<=o;--o){var a=e.cc[o];if(a==V)i=i.prev;else if(a!=De)break}for(;("stat"==i.type||"form"==i.type)&&("}"==n||(r=e.cc[e.cc.length-1])&&(r==Z||r==J)&&!/^[,\.=+\-*:?[\(]/.test(t));)i=i.prev;d&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var l=i.type,s=n==l;return"vardef"==l?i.indented+("operator"==e.lastType||","==e.lastType?i.info.length+1:0):"form"==l&&"{"==n?i.indented:"form"==l?i.indented+u:"stat"==l?i.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||y.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(e,t)?d||u:0):"switch"!=i.info||s||0==c.doubleIndentSwitch?i.align?i.column+(s?0:1):i.indented+(s?0:u):i.indented+(/^(?:case|default)\b/.test(t)?u:2*u)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"` + "``" + `",helperType:s?"json":"javascript",jsonldMode:l,jsonMode:s,expressionAllowed:et,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=q&&t!=$||e.cc.pop()}}}),tt.registerHelper("wordChars","javascript",/[\w$]/),tt.defineMIME("text/javascript","javascript"),tt.defineMIME("text/ecmascript","javascript"),tt.defineMIME("application/javascript","javascript"),tt.defineMIME("application/x-javascript","javascript"),tt.defineMIME("application/ecmascript","javascript"),tt.defineMIME("application/json",{name:"javascript",json:!0}),tt.defineMIME("application/x-json",{name:"javascript",json:!0}),tt.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),tt.defineMIME("text/typescript",{name:"javascript",typescript:!0}),tt.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(A){"use strict";function e(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}A.defineMode("css",function(e,t){var r=t.inline;t.propertyKeywords||(t=A.resolveMode("text/css"));var n,i,o=e.indentUnit,a=t.tokenHooks,l=t.documentTypes||{},s=t.mediaTypes||{},c=t.mediaFeatures||{},u=t.mediaValueKeywords||{},d=t.propertyKeywords||{},f=t.nonStandardPropertyKeywords||{},h=t.fontProperties||{},p=t.counterDescriptors||{},m=t.colorKeywords||{},g=t.valueKeywords||{},v=t.allowNested,y=t.lineComment,b=!0===t.supportsAtComponent;function w(e,t){return n=t,e}function x(i){return function(e,t){for(var r,n=!1;null!=(r=e.next());){if(r==i&&!n){")"==i&&e.backUp(1);break}n=!n&&"\\"==r}return r!=i&&(n||")"==i)||(t.tokenize=null),w("string","string")}}function k(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=x(")"),w(null,"(")}function C(e,t,r){this.type=e,this.indent=t,this.prev=r}function S(e,t,r,n){return e.context=new C(r,t.indentation()+(!1===n?0:o),e.context),r}function L(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function T(e,t,r){return O[r.context.type](e,t,r)}function M(e,t,r,n){for(var i=n||1;0<i;i--)r.context=r.context.prev;return T(e,t,r)}function N(e){var t=e.current().toLowerCase();i=g.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var O={top:function(e,t,r){if("{"==e)return S(r,t,"block");if("}"==e&&r.context.prev)return L(r);if(b&&/@component/i.test(e))return S(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return S(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return S(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return S(r,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return S(r,t,"interpolation");if(":"==e)return"pseudo";if(v&&"("==e)return S(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"!=e)return"meta"==e?"block":v||"hash"!=e&&"qualifier"!=e?O.top(e,t,r):(i="error","block");var n=t.current().toLowerCase();return d.hasOwnProperty(n)?(i="property","maybeprop"):f.hasOwnProperty(n)?(i="string-2","maybeprop"):v?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")},maybeprop:function(e,t,r){return":"==e?S(r,t,"prop"):T(e,t,r)},prop:function(e,t,r){if(";"==e)return L(r);if("{"==e&&v)return S(r,t,"propBlock");if("}"==e||"{"==e)return M(e,t,r);if("("==e)return S(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)N(t);else if("interpolation"==e)return S(r,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?L(r):"word"==e?(i="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?M(e,t,r):")"==e?L(r):"("==e?S(r,t,"parens"):"interpolation"==e?S(r,t,"interpolation"):("word"==e&&N(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(i="variable-3",r.context.type):T(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&l.hasOwnProperty(t.current())?(i="tag",r.context.type):O.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return S(r,t,"atBlock_parens");if("}"==e||";"==e)return M(e,t,r);if("{"==e)return L(r)&&S(r,t,v?"block":"top");if("interpolation"==e)return S(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();i="only"==n||"not"==n||"and"==n||"or"==n?"keyword":s.hasOwnProperty(n)?"attribute":c.hasOwnProperty(n)?"property":u.hasOwnProperty(n)?"keyword":d.hasOwnProperty(n)?"property":f.hasOwnProperty(n)?"string-2":g.hasOwnProperty(n)?"atom":m.hasOwnProperty(n)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?M(e,t,r):"{"==e?L(r)&&S(r,t,v?"block":"top",!1):("word"==e&&(i="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?L(r):"{"==e||"}"==e?M(e,t,r,2):O.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?S(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(i="variable","restricted_atBlock_before"):T(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,L(r)):"word"==e?(i="@font-face"==r.stateArg&&!h.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(i="variable","keyframes"):"{"==e?S(r,t,"top"):T(e,t,r)},at:function(e,t,r){return";"==e?L(r):"{"==e||"}"==e?M(e,t,r):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?L(r):"{"==e||";"==e?M(e,t,r):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new C(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||function(e,t){var r=e.next();if(a[r]){var n=a[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),w("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?w(null,"compare"):'"'==r||"'"==r?(t.tokenize=x(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),w("atom","hash")):"!"==r?(e.match(/^\s*\w*/),w("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),w("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?w(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?w("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?w(null,r):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=k),w("variable callee","variable")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),w("property","word")):w(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),w("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?w("variable-2","variable-definition"):w("variable-2","variable")):e.match(/^\w+-/)?w("meta","meta"):void 0})(e,t);return r&&"object"==typeof r&&(n=r[1],r=r[0]),i=r,"comment"!=n&&(t.state=O[t.state](n,e,t)),i},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-o)):i=(r=r.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}});var t=["domain","regexp","url","url-prefix"],r=e(t),n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(n),o=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],a=e(o),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],s=e(l),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=e(c),d=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],f=e(d),h=e(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),p=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],g=e(m),v=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],y=e(v),b=t.concat(n).concat(o).concat(l).concat(c).concat(d).concat(m).concat(v);function w(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}A.registerHelper("hintWords","css",b),A.defineMIME("text/css",{documentTypes:r,mediaTypes:i,mediaFeatures:a,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:p,colorKeywords:g,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w)(e,t)}},name:"css"}),A.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:f,colorKeywords:g,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),A.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:f,colorKeywords:g,valueKeywords:y,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w)(e,t):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),A.defineMIME("text/x-gss",{documentTypes:r,mediaTypes:i,mediaFeatures:a,propertyKeywords:u,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:p,colorKeywords:g,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w)(e,t)}},name:"css",helperType:"gss"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("vbscript",function(n,i){var o="error";function e(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}var a=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),l=new RegExp("^((<>)|(<=)|(>=))"),s=new RegExp("^[\\.,]"),c=new RegExp("^[\\(\\)]"),u=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),d=e(["and","or","not","xor","is","mod","eqv","imp"]),t=["WScript","err","debug","RegExp"],f=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"].concat(["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"]);t=t.concat(["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"]),n.isASP&&(t=t.concat(["server","response","request","session","application"]),f=f.concat(["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"]));var h=e(["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"]),p=e(["true","false","nothing","empty","null"]),m=e(["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"]),g=e(t),v=e(f),y='"',b=e(["class","sub","select","while","if","function","property","with","for"]),w=e(["else","elseif","case"]),x=e(["next","loop","wend"]),k=e(["end"]),C=e(["do"]),S=e(["on error resume next","exit"]),L=e(["rem"]);function T(e,t){t.currentIndent++}function M(e,t){t.currentIndent--}function N(e,t){if(e.eatSpace())return"space";if("'"===e.peek())return e.skipToEnd(),"comment";if(e.match(L))return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!e.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var r=!1;if(e.match(/^\d*\.\d+/i)?r=!0:e.match(/^\d+\.\d*/)?r=!0:e.match(/^\.\d+/)&&(r=!0),r)return e.eat(/J/i),"number";var n=!1;if(e.match(/^&H[0-9a-f]+/i)?n=!0:e.match(/^&O[0-7]+/i)?n=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),n=!0):e.match(/^0(?![\dx])/i)&&(n=!0),n)return e.eat(/L/i),"number"}return e.match(y)?(t.tokenize=function(r){var n=1==r.length;return function(e,t){for(;!e.eol();){if(e.eatWhile(/[^'"]/),e.match(r))return t.tokenize=N,"string";e.eat(/['"]/)}if(n){if(i.singleLineStringErrors)return o;t.tokenize=N}return"string"}}(e.current()),t.tokenize(e,t)):e.match(l)||e.match(a)||e.match(d)?"operator":e.match(s)?null:e.match(c)?"bracket":e.match(S)?(t.doInCurrentLine=!0,"keyword"):e.match(C)?(T(0,t),t.doInCurrentLine=!0,"keyword"):e.match(b)?(t.doInCurrentLine?t.doInCurrentLine=!1:T(0,t),"keyword"):e.match(w)?"keyword":e.match(k)?(M(0,t),M(0,t),"keyword"):e.match(x)?(t.doInCurrentLine?t.doInCurrentLine=!1:M(0,t),"keyword"):e.match(h)?"keyword":e.match(p)?"atom":e.match(v)?"variable-2":e.match(m)?"builtin":e.match(g)?"variable-2":e.match(u)?"variable":(e.next(),o)}return{electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:N,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var r=function(e,t){var r=t.tokenize(e,t),n=e.current();return"."===n?(r=t.tokenize(e,t),n=e.current(),!r||"variable"!==r.substr(0,8)&&"builtin"!==r&&"keyword"!==r?o:("builtin"!==r&&"keyword"!==r||(r="variable"),-1<f.indexOf(n.substr(1))&&(r="variable-2"),r)):r}(e,t);return t.lastToken={style:r,content:e.current()},"space"===r&&(r=null),r},indent:function(e,t){var r=t.replace(/^\s+|\s+$/g,"");return r.match(x)||r.match(k)||r.match(w)?n.indentUnit*(e.currentIndent-1):e.currentIndent<0?0:e.currentIndent*n.indentUnit}}}),e.defineMIME("text/vbscript","vbscript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(p){"use strict";var i={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};var n={};function m(e,t){var r=e.match(function(e){var t=n[e];return t||(n[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}(t));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function g(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function o(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),i=e[r],o=i.length-1;0<=o;o--)n.unshift(i[o])}p.defineMode("htmlmixed",function(u,e){var d=p.getMode(u,{name:"xml",htmlMode:!0,multilineTagIndentFactor:e.multilineTagIndentFactor,multilineTagIndentPastTag:e.multilineTagIndentPastTag}),f={},t=e&&e.tags,r=e&&e.scriptTypes;if(o(i,f),t&&o(t,f),r)for(var n=r.length-1;0<=n;n--)f.script.unshift(["type",r[n].matches,r[n].mode]);function h(e,t){var r,n=d.token(e,t.htmlState),i=/\btag\b/.test(n);if(i&&!/[<>\s\/]/.test(e.current())&&(r=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&f.hasOwnProperty(r))t.inTag=r+" ";else if(t.inTag&&i&&/>$/.test(e.current())){var o=/^([\S]+) (.*)/.exec(t.inTag);t.inTag=null;var a=">"==e.current()&&function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n[0]||n[1].test(m(t,n[0])))return n[2]}}(f[o[1]],o[2]),l=p.getMode(u,a),s=g(o[1],!0),c=g(o[1],!1);t.token=function(e,t){return e.match(s,!1)?(t.token=h,t.localState=t.localMode=null,null):function(e,t,r){var n=e.current(),i=n.search(t);return-1<i?e.backUp(n.length-i):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}(e,c,t.localMode.token(e,t.localState))},t.localMode=l,t.localState=p.startState(l,d.indent(t.htmlState,"",""))}else t.inTag&&(t.inTag+=e.current(),e.eol()&&(t.inTag+=" "));return n}return{startState:function(){return{token:h,inTag:null,localMode:null,localState:null,htmlState:p.startState(d)}},copyState:function(e){var t;return e.localState&&(t=p.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:t,htmlState:p.copyState(d,e.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(e,t,r){return!e.localMode||/^\s*<\//.test(t)?d.indent(e.htmlState,t,r):e.localMode.indent?e.localMode.indent(e.localState,t,r):p.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||d}}}},"xml","javascript","css"),p.defineMIME("text/html","htmlmixed")});`)
|