2 lines
193 KiB
JavaScript
2 lines
193 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-fb153a9a"],{"00ee":function(e,t,n){"use strict";var r=n("b622"),i=r("toStringTag"),o={};o[i]="z",e.exports="[object z]"===String(o)},"0366":function(e,t,n){"use strict";var r=n("4625"),i=n("59ed"),o=n("40d5"),l=r(r.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?l(e,t):function(){return e.apply(t,arguments)}}},"0dd0":function(e,t,n){},"10b2":function(e,t,n){(function(e){e(n("56b3"))})((function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,l){l&&l!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(o(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))}));var i={Backspace:s,Enter:u};function o(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),r="'"+n+"'";i[r]||(i[r]=l(n))}}function l(e){return function(t){return h(t,e)}}function a(e){var t=e.state.closeBrackets;if(!t||t.override)return t;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function s(t){var i=a(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var o=r(i,"pairs"),l=t.listSelections(),s=0;s<l.length;s++){if(!l[s].empty())return e.Pass;var u=d(t,l[s].head);if(!u||o.indexOf(u)%2!=0)return e.Pass}for(s=l.length-1;s>=0;s--){var c=l[s].head;t.replaceRange("",n(c.line,c.ch-1),n(c.line,c.ch+1),"+delete")}}function u(t){var n=a(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return e.Pass;var s=d(t,o[l].head);if(!s||i.indexOf(s)%2!=0)return e.Pass}t.operation((function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),c(t,-1),o=t.listSelections();for(var n=0;n<o.length;n++){var r=o[n].head.line;t.indentLine(r,null,!0),t.indentLine(r+1,null,!0)}}))}function c(e,t){for(var n=[],r=e.listSelections(),i=0,o=0;o<r.length;o++){var l=r[o];l.head==e.getCursor()&&(i=o);var a=l.head.ch||t>0?{line:l.head.line,ch:l.head.ch+t}:{line:l.head.line-1};n.push({anchor:a,head:a})}e.setSelections(n,i)}function f(t){var r=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new n(t.head.line,t.head.ch+(r?1:-1))}}function h(t,i){var o=a(t);if(!o||t.getOption("disableInput"))return e.Pass;var l=r(o,"pairs"),s=l.indexOf(i);if(-1==s)return e.Pass;for(var u,h=r(o,"closeBefore"),d=r(o,"triples"),g=l.charAt(s+1)==i,v=t.listSelections(),m=s%2==0,y=0;y<v.length;y++){var b,w=v[y],x=w.head,C=t.getRange(x,n(x.line,x.ch+1));if(m&&!w.empty())b="surround";else if(!g&&m||C!=i)if(g&&x.ch>1&&d.indexOf(i)>=0&&t.getRange(n(x.line,x.ch-2),x)==i+i){if(x.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(x.line,x.ch-2))))return e.Pass;b="addFour"}else if(g){var S=0==x.ch?" ":t.getRange(n(x.line,x.ch-1),x);if(e.isWordChar(C)||S==i||e.isWordChar(S))return e.Pass;b="both"}else{if(!m||!(0===C.length||/\s/.test(C)||h.indexOf(C)>-1))return e.Pass;b="both"}else b=g&&p(t,x)?"both":d.indexOf(i)>=0&&t.getRange(x,n(x.line,x.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=b)return e.Pass}else u=b}var k=s%2?l.charAt(s-1):i,L=s%2?i:l.charAt(s+1);t.operation((function(){if("skip"==u)c(t,1);else if("skipThree"==u)c(t,3);else if("surround"==u){for(var e=t.getSelections(),n=0;n<e.length;n++)e[n]=k+e[n]+L;t.replaceSelections(e,"around"),e=t.listSelections().slice();for(n=0;n<e.length;n++)e[n]=f(e[n]);t.setSelections(e)}else"both"==u?(t.replaceSelection(k+L,null),t.triggerElectric(k+L),c(t,-1)):"addFour"==u&&(t.replaceSelection(k+k+k+k,"before"),c(t,1))}))}function d(e,t){var r=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==r.length?r:null}function p(e,t){var r=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")}))},2266:function(e,t,n){"use strict";var r=n("0366"),i=n("c65b"),o=n("825a"),l=n("0d51"),a=n("e95a"),s=n("07fa"),u=n("3a9b"),c=n("9a1f"),f=n("35a1"),h=n("2a62"),d=TypeError,p=function(e,t){this.stopped=e,this.result=t},g=p.prototype;e.exports=function(e,t,n){var v,m,y,b,w,x,C,S=n&&n.that,k=!(!n||!n.AS_ENTRIES),L=!(!n||!n.IS_RECORD),T=!(!n||!n.IS_ITERATOR),M=!(!n||!n.INTERRUPTED),O=r(t,S),N=function(e){return v&&h(v,"normal"),new p(!0,e)},A=function(e){return k?(o(e),M?O(e[0],e[1],N):O(e[0],e[1])):M?O(e,N):O(e)};if(L)v=e.iterator;else if(T)v=e;else{if(m=f(e),!m)throw new d(l(e)+" is not iterable");if(a(m)){for(y=0,b=s(e);b>y;y++)if(w=A(e[y]),w&&u(g,w))return w;return new p(!1)}v=c(e,m)}x=L?e.next:v.next;while(!(C=i(x,v)).done){try{w=A(C.value)}catch(D){h(v,"throw",D)}if("object"==typeof w&&w&&u(g,w))return w}return new p(!1)}},"35a1":function(e,t,n){"use strict";var r=n("f5df"),i=n("dc4a"),o=n("7234"),l=n("3f8c"),a=n("b622"),s=a("iterator");e.exports=function(e){if(!o(e))return i(e,s)||i(e,"@@iterator")||l[r(e)]}},"3f8c":function(e,t,n){"use strict";e.exports={}},4625:function(e,t,n){"use strict";var r=n("c6b6"),i=n("e330");e.exports=function(e){if("Function"===r(e))return i(e)}},4895:function(e,t,n){(function(e){e(n("56b3"))})((function(e){"use strict";function t(t,r,o,l){if(o&&o.call){var a=o;o=null}else a=i(t,o,"rangeFinder");"number"==typeof r&&(r=e.Pos(r,0));var s=i(t,o,"minFoldSize");function u(e){var n=a(t,r);if(!n||n.to.line-n.from.line<s)return null;if("fold"===l)return n;for(var i=t.findMarksAt(n.from),o=0;o<i.length;++o)if(i[o].__isFold){if(!e)return null;n.cleared=!0,i[o].clear()}return n}var c=u(!0);if(i(t,o,"scanUp"))while(!c&&r.line>t.firstLine())r=e.Pos(r.line-1,0),c=u(!1);if(c&&!c.cleared&&"unfold"!==l){var f=n(t,o,c);e.on(f,"mousedown",(function(t){h.clear(),e.e_preventDefault(t)}));var h=t.markText(c.from,c.to,{replacedWith:f,clearOnEnter:i(t,o,"clearOnEnter"),__isFold:!0});h.on("clear",(function(n,r){e.signal(t,"unfold",t,n,r)})),e.signal(t,"fold",t,c.from,c.to)}}function n(e,t,n){var r=i(e,t,"widget");if("function"==typeof r&&(r=r(n.from,n.to)),"string"==typeof r){var o=document.createTextNode(r);r=document.createElement("span"),r.appendChild(o),r.className="CodeMirror-foldmarker"}else r&&(r=r.cloneNode(!0));return r}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",(function(e,n,r){t(this,e,n,r)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),n=0;n<t.length;++n)if(t[n].__isFold)return!0})),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),{scanUp:!1},"unfold")},e.commands.foldAll=function(t){t.operation((function(){for(var n=t.firstLine(),r=t.lastLine();n<=r;n++)t.foldCode(e.Pos(n,0),{scanUp:!1},"fold")}))},e.commands.unfoldAll=function(t){t.operation((function(){for(var n=t.firstLine(),r=t.lastLine();n<=r;n++)t.foldCode(e.Pos(n,0),{scanUp:!1},"unfold")}))},e.registerHelper("fold","combine",(function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var r=0;r<e.length;++r){var i=e[r](t,n);if(i)return i}}})),e.registerHelper("fold","auto",(function(e,t){for(var n=e.getHelpers(t,"fold"),r=0;r<n.length;r++){var i=n[r](e,t);if(i)return i}}));var r={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function i(e,t,n){if(t&&void 0!==t[n])return t[n];var i=e.options.foldOptions;return i&&void 0!==i[n]?i[n]:r[n]}e.defineOption("foldOptions",null),e.defineExtension("foldOption",(function(e,t){return i(this,e,t)}))}))},"56b3":function(e,t,n){(function(t,n){e.exports=n()})(0,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=r||i||o,a=l&&(r?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),u=s&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\/(\d+)/.exec(e),f=c&&+c[1],h=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),g=/PhantomJS/.test(e),v=d&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),m=/Android/.test(e),y=v||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=v||/Mac/.test(t),w=/\bCrOS\b/.test(e),x=/win/i.test(t),C=h&&e.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(h=!1,s=!0);var S=b&&(u||h&&(null==C||C<12.11)),k=n||l&&a>=9;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var T,M=function(e,t){var n=e.className,r=L(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function O(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return O(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"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 D(e,t,n,r){var i=A(e,t,n,r);return i.setAttribute("role","presentation"),i}function W(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 F(e){var t,n=e.ownerDocument||e;try{t=e.activeElement}catch(r){t=n.body||null}while(t&&t.shadowRoot&&t.shadowRoot.activeElement)t=t.shadowRoot.activeElement;return t}function E(e,t){var n=e.className;L(t).test(n)||(e.className+=(n?" ":"")+t)}function H(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!L(n[r]).test(t)&&(t+=" "+n[r]);return t}T=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var P=function(e){e.select()};function R(e){return e.display.wrapper.ownerDocument}function I(e){return z(e.display.wrapper)}function z(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function B(e){return R(e).defaultView}function G(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function U(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function _(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,l=i||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}v?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(P=function(e){try{e.select()}catch(t){}});var V=function(){this.id=null,this.f=null,this.time=0,this.handler=G(this.onTimeout,this)};function j(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}V.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},V.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var K=50,X={toString:function(){return"CodeMirror.Pass"}},$={scroll:!1},Y={origin:"*mouse"},q={origin:"+move"};function Z(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var J=[""];function Q(e){while(J.length<=e)J.push(ee(J)+" ");return J[e]}function ee(e){return e[e.length-1]}function te(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function ne(e,t,n){var r=0,i=n(t);while(r<e.length&&n(e[r])<=i)r++;e.splice(r,0,t)}function re(){}function ie(e,t){var n;return Object.create?n=Object.create(e):(re.prototype=e,n=new re),t&&U(t,n),n}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function le(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||oe.test(e))}function ae(e,t){return t?!!(t.source.indexOf("\\w")>-1&&le(e))||t.test(e):le(e)}function se(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ue=/[\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 ce(e){return e.charCodeAt(0)>=768&&ue.test(e)}function fe(e,t,n){while((n<0?t>0:t<e.length)&&ce(e.charAt(t)))t+=n;return t}function he(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function de(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var pe=null;function ge(e,t,n){var r;pe=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"==n?r=i:pe=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:pe=i)}return null!=r?r:pe}var ve=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var c=e.length,f=[],h=0;h<c;++h)f.push(n(e.charCodeAt(h)));for(var d=0,p=u;d<c;++d){var g=f[d];"m"==g?f[d]=p:p=g}for(var v=0,m=u;v<c;++v){var y=f[v];"1"==y&&"r"==m?f[v]="n":o.test(y)&&(m=y,"r"==y&&(f[v]="R"))}for(var b=1,w=f[0];b<c-1;++b){var x=f[b];"+"==x&&"1"==w&&"1"==f[b+1]?f[b]="1":","!=x||w!=f[b+1]||"1"!=w&&"n"!=w||(f[b]=w),w=x}for(var C=0;C<c;++C){var S=f[C];if(","==S)f[C]="N";else if("%"==S){var k=void 0;for(k=C+1;k<c&&"%"==f[k];++k);for(var L=C&&"!"==f[C-1]||k<c&&"1"==f[k]?"1":"N",T=C;T<k;++T)f[T]=L;C=k-1}}for(var M=0,O=u;M<c;++M){var N=f[M];"L"==O&&"1"==N?f[M]="L":o.test(N)&&(O=N)}for(var A=0;A<c;++A)if(i.test(f[A])){var D=void 0;for(D=A+1;D<c&&i.test(f[D]);++D);for(var W="L"==(A?f[A-1]:u),F="L"==(D<c?f[D]:u),E=W==F?W?"L":"R":u,H=A;H<D;++H)f[H]=E;A=D-1}for(var P,R=[],I=0;I<c;)if(l.test(f[I])){var z=I;for(++I;I<c&&l.test(f[I]);++I);R.push(new s(0,z,I))}else{var B=I,G=R.length,U="rtl"==t?1:0;for(++I;I<c&&"L"!=f[I];++I);for(var _=B;_<I;)if(a.test(f[_])){B<_&&(R.splice(G,0,new s(1,B,_)),G+=U);var V=_;for(++_;_<I&&a.test(f[_]);++_);R.splice(G,0,new s(2,V,_)),G+=U,B=_}else++_;B<I&&R.splice(G,0,new s(1,B,I))}return"ltr"==t&&(1==R[0].level&&(P=e.match(/^\s+/))&&(R[0].from=P[0].length,R.unshift(new s(0,0,P[0].length))),1==ee(R).level&&(P=e.match(/\s+$/))&&(ee(R).to-=P[0].length,R.push(new s(0,c-P[0].length,c)))),"rtl"==t?R.reverse():R}}();function me(e,t){var n=e.order;return null==n&&(n=e.order=ve(e.text,t)),n}var ye=[],be=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ye).concat(n)}};function we(e,t){return e._handlers&&e._handlers[t]||ye}function xe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=j(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ce(e,t){var n=we(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Se(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ce(e,n||t.type,e,t),Ne(t)||t.codemirrorIgnore}function ke(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==j(n,t[r])&&n.push(t[r])}function Le(e,t){return we(e,t).length>0}function Te(e){e.prototype.on=function(e,t){be(this,e,t)},e.prototype.off=function(e,t){xe(this,e,t)}}function Me(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ne(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ae(e){Me(e),Oe(e)}function De(e){return e.target||e.srcElement}function We(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Fe,Ee,He=function(){if(l&&a<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Pe(e){if(null==Fe){var t=A("span","");N(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Fe=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&a<8))}var n=Fe?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Re(e){if(null!=Ee)return Ee;var t=N(e,document.createTextNode("AخA")),n=T(t,0,1).getBoundingClientRect(),r=T(t,1,2).getBoundingClientRect();return O(e),!(!n||n.left==n.right)&&(Ee=r.right-n.right<3)}var Ie=3!="\n\nb".split(/\n/).length?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ze=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Be=function(){var e=A("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Ge=null;function Ue(e){if(null!=Ge)return Ge;var t=N(e,A("span","x")),n=t.getBoundingClientRect(),r=T(t,0,1).getBoundingClientRect();return Ge=Math.abs(n.left-r.left)>1}var _e={},Ve={};function je(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),_e[e]=t}function Ke(e,t){Ve[e]=t}function Xe(e){if("string"==typeof e&&Ve.hasOwnProperty(e))e=Ve[e];else if(e&&"string"==typeof e.name&&Ve.hasOwnProperty(e.name)){var t=Ve[e.name];"string"==typeof t&&(t={name:t}),e=ie(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Xe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Xe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function $e(e,t){t=Xe(t);var n=_e[t.name];if(!n)return $e(e,"text/plain");var r=n(e,t);if(Ye.hasOwnProperty(t.name)){var i=Ye[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var Ye={};function qe(e,t){var n=Ye.hasOwnProperty(e)?Ye[e]:Ye[e]={};U(t,n)}function Ze(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Je(e,t){var n;while(e.innerMode){if(n=e.innerMode(t),!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}}function Qe(e,t,n){return!e.startState||e.startState(t,n)}var et=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function tt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");var n=e;while(!n.lines)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function nt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function rt(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function it(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ot(e){if(null==e.parent)return null;for(var t=e.parent,n=j(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n+t.first}function lt(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l],s=a.height;if(t<s)break;t-=s}return n+l}function at(e,t){return t>=e.first&&t<e.first+e.size}function st(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ut(e,t,n){if(void 0===n&&(n=null),!(this instanceof ut))return new ut(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ct(e,t){return e.line-t.line||e.ch-t.ch}function ft(e,t){return e.sticky==t.sticky&&0==ct(e,t)}function ht(e){return ut(e.line,e.ch)}function dt(e,t){return ct(e,t)<0?t:e}function pt(e,t){return ct(e,t)<0?e:t}function gt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function vt(e,t){if(t.line<e.first)return ut(e.first,0);var n=e.first+e.size-1;return t.line>n?ut(n,tt(e,n).text.length):mt(t,tt(e,t.line).text.length)}function mt(e,t){var n=e.ch;return null==n||n>t?ut(e.line,t):n<0?ut(e.line,0):e}function yt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=vt(e,t[r]);return n}et.prototype.eol=function(){return this.pos>=this.string.length},et.prototype.sol=function(){return this.pos==this.lineStart},et.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},et.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},et.prototype.eat=function(e){var t,n=this.string.charAt(this.pos);if(t="string"==typeof e?n==e:n&&(e.test?e.test(n):e(n)),t)return++this.pos,n},et.prototype.eatWhile=function(e){var t=this.pos;while(this.eat(e));return this.pos>t},et.prototype.eatSpace=function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},et.prototype.skipToEnd=function(){this.pos=this.string.length},et.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},et.prototype.backUp=function(e){this.pos-=e},et.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=_(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)},et.prototype.indentation=function(){return _(this.string,null,this.tabSize)-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)},et.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return!1!==t&&(this.pos+=e.length),!0},et.prototype.current=function(){return this.string.slice(this.start,this.pos)},et.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},et.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},et.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var bt=function(e,t){this.state=e,this.lookAhead=t},wt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function xt(e,t,n,r){var i=[e.state.modeGen],o={};At(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var l=n.state,a=function(r){n.baseTokens=i;var a=e.state.overlays[r],s=1,u=0;n.state=!0,At(e,t.text,a.mode,n,(function(e,t){var n=s;while(u<e){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,u=Math.min(e,r)}if(t)if(a.opaque)i.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=l,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ct(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=St(e,ot(t)),i=t.text.length>e.options.maxHighlightLength&&Ze(e.doc.mode,r.state),o=xt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function St(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new wt(r,!0,t);var o=Dt(e,t,n),l=o>r.first&&tt(r,o-1).stateAfter,a=l?wt.fromSaved(r,l,o):new wt(r,Qe(r.mode),o);return r.iter(o,t,(function(n){kt(e,n.text,a);var r=a.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?a.save():null,a.nextLine()})),n&&(r.modeFrontier=a.line),a}function kt(e,t,n,r){var i=e.doc.mode,o=new et(t,e.options.tabSize,n);o.start=o.pos=r||0,""==t&&Lt(i,n.state);while(!o.eol())Tt(i,o,n.state),o.start=o.pos}function Lt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Je(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Tt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Je(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}wt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},wt.prototype.baseToken=function(e){if(!this.baseTokens)return null;while(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}},wt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},wt.fromSaved=function(e,t,n){return t instanceof bt?new wt(e,Ze(e.mode,t.state),n,t.lookAhead):new wt(e,Ze(e.mode,t),n)},wt.prototype.save=function(e){var t=!1!==e?Ze(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new bt(t,this.maxLookAhead):t};var Mt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Ot(e,t,n,r){var i,o=e.doc,l=o.mode;t=vt(o,t);var a,s=tt(o,t.line),u=St(e,t.line,n),c=new et(s.text,e.options.tabSize,u);r&&(a=[]);while((r||c.pos<t.ch)&&!c.eol())c.start=c.pos,i=Tt(l,c,u.state),r&&a.push(new Mt(c,i,Ze(o.mode,u.state)));return r?a:new Mt(c,i,u.state)}function Nt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function At(e,t,n,r,i,o,l){var a=n.flattenSpans;null==a&&(a=e.options.flattenSpans);var s,u=0,c=null,f=new et(t,e.options.tabSize,r),h=e.options.addModeClass&&[null];""==t&&Nt(Lt(n,r.state),o);while(!f.eol()){if(f.pos>e.options.maxHighlightLength?(a=!1,l&&kt(e,t,r,f.pos),f.pos=t.length,s=null):s=Nt(Tt(n,f,r.state,h),o),h){var d=h[0].name;d&&(s="m-"+(s?d+" "+s:d))}if(!a||c!=s){while(u<f.start)u=Math.min(f.start,u+5e3),i(u,c);c=s}f.start=f.pos}while(u<f.pos){var p=Math.min(f.pos,u+5e3);i(p,c),u=p}}function Dt(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=tt(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof bt?u.lookAhead:0)<=o.modeFrontier))return a;var c=_(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=a-1,r=c)}return i}function Wt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=tt(e,r).stateAfter;if(i&&(!(i instanceof bt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Ft=!1,Et=!1;function Ht(){Ft=!0}function Pt(){Et=!0}function Rt(e,t,n){this.marker=e,this.from=t,this.to=n}function It(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function zt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Bt(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Gt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&"bookmark"==l.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Rt(l,o.from,s?null:o.to))}}return r}function Ut(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&"bookmark"==l.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Rt(l,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}function _t(e,t){if(t.full)return null;var n=at(e,t.from.line)&&tt(e,t.from.line).markedSpans,r=at(e,t.to.line)&&tt(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=0==ct(t.from,t.to),a=Gt(n,i,l),s=Ut(r,o,l),u=1==t.text.length,c=ee(t.text).length+(u?i:0);if(a)for(var f=0;f<a.length;++f){var h=a[f];if(null==h.to){var d=It(s,h.marker);d?u&&(h.to=null==d.to?null:d.to+c):h.to=i}}if(s)for(var p=0;p<s.length;++p){var g=s[p];if(null!=g.to&&(g.to+=c),null==g.from){var v=It(a,g.marker);v||(g.from=c,u&&(a||(a=[])).push(g))}else g.from+=c,u&&(a||(a=[])).push(g)}a&&(a=Vt(a)),s&&s!=a&&(s=Vt(s));var m=[a];if(!u){var y,b=t.text.length-2;if(b>0&&a)for(var w=0;w<a.length;++w)null==a[w].to&&(y||(y=[])).push(new Rt(a[w].marker,null,null));for(var x=0;x<b;++x)m.push(y);m.push(s)}return m}function Vt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function jt(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=j(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],a=l.find(0),s=0;s<i.length;++s){var u=i[s];if(!(ct(u.to,a.from)<0||ct(u.from,a.to)>0)){var c=[s,1],f=ct(u.from,a.from),h=ct(u.to,a.to);(f<0||!l.inclusiveLeft&&!f)&&c.push({from:u.from,to:a.from}),(h>0||!l.inclusiveRight&&!h)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),s+=c.length-3}}return i}function Kt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Xt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function $t(e){return e.inclusiveLeft?-1:0}function Yt(e){return e.inclusiveRight?1:0}function qt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=ct(r.from,i.from)||$t(e)-$t(t);if(o)return-o;var l=ct(r.to,i.to)||Yt(e)-Yt(t);return l||t.id-e.id}function Zt(e,t){var n,r=Et&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||qt(n,i.marker)<0)&&(n=i.marker);return n}function Jt(e){return Zt(e,!0)}function Qt(e){return Zt(e,!1)}function en(e,t){var n,r=Et&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||qt(n,o.marker)<0)&&(n=o.marker)}return n}function tn(e,t,n,r,i){var o=tt(e,t),l=Et&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(s.marker.collapsed){var u=s.marker.find(0),c=ct(u.from,n)||$t(s.marker)-$t(i),f=ct(u.to,r)||Yt(s.marker)-Yt(i);if(!(c>=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ct(u.to,n)>=0:ct(u.to,n)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ct(u.from,r)<=0:ct(u.from,r)<0)))return!0}}}function nn(e){var t;while(t=Jt(e))e=t.find(-1,!0).line;return e}function rn(e){var t;while(t=Qt(e))e=t.find(1,!0).line;return e}function on(e){var t,n;while(t=Qt(e))e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function ln(e,t){var n=tt(e,t),r=nn(n);return n==r?t:ot(r)}function an(e,t){if(t>e.lastLine())return t;var n,r=tt(e,t);if(!sn(e,r))return t;while(n=Qt(r))r=n.find(1,!0).line;return ot(r)+1}function sn(e,t){var n=Et&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&un(e,t,r))return!0}}function un(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return un(e,r.line,It(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&un(e,t,i))return!0}function cn(e){e=nn(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==n)break;t+=a.height}return t}function fn(e){if(0==e.height)return 0;var t,n=e.text.length,r=e;while(t=Jt(r)){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}r=e;while(t=Qt(r)){var o=t.find(0,!0);n-=r.text.length-o.from.ch,r=o.to.line,n+=r.text.length-o.to.ch}return n}function hn(e){var t=e.display,n=e.doc;t.maxLine=tt(n,n.first),t.maxLineLength=fn(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=fn(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var dn=function(e,t,n){this.text=e,Xt(this,t),this.height=n?n(this):1};function pn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Kt(e),Xt(e,n);var i=r?r(e):1;i!=e.height&&it(e,i)}function gn(e){e.parent=null,Kt(e)}dn.prototype.lineNo=function(){return ot(this)},Te(dn);var vn={},mn={};function yn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?mn:vn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function bn(e,t){var n=D("span",null,null,s?"padding-right: .1px":null),r={pre:D("pre",[n],"CodeMirror-line"),content:n,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,l=void 0;r.pos=0,r.addToken=xn,Re(e.display.measure)&&(l=me(o,e.doc.direction))&&(r.addToken=Sn(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&ot(o);Ln(o,r,Ct(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=H(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=H(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Pe(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var u=r.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ce(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=H(r.pre.className,r.textClass||"")),r}function wn(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function xn(e,t,n,r,i,o,s){if(t){var u,c=e.splitSpaces?Cn(t,e.trailingSpace):t,f=e.cm.state.specialChars,h=!1;if(f.test(t)){u=document.createDocumentFragment();var d=0;while(1){f.lastIndex=d;var p=f.exec(t),g=p?p.index-d:t.length-d;if(g){var v=document.createTextNode(c.slice(d,d+g));l&&a<9?u.appendChild(A("span",[v])):u.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!p)break;d+=g+1;var m=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;m=u.appendChild(A("span",Q(b),"cm-tab")),m.setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?(m=u.appendChild(A("span","\r"==p[0]?"␍":"","cm-invalidchar")),m.setAttribute("cm-text",p[0]),e.col+=1):(m=e.cm.options.specialCharPlaceholder(p[0]),m.setAttribute("cm-text",p[0]),l&&a<9?u.appendChild(A("span",[m])):u.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),l&&a<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||h||o||s){var w=n||"";r&&(w+=r),i&&(w+=i);var x=A("span",[u],w,o);if(s)for(var C in s)s.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,s[C]);return e.content.appendChild(x)}e.content.appendChild(u)}}function Cn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}function Sn(e,t){return function(n,r,i,o,l,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+r.length;;){for(var f=void 0,h=0;h<t.length;h++)if(f=t[h],f.to>u&&f.from<=u)break;if(f.to>=c)return e(n,r,i,o,l,a,s);e(n,r.slice(0,f.to-u),i,o,null,a,s),o=null,r=r.slice(f.to-u),u=f.to}}}function kn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Ln(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var l,a,s,u,c,f,h,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){s=u=c=a="",h=null,f=null,m=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;if("bookmark"==C.type&&x.from==p&&C.widgetNode)y.push(C);else if(x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(s+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((h||(h={})).title=C.title),C.attributes)for(var S in C.attributes)(h||(h={}))[S]=C.attributes[S];C.collapsed&&(!f||qt(f.marker,C)<0)&&(f=x)}else x.from>p&&m>x.from&&(m=x.from)}if(b)for(var k=0;k<b.length;k+=2)b[k+1]==m&&(u+=" "+b[k]);if(!f||f.from==p)for(var L=0;L<y.length;++L)kn(t,0,y[L]);if(f&&(f.from||0)==p){if(kn(t,(null==f.to?d+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=d)break;var T=Math.min(d,m);while(1){if(v){var M=p+v.length;if(!f){var O=M>T?v.slice(0,T-p):v;t.addToken(t,O,l?l+s:s,c,p+O.length==m?u:"",a,h)}if(M>=T){v=v.slice(T-p),p=T;break}p=M,c=""}v=i.slice(o,o=n[g++]),l=yn(n[g++],t.cm.options)}}else for(var N=1;N<n.length;N+=2)t.addToken(t,i.slice(o,o=n[N]),yn(n[N+1],t.cm.options))}function Tn(e,t,n){this.line=t,this.rest=on(t),this.size=this.rest?ot(ee(this.rest))-n+1:1,this.node=this.text=null,this.hidden=sn(e,t)}function Mn(e,t,n){for(var r,i=[],o=t;o<n;o=r){var l=new Tn(e.doc,tt(e.doc,o),o);r=o+l.size,i.push(l)}return i}var On=null;function Nn(e){On?On.ops.push(e):e.ownsGroup=On={ops:[e],delayedCallbacks:[]}}function An(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)while(i.cursorActivityCalled<i.cursorActivityHandlers.length)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Dn(e,t){var n=e.ownsGroup;if(n)try{An(n)}finally{On=null,t(n)}}var Wn=null;function Fn(e,t){var n=we(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);On?r=On.delayedCallbacks:Wn?r=Wn:(r=Wn=[],setTimeout(En,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},l=0;l<n.length;++l)o(l)}}function En(){var e=Wn;Wn=null;for(var t=0;t<e.length;++t)e[t]()}function Hn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?zn(e,t):"gutter"==o?Gn(e,t,n,r):"class"==o?Bn(e,t):"widget"==o&&Un(e,t,r)}t.changes=null}function Pn(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),l&&a<8&&(e.node.style.zIndex=2)),e.node}function Rn(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Pn(t);t.background=r.insertBefore(A("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function In(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):bn(e,t)}function zn(e,t){var n=t.text.className,r=In(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Bn(e,t)):n&&(t.text.className=n)}function Bn(e,t){Rn(e,t),t.line.wrapClass?Pn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Gn(e,t,n,r){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=Pn(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.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 l=Pn(t),a=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(a.setAttribute("aria-hidden","true"),e.display.input.setUneditable(a),l.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(A("div",st(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,c=o.hasOwnProperty(u)&&o[u];c&&a.appendChild(A("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Un(e,t,n){t.alignable&&(t.alignable=null);for(var r=L("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Vn(e,t,n)}function _n(e,t,n,r){var i=In(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Bn(e,t),Gn(e,t,n,r),Vn(e,t,r),t.node}function Vn(e,t,n){if(jn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)jn(e,t.rest[r],t,n,!1)}function jn(e,t,n,r,i){if(t.widgets)for(var o=Pn(n),l=0,a=t.widgets;l<a.length;++l){var s=a[l],u=A("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Kn(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),Fn(s,"redraw")}}function Kn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Xn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!W(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,A("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function $n(e,t){for(var n=De(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Yn(e){return e.lineSpace.offsetTop}function qn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Zn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=N(e.measure,A("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Jn(e){return K-e.display.nativeBarWidth}function Qn(e){return e.display.scroller.clientWidth-Jn(e)-e.display.barWidth}function er(e){return e.display.scroller.clientHeight-Jn(e)-e.display.barHeight}function tr(e,t,n){var r=e.options.lineWrapping,i=r&&Qn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),a=0;a<l.length-1;a++){var s=l[a],u=l[a+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function nr(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(ot(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function rr(e,t){t=nn(t);var n=ot(t),r=e.display.externalMeasured=new Tn(e.doc,t,n);r.lineN=n;var i=r.built=bn(e,r);return r.text=i.pre,N(e.display.lineMeasure,i.pre),r}function ir(e,t,n,r){return ar(e,lr(e,t),n,r)}function or(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Br(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function lr(e,t){var n=ot(t),r=or(e,n);r&&!r.text?r=null:r&&r.changes&&(Hn(e,r,n,Hr(e)),e.curOp.forceUpdate=!0),r||(r=rr(e,t));var i=nr(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function ar(e,t,n,r,i){t.before&&(n=-1);var o,l=n+(r||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(tr(e,t.view,t.rect),t.hasHeights=!0),o=hr(e,t,n,r),o.bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var sr,ur={left:0,right:0,top:0,bottom:0};function cr(e,t,n){for(var r,i,o,l,a,s,u=0;u<e.length;u+=3)if(a=e[u],s=e[u+1],t<a?(i=0,o=1,l="left"):t<s?(i=t-a,o=i+1):(u==e.length-3||t==s&&e[u+3]>t)&&(o=s-a,i=o-1,t>=s&&(l="right")),null!=i){if(r=e[u+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)while(u&&e[u-2]==e[u-3]&&e[u-1].insertLeft)r=e[2+(u-=3)],l="left";if("right"==n&&i==s-a)while(u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft)r=e[(u+=3)+2],l="right";break}return{node:r,start:i,end:o,collapse:l,coverStart:a,coverEnd:s}}function fr(e,t){var n=ur;if("left"==t){for(var r=0;r<e.length;r++)if((n=e[r]).left!=n.right)break}else for(var i=e.length-1;i>=0;i--)if((n=e[i]).left!=n.right)break;return n}function hr(e,t,n,r){var i,o=cr(t.map,n,r),s=o.node,u=o.start,c=o.end,f=o.collapse;if(3==s.nodeType){for(var h=0;h<4;h++){while(u&&ce(t.line.text.charAt(o.coverStart+u)))--u;while(o.coverStart+c<o.coverEnd&&ce(t.line.text.charAt(o.coverStart+c)))++c;if(i=l&&a<9&&0==u&&c==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():fr(T(s,u,c).getClientRects(),r),i.left||i.right||0==u)break;c=u,u-=1,f="right"}l&&a<11&&(i=dr(e.display.measure,i))}else{var d;u>0&&(f=r="right"),i=e.options.lineWrapping&&(d=s.getClientRects()).length>1?d["right"==r?d.length-1:0]:s.getBoundingClientRect()}if(l&&a<9&&!u&&(!i||!i.left&&!i.right)){var p=s.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Er(e.display),top:p.top,bottom:p.bottom}:ur}for(var g=i.top-t.rect.top,v=i.bottom-t.rect.top,m=(g+v)/2,y=t.view.measure.heights,b=0;b<y.length-1;b++)if(m<y[b])break;var w=b?y[b-1]:0,x=y[b],C={left:("right"==f?i.right:i.left)-t.rect.left,right:("left"==f?i.left:i.right)-t.rect.left,top:w,bottom:x};return i.left||i.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=g,C.rbottom=v),C}function dr(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ue(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function pr(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 gr(e){e.display.externalMeasure=null,O(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)pr(e.display.view[t])}function vr(e){gr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function mr(e){return c&&m?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function yr(e){return c&&m?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function br(e){var t=nn(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=Xn(n[i]));return r}function wr(e,t,n,r,i){if(!i){var o=br(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var l=cn(t);if("local"==r?l+=Yn(e.display):l-=e.display.viewOffset,"page"==r||"window"==r){var a=e.display.lineSpace.getBoundingClientRect();l+=a.top+("window"==r?0:yr(R(e)));var s=a.left+("window"==r?0:mr(R(e)));n.left+=s,n.right+=s}return n.top+=l,n.bottom+=l,n}function xr(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=mr(R(e)),i-=yr(R(e));else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:r-l.left,top:i-l.top}}function Cr(e,t,n,r,i){return r||(r=tt(e.doc,t.line)),wr(e,r,ir(e,r,t.ch,i),n)}function Sr(e,t,n,r,i,o){function l(t,l){var a=ar(e,i,t,l?"right":"left",o);return l?a.left=a.right:a.right=a.left,wr(e,r,a,n)}r=r||tt(e.doc,t.line),i||(i=lr(e,r));var a=me(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l("before"==u?s-1:s,"before"==u);function c(e,t,n){var r=a[t],i=1==r.level;return l(n?e-1:e,i!=n)}var f=ge(a,s,u),h=pe,d=c(s,f,"before"==u);return null!=h&&(d.other=c(s,h,"before"!=u)),d}function kr(e,t){var n=0;t=vt(e.doc,t),e.options.lineWrapping||(n=Er(e.display)*t.ch);var r=tt(e.doc,t.line),i=cn(r)+Yn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Lr(e,t,n,r,i){var o=ut(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Tr(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Lr(r.first,0,null,-1,-1);var i=lt(r,n),o=r.first+r.size-1;if(i>o)return Lr(r.first+r.size-1,tt(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=tt(r,i);;){var a=Ar(e,l,i,t,n),s=en(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=tt(r,i=u.line)}}function Mr(e,t,n,r){r-=br(t);var i=t.text.length,o=he((function(t){return ar(e,n,t-1).bottom<=r}),i,0);return i=he((function(t){return ar(e,n,t).top>r}),o,i),{begin:o,end:i}}function Or(e,t,n,r){n||(n=lr(e,t));var i=wr(e,t,ar(e,n,r),"line").top;return Mr(e,t,n,i)}function Nr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Ar(e,t,n,r,i){i-=cn(t);var o=lr(e,t),l=br(t),a=0,s=t.text.length,u=!0,c=me(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?Wr:Dr)(e,t,n,o,c,r,i);u=1!=f.level,a=u?f.from:f.to-1,s=u?f.to:f.from-1}var h,d,p=null,g=null,v=he((function(t){var n=ar(e,o,t);return n.top+=l,n.bottom+=l,!!Nr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,g=n),!0)}),a,s),m=!1;if(g){var y=r-g.left<g.right-r,b=y==u;v=p+(b?0:1),d=b?"after":"before",h=y?g.left:g.right}else{u||v!=s&&v!=a||v++,d=0==v?"after":v==t.text.length?"before":ar(e,o,v-(u?1:0)).bottom+l<=i==u?"after":"before";var w=Sr(e,ut(n,v,d),"line",t,o);h=w.left,m=i<w.top?-1:i>=w.bottom?1:0}return v=fe(t.text,v,1),Lr(n,v,d,m,r-h)}function Dr(e,t,n,r,i,o,l){var a=he((function(a){var s=i[a],u=1!=s.level;return Nr(Sr(e,ut(n,u?s.to:s.from,u?"before":"after"),"line",t,r),o,l,!0)}),0,i.length-1),s=i[a];if(a>0){var u=1!=s.level,c=Sr(e,ut(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Nr(c,o,l,!0)&&c.top>l&&(s=i[a-1])}return s}function Wr(e,t,n,r,i,o,l){var a=Mr(e,t,r,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,f=null,h=0;h<i.length;h++){var d=i[h];if(!(d.from>=u||d.to<=s)){var p=1!=d.level,g=ar(e,r,p?Math.min(u,d.to)-1:Math.max(s,d.from)).right,v=g<o?o-g+1e9:g-o;(!c||f>v)&&(c=d,f=v)}}return c||(c=i[i.length-1]),c.from<s&&(c={from:s,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function Fr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==sr){sr=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)sr.appendChild(document.createTextNode("x")),sr.appendChild(A("br"));sr.appendChild(document.createTextNode("x"))}N(e.measure,sr);var n=sr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),O(e.measure),n||1}function Er(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t],"CodeMirror-line-like");N(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Hr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:Pr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Pr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Rr(e){var t=Fr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Er(e.display)-3);return function(i){if(sn(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Ir(e){var t=e.doc,n=Rr(e);t.iter((function(e){var t=n(e);t!=e.height&&it(e,t)}))}function zr(e,t,n,r){var i=e.display;if(!n&&"true"==De(t).getAttribute("cm-not-content"))return null;var o,l,a=i.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,l=t.clientY-a.top}catch(f){return null}var s,u=Tr(e,o,l);if(r&&u.xRel>0&&(s=tt(e.doc,u.line).text).length==u.ch){var c=_(s,s.length,e.options.tabSize)-s.length;u=ut(u.line,Math.max(0,Math.round((o-Zn(e.display).left)/Er(e.display))-c))}return u}function Br(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Gr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Et&&ln(e.doc,t)<i.viewTo&&_r(e);else if(n<=i.viewFrom)Et&&an(e.doc,n+r)>i.viewFrom?_r(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)_r(e);else if(t<=i.viewFrom){var o=Vr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):_r(e)}else if(n>=i.viewTo){var l=Vr(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):_r(e)}else{var a=Vr(e,t,t,-1),s=Vr(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(Mn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):_r(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function Ur(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Br(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==j(l,n)&&l.push(n)}}}function _r(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Vr(e,t,n,r){var i,o=Br(e,t),l=e.display.view;if(!Et||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=e.display.viewFrom,s=0;s<o;s++)a+=l[s].size;if(a!=t){if(r>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,n+=i}while(ln(e.doc,n)!=n){if(o==(r<0?0:l.length-1))return null;n+=r*l[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function jr(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Mn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Mn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Br(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Mn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Br(e,n)))),r.viewTo=n}function Kr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function Xr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function $r(e,t){void 0===t&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),l=e.options.$customCursor;l&&(t=!0);for(var a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var u=s.empty();if(l){var c=l(e,s);c&&Yr(e,c,i)}else(u||e.options.showCursorWhenSelecting)&&Yr(e,s.head,i);u||Zr(e,s,o)}}return r}function Yr(e,t,n){var r=Sr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(A("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=Cr(e,t,"div",null,null),l=o.right-o.left;i.style.width=(l>0?l:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function qr(e,t){return e.top-t.top||e.left-t.left}function Zr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),l=Zn(e.display),a=l.left,s=Math.max(r.sizerWidth,Qn(e)-r.sizer.offsetLeft)-l.right,u="ltr"==i.direction;function c(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?s-e:n)+"px;\n height: "+(r-t)+"px"))}function f(t,n,r){var o,l,f=tt(i,t),h=f.text.length;function d(n,r){return Cr(e,ut(t,n),"div",f,r)}function p(t,n,r){var i=Or(e,f,null,t),o="ltr"==n==("after"==r)?"left":"right",l="after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1);return d(l,o)[o]}var g=me(f,i.direction);return de(g,n||0,null==r?h:r,(function(e,t,i,f){var v="ltr"==i,m=d(e,v?"left":"right"),y=d(t-1,v?"right":"left"),b=null==n&&0==e,w=null==r&&t==h,x=0==f,C=!g||f==g.length-1;if(y.top-m.top<=3){var S=(u?b:w)&&x,k=(u?w:b)&&C,L=S?a:(v?m:y).left,T=k?s:(v?y:m).right;c(L,m.top,T-L,m.bottom)}else{var M,O,N,A;v?(M=u&&b&&x?a:m.left,O=u?s:p(e,i,"before"),N=u?a:p(t,i,"after"),A=u&&w&&C?s:y.right):(M=u?p(e,i,"before"):a,O=!u&&b&&x?s:m.right,N=!u&&w&&C?a:y.left,A=u?p(t,i,"after"):s),c(M,m.top,O-M,m.bottom),m.bottom<y.top&&c(a,m.bottom,null,y.top),c(N,y.top,A-N,y.bottom)}(!o||qr(m,o)<0)&&(o=m),qr(y,o)<0&&(o=y),(!l||qr(m,l)<0)&&(l=m),qr(y,l)<0&&(l=y)})),{start:o,end:l}}var h=t.from(),d=t.to();if(h.line==d.line)f(h.line,h.ch,d.ch);else{var p=tt(i,h.line),g=tt(i,d.line),v=nn(p)==nn(g),m=f(h.line,h.ch,v?p.text.length+1:null).end,y=f(d.line,v?0:null,d.ch).start;v&&(m.top<y.top-2?(c(m.right,m.top,null,m.bottom),c(a,y.top,y.left,y.bottom)):c(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&c(a,m.bottom,null,y.top)}n.appendChild(o)}function Jr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||ni(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Qr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ti(e))}function ei(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&ni(e))}),100)}function ti(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ce(e,"focus",e,t),e.state.focused=!0,E(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Jr(e))}function ni(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ce(e,"blur",e,t),e.state.focused=!1,M(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function ri(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,s=0;s<t.view.length;s++){var u=t.view[s],c=e.options.lineWrapping,f=void 0,h=0;if(!u.hidden){if(i+=u.line.height,l&&a<8){var d=u.node.offsetTop+u.node.offsetHeight;f=d-n,n=d}else{var p=u.node.getBoundingClientRect();f=p.bottom-p.top,!c&&u.text.firstChild&&(h=u.text.firstChild.getBoundingClientRect().right-p.left-1)}var g=u.line.height-f;if((g>.005||g<-.005)&&(i<r&&(o-=g),it(u.line,f),ii(u.line),u.rest))for(var v=0;v<u.rest.length;v++)ii(u.rest[v]);if(h>e.display.sizerWidth){var m=Math.ceil(h/Er(e.display));m>e.display.maxLineLength&&(e.display.maxLineLength=m,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ii(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function oi(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Yn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=lt(t,r),l=lt(t,i);if(n&&n.ensure){var a=n.ensure.from.line,s=n.ensure.to.line;a<o?(o=a,l=lt(t,cn(tt(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(o=lt(t,cn(tt(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function li(e,t){if(!Se(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),null!=i&&!g){var l=A("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Yn(e.display))+"px;\n height: "+(t.bottom-t.top+Jn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function ai(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?ut(t.line,t.ch+1,"before"):t,t=t.ch?ut(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=Sr(e,t),s=n&&n!=t?Sr(e,n):a;i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=ui(e,i),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=u.scrollTop&&(vi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(yi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(l=!0)),!l)break}return i}function si(e,t){var n=ui(e,t);null!=n.scrollTop&&vi(e,n.scrollTop),null!=n.scrollLeft&&yi(e,n.scrollLeft)}function ui(e,t){var n=e.display,r=Fr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=er(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+qn(n),s=t.top<r,u=t.bottom>a-r;if(t.top<i)l.scrollTop=s?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?a:t.bottom)-o);c!=i&&(l.scrollTop=c)}var f=e.options.fixedGutter?0:n.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-f,d=Qn(e)-n.gutters.offsetWidth,p=t.right-t.left>d;return p&&(t.right=t.left+d),t.left<10?l.scrollLeft=0:t.left<h?l.scrollLeft=Math.max(0,t.left+f-(p?0:10)):t.right>d+h-3&&(l.scrollLeft=t.right+(p?0:10)-d),l}function ci(e,t){null!=t&&(pi(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function fi(e){pi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function hi(e,t,n){null==t&&null==n||pi(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function di(e,t){pi(e),e.curOp.scrollToPos=t}function pi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=kr(e,t.from),r=kr(e,t.to);gi(e,n,r,t.margin)}}function gi(e,t,n,r){var i=ui(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});hi(e,i.scrollLeft,i.scrollTop)}function vi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Xi(e,{top:t}),mi(e,t,!0),n&&Xi(e),zi(e,100))}function mi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function yi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Zi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function bi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+qn(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?n:0,docHeight:r,scrollHeight:r+Jn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var wi=function(e,t,n){this.cm=n;var r=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");r.tabIndex=i.tabIndex=-1,e(r),e(i),be(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),be(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};wi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},wi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},wi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},wi.prototype.zeroWidthHack=function(){var e=b&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new V,this.disableVert=new V},wi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}e.style.visibility="",t.set(1e3,r)},wi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var xi=function(){};function Ci(e,t){t||(t=bi(e));var n=e.display.barWidth,r=e.display.barHeight;Si(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ri(e),Si(e,bi(e)),n=e.display.barWidth,r=e.display.barHeight}function Si(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}xi.prototype.update=function(){return{bottom:0,right:0}},xi.prototype.setScrollLeft=function(){},xi.prototype.setScrollTop=function(){},xi.prototype.clear=function(){};var ki={native:wi,null:xi};function Li(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ki[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),be(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?yi(e,t):vi(e,t)}),e),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)}var Ti=0;function Mi(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:++Ti,markArrays:null},Nn(e.curOp)}function Oi(e){var t=e.curOp;t&&Dn(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Ni(e)}))}function Ni(e){for(var t=e.ops,n=0;n<t.length;n++)Ai(t[n]);for(var r=0;r<t.length;r++)Di(t[r]);for(var i=0;i<t.length;i++)Wi(t[i]);for(var o=0;o<t.length;o++)Fi(t[o]);for(var l=0;l<t.length;l++)Ei(t[l])}function Ai(e){var t=e.cm,n=t.display;Ui(t),e.updateMaxLine&&hn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Gi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Di(e){e.updatedDisplay=e.mustUpdate&&ji(e.cm,e.update)}function Wi(e){var t=e.cm,n=t.display;e.updatedDisplay&&ri(t),e.barMeasure=bi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ir(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Jn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Qn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Fi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&yi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==F(I(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ci(t,e.barMeasure),e.updatedDisplay&&qi(t,e.barMeasure),e.selectionChanged&&Jr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Qr(e.cm)}function Ei(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Ki(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&mi(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&yi(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=ai(t,vt(r,e.scrollToPos.from),vt(r,e.scrollToPos.to),e.scrollToPos.margin);li(t,i)}var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||Ce(o[a],"hide");if(l)for(var s=0;s<l.length;++s)l[s].lines.length&&Ce(l[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ce(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Hi(e,t){if(e.curOp)return t();Mi(e);try{return t()}finally{Oi(e)}}function Pi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Mi(e);try{return t.apply(e,arguments)}finally{Oi(e)}}}function Ri(e){return function(){if(this.curOp)return e.apply(this,arguments);Mi(this);try{return e.apply(this,arguments)}finally{Oi(this)}}}function Ii(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Mi(t);try{return e.apply(this,arguments)}finally{Oi(t)}}}function zi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,G(Bi,e))}function Bi(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=St(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?Ze(t.mode,r.state):null,s=xt(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var u=o.styleClasses,c=s.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var f=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!f&&h<l.length;++h)f=l[h]!=o.styles[h];f&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&kt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return zi(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Hi(e,(function(){for(var t=0;t<i.length;t++)Ur(e,i[t],"text")}))}}var Gi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=oi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Qn(e),this.force=n,this.dims=Hr(e),this.events=[]};function Ui(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Jn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Jn(e)+"px",t.scrollbarsClipped=!0)}function _i(e){if(e.hasFocus())return null;var t=F(I(e));if(!t||!W(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=B(e).getSelection();r.anchorNode&&r.extend&&W(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Vi(e){if(e&&e.activeElt&&e.activeElt!=F(z(e.activeElt))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&W(document.body,e.anchorNode)&&W(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function ji(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return _r(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Kr(e))return!1;Ji(e)&&(_r(e),t.dims=Hr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),Et&&(o=ln(e.doc,o),l=an(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;jr(e,o,l),n.viewOffset=cn(tt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=Kr(e);if(!a&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=_i(e);return s>4&&(n.lineDiv.style.display="none"),$i(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Vi(u),O(n.cursorDiv),O(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,zi(e,400)),n.updateLineNumbers=null,!0}function Ki(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Qn(e))r&&(t.visible=oi(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qn(e.display)-er(e),n.top)}),t.visible=oi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ji(e,t))break;ri(e);var i=bi(e);Xr(e),Ci(e,i),qi(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 Xi(e,t){var n=new Gi(e,t);if(ji(e,n)){ri(e),Ki(e,n);var r=bi(e);Xr(e),Ci(e,r),qi(e,r),n.finish()}}function $i(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function a(t){var n=t.nextSibling;return s&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=r.view,c=r.viewFrom,f=0;f<u.length;f++){var h=u[f];if(h.hidden);else if(h.node&&h.node.parentNode==o){while(l!=h.node)l=a(l);var d=i&&null!=t&&t<=c&&h.lineNumber;h.changes&&(j(h.changes,"gutter")>-1&&(d=!1),Hn(e,h,c,n)),d&&(O(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(st(e.options,c)))),l=h.node.nextSibling}else{var p=_n(e,h,c,n);o.insertBefore(p,l)}c+=h.size}while(l)l=a(l)}function Yi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Fn(e,"gutterChanged",e)}function qi(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+Jn(e)+"px"}function Zi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Pr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=o),n[l].gutterBackground&&(n[l].gutterBackground.style.left=o));var a=n[l].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Ji(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=st(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(A("div",[A("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-l)+1,r.lineNumWidth=r.lineNumInnerWidth+l,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Yi(e.display),!0}return!1}function Qi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],l=null;if("string"!=typeof o&&(l=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:l})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function eo(e){var t=e.gutters,n=e.gutterSpecs;O(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,l=i.style,a=t.appendChild(A("div",null,"CodeMirror-gutter "+o));l&&(a.style.cssText=l),"CodeMirror-linenumbers"==o&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Yi(e)}function to(e){eo(e.display),Gr(e),Zi(e)}function no(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=D("div",null,"CodeMirror-code"),o.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=A("div",null,"CodeMirror-cursors"),o.measure=A("div",null,"CodeMirror-measure"),o.lineMeasure=A("div",null,"CodeMirror-measure"),o.lineSpace=D("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=D("div",[o.lineSpace],"CodeMirror-lines");o.mover=A("div",[u],null,"position: relative"),o.sizer=A("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=A("div",null,null,"position: absolute; height: "+K+"px; width: 1px;"),o.gutters=A("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=A("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=A("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),c&&105===f&&(o.wrapper.style.clipPath="inset(0px)"),o.wrapper.setAttribute("translate","no"),l&&a<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),s||n&&y||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Qi(i.gutters,i.lineNumbers),eo(o),r.init(o)}Gi.prototype.signal=function(e,t){Le(e,t)&&this.events.push(arguments)},Gi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ce.apply(null,this.events[e])};var ro=0,io=null;function oo(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function lo(e){var t=oo(e);return t.x*=io,t.y*=io,t}function ao(e,t){c&&102==f&&(null==e.display.chromeScrollHack?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout((function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""}),100));var r=oo(t),i=r.x,o=r.y,l=io;0===t.deltaMode&&(i=t.deltaX,o=t.deltaY,l=1);var a=e.display,u=a.scroller,d=u.scrollWidth>u.clientWidth,p=u.scrollHeight>u.clientHeight;if(i&&d||o&&p){if(o&&b&&s)e:for(var g=t.target,v=a.view;g!=u;g=g.parentNode)for(var m=0;m<v.length;m++)if(v[m].node==g){e.display.currentWheelTarget=g;break e}if(i&&!n&&!h&&null!=l)return o&&p&&vi(e,Math.max(0,u.scrollTop+o*l)),yi(e,Math.max(0,u.scrollLeft+i*l)),(!o||o&&p)&&Me(t),void(a.wheelStartX=null);if(o&&null!=l){var y=o*l,w=e.doc.scrollTop,x=w+a.wrapper.clientHeight;y<0?w=Math.max(0,w+y-50):x=Math.min(e.doc.height,x+y+50),Xi(e,{top:w,bottom:x})}ro<20&&0!==t.deltaMode&&(null==a.wheelStartX?(a.wheelStartX=u.scrollLeft,a.wheelStartY=u.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=u.scrollLeft-a.wheelStartX,t=u.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(io=(io*ro+n)/(ro+1),++ro)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}l?io=-.53:n?io=15:c?io=-.7:d&&(io=-1/3);var so=function(e,t){this.ranges=e,this.primIndex=t};so.prototype.primary=function(){return this.ranges[this.primIndex]},so.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 n=this.ranges[t],r=e.ranges[t];if(!ft(n.anchor,r.anchor)||!ft(n.head,r.head))return!1}return!0},so.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new uo(ht(this.ranges[t].anchor),ht(this.ranges[t].head));return new so(e,this.primIndex)},so.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},so.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ct(t,r.from())>=0&&ct(e,r.to())<=0)return n}return-1};var uo=function(e,t){this.anchor=e,this.head=t};function co(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return ct(e.from(),t.from())})),n=j(t,i);for(var o=1;o<t.length;o++){var l=t[o],a=t[o-1],s=ct(a.to(),l.from());if(r&&!l.empty()?s>0:s>=0){var u=pt(a.from(),l.from()),c=dt(a.to(),l.to()),f=a.empty()?l.from()==l.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new uo(f?c:u,f?u:c))}}return new so(t,n)}function fo(e,t){return new so([new uo(e,t||e)],0)}function ho(e){return e.text?ut(e.from.line+e.text.length-1,ee(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function po(e,t){if(ct(e,t.from)<0)return e;if(ct(e,t.to)<=0)return ho(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=ho(t).ch-t.to.ch),ut(n,r)}function go(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new uo(po(i.anchor,t),po(i.head,t)))}return co(e.cm,n,e.sel.primIndex)}function vo(e,t,n){return e.line==t.line?ut(n.line,e.ch-t.ch+n.ch):ut(n.line+(e.line-t.line),e.ch)}function mo(e,t,n){for(var r=[],i=ut(e.first,0),o=i,l=0;l<t.length;l++){var a=t[l],s=vo(a.from,i,o),u=vo(ho(a),i,o);if(i=a.to,o=u,"around"==n){var c=e.sel.ranges[l],f=ct(c.head,c.anchor)<0;r[l]=new uo(f?u:s,f?s:u)}else r[l]=new uo(s,s)}return new so(r,e.sel.primIndex)}function yo(e){e.doc.mode=$e(e.options,e.doc.modeOption),bo(e)}function bo(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,zi(e,100),e.state.modeGen++,e.curOp&&Gr(e)}function wo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==ee(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function xo(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){pn(e,n,i,r),Fn(e,"change",e,t)}function l(e,t){for(var n=[],o=e;o<t;++o)n.push(new dn(u[o],i(o),r));return n}var a=t.from,s=t.to,u=t.text,c=tt(e,a.line),f=tt(e,s.line),h=ee(u),d=i(u.length-1),p=s.line-a.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(wo(e,t)){var g=l(0,u.length-1);o(f,f.text,d),p&&e.remove(a.line,p),g.length&&e.insert(a.line,g)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,a.ch)+h+c.text.slice(s.ch),d);else{var v=l(1,u.length-1);v.push(new dn(h+c.text.slice(s.ch),d,r)),o(c,c.text.slice(0,a.ch)+u[0],i(0)),e.insert(a.line+1,v)}else if(1==u.length)o(c,c.text.slice(0,a.ch)+u[0]+f.text.slice(s.ch),i(0)),e.remove(a.line+1,p);else{o(c,c.text.slice(0,a.ch)+u[0],i(0)),o(f,h+f.text.slice(s.ch),d);var m=l(1,u.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,m)}Fn(e,"change",e,t)}function Co(e,t,n){function r(e,i,o){if(e.linked)for(var l=0;l<e.linked.length;++l){var a=e.linked[l];if(a.doc!=i){var s=o&&a.sharedHist;n&&!s||(t(a.doc,s),r(a.doc,e,s))}}}r(e,null,!0)}function So(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ir(e),yo(e),ko(e),e.options.direction=t.direction,e.options.lineWrapping||hn(e),e.options.mode=t.modeOption,Gr(e)}function ko(e){("rtl"==e.doc.direction?E:M)(e.display.lineDiv,"CodeMirror-rtl")}function Lo(e){Hi(e,(function(){ko(e),Gr(e)}))}function To(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Mo(e,t){var n={from:ht(t.from),to:ho(t),text:nt(e,t.from,t.to)};return Eo(e,n,t.from.line,t.to.line+1),Co(e,(function(e){return Eo(e,n,t.from.line,t.to.line+1)}),!0),n}function Oo(e){while(e.length){var t=ee(e);if(!t.ranges)break;e.pop()}}function No(e,t){return t?(Oo(e.done),ee(e.done)):e.done.length&&!ee(e.done).ranges?ee(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),ee(e.done)):void 0}function Ao(e,t,n,r){var i=e.history;i.undone.length=0;var o,l,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=No(i,i.lastOp==r)))l=ee(o.changes),0==ct(t.from,t.to)&&0==ct(t.from,l.to)?l.to=ho(t):o.changes.push(Mo(e,t));else{var s=ee(i.done);s&&s.ranges||Fo(e.sel,i.done),o={changes:[Mo(e,t)],generation:i.generation},i.done.push(o);while(i.done.length>i.undoDepth)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||Ce(e,"historyAdded")}function Do(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Wo(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Do(e,o,ee(i.done),t))?i.done[i.done.length-1]=t:Fo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Oo(i.undone)}function Fo(e,t){var n=ee(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Eo(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Ho(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Po(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Ho(n[i]));return r}function Ro(e,t){var n=Po(e,t),r=_t(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],l=r[i];if(o&&l)e:for(var a=0;a<l.length;++a){for(var s=l[a],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else l&&(n[i]=l)}return n}function Io(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?so.prototype.deepCopy.call(o):o);else{var l=o.changes,a=[];r.push({changes:a});for(var s=0;s<l.length;++s){var u=l[s],c=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(c=f.match(/^spans_(\d+)$/))&&j(t,Number(c[1]))>-1&&(ee(a)[f]=u[f],delete u[f])}}}return r}function zo(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ct(t,i)<0;o!=ct(n,i)<0?(i=t,t=n):o!=ct(t,n)<0&&(t=n)}return new uo(i,t)}return new uo(n||t,t)}function Bo(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ko(e,new so([zo(e.sel.primary(),t,n,i)],0),r)}function Go(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=zo(e.sel.ranges[o],t[o],null,i);var l=co(e.cm,r,e.sel.primIndex);Ko(e,l,n)}function Uo(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Ko(e,co(e.cm,i,e.sel.primIndex),r)}function _o(e,t,n,r){Ko(e,fo(t,n),r)}function Vo(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new uo(vt(e,t[n].anchor),vt(e,t[n].head))},origin:n&&n.origin};return Ce(e,"beforeSelectionChange",e,r),e.cm&&Ce(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?co(e.cm,r.ranges,r.ranges.length-1):t}function jo(e,t,n){var r=e.history.done,i=ee(r);i&&i.ranges?(r[r.length-1]=t,Xo(e,t,n)):Ko(e,t,n)}function Ko(e,t,n){Xo(e,t,n),Wo(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Xo(e,t,n){(Le(e,"beforeSelectionChange")||e.cm&&Le(e.cm,"beforeSelectionChange"))&&(t=Vo(e,t,n));var r=n&&n.bias||(ct(t.primary().head,e.sel.primary().head)<0?-1:1);$o(e,qo(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||fi(e.cm)}function $o(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ke(e.cm)),Fn(e,"cursorActivity",e))}function Yo(e){$o(e,qo(e,e.sel,null,!1))}function qo(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Jo(e,l.anchor,a&&a.anchor,n,r),u=l.head==l.anchor?s:Jo(e,l.head,a&&a.head,n,r);(i||s!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new uo(s,u))}return i?co(e.cm,i,t.primIndex):t}function Zo(e,t,n,r,i){var o=tt(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var a=o.markedSpans[l],s=a.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,c="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==a.from||(u?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(c?a.to>=t.ch:a.to>t.ch))){if(i&&(Ce(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!s.atomic)continue;if(n){var f=s.find(r<0?1:-1),h=void 0;if((r<0?c:u)&&(f=Qo(e,f,-r,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(h=ct(f,n))&&(r<0?h<0:h>0))return Zo(e,f,t,r,i)}var d=s.find(r<0?-1:1);return(r<0?u:c)&&(d=Qo(e,d,r,d.line==t.line?o:null)),d?Zo(e,d,t,r,i):null}}return t}function Jo(e,t,n,r,i){var o=r||1,l=Zo(e,t,n,o,i)||!i&&Zo(e,t,n,o,!0)||Zo(e,t,n,-o,i)||!i&&Zo(e,t,n,-o,!0);return l||(e.cantEdit=!0,ut(e.first,0))}function Qo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?vt(e,ut(t.line-1)):null:n>0&&t.ch==(r||tt(e,t.line)).text.length?t.line<e.first+e.size-1?ut(t.line+1,0):null:new ut(t.line,t.ch+n)}function el(e){e.setSelection(ut(e.firstLine(),0),ut(e.lastLine()),$)}function tl(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=vt(e,t)),n&&(r.to=vt(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),Ce(e,"beforeChange",e,r),e.cm&&Ce(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function nl(e,t,n){if(e.cm){if(!e.cm.curOp)return Pi(e.cm,nl)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(Le(e,"beforeChange")||e.cm&&Le(e.cm,"beforeChange"))||(t=tl(e,t,!0),t)){var r=Ft&&!n&&jt(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)rl(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else rl(e,t)}}function rl(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ct(t.from,t.to)){var n=go(e,t);Ao(e,t,n,e.cm?e.cm.curOp.id:NaN),ll(e,t,n,_t(e,t));var r=[];Co(e,(function(e,n){n||-1!=j(r,e.history)||(fl(e.history,t),r.push(e.history)),ll(e,t,null,_t(e,t))}))}}function il(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,l=e.sel,a="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,u=0;u<a.length;u++)if(i=a[u],n?i.ranges&&!i.equals(e.sel):!i.ranges)break;if(u!=a.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(i=a.pop(),!i.ranges){if(r)return void a.push(i);break}if(Fo(i,s),n&&!i.equals(e.sel))return void Ko(e,i,{clearRedo:!1});l=i}var c=[];Fo(l,s),s.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=Le(e,"beforeChange")||e.cm&&Le(e.cm,"beforeChange"),h=function(n){var r=i.changes[n];if(r.origin=t,f&&!tl(e,r,!1))return a.length=0,{};c.push(Mo(e,r));var o=n?go(e,r):ee(a);ll(e,r,o,Ro(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:ho(r)});var l=[];Co(e,(function(e,t){t||-1!=j(l,e.history)||(fl(e.history,r),l.push(e.history)),ll(e,r,null,Ro(e,r))}))},d=i.changes.length-1;d>=0;--d){var p=h(d);if(p)return p.v}}}}function ol(e,t){if(0!=t&&(e.first+=t,e.sel=new so(te(e.sel.ranges,(function(e){return new uo(ut(e.anchor.line+t,e.anchor.ch),ut(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Gr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Ur(e.cm,r,"gutter")}}function ll(e,t,n,r){if(e.cm&&!e.cm.curOp)return Pi(e.cm,ll)(e,t,n,r);if(t.to.line<e.first)ol(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);ol(e,i),t={from:ut(e.first,0),to:ut(t.to.line+i,t.to.ch),text:[ee(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ut(o,tt(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=nt(e,t.from,t.to),n||(n=go(e,t)),e.cm?al(e.cm,t,r):xo(e,t,r),Xo(e,n,$),e.cantEdit&&Jo(e,ut(e.firstLine(),0))&&(e.cantEdit=!1)}}function al(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=ot(nn(tt(r,o.line))),r.iter(s,l.line+1,(function(e){if(e==i.maxLine)return a=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ke(e),xo(r,t,n,Rr(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,(function(e){var t=fn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),Wt(r,o.line),zi(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?Gr(e):o.line!=l.line||1!=t.text.length||wo(e.doc,t)?Gr(e,o.line,l.line+1,u):Ur(e,o.line,"text");var c=Le(e,"changes"),f=Le(e,"change");if(f||c){var h={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};f&&Fn(e,"change",e,h),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function sl(e,t,n,r,i){var o;r||(r=n),ct(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),nl(e,{from:n,to:r,text:t,origin:i})}function ul(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function cl(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var a=0;a<o.ranges.length;a++)ul(o.ranges[a].anchor,t,n,r),ul(o.ranges[a].head,t,n,r)}else{for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(n<u.from.line)u.from=ut(u.from.line+r,u.from.ch),u.to=ut(u.to.line+r,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function fl(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;cl(e.done,n,r,i),cl(e.undone,n,r,i)}function hl(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=tt(e,gt(e,t)):i=ot(t),null==i?null:(r(o,i)&&e.cm&&Ur(e.cm,i,n),o)}function dl(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function pl(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}uo.prototype.from=function(){return pt(this.anchor,this.head)},uo.prototype.to=function(){return dt(this.anchor,this.head)},uo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},dl.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,gn(i),Fn(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},pl.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),l=r.height;if(r.removeInner(e,o),this.height-=l-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof dl))){var a=[];this.collapse(a),this.children=[new dl(a)],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,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,a=l;a<i.lines.length;){var s=new dl(i.lines.slice(a,a+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new pl(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=j(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new pl(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,n))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var gl=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function vl(e,t,n){cn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ci(e,n)}function ml(e,t,n,r){var i=new gl(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),hl(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!sn(e,t)){var r=cn(t)<e.scrollTop;it(t,t.height+Xn(i)),r&&ci(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&Fn(o,"lineWidgetAdded",o,i,"number"==typeof t?t:ot(t)),i}gl.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ot(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Xn(this);it(n,Math.max(0,n.height-o)),e&&(Hi(e,(function(){vl(e,n,-o),Ur(e,r,"widget")})),Fn(e,"lineWidgetCleared",e,this,r))}},gl.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Xn(this)-t;i&&(sn(this.doc,r)||it(r,r.height+i),n&&Hi(n,(function(){n.curOp.forceUpdate=!0,vl(n,r,i),Fn(n,"lineWidgetChanged",n,e,ot(r))})))},Te(gl);var yl=0,bl=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++yl};function wl(e,t,n,r,i){if(r&&r.shared)return Cl(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Pi(e.cm,wl)(e,t,n,r,i);var o=new bl(e,i),l=ct(t,n);if(r&&U(r,o,!1),l>0||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(tn(e,t.line,t,n,o)||t.line!=n.line&&tn(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Pt()}o.addToHistory&&Ao(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,s=t.line,u=e.cm;if(e.iter(s,n.line+1,(function(r){u&&o.collapsed&&!u.options.lineWrapping&&nn(r)==u.display.maxLine&&(a=!0),o.collapsed&&s!=t.line&&it(r,0),Bt(r,new Rt(o,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){sn(e,t)&&it(t,0)})),o.clearOnEnter&&be(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ht(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++yl,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)Gr(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)Ur(u,c,"text");o.atomic&&Yo(u.doc),Fn(u,"markerAdded",u,o)}return o}bl.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Mi(e),Le(this,"clear")){var n=this.find();n&&Fn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],a=It(l.markedSpans,this);e&&!this.collapsed?Ur(e,ot(l),"text"):e&&(null!=a.to&&(i=ot(l)),null!=a.from&&(r=ot(l))),l.markedSpans=zt(l.markedSpans,a),null==a.from&&this.collapsed&&!sn(this.doc,l)&&e&&it(l,Fr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=nn(this.lines[s]),c=fn(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Gr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Yo(e.doc)),e&&Fn(e,"markerCleared",e,this,r,i),t&&Oi(e),this.parent&&this.parent.clear()}},bl.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],l=It(o.markedSpans,this);if(null!=l.from&&(n=ut(t?o:ot(o),l.from),-1==e))return n;if(null!=l.to&&(r=ut(t?o:ot(o),l.to),1==e))return r}return n&&{from:n,to:r}},bl.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Hi(r,(function(){var i=t.line,o=ot(t.line),l=or(r,o);if(l&&(pr(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!sn(n.doc,i)&&null!=n.height){var a=n.height;n.height=null;var s=Xn(n)-a;s&&it(i,i.height+s)}Fn(r,"markerChanged",r,e)}))},bl.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=j(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},bl.prototype.detachLine=function(e){if(this.lines.splice(j(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Te(bl);var xl=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Cl(e,t,n,r,i){r=U(r),r.shared=!1;var o=[wl(e,t,n,r,i)],l=o[0],a=r.widgetNode;return Co(e,(function(e){a&&(r.widgetNode=a.cloneNode(!0)),o.push(wl(e,vt(e,t),vt(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;l=ee(o)})),new xl(o,l)}function Sl(e){return e.findMarks(ut(e.first,0),e.clipPos(ut(e.lastLine())),(function(e){return e.parent}))}function kl(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(ct(o,l)){var a=wl(e,o,l,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}function Ll(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Co(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==j(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}xl.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Fn(this,"clear")}},xl.prototype.find=function(e,t){return this.primary.find(e,t)},Te(xl);var Tl=0,Ml=function(e,t,n,r,i){if(!(this instanceof Ml))return new Ml(e,t,n,r,i);null==n&&(n=0),pl.call(this,[new dl([new dn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=ut(n,0);this.sel=fo(o),this.history=new To(null),this.id=++Tl,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),xo(this,{from:o,to:o,text:e}),Ko(this,fo(o),$)};Ml.prototype=ie(pl.prototype,{constructor:Ml,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},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:Ii((function(e){var t=ut(this.first,0),n=this.first+this.size-1;nl(this,{from:t,to:ut(n,tt(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&hi(this.cm,0,0),Ko(this,fo(t),$)})),replaceRange:function(e,t,n,r){t=vt(this,t),n=n?vt(this,n):t,sl(this,e,t,n,r)},getRange:function(e,t,n){var r=nt(this,vt(this,e),vt(this,t));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(at(this,e))return tt(this,e)},getLineNumber:function(e){return ot(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=tt(this,e)),nn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return vt(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||!1===e?n.to():n.from(),t},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ii((function(e,t,n){_o(this,vt(this,"number"==typeof e?ut(e,t||0):e),null,n)})),setSelection:Ii((function(e,t,n){_o(this,vt(this,e),vt(this,t||e),n)})),extendSelection:Ii((function(e,t,n){Bo(this,vt(this,e),t&&vt(this,t),n)})),extendSelections:Ii((function(e,t){Go(this,yt(this,e),t)})),extendSelectionsBy:Ii((function(e,t){var n=te(this.sel.ranges,e);Go(this,yt(this,n),t)})),setSelections:Ii((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new uo(vt(this,e[i].anchor),vt(this,e[i].head||e[i].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ko(this,co(this.cm,r,t),n)}})),addSelection:Ii((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new uo(vt(this,e),vt(this,t||e))),Ko(this,co(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=nt(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=nt(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Ii((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];r[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:n}}for(var a=t&&"end"!=t&&mo(this,r,t),s=r.length-1;s>=0;s--)nl(this,r[s]);a?jo(this,a):this.cm&&fi(this.cm)})),undo:Ii((function(){il(this,"undo")})),redo:Ii((function(){il(this,"redo")})),undoSelection:Ii((function(){il(this,"undo",!0)})),redoSelection:Ii((function(){il(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new To(this.history),Co(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Io(this.history.done),undone:Io(this.history.undone)}},setHistory:function(e){var t=this.history=new To(this.history);t.done=Io(e.done.slice(0),null,!0),t.undone=Io(e.undone.slice(0),null,!0)},setGutterMarker:Ii((function(e,t,n){return hl(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&se(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:Ii((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&hl(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,se(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!at(this,e))return null;if(t=e,e=tt(this,e),!e)return null}else if(t=ot(e),null==t)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Ii((function(e,t,n){return hl(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(L(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:Ii((function(e,t,n){return hl(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(L(n));if(!o)return!1;var l=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0}))})),addLineWidget:Ii((function(e,t,n){return ml(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return wl(this,vt(this,e),vt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=vt(this,e),wl(this,e,e,n,"bookmark")},findMarksAt:function(e){e=vt(this,e);var t=[],n=tt(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=vt(this,e),t=vt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var l=o.markedSpans;if(l)for(var a=0;a<l.length;a++){var s=l[a];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),vt(this,ut(n,t))},indexFromPos:function(e){e=vt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Ml(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,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ml(rt(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],kl(r,Sl(this)),r},unlinkDoc:function(e){if(e instanceof Ga&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ll(Sl(this));break}}if(e.history==this.history){var r=[e.id];Co(e,(function(e){return r.push(e.id)}),!0),e.history=new To(null),e.history.done=Io(this.history.done,r),e.history.undone=Io(this.history.undone,r)}},iterLinkedDocs:function(e){Co(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ie(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Ii((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Lo(this.cm))}))}),Ml.prototype.eachLine=Ml.prototype.iter;var Ol=0;function Nl(e){var t=this;if(Wl(t),!Se(t,e)&&!$n(t.display,e)){Me(e),l&&(Ol=+new Date);var n=zr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(){++a==i&&Pi(t,(function(){n=vt(t.doc,n);var e={from:n,to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};nl(t.doc,e),jo(t.doc,fo(vt(t.doc,n),vt(t.doc,ho(e))))}))()},u=function(e,n){if(t.options.allowDropFileTypes&&-1==j(t.options.allowDropFileTypes,e.type))s();else{var r=new FileReader;r.onerror=function(){return s()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),s()},r.readAsText(e)}},c=0;c<r.length;c++)u(r[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),Xo(t.doc,fo(n,n)),h)for(var d=0;d<h.length;++d)sl(t.doc,"",h[d].anchor,h[d].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(p){}}}}function Al(e,t){if(l&&(!e.state.draggingText||+new Date-Ol<100))Ae(t);else if(!Se(e,t)&&!$n(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}function Dl(e,t){var n=zr(e,t);if(n){var r=document.createDocumentFragment();Yr(e,n,r),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,r)}}function Wl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Fl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var El=!1;function Hl(){El||(Pl(),El=!0)}function Pl(){var e;be(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Fl(Rl)}),100))})),be(window,"blur",(function(){return Fl(ni)}))}function Rl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Il={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},zl=0;zl<10;zl++)Il[zl+48]=Il[zl+96]=String(zl);for(var Bl=65;Bl<=90;Bl++)Il[Bl]=String.fromCharCode(Bl);for(var Gl=1;Gl<=12;Gl++)Il[Gl+111]=Il[Gl+63235]="F"+Gl;var Ul={};function _l(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var l=0;l<o.length-1;l++){var a=o[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Vl(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=te(n.split(" "),_l),o=0;o<i.length;o++){var l=void 0,a=void 0;o==i.length-1?(a=i.join(" "),l=r):(a=i.slice(0,o+1).join(" "),l="...");var s=t[a];if(s){if(s!=l)throw new Error("Inconsistent bindings for "+a)}else t[a]=l}delete e[n]}for(var u in t)e[u]=t[u];return e}function jl(e,t,n,r){t=Yl(t);var i=t.call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return jl(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var l=jl(e,t.fallthrough[o],n,r);if(l)return l}}}function Kl(e){var t="string"==typeof e?e:Il[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Xl(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function $l(e,t){if(h&&34==e.keyCode&&e["char"])return!1;var n=Il[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Xl(n,e,t))}function Yl(e){return"string"==typeof e?Ul[e]:e}function ql(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){var o=t(n[i]);while(r.length&&ct(o.from,ee(r).to)<=0){var l=r.pop();if(ct(l.from,o.from)<0){o.from=l.from;break}}r.push(o)}Hi(e,(function(){for(var t=r.length-1;t>=0;t--)sl(e.doc,"",r[t].from,r[t].to,"+delete");fi(e)}))}function Zl(e,t,n){var r=fe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Jl(e,t,n){var r=Zl(e,t.ch,n);return null==r?null:new ut(t.line,r,n<0?"after":"before")}function Ql(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=me(n,t.doc.direction);if(o){var l,a=i<0?ee(o):o[0],s=i<0==(1==a.level),u=s?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var c=lr(t,n);l=i<0?n.text.length-1:0;var f=ar(t,c,l).top;l=he((function(e){return ar(t,c,e).top==f}),i<0==(1==a.level)?a.from:a.to-1,l),"before"==u&&(l=Zl(n,l,1))}else l=i<0?a.to:a.from;return new ut(r,l,u)}}return new ut(r,i<0?n.text.length:0,i<0?"before":"after")}function ea(e,t,n,r){var i=me(t,e.doc.direction);if(!i)return Jl(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ge(i,n.ch,n.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(r>0?l.to>n.ch:l.from<n.ch))return Jl(t,n,r);var a,s=function(e,n){return Zl(t,e instanceof ut?e.ch:e,n)},u=function(n){return e.options.lineWrapping?(a=a||lr(e,t),Or(e,t,a,n)):{begin:0,end:t.text.length}},c=u("before"==n.sticky?s(n,-1):n.ch);if("rtl"==e.doc.direction||1==l.level){var f=1==l.level==r<0,h=s(n,f?1:-1);if(null!=h&&(f?h<=l.to&&h<=c.end:h>=l.from&&h>=c.begin)){var d=f?"before":"after";return new ut(n.line,h,d)}}var p=function(e,t,r){for(var o=function(e,t){return t?new ut(n.line,s(e,1),"before"):new ut(n.line,e,"after")};e>=0&&e<i.length;e+=t){var l=i[e],a=t>0==(1!=l.level),u=a?r.begin:s(r.end,-1);if(l.from<=u&&u<l.to)return o(u,a);if(u=a?l.from:s(l.to,-1),r.begin<=u&&u<r.end)return o(u,a)}},g=p(o+r,r,c);if(g)return g;var v=r>0?c.end:s(c.begin,-1);return null==v||r>0&&v==t.text.length||(g=p(r>0?0:i.length-1,r,u(v)),!g)?null:g}Ul.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"},Ul.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"},Ul.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ul.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"]},Ul["default"]=b?Ul.macDefault:Ul.pcDefault;var ta={selectAll:el,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$)},killLine:function(e){return ql(e,(function(t){if(t.empty()){var n=tt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ut(t.head.line+1,0)}:{from:t.head,to:ut(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return ql(e,(function(t){return{from:ut(t.from().line,0),to:vt(e.doc,ut(t.to().line+1,0))}}))},delLineLeft:function(e){return ql(e,(function(e){return{from:ut(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return ql(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}}))},delWrappedLineRight:function(e){return ql(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.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(ut(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ut(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return na(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ia(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return ra(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),q)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),q)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ia(e,t.head):r}),q)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),l=_(e.getLine(o.line),o.ch,r);t.push(Q(r-l%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Hi(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=tt(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ut(i.line,i.ch-1)),i.ch>0)i=new ut(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ut(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=tt(e.doc,i.line-1).text;l&&(i=new ut(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),ut(i.line-1,l.length-1),i,"+transpose"))}n.push(new uo(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Hi(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);fi(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function na(e,t){var n=tt(e.doc,t),r=nn(n);return r!=n&&(t=ot(r)),Ql(!0,e,r,t,1)}function ra(e,t){var n=tt(e.doc,t),r=rn(n);return r!=n&&(t=ot(r)),Ql(!0,e,n,t,-1)}function ia(e,t){var n=na(e,t.line),r=tt(e.doc,n.line),i=me(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=o&&t.ch;return ut(n.line,l?0:o,n.sticky)}return n}function oa(e,t,n){if("string"==typeof t&&(t=ta[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=X}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function la(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=jl(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&jl(t,e.options.extraKeys,n,e)||jl(t,e.options.keyMap,n,e)}var aa=new V;function sa(e,t,n,r){var i=e.state.keySeq;if(i){if(Kl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:aa.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),ua(e,i+" "+t,n,r))return!0}return ua(e,t,n,r)}function ua(e,t,n,r){var i=la(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&Fn(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(Me(n),Jr(e)),!!i}function ca(e,t){var n=$l(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?sa(e,"Shift-"+n,t,(function(t){return oa(e,t,!0)}))||sa(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return oa(e,t)})):sa(e,n,t,(function(t){return oa(e,t)})))}function fa(e,t,n){return sa(e,"'"+n+"'",t,(function(t){return oa(e,t,!0)}))}var ha=null;function da(e){var t=this;if((!e.target||e.target==t.display.input.getField())&&(t.curOp.focus=F(I(t)),!Se(t,e))){l&&a<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=ca(t,e);h&&(ha=i?r:null,i||88!=r||Be||!(b?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!b&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||pa(t)}}function pa(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(M(t,"CodeMirror-crosshair"),xe(document,"keyup",n),xe(document,"mouseover",n))}E(t,"CodeMirror-crosshair"),be(document,"keyup",n),be(document,"mouseover",n)}function ga(e){16==e.keyCode&&(this.doc.sel.shift=!1),Se(this,e)}function va(e){var t=this;if((!e.target||e.target==t.display.input.getField())&&!($n(t.display,e)||Se(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(h&&n==ha)return ha=null,void Me(e);if(!h||e.which&&!(e.which<10)||!ca(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(fa(t,e,i)||t.display.input.onKeyPress(e))}}}var ma,ya,ba=400,wa=function(e,t,n){this.time=e,this.pos=t,this.button=n};function xa(e,t){var n=+new Date;return ya&&ya.compare(n,e,t)?(ma=ya=null,"triple"):ma&&ma.compare(n,e,t)?(ya=new wa(n,e,t),ma=null,"double"):(ma=new wa(n,e,t),ya=null,"single")}function Ca(e){var t=this,n=t.display;if(!(Se(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,$n(n,e))s||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Da(t,e)){var r=zr(t,e),i=We(e),o=r?xa(r,i):"single";B(t).focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&Sa(t,i,r,o,e)||(1==i?r?La(t,r,o,e):De(e)==n.scroller&&Me(e):2==i?(r&&Bo(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(k?t.display.input.onContextMenu(e):ei(t)))}}function Sa(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),o=(1==t?"Left":2==t?"Middle":"Right")+o,sa(e,Xl(o,i),i,(function(t){if("string"==typeof t&&(t=ta[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=X}finally{e.state.suppressEdits=!1}return r}))}function ka(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=w?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=b?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(b?n.altKey:n.ctrlKey)),i}function La(e,t,n,r){l?setTimeout(G(Qr,e),0):e.curOp.focus=F(I(e));var i,o=ka(e,n,r),a=e.doc.sel;e.options.dragDrop&&He&&!e.isReadOnly()&&"single"==n&&(i=a.contains(t))>-1&&(ct((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(ct(i.to(),t)>0||t.xRel<0)?Ta(e,r,t,o):Oa(e,r,t,o)}function Ta(e,t,n,r){var i=e.display,o=!1,u=Pi(e,(function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:ei(e)),xe(i.wrapper.ownerDocument,"mouseup",u),xe(i.wrapper.ownerDocument,"mousemove",c),xe(i.scroller,"dragstart",f),xe(i.scroller,"drop",u),o||(Me(t),r.addNew||Bo(e.doc,n,null,null,r.extend),s&&!d||l&&9==a?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return o=!0};s&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,be(i.wrapper.ownerDocument,"mouseup",u),be(i.wrapper.ownerDocument,"mousemove",c),be(i.scroller,"dragstart",f),be(i.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ma(e,t,n){if("char"==n)return new uo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new uo(ut(t.line,0),vt(e.doc,ut(t.line+1,0)));var r=n(e,t);return new uo(r.from,r.to)}function Oa(e,t,n,r){l&&ei(e);var i=e.display,o=e.doc;Me(t);var a,s,u=o.sel,c=u.ranges;if(r.addNew&&!r.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new uo(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new uo(n,n)),n=zr(e,t,!0,!0),s=-1;else{var f=Ma(e,n,r.unit);a=r.extend?zo(a,f.anchor,f.head,r.extend):f}r.addNew?-1==s?(s=c.length,Ko(o,co(e,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==r.unit&&!r.extend?(Ko(o,co(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Uo(o,s,a,Y):(s=0,Ko(o,new so([a],0),Y),u=o.sel);var h=n;function d(t){if(0!=ct(h,t))if(h=t,"rectangle"==r.unit){for(var i=[],l=e.options.tabSize,c=_(tt(o,n.line).text,n.ch,l),f=_(tt(o,t.line).text,t.ch,l),d=Math.min(c,f),p=Math.max(c,f),g=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));g<=v;g++){var m=tt(o,g).text,y=Z(m,d,l);d==p?i.push(new uo(ut(g,y),ut(g,y))):m.length>y&&i.push(new uo(ut(g,y),ut(g,Z(m,p,l))))}i.length||i.push(new uo(n,n)),Ko(o,co(e,u.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=a,x=Ma(e,t,r.unit),C=w.anchor;ct(x.anchor,C)>0?(b=x.head,C=pt(w.from(),x.anchor)):(b=x.anchor,C=dt(w.to(),x.head));var S=u.ranges.slice(0);S[s]=Na(e,new uo(vt(o,C),b)),Ko(o,co(e,S,s),Y)}}var p=i.wrapper.getBoundingClientRect(),g=0;function v(t){var n=++g,l=zr(e,t,!0,"rectangle"==r.unit);if(l)if(0!=ct(l,h)){e.curOp.focus=F(I(e)),d(l);var a=oi(i,o);(l.line>=a.to||l.line<a.from)&&setTimeout(Pi(e,(function(){g==n&&v(t)})),150)}else{var s=t.clientY<p.top?-20:t.clientY>p.bottom?20:0;s&&setTimeout(Pi(e,(function(){g==n&&(i.scroller.scrollTop+=s,v(t))})),50)}}function m(t){e.state.selectingText=!1,g=1/0,t&&(Me(t),i.input.focus()),xe(i.wrapper.ownerDocument,"mousemove",y),xe(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Pi(e,(function(e){0!==e.buttons&&We(e)?v(e):m(e)})),b=Pi(e,m);e.state.selectingText=b,be(i.wrapper.ownerDocument,"mousemove",y),be(i.wrapper.ownerDocument,"mouseup",b)}function Na(e,t){var n=t.anchor,r=t.head,i=tt(e.doc,n.line);if(0==ct(n,r)&&n.sticky==r.sticky)return t;var o=me(i);if(!o)return t;var l=ge(o,n.ch,n.sticky),a=o[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s,u=l+(a.from==n.ch==(1!=a.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)s=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ge(o,r.ch,r.sticky),f=c-l||(r.ch-n.ch)*(1==a.level?-1:1);s=c==u-1||c==u?f<0:f>0}var h=o[u+(s?-1:0)],d=s==(1==h.level),p=d?h.from:h.to,g=d?"after":"before";return n.ch==p&&n.sticky==g?t:new uo(new ut(n.line,p,g),r)}function Aa(e,t,n,r){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(h){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Me(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!Le(e,n))return Ne(t);o-=a.top-l.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=l.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i){var c=lt(e.doc,o),f=e.display.gutterSpecs[s];return Ce(e,n,e,c,f.className,t),Ne(t)}}}function Da(e,t){return Aa(e,t,"gutterClick",!0)}function Wa(e,t){$n(e.display,t)||Fa(e,t)||Se(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Fa(e,t){return!!Le(e,"gutterContextMenu")&&Aa(e,t,"gutterContextMenu",!1)}function Ea(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vr(e)}wa.prototype.compare=function(e,t,n){return this.time+ba>e&&0==ct(t,this.pos)&&n==this.button};var Ha={toString:function(){return"CodeMirror.Init"}},Pa={},Ra={};function Ia(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Ha&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Ha,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,yo(e)}),!0),n("indentUnit",2,yo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){bo(e),vr(e),Gr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(ut(r,o))}r++}));for(var i=n.length-1;i>=0;i--)sl(e.doc,t,n[i],ut(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ha&&e.refresh()})),n("specialCharPlaceholder",wn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ea(e),to(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Yl(t),i=n!=Ha&&Yl(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ba,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Qi(t,e.options.lineNumbers),to(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Pr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Ci(e)}),!0),n("scrollbarStyle","native",(function(e){Li(e),Ci(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Qi(e.options.gutters,t),to(e)}),!0),n("firstLineNumber",1,to,!0),n("lineNumberFormatter",(function(e){return e}),to,!0),n("showCursorWhenSelecting",!1,Xr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(ni(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,za),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Xr,!0),n("singleCursorHeightPerLine",!0,Xr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,bo,!0),n("addModeClass",!1,bo,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,bo,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function za(e,t,n){var r=n&&n!=Ha;if(!t!=!r){var i=e.display.dragFunctions,o=t?be:xe;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Ba(e){e.options.lineWrapping?(E(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(M(e.display.wrapper,"CodeMirror-wrap"),hn(e)),Ir(e),Gr(e),vr(e),setTimeout((function(){return Ci(e)}),100)}function Ga(e,t){var n=this;if(!(this instanceof Ga))return new Ga(e,t);this.options=t=t?U(t):{},U(Pa,t,!1);var r=t.value;"string"==typeof r?r=new Ml(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ga.inputStyles[t.inputStyle](this),o=this.display=new no(e,r,i,t);for(var u in o.wrapper.CodeMirror=this,Ea(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Li(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 V,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),l&&a<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Ua(this),Hl(),Mi(this),this.curOp.forceUpdate=!0,So(this,r),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&ti(n)}),20):ni(this),Ra)Ra.hasOwnProperty(u)&&Ra[u](this,t[u],Ha);Ji(this),t.finishInit&&t.finishInit(this);for(var c=0;c<_a.length;++c)_a[c](this);Oi(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Ua(e){var t=e.display;be(t.scroller,"mousedown",Pi(e,Ca)),be(t.scroller,"dblclick",l&&a<11?Pi(e,(function(t){if(!Se(e,t)){var n=zr(e,t);if(n&&!Da(e,t)&&!$n(e.display,t)){Me(t);var r=e.findWordAt(n);Bo(e.doc,r.anchor,r.head)}}})):function(t){return Se(e,t)||Me(t)}),be(t.scroller,"contextmenu",(function(t){return Wa(e,t)})),be(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Wa(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),r=t.activeTouch,r.end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function s(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}be(t.scroller,"touchstart",(function(i){if(!Se(e,i)&&!o(i)&&!Da(e,i)){t.input.ensurePolled(),clearTimeout(n);var l=+new Date;t.activeTouch={start:l,moved:!1,prev:l-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),be(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),be(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!$n(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,l=e.coordsChar(t.activeTouch,"page");o=!r.prev||s(r,r.prev)?new uo(l,l):!r.prev.prev||s(r,r.prev.prev)?e.findWordAt(l):new uo(ut(l.line,0),vt(e.doc,ut(l.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Me(n)}i()})),be(t.scroller,"touchcancel",i),be(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(vi(e,t.scroller.scrollTop),yi(e,t.scroller.scrollLeft,!0),Ce(e,"scroll",e))})),be(t.scroller,"mousewheel",(function(t){return ao(e,t)})),be(t.scroller,"DOMMouseScroll",(function(t){return ao(e,t)})),be(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){Se(e,t)||Ae(t)},over:function(t){Se(e,t)||(Dl(e,t),Ae(t))},start:function(t){return Al(e,t)},drop:Pi(e,Nl),leave:function(t){Se(e,t)||Wl(e)}};var u=t.input.getField();be(u,"keyup",(function(t){return ga.call(e,t)})),be(u,"keydown",Pi(e,da)),be(u,"keypress",Pi(e,va)),be(u,"focus",(function(t){return ti(e,t)})),be(u,"blur",(function(t){return ni(e,t)}))}Ga.defaults=Pa,Ga.optionHandlers=Ra;var _a=[];function Va(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=St(e,t).state:n="prev");var l=e.options.tabSize,a=tt(o,t),s=_(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&(u=o.mode.indent(i,a.text.slice(c.length),a.text),u==X||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?_(tt(o,t-1).text,null,l):0:"add"==n?u=s+e.options.indentUnit:"subtract"==n?u=s-e.options.indentUnit:"number"==typeof n&&(u=s+n),u=Math.max(0,u);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(u/l);d;--d)h+=l,f+="\t";if(h<u&&(f+=Q(u-h)),f!=c)return sl(o,f,ut(t,0),ut(t,c.length),"+input"),a.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p];if(g.head.line==t&&g.head.ch<c.length){var v=ut(t,c.length);Uo(o,p,new uo(v,v));break}}}Ga.defineInitHook=function(e){return _a.push(e)};var ja=null;function Ka(e){ja=e}function Xa(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var l=+new Date-200,a="paste"==i||e.state.pasteIncoming>l,s=Ie(t),u=null;if(a&&r.ranges.length>1)if(ja&&ja.text.join("\n")==t){if(r.ranges.length%ja.text.length==0){u=[];for(var c=0;c<ja.text.length;c++)u.push(o.splitLines(ja.text[c]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=te(s,(function(e){return[e]})));for(var f=e.curOp.updateInput,h=r.ranges.length-1;h>=0;h--){var d=r.ranges[h],p=d.from(),g=d.to();d.empty()&&(n&&n>0?p=ut(p.line,p.ch-n):e.state.overwrite&&!a?g=ut(g.line,Math.min(tt(o,g.line).text.length,g.ch+ee(s).length)):a&&ja&&ja.lineWise&&ja.text.join("\n")==s.join("\n")&&(p=g=ut(p.line,0)));var v={from:p,to:g,text:u?u[h%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};nl(e.doc,v),Fn(e,"inputRead",e,v)}t&&!a&&Ya(e,t),fi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function $a(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||Hi(t,(function(){return Xa(t,n,0,null,"paste")})),!0}function Ya(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){l=Va(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(tt(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Va(e,i.head.line,"smart"));l&&Fn(e,"electricInput",e,i.head.line)}}}function qa(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:ut(i,0),head:ut(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Za(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function Ja(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),v&&(e.style.border="1px solid black"),t}function Qa(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){B(this).focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Pi(this,t[e])(this,n,i),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"](Yl(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Ri((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");ne(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,Gr(this)})),removeOverlay:Ri((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Gr(this)}})),indentLine:Ri((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),at(this.doc,e)&&Va(this,e,t,n)})),indentSelection:Ri((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Va(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&fi(this));else{var o=i.from(),l=i.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var s=a;s<n;++s)Va(this,s,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[r].from().ch>0&&Uo(this.doc,r,new uo(o,u[r].to()),$)}}})),getTokenAt:function(e,t){return Ot(this,e,t)},getLineTokens:function(e,t){return Ot(this,ut(e),t,!0)},getTokenTypeAt:function(e){e=vt(this.doc,e);var t,n=Ct(this,tt(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var l=r+i>>1;if((l?n[2*l-1]:0)>=o)i=l;else{if(!(n[2*l+1]<o)){t=n[2*l+2];break}r=l+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var l=0;l<o[t].length;l++){var a=i[o[t][l]];a&&r.push(a)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var s=0;s<i._global.length;s++){var u=i._global[s];u.pred(o,this)&&-1==j(r,u.val)&&r.push(u.val)}return r},getStateAfter:function(e,t){var n=this.doc;return e=gt(n,null==e?n.first+n.size-1:e),St(this,e+1,t).state},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?vt(this.doc,e):e?r.from():r.to(),Sr(this,n,t||"page")},charCoords:function(e,t){return Cr(this,vt(this.doc,e),t||"page")},coordsChar:function(e,t){return e=xr(this,e,t||"page"),Tr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=xr(this,{top:e,left:0},t||"page").top,lt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=tt(this.doc,e)}else r=e;return wr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-cn(r):0)},defaultTextHeight:function(){return Fr(this.display)},defaultCharWidth:function(){return Er(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=Sr(this,vt(this.doc,e));var l=e.bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(l=e.bottom),a+t.offsetWidth>u&&(a=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),n&&si(this,{left:a,top:l,right:a+t.offsetWidth,bottom:l+t.offsetHeight})},triggerOnKeyDown:Ri(da),triggerOnKeyPress:Ri(va),triggerOnKeyUp:ga,triggerOnMouseDown:Ri(Ca),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:Ri((function(e){Ya(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=vt(this.doc,e),l=0;l<t;++l)if(o=es(this.doc,o,i,n,r),o.hitSide)break;return o},moveH:Ri((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?es(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),q)})),deleteH:Ri((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):ql(this,(function(n){var i=es(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var l=vt(this.doc,e),a=0;a<t;++a){var s=Sr(this,l,"div");if(null==o?o=s.left:s.left=o,l=ts(this,s,i,n),l.hitSide)break}return l},moveV:Ri((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(l){if(o)return e<0?l.from():l.to();var a=Sr(n,l.head,"div");null!=l.goalColumn&&(a.left=l.goalColumn),i.push(a.left);var s=ts(n,a,e,t);return"page"==t&&l==r.sel.primary()&&ci(n,Cr(n,s,"div").top-a.top),s}),q),i.length)for(var l=0;l<r.sel.ranges.length;l++)r.sel.ranges[l].goalColumn=i[l]})),findWordAt:function(e){var t=this.doc,n=tt(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=n.length||!r?++i:--r;var l=n.charAt(r),a=ae(l,o)?function(e){return ae(e,o)}:/\s/.test(l)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ae(e)};while(r>0&&a(n.charAt(r-1)))--r;while(i<n.length&&a(n.charAt(i)))++i}return new uo(ut(e.line,r),ut(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?E(this.display.cursorDiv,"CodeMirror-overwrite"):M(this.display.cursorDiv,"CodeMirror-overwrite"),Ce(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==F(I(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Ri((function(e,t){hi(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Jn(this)-this.display.barHeight,width:e.scrollWidth-Jn(this)-this.display.barWidth,clientHeight:er(this),clientWidth:Qn(this)}},scrollIntoView:Ri((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:ut(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?di(this,e):gi(this,e.from,e.to,e.margin)})),setSize:Ri((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&gr(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){Ur(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,Ce(this,"refresh",this)})),operation:function(e){return Hi(this,e)},startOperation:function(){return Mi(this)},endOperation:function(){return Oi(this)},refresh:Ri((function(){var e=this.display.cachedTextHeight;Gr(this),this.curOp.forceUpdate=!0,vr(this),hi(this,this.doc.scrollLeft,this.doc.scrollTop),Yi(this.display),(null==e||Math.abs(e-Fr(this.display))>.5||this.options.lineWrapping)&&Ir(this),Ce(this,"refresh",this)})),swapDoc:Ri((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),So(this,e),vr(this),this.display.input.reset(),hi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Fn(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}},Te(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function es(e,t,n,r,i){var o=t,l=n,a=tt(e,t.line),s=i&&"rtl"==e.direction?-n:n;function u(){var n=t.line+s;return!(n<e.first||n>=e.first+e.size)&&(t=new ut(n,t.ch,t.sticky),a=tt(e,n))}function c(o){var l;if("codepoint"==r){var c=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(c))l=null;else{var f=n>0?c>=55296&&c<56320:c>=56320&&c<57343;l=new ut(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(f?2:1))),-n)}}else l=i?ea(e.cm,a,t,n):Jl(a,t,n);if(null==l){if(o||!u())return!1;t=Ql(i,e.cm,a,t.line,s)}else t=l;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var f=null,h="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;;p=!1){if(n<0&&!c(!p))break;var g=a.text.charAt(t.ch)||"\n",v=ae(g,d)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||p||v||(v="s"),f&&f!=v){n<0&&(n=1,c(),t.sticky="after");break}if(v&&(f=v),n>0&&!c(!p))break}var m=Jo(e,t,o,l,!0);return ft(o,m)&&(m.hitSide=!0),m}function ts(e,t,n,r){var i,o,l=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,B(e).innerHeight||l(e).documentElement.clientHeight),u=Math.max(s-.5*Fr(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){if(o=Tr(e,a,i),!o.outside)break;if(n<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*n}return o}var ns=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function rs(e,t){var n=or(e,t.line);if(!n||n.hidden)return null;var r=tt(e.doc,t.line),i=nr(n,r,t.line),o=me(r,e.doc.direction),l="left";if(o){var a=ge(o,t.ch);l=a%2?"right":"left"}var s=cr(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function is(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function os(e,t){return t&&(e.bad=!0),e}function ls(e,t,n,r,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(e){return function(t){return t.id==e}}function c(){l&&(o+=a,s&&(o+=a),l=s=!1)}function f(e){e&&(c(),o+=e)}function h(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void f(n);var o,d=t.getAttribute("cm-marker");if(d){var p=e.findMarks(ut(r,0),ut(i+1,0),u(+d));return void(p.length&&(o=p[0].find(0))&&f(nt(e.doc,o.from,o.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;g&&c();for(var v=0;v<t.childNodes.length;v++)h(t.childNodes[v]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),g&&(l=!0)}else 3==t.nodeType&&f(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;;){if(h(t),t==n)break;t=t.nextSibling,s=!1}return o}function as(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return os(e.clipPos(ut(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return ss(o,t,n)}}function ss(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!W(r,t))return os(ut(ot(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?ee(e.rest):e.line;return os(ut(ot(o),o.text.length),i)}var l=3==t.nodeType?t:null,a=t;l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));while(a.parentNode!=r)a=a.parentNode;var s=e.measure,u=s.maps;function c(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?s.map:u[i],l=0;l<o.length;l+=3){var a=o[l+2];if(a==t||a==n){var c=ot(i<0?e.line:e.rest[i]),f=o[l]+r;return(r<0||a!=t)&&(f=o[l+(r?1:0)]),ut(c,f)}}}var f=c(l,a,n);if(f)return os(f,i);for(var h=a.nextSibling,d=l?l.nodeValue.length-n:0;h;h=h.nextSibling){if(f=c(h,h.firstChild,0),f)return os(ut(f.line,f.ch-d),i);d+=h.textContent.length}for(var p=a.previousSibling,g=n;p;p=p.previousSibling){if(f=c(p,p.firstChild,-1),f)return os(ut(f.line,f.ch+g),i);g+=p.textContent.length}}ns.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function l(e){if(o(e)&&!Se(r,e)){if(r.somethingSelected())Ka({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=qa(r);Ka({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,$),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var l=ja.text.join("\n");if(e.clipboardData.setData("Text",l),e.clipboardData.getData("Text")==l)return void e.preventDefault()}var a=Ja(),s=a.firstChild;Za(s),r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=ja.text.join("\n");var u=F(z(i));P(s),setTimeout((function(){r.display.lineSpace.removeChild(a),u.focus(),u==i&&n.showPrimarySelection()}),50)}}i.contentEditable=!0,Za(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),be(i,"paste",(function(e){!o(e)||Se(r,e)||$a(e,r)||a<=11&&setTimeout(Pi(r,(function(){return t.updateFromDOM()})),20)})),be(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),be(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),be(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),be(i,"touchstart",(function(){return n.forceCompositionEnd()})),be(i,"input",(function(){t.composing||t.readFromDOMSoon()})),be(i,"copy",l),be(i,"cut",l)},ns.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ns.prototype.prepareSelection=function(){var e=$r(this.cm,!1);return e.focus=F(z(this.div))==this.div,e},ns.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ns.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ns.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var l=as(t,e.anchorNode,e.anchorOffset),a=as(t,e.focusNode,e.focusOffset);if(!l||l.bad||!a||a.bad||0!=ct(pt(l,a),i)||0!=ct(dt(l,a),o)){var s=t.display.view,u=i.line>=t.display.viewFrom&&rs(t,i)||{node:s[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&rs(t,o);if(!c){var f=s[s.length-1].measure,h=f.maps?f.maps[f.maps.length-1]:f.map;c={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(u&&c){var d,p=e.rangeCount&&e.getRangeAt(0);try{d=T(u.node,u.offset,c.offset,c.node)}catch(g){}d&&(!n&&t.state.focused?(e.collapse(u.node,u.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},ns.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)},ns.prototype.showMultipleSelections=function(e){N(this.cm.display.cursorDiv,e.cursors),N(this.cm.display.selectionDiv,e.selection)},ns.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ns.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return W(this.div,t)},ns.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&F(z(this.div))==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},ns.prototype.blur=function(){this.div.blur()},ns.prototype.getField=function(){return this.div},ns.prototype.supportsTouch=function(){return!0},ns.prototype.receivedFocus=function(){var e=this,t=this;function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.selectionInEditor()?setTimeout((function(){return e.pollSelection()}),20):Hi(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,n)},ns.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ns.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(m&&c&&this.cm.display.gutterSpecs.length&&is(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=as(t,e.anchorNode,e.anchorOffset),r=as(t,e.focusNode,e.focusOffset);n&&r&&Hi(t,(function(){Ko(t.doc,fo(n,r),$),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},ns.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),l=o.from(),a=o.to();if(0==l.ch&&l.line>r.firstLine()&&(l=ut(l.line-1,tt(r.doc,l.line-1).length)),a.ch==tt(r.doc,a.line).text.length&&a.line<r.lastLine()&&(a=ut(a.line+1,0)),l.line<i.viewFrom||a.line>i.viewTo-1)return!1;l.line==i.viewFrom||0==(e=Br(r,l.line))?(t=ot(i.view[0].line),n=i.view[0].node):(t=ot(i.view[e].line),n=i.view[e-1].node.nextSibling);var s,u,c=Br(r,a.line);if(c==i.view.length-1?(s=i.viewTo-1,u=i.lineDiv.lastChild):(s=ot(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;var f=r.doc.splitLines(ls(r,n,u,t,s)),h=nt(r.doc,ut(t,0),ut(s,tt(r.doc,s).text.length));while(f.length>1&&h.length>1)if(ee(f)==ee(h))f.pop(),h.pop(),s--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),t++}var d=0,p=0,g=f[0],v=h[0],m=Math.min(g.length,v.length);while(d<m&&g.charCodeAt(d)==v.charCodeAt(d))++d;var y=ee(f),b=ee(h),w=Math.min(y.length-(1==f.length?d:0),b.length-(1==h.length?d:0));while(p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1))++p;if(1==f.length&&1==h.length&&t==l.line)while(d&&d>l.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1))d--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var x=ut(t,d),C=ut(s,h.length?ee(h).length-p:0);return f.length>1||f[0]||ct(x,C)?(sl(r.doc,f,x,C,"+input"),!0):void 0},ns.prototype.ensurePolled=function(){this.forceCompositionEnd()},ns.prototype.reset=function(){this.forceCompositionEnd()},ns.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ns.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))},ns.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Hi(this.cm,(function(){return Gr(e.cm)}))},ns.prototype.setUneditable=function(e){e.contentEditable="false"},ns.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Pi(this.cm,Xa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},ns.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},ns.prototype.onContextMenu=function(){},ns.prototype.resetPosition=function(){},ns.prototype.needsContentAttribute=!0;var us=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null,this.resetting=!1};function cs(e,t){if(t=t?U(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=F(z(e));t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(be(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch(s){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(xe(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var a=Ga((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a}function fs(e){e.off=xe,e.on=be,e.wheelEventPixels=lo,e.Doc=Ml,e.splitLines=Ie,e.countColumn=_,e.findColumn=Z,e.isWordChar=le,e.Pass=X,e.signal=Ce,e.Line=dn,e.changeEnd=ho,e.scrollbarModel=ki,e.Pos=ut,e.cmpPos=ct,e.modes=_e,e.mimeModes=Ve,e.resolveMode=Xe,e.getMode=$e,e.modeExtensions=Ye,e.extendMode=qe,e.copyState=Ze,e.startState=Qe,e.innerMode=Je,e.commands=ta,e.keyMap=Ul,e.keyName=$l,e.isModifierKey=Kl,e.lookupKey=jl,e.normalizeKeyMap=Vl,e.StringStream=et,e.SharedTextMarker=xl,e.TextMarker=bl,e.LineWidget=gl,e.e_preventDefault=Me,e.e_stopPropagation=Oe,e.e_stop=Ae,e.addClass=E,e.contains=W,e.rmClass=M,e.keyNames=Il}us.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!Se(r,e)){if(r.somethingSelected())Ka({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=qa(r);Ka({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,$):(n.prevInput="",i.value=t.text.join("\n"),P(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),v&&(i.style.width="0px"),be(i,"input",(function(){l&&a>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),be(i,"paste",(function(e){Se(r,e)||$a(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),be(i,"cut",o),be(i,"copy",o),be(e.scroller,"paste",(function(t){if(!$n(e,t)&&!Se(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),be(e.lineSpace,"selectstart",(function(t){$n(e,t)||Me(t)})),be(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),be(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},us.prototype.createField=function(e){this.wrapper=Ja(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Za(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},us.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},us.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=$r(e);if(e.options.moveInputWithCursor){var i=Sr(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},us.prototype.showSelection=function(e){var t=this.cm,n=t.display;N(n.cursorDiv,e.cursors),N(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},us.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&P(this.textarea),l&&a>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",l&&a>=9&&(this.hasSelection=null));this.resetting=!1}},us.prototype.getField=function(){return this.textarea},us.prototype.supportsTouch=function(){return!1},us.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||F(z(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},us.prototype.blur=function(){this.textarea.blur()},us.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},us.prototype.receivedFocus=function(){this.slowPoll()},us.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},us.prototype.fastPoll=function(){var e=!1,t=this;function n(){var r=t.poll();r||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},us.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||ze(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(l&&a>=9&&this.hasSelection===i||b&&/[\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||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}var s=0,u=Math.min(r.length,i.length);while(s<u&&r.charCodeAt(s)==i.charCodeAt(s))++s;return Hi(t,(function(){Xa(t,i.slice(s),r.length-s,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.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},us.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},us.prototype.onKeyPress=function(){l&&a>=9&&(this.hasSelection=null),this.fastPoll()},us.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=zr(n,e),u=r.scroller.scrollTop;if(o&&!h){var c=n.options.resetSelectionOnContextMenu;c&&-1==n.doc.sel.contains(o)&&Pi(n,Ko)(n.doc,fo(o),$);var f,d=i.style.cssText,p=t.wrapper.style.cssText,g=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-g.top-5)+"px; left: "+(e.clientX-g.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(f=i.ownerDocument.defaultView.scrollY),r.input.focus(),s&&i.ownerDocument.defaultView.scrollTo(null,f),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),l&&a>=9&&m(),k){Ae(e);var v=function(){xe(window,"mouseup",v),setTimeout(y,20)};be(window,"mouseup",v)}else setTimeout(y,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=d,l&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!l||l&&a<9)&&m();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?Pi(n,el)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},us.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},us.prototype.setUneditable=function(){},us.prototype.needsContentAttribute=!1,Ia(Ga),Qa(Ga);var hs="iter insert remove copy getEditor constructor".split(" ");for(var ds in Ml.prototype)Ml.prototype.hasOwnProperty(ds)&&j(hs,ds)<0&&(Ga.prototype[ds]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ml.prototype[ds]));return Te(Ml),Ga.inputStyles={textarea:us,contenteditable:ns},Ga.defineMode=function(e){Ga.defaults.mode||"null"==e||(Ga.defaults.mode=e),je.apply(this,arguments)},Ga.defineMIME=Ke,Ga.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ga.defineMIME("text/plain","null"),Ga.defineExtension=function(e,t){Ga.prototype[e]=t},Ga.defineDocExtension=function(e,t){Ml.prototype[e]=t},Ga.fromTextArea=cs,fs(Ga),Ga.version="5.65.20",Ga}))},"577e":function(e,t,n){"use strict";var r=n("f5df"),i=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},"697e":function(e,t,n){},8822:function(e,t,n){(function(e){e(n("56b3"))})((function(e){"use strict";var t="CodeMirror-lint-markers",n="CodeMirror-lint-line-";function r(t,n,r){var i=document.createElement("div");function o(t){if(!i.parentNode)return e.off(document,"mousemove",o);var n=Math.max(0,t.clientY-i.offsetHeight-5),r=Math.max(0,Math.min(t.clientX+5,i.ownerDocument.defaultView.innerWidth-i.offsetWidth));i.style.top=n+"px",i.style.left=r+"px"}return i.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme,i.appendChild(r.cloneNode(!0)),t.state.lint.options.selfContain?t.getWrapperElement().appendChild(i):document.body.appendChild(i),e.on(document,"mousemove",o),o(n),null!=i.style.opacity&&(i.style.opacity=1),i}function i(e){e.parentNode&&e.parentNode.removeChild(e)}function o(e){e.parentNode&&(null==e.style.opacity&&i(e),e.style.opacity=0,setTimeout((function(){i(e)}),600))}function l(t,n,i,l){var a=r(t,n,i);function s(){e.off(l,"mouseout",s),a&&(o(a),a=null)}var u=setInterval((function(){if(a)for(var e=l;;e=e.parentNode){if(e&&11==e.nodeType&&(e=e.host),e==document.body)return;if(!e){s();break}}if(!a)return clearInterval(u)}),400);e.on(l,"mouseout",s)}function a(e,t,n){for(var r in this.marked=[],t instanceof Function&&(t={getAnnotations:t}),t&&!0!==t||(t={}),this.options={},this.linterOptions=t.options||{},s)this.options[r]=s[r];for(var r in t)s.hasOwnProperty(r)?null!=t[r]&&(this.options[r]=t[r]):t.options||(this.linterOptions[r]=t[r]);this.timeout=null,this.hasGutter=n,this.onMouseOver=function(t){w(e,t)},this.waitingFor=0}var s={highlightLines:!1,tooltips:!0,delay:500,lintOnChange:!0,getAnnotations:null,async:!1,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function u(e){var n=e.state.lint;n.hasGutter&&e.clearGutter(t),n.options.highlightLines&&c(e);for(var r=0;r<n.marked.length;++r)n.marked[r].clear();n.marked.length=0}function c(e){e.eachLine((function(t){var n=t.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(t.wrapClass);n&&e.removeLineClass(t,"wrap",n[0])}))}function f(t,n,r,i,o){var a=document.createElement("div"),s=a;return a.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+r,i&&(s=a.appendChild(document.createElement("div")),s.className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"),0!=o&&e.on(s,"mouseover",(function(e){l(t,e,n,s)})),a}function h(e,t){return"error"==e?e:t}function d(e){for(var t=[],n=0;n<e.length;++n){var r=e[n],i=r.from.line;(t[i]||(t[i]=[])).push(r)}return t}function p(e){var t=e.severity;t||(t="error");var n=document.createElement("div");return n.className="CodeMirror-lint-message CodeMirror-lint-message-"+t,"undefined"!=typeof e.messageHTML?n.innerHTML=e.messageHTML:n.appendChild(document.createTextNode(e.message)),n}function g(t,n){var r=t.state.lint,i=++r.waitingFor;function o(){i=-1,t.off("change",o)}t.on("change",o),n(t.getValue(),(function(n,l){t.off("change",o),r.waitingFor==i&&(l&&n instanceof e&&(n=l),t.operation((function(){m(t,n)})))}),r.linterOptions,t)}function v(t){var n=t.state.lint;if(n){var r=n.options,i=r.getAnnotations||t.getHelper(e.Pos(0,0),"lint");if(i)if(r.async||i.async)g(t,i);else{var o=i(t.getValue(),n.linterOptions,t);if(!o)return;o.then?o.then((function(e){t.operation((function(){m(t,e)}))})):t.operation((function(){m(t,o)}))}}}function m(e,r){var i=e.state.lint;if(i){var o=i.options;u(e);for(var l=d(r),a=0;a<l.length;++a){var s=l[a];if(s){for(var c=null,g=i.hasGutter&&document.createDocumentFragment(),v=0;v<s.length;++v){var m=s[v],y=m.severity;y||(y="error"),c=h(c,y),o.formatAnnotation&&(m=o.formatAnnotation(m)),i.hasGutter&&g.appendChild(p(m)),m.to&&i.marked.push(e.markText(m.from,m.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+y,__annotation:m}))}i.hasGutter&&e.setGutterMarker(a,t,f(e,g,c,s.length>1,o.tooltips)),o.highlightLines&&e.addLineClass(a,"wrap",n+c)}}o.onUpdateLinting&&o.onUpdateLinting(r,l,e)}}function y(e){var t=e.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){v(e)}),t.options.delay))}function b(e,t,n){for(var r=n.target||n.srcElement,i=document.createDocumentFragment(),o=0;o<t.length;o++){var a=t[o];i.appendChild(p(a))}l(e,n,i,r)}function w(e,t){var n=t.target||t.srcElement;if(/\bCodeMirror-lint-mark-/.test(n.className)){for(var r=n.getBoundingClientRect(),i=(r.left+r.right)/2,o=(r.top+r.bottom)/2,l=e.findMarksAt(e.coordsChar({left:i,top:o},"client")),a=[],s=0;s<l.length;++s){var u=l[s].__annotation;u&&a.push(u)}a.length&&b(e,a,t)}}e.defineOption("lint",!1,(function(n,r,i){if(i&&i!=e.Init&&(u(n),!1!==n.state.lint.options.lintOnChange&&n.off("change",y),e.off(n.getWrapperElement(),"mouseover",n.state.lint.onMouseOver),clearTimeout(n.state.lint.timeout),delete n.state.lint),r){for(var o=n.getOption("gutters"),l=!1,s=0;s<o.length;++s)o[s]==t&&(l=!0);var c=n.state.lint=new a(n,r,l);c.options.lintOnChange&&n.on("change",y),0!=c.options.tooltips&&"gutter"!=c.options.tooltips&&e.on(n.getWrapperElement(),"mouseover",c.onMouseOver),v(n)}})),e.defineExtension("performLint",(function(){v(this)}))}))},"8f94":function(e,t,n){!function(t,r){e.exports=r(n("56b3"))}(0,(function(e){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=3)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=window.CodeMirror||i.default;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),r=1;r<arguments.length;r++){var i=arguments[r];if(null!=i)for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},writable:!0,configurable:!0}),t.default={name:"codemirror",data:function(){return{content:"",codemirror:null,cminstance:null}},props:{code:String,value:String,marker:Function,unseenLines:Array,name:{type:String,default:"codemirror"},placeholder:{type:String,default:""},merge:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},events:{type:Array,default:function(){return[]}},globalOptions:{type:Object,default:function(){return{}}},globalEvents:{type:Array,default:function(){return[]}}},watch:{options:{deep:!0,handler:function(e){for(var t in e)this.cminstance.setOption(t,e[t])}},merge:function(){this.$nextTick(this.switchMerge)},code:function(e){this.handerCodeChange(e)},value:function(e){this.handerCodeChange(e)}},methods:{initialize:function(){var e=this,t=Object.assign({},this.globalOptions,this.options);this.merge?(this.codemirror=o.MergeView(this.$refs.mergeview,t),this.cminstance=this.codemirror.edit):(this.codemirror=o.fromTextArea(this.$refs.textarea,t),this.cminstance=this.codemirror,this.cminstance.setValue(this.code||this.value||this.content)),this.cminstance.on("change",(function(t){e.content=t.getValue(),e.$emit&&e.$emit("input",e.content)}));var n={};["scroll","changes","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"].concat(this.events).concat(this.globalEvents).filter((function(e){return!n[e]&&(n[e]=!0)})).forEach((function(t){e.cminstance.on(t,(function(){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];e.$emit.apply(e,[t].concat(r));var o=t.replace(/([A-Z])/g,"-$1").toLowerCase();o!==t&&e.$emit.apply(e,[o].concat(r))}))})),this.$emit("ready",this.codemirror),this.unseenLineMarkers(),this.refresh()},refresh:function(){var e=this;this.$nextTick((function(){e.cminstance.refresh()}))},destroy:function(){var e=this.cminstance.doc.cm.getWrapperElement();e&&e.remove&&e.remove()},handerCodeChange:function(e){if(e!==this.cminstance.getValue()){var t=this.cminstance.getScrollInfo();this.cminstance.setValue(e),this.content=e,this.cminstance.scrollTo(t.left,t.top)}this.unseenLineMarkers()},unseenLineMarkers:function(){var e=this;void 0!==this.unseenLines&&void 0!==this.marker&&this.unseenLines.forEach((function(t){var n=e.cminstance.lineInfo(t);e.cminstance.setGutterMarker(t,"breakpoints",n.gutterMarkers?null:e.marker())}))},switchMerge:function(){var e=this.cminstance.doc.history,t=this.cminstance.doc.cleanGeneration;this.options.value=this.cminstance.getValue(),this.destroy(),this.initialize(),this.cminstance.doc.history=e,this.cminstance.doc.cleanGeneration=t}},mounted:function(){this.initialize()},beforeDestroy:function(){this.destroy()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n.n(r);for(var o in r)["default","default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var l=n(5),a=n(4),s=a(i.a,l.a,!1,null,null,null);t.default=s.exports},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.install=t.codemirror=t.CodeMirror=void 0;var i=n(0),o=r(i),l=n(2),a=r(l),s=window.CodeMirror||o.default,u=function(e,t){t&&(t.options&&(a.default.props.globalOptions.default=function(){return t.options}),t.events&&(a.default.props.globalEvents.default=function(){return t.events})),e.component(a.default.name,a.default)},c={CodeMirror:s,codemirror:a.default,install:u};t.default=c,t.CodeMirror=s,t.codemirror=a.default,t.install=u},function(e,t){e.exports=function(e,t,n,r,i,o){var l,a=e=e||{},s=typeof e.default;"object"!==s&&"function"!==s||(l=e,a=e.default);var u,c="function"==typeof a?a.options:a;if(t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),i&&(c._scopeId=i),o?(u=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},c._ssrRegister=u):r&&(u=r),u){var f=c.functional,h=f?c.render:c.beforeCreate;f?(c._injectStyles=u,c.render=function(e,t){return u.call(t),h(e,t)}):c.beforeCreate=h?[].concat(h,u):[u]}return{esModule:l,exports:a,options:c}}},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vue-codemirror",class:{merge:e.merge}},[e.merge?n("div",{ref:"mergeview"}):n("textarea",{ref:"textarea",attrs:{name:e.name,placeholder:e.placeholder}})])},i=[],o={render:r,staticRenderFns:i};t.a=o}])}))},"9a1f":function(e,t,n){"use strict";var r=n("c65b"),i=n("59ed"),o=n("825a"),l=n("0d51"),a=n("35a1"),s=TypeError;e.exports=function(e,t){var n=arguments.length<2?a(e):t;if(i(n))return o(r(n,e));throw new s(l(e)+" is not iterable")}},a7be:function(e,t,n){},cbc8:function(e,t,n){(function(e){e(n("56b3"),n("4895"))})((function(e){"use strict";e.defineOption("foldGutter",!1,(function(t,i,o){o&&o!=e.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",u),t.off("changes",f),t.off("viewportChange",h),t.off("fold",d),t.off("unfold",d),t.off("swapDoc",f),t.off("optionChange",c)),i&&(t.state.foldGutter=new n(r(i)),s(t),t.on("gutterClick",u),t.on("changes",f),t.on("viewportChange",h),t.on("fold",d),t.on("unfold",d),t.on("swapDoc",f),t.on("optionChange",c))}));var t=e.Pos;function n(e){this.options=e,this.from=this.to=0}function r(e){return!0===e&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function i(e,n){for(var r=e.findMarks(t(n,0),t(n+1,0)),i=0;i<r.length;++i)if(r[i].__isFold){var o=r[i].find(-1);if(o&&o.line===n)return r[i]}}function o(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function l(e,n,r){var l=e.state.foldGutter.options,s=n-1,u=e.foldOption(l,"minFoldSize"),c=e.foldOption(l,"rangeFinder"),f="string"==typeof l.indicatorFolded&&a(l.indicatorFolded),h="string"==typeof l.indicatorOpen&&a(l.indicatorOpen);e.eachLine(n,r,(function(n){++s;var r=null,a=n.gutterMarkers;if(a&&(a=a[l.gutter]),i(e,s)){if(f&&a&&f.test(a.className))return;r=o(l.indicatorFolded)}else{var d=t(s,0),p=c&&c(e,d);if(p&&p.to.line-p.from.line>=u){if(h&&a&&h.test(a.className))return;r=o(l.indicatorOpen)}}(r||a)&&e.setGutterMarker(n,l.gutter,r)}))}function a(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function s(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation((function(){l(e,t.from,t.to)})),n.from=t.from,n.to=t.to)}function u(e,n,r){var o=e.state.foldGutter;if(o){var l=o.options;if(r==l.gutter){var a=i(e,n);a?a.clear():e.foldCode(t(n,0),l)}}}function c(e,t){"mode"==t&&f(e)}function f(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){s(e)}),n.foldOnChangeTimeSpan||600)}}function h(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?s(e):e.operation((function(){n.from<t.from&&(l(e,n.from,t.from),t.from=n.from),n.to>t.to&&(l(e,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function d(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r<n.to&&l(e,r,r+1)}}}))},d8c0:function(e,t,n){"use strict";n("14d9");var r=n("bc3a"),i=n.n(r),o=n("5c96"),l=n("0428"),a=(n("e43c"),n("a18c")),s=i.a.create({timeout:1e4,baseURL:l["b"],headers:{"X-Custom-Header":"foobar"}});s.interceptors.request.use(e=>(e.headers["hadLoading"],"get"==e.method&&(e.params?e.params["_t"]=(new Date).getTime():e.params={}),e.headers.sessionId=sessionStorage.getItem("access_token")||"",e),e=>Promise.reject(e)),s.interceptors.response.use(e=>{const t=e.data;return t instanceof Blob?e:-1==t.code?(localStorage.removeItem("access_token"),o["Message"].closeAll(),Object(o["Message"])({message:t.msg||t.message||"系统出错",type:"error",duration:1e3,onClose:function(){a["a"].push("/")}}),t):-5==t.code||-25==t.code?(o["Message"].closeAll(),o["Message"].error({message:t.msg})):t},e=>(o["Message"].closeAll(),Object(o["Message"])({message:"网络超时,请稍后重试",type:"error"}),Promise.reject(e))),t["a"]=s},e95a:function(e,t,n){"use strict";var r=n("b622"),i=n("3f8c"),o=r("iterator"),l=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||l[o]===e)}},f5df:function(e,t,n){"use strict";var r=n("00ee"),i=n("1626"),o=n("c6b6"),l=n("b622"),a=l("toStringTag"),s=Object,u="Arguments"===o(function(){return arguments}()),c=function(e,t){try{return e[t]}catch(n){}};e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=c(t=s(e),a))?n:u?o(t):"Object"===(r=o(t))&&i(t.callee)?"Arguments":r}}}]);
|
||
//# sourceMappingURL=chunk-fb153a9a.260d4091.js.map
|