UNPKG

@nodefony/monitoring-bundle

Version:
1 lines 192 kB
"use strict";(self["webpackChunk_nodefony_monitoring_bundle"]=self["webpackChunk_nodefony_monitoring_bundle"]||[]).push([[3277],{50090:function(e,t,r){r.d(t,{g:function(){return n},r:function(){return l}});"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:"undefined"!==typeof self&&self;function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var i,o={exports:{}};function l(){return i||(i=1,function(e){(function(t,r){e.exports=r()})(0,(function(){var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=n||i||o,a=l&&(n?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),u=s&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),f=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=h&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=f&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,s=!0);var C=y&&(u||f&&(null==x||x<12.11)),k=r||l&&a>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,T=function(e,t){var r=e.className,n=S(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function M(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return M(e).appendChild(t)}function A(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function O(e,t,r,n){var i=A(e,t,r,n);return i.setAttribute("role","presentation"),i}function D(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function W(){var e;try{e=document.activeElement}catch(t){e=document.body||null}while(e&&e.shadowRoot&&e.shadowRoot.activeElement)e=e.shadowRoot.activeElement;return e}function H(e,t){var r=e.className;S(t).test(r)||(e.className+=(r?" ":"")+t)}function E(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!S(r[n]).test(t)&&(t+=" "+r[n]);return t}L=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var F=function(e){e.select()};function P(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function z(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=n||0,l=i||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=r-l%r,o=a+1}}g?F=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(F=function(e){try{e.select()}catch(t){}});var R=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};function B(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}R.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},R.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var j=50,V={toString:function(){return"CodeMirror.Pass"}},G={scroll:!1},U={origin:"*mouse"},K={origin:"+move"};function _(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}var X=[""];function $(e){while(X.length<=e)X.push(Y(X)+" ");return X[e]}function Y(e){return e[e.length-1]}function q(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Z(e,t,r){var n=0,i=r(t);while(n<e.length&&r(e[n])<=i)n++;e.splice(n,0,t)}function Q(){}function J(e,t){var r;return Object.create?r=Object.create(e):(Q.prototype=e,r=new Q),t&&I(t,r),r}var ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function te(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function re(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\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 oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function le(e,t,r){while((r<0?t>0:t<e.length)&&oe(e.charAt(t)))t+=r;return t}function ae(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function se(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}var ue=null;function ce(e,t,r){var n;ue=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:ue=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:ue=i)}return null!=n?n:ue}var fe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(r){return r<=247?e.charAt(r):1424<=r&&r<=1524?"R":1536<=r&&r<=1785?t.charAt(r-1536):1774<=r&&r<=2220?"r":8192<=r&&r<=8203?"w":8204==r?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(e,t,r){this.level=e,this.from=t,this.to=r}return function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!n.test(e))return!1;for(var c=e.length,f=[],h=0;h<c;++h)f.push(r(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 k=f[C];if(","==k)f[C]="N";else if("%"==k){var S=void 0;for(S=C+1;S<c&&"%"==f[S];++S);for(var L=C&&"!"==f[C-1]||S<c&&"1"==f[S]?"1":"N",T=C;T<S;++T)f[T]=L;C=S-1}}for(var M=0,N=u;M<c;++M){var A=f[M];"L"==N&&"1"==A?f[M]="L":o.test(A)&&(N=A)}for(var O=0;O<c;++O)if(i.test(f[O])){var D=void 0;for(D=O+1;D<c&&i.test(f[D]);++D);for(var W="L"==(O?f[O-1]:u),H="L"==(D<c?f[D]:u),E=W==H?W?"L":"R":u,F=O;F<D;++F)f[F]=E;O=D-1}for(var P,I=[],z=0;z<c;)if(l.test(f[z])){var R=z;for(++z;z<c&&l.test(f[z]);++z);I.push(new s(0,R,z))}else{var B=z,j=I.length,V="rtl"==t?1:0;for(++z;z<c&&"L"!=f[z];++z);for(var G=B;G<z;)if(a.test(f[G])){B<G&&(I.splice(j,0,new s(1,B,G)),j+=V);var U=G;for(++G;G<z&&a.test(f[G]);++G);I.splice(j,0,new s(2,U,G)),j+=V,B=G}else++G;B<z&&I.splice(j,0,new s(1,B,z))}return"ltr"==t&&(1==I[0].level&&(P=e.match(/^\s+/))&&(I[0].from=P[0].length,I.unshift(new s(0,0,P[0].length))),1==Y(I).level&&(P=e.match(/\s+$/))&&(Y(I).to-=P[0].length,I.push(new s(0,c-P[0].length,c)))),"rtl"==t?I.reverse():I}}();function he(e,t){var r=e.order;return null==r&&(r=e.order=fe(e.text,t)),r}var de=[],pe=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||de).concat(r)}};function ge(e,t){return e._handlers&&e._handlers[t]||de}function ve(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=B(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function me(e,t){var r=ge(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function ye(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),me(e,r||t.type,e,t),Se(t)||t.codemirrorIgnore}function be(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==B(r,t[n])&&r.push(t[n])}function we(e,t){return ge(e,t).length>0}function xe(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){ve(this,e,t)}}function Ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ke(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Se(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Le(e){Ce(e),ke(e)}function Te(e){return e.target||e.srcElement}function Me(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Ne,Ae,Oe=function(){if(l&&a<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function De(e){if(null==Ne){var t=A("span","​");N(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ne=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&a<8))}var r=Ne?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function We(e){if(null!=Ae)return Ae;var t=N(e,document.createTextNode("AخA")),r=L(t,0,1).getBoundingClientRect(),n=L(t,1,2).getBoundingClientRect();return M(e),!(!r||r.left==r.right)&&(Ae=n.right-r.right<3)}var He=3!="\n\nb".split(/\n/).length?function(e){var t=0,r=[],n=e.length;while(t<=n){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Ee=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(r){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Fe=function(){var e=A("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Pe=null;function Ie(e){if(null!=Pe)return Pe;var t=N(e,A("span","x")),r=t.getBoundingClientRect(),n=L(t,0,1).getBoundingClientRect();return Pe=Math.abs(r.left-n.left)>1}var ze={},Re={};function Be(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ze[e]=t}function je(e,t){Re[e]=t}function Ve(e){if("string"==typeof e&&Re.hasOwnProperty(e))e=Re[e];else if(e&&"string"==typeof e.name&&Re.hasOwnProperty(e.name)){var t=Re[e.name];"string"==typeof t&&(t={name:t}),e=J(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ve("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ge(e,t){t=Ve(t);var r=ze[t.name];if(!r)return Ge(e,"text/plain");var n=r(e,t);if(Ue.hasOwnProperty(t.name)){var i=Ue[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var Ue={};function Ke(e,t){var r=Ue.hasOwnProperty(e)?Ue[e]:Ue[e]={};I(t,r)}function _e(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Xe(e,t){var r;while(e.innerMode){if(r=e.innerMode(t),!r||r.mode==e)break;t=r.state,e=r.mode}return r||{mode:e,state:t}}function $e(e,t,r){return!e.startState||e.startState(t,r)}var Ye=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function qe(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 r=e;while(!r.lines)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function Ze(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,(function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i})),n}function Qe(e,t,r){var n=[];return e.iter(t,r,(function(e){n.push(e.text)})),n}function Je(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function et(e){if(null==e.parent)return null;for(var t=e.parent,r=B(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;;++i){if(n.children[i]==t)break;r+=n.children[i].chunkSize()}return r+t.first}function tt(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l],s=a.height;if(t<s)break;t-=s}return r+l}function rt(e,t){return t>=e.first&&t<e.first+e.size}function nt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function it(e,t,r){if(void 0===r&&(r=null),!(this instanceof it))return new it(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ot(e,t){return e.line-t.line||e.ch-t.ch}function lt(e,t){return e.sticky==t.sticky&&0==ot(e,t)}function at(e){return it(e.line,e.ch)}function st(e,t){return ot(e,t)<0?t:e}function ut(e,t){return ot(e,t)<0?e:t}function ct(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ft(e,t){if(t.line<e.first)return it(e.first,0);var r=e.first+e.size-1;return t.line>r?it(r,qe(e,r).text.length):ht(t,qe(e,t.line).text.length)}function ht(e,t){var r=e.ch;return null==r||r>t?it(e.line,t):r<0?it(e.line,0):e}function dt(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=ft(e,t[n]);return r}Ye.prototype.eol=function(){return this.pos>=this.string.length},Ye.prototype.sol=function(){return this.pos==this.lineStart},Ye.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ye.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ye.prototype.eat=function(e){var t,r=this.string.charAt(this.pos);if(t="string"==typeof e?r==e:r&&(e.test?e.test(r):e(r)),t)return++this.pos,r},Ye.prototype.eatWhile=function(e){var t=this.pos;while(this.eat(e));return this.pos>t},Ye.prototype.eatSpace=function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},Ye.prototype.skipToEnd=function(){this.pos=this.string.length},Ye.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ye.prototype.backUp=function(e){this.pos-=e},Ye.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Ye.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Ye.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return!1!==t&&(this.pos+=e.length),!0},Ye.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ye.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ye.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ye.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var pt=function(e,t){this.state=e,this.lookAhead=t},gt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function vt(e,t,r,n){var i=[e.state.modeGen],o={};Lt(e,t.text,e.doc.mode,r,(function(e,t){return i.push(e,t)}),o,n);for(var l=r.state,a=function(n){r.baseTokens=i;var a=e.state.overlays[n],s=1,u=0;r.state=!0,Lt(e,t.text,a.mode,r,(function(e,t){var r=s;while(u<e){var n=i[s];n>e&&i.splice(s,1,e,i[s+1],n),s+=2,u=Math.min(e,n)}if(t)if(a.opaque)i.splice(r,s-r,e,"overlay "+t),s=r+2;else for(;r<s;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}}),o),r.state=l,r.baseTokens=null,r.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function mt(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=yt(e,et(t)),i=t.text.length>e.options.maxHighlightLength&&_e(e.doc.mode,n.state),o=vt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function yt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new gt(n,!0,t);var o=Tt(e,t,r),l=o>n.first&&qe(n,o-1).stateAfter,a=l?gt.fromSaved(n,l,o):new gt(n,$e(n.mode),o);return n.iter(o,t,(function(r){bt(e,r.text,a);var n=a.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?a.save():null,a.nextLine()})),r&&(n.modeFrontier=a.line),a}function bt(e,t,r,n){var i=e.doc.mode,o=new Ye(t,e.options.tabSize,r);o.start=o.pos=n||0,""==t&&wt(i,r.state);while(!o.eol())xt(i,o,r.state),o.start=o.pos}function wt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Xe(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function xt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Xe(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}gt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},gt.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}},gt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},gt.fromSaved=function(e,t,r){return t instanceof pt?new gt(e,_e(e.mode,t.state),r,t.lookAhead):new gt(e,_e(e.mode,t),r)},gt.prototype.save=function(e){var t=!1!==e?_e(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new pt(t,this.maxLookAhead):t};var Ct=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function kt(e,t,r,n){var i,o=e.doc,l=o.mode;t=ft(o,t);var a,s=qe(o,t.line),u=yt(e,t.line,r),c=new Ye(s.text,e.options.tabSize,u);n&&(a=[]);while((n||c.pos<t.ch)&&!c.eol())c.start=c.pos,i=xt(l,c,u.state),n&&a.push(new Ct(c,i,_e(o.mode,u.state)));return n?a:new Ct(c,i,u.state)}function St(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Lt(e,t,r,n,i,o,l){var a=r.flattenSpans;null==a&&(a=e.options.flattenSpans);var s,u=0,c=null,f=new Ye(t,e.options.tabSize,n),h=e.options.addModeClass&&[null];""==t&&St(wt(r,n.state),o);while(!f.eol()){if(f.pos>e.options.maxHighlightLength?(a=!1,l&&bt(e,t,n,f.pos),f.pos=t.length,s=null):s=St(xt(r,f,n.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 Tt(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=qe(o,a-1),u=s.stateAfter;if(u&&(!r||a+(u instanceof pt?u.lookAhead:0)<=o.modeFrontier))return a;var c=z(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=a-1,n=c)}return i}function Mt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=qe(e,n).stateAfter;if(i&&(!(i instanceof pt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}var Nt=!1,At=!1;function Ot(){Nt=!0}function Dt(){At=!0}function Wt(e,t,r){this.marker=e,this.from=t,this.to=r}function Ht(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Et(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Ft(e,t,r){var n=r&&window.WeakSet&&(r.markedSpans||(r.markedSpans=new WeakSet));n&&e.markedSpans&&n.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],n&&n.add(e.markedSpans)),t.marker.attachLine(e)}function Pt(e,t,r){var n;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&&(!r||!o.marker.insertLeft)){var s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Wt(l,o.from,s?null:o.to))}}return n}function It(e,t,r){var n;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&&(!r||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Wt(l,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}function zt(e,t){if(t.full)return null;var r=rt(e,t.from.line)&&qe(e,t.from.line).markedSpans,n=rt(e,t.to.line)&&qe(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==ot(t.from,t.to),a=Pt(r,i,l),s=It(n,o,l),u=1==t.text.length,c=Y(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=Ht(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=Ht(a,g.marker);v||(g.from=c,u&&(a||(a=[])).push(g))}else g.from+=c,u&&(a||(a=[])).push(g)}a&&(a=Rt(a)),s&&s!=a&&(s=Rt(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 Wt(a[w].marker,null,null));for(var x=0;x<b;++x)m.push(y);m.push(s)}return m}function Rt(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Bt(e,t,r){var n=null;if(e.iter(t.line,r.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=B(n,r)||(n||(n=[])).push(r)}})),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],a=l.find(0),s=0;s<i.length;++s){var u=i[s];if(!(ot(u.to,a.from)<0||ot(u.from,a.to)>0)){var c=[s,1],f=ot(u.from,a.from),h=ot(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 jt(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Vt(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Gt(e){return e.inclusiveLeft?-1:0}function Ut(e){return e.inclusiveRight?1:0}function Kt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=ot(n.from,i.from)||Gt(e)-Gt(t);if(o)return-o;var l=ot(n.to,i.to)||Ut(e)-Ut(t);return l||t.id-e.id}function _t(e,t){var r,n=At&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||Kt(r,i.marker)<0)&&(r=i.marker);return r}function Xt(e){return _t(e,!0)}function $t(e){return _t(e,!1)}function Yt(e,t){var r,n=At&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||Kt(r,o.marker)<0)&&(r=o.marker)}return r}function qt(e,t,r,n,i){var o=qe(e,t),l=At&&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=ot(u.from,r)||Gt(s.marker)-Gt(i),f=ot(u.to,n)||Ut(s.marker)-Ut(i);if(!(c>=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ot(u.to,r)>=0:ot(u.to,r)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ot(u.from,n)<=0:ot(u.from,n)<0)))return!0}}}function Zt(e){var t;while(t=Xt(e))e=t.find(-1,!0).line;return e}function Qt(e){var t;while(t=$t(e))e=t.find(1,!0).line;return e}function Jt(e){var t,r;while(t=$t(e))e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function er(e,t){var r=qe(e,t),n=Zt(r);return r==n?t:et(n)}function tr(e,t){if(t>e.lastLine())return t;var r,n=qe(e,t);if(!rr(e,n))return t;while(r=$t(n))n=r.find(1,!0).line;return et(n)+1}function rr(e,t){var r=At&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&nr(e,t,n))return!0}}function nr(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return nr(e,n.line,Ht(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&nr(e,t,i))return!0}function ir(e){e=Zt(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==r)break;t+=a.height}return t}function or(e){if(0==e.height)return 0;var t,r=e.text.length,n=e;while(t=Xt(n)){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}n=e;while(t=$t(n)){var o=t.find(0,!0);r-=n.text.length-o.from.ch,n=o.to.line,r+=n.text.length-o.to.ch}return r}function lr(e){var t=e.display,r=e.doc;t.maxLine=qe(r,r.first),t.maxLineLength=or(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=or(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var ar=function(e,t,r){this.text=e,Vt(this,t),this.height=r?r(this):1};function sr(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),jt(e),Vt(e,r);var i=n?n(e):1;i!=e.height&&Je(e,i)}function ur(e){e.parent=null,jt(e)}ar.prototype.lineNo=function(){return et(this)},xe(ar);var cr={},fr={};function hr(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?fr:cr;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function dr(e,t){var r=O("span",null,null,s?"padding-right: .1px":null),n={pre:O("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;n.pos=0,n.addToken=gr,We(e.display.measure)&&(l=he(o,e.doc.direction))&&(n.addToken=mr(n.addToken,l)),n.map=[];var a=t!=e.display.externalMeasured&&et(o);br(o,n,mt(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=E(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=E(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(De(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return me(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=E(n.pre.className,n.textClass||"")),n}function pr(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gr(e,t,r,n,i,o,s){if(t){var u,c=e.splitSpaces?vr(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",$(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),r||n||i||h||o||s){var w=r||"";n&&(w+=n),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 vr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}function mr(e,t){return function(r,n,i,o,l,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.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(r,n,i,o,l,a,s);e(r,n.slice(0,f.to-u),i,o,null,a,s),o=null,n=n.slice(f.to-u),u=f.to}}}function yr(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function br(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)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<n.length;++w){var x=n[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 k in C.attributes)(h||(h={}))[k]=C.attributes[k];C.collapsed&&(!f||Kt(f.marker,C)<0)&&(f=x)}else x.from>p&&m>x.from&&(m=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==m&&(u+=" "+b[S]);if(!f||f.from==p)for(var L=0;L<y.length;++L)yr(t,0,y[L]);if(f&&(f.from||0)==p){if(yr(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 N=M>T?v.slice(0,T-p):v;t.addToken(t,N,l?l+s:s,c,p+N.length==m?u:"",a,h)}if(M>=T){v=v.slice(T-p),p=T;break}p=M,c=""}v=i.slice(o,o=r[g++]),l=hr(r[g++],t.cm.options)}}else for(var A=1;A<r.length;A+=2)t.addToken(t,i.slice(o,o=r[A]),hr(r[A+1],t.cm.options))}function wr(e,t,r){this.line=t,this.rest=Jt(t),this.size=this.rest?et(Y(this.rest))-r+1:1,this.node=this.text=null,this.hidden=rr(e,t)}function xr(e,t,r){for(var n,i=[],o=t;o<r;o=n){var l=new wr(e.doc,qe(e.doc,o),o);n=o+l.size,i.push(l)}return i}var Cr=null;function kr(e){Cr?Cr.ops.push(e):e.ownsGroup=Cr={ops:[e],delayedCallbacks:[]}}function Sr(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)while(i.cursorActivityCalled<i.cursorActivityHandlers.length)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function Lr(e,t){var r=e.ownsGroup;if(r)try{Sr(r)}finally{Cr=null,t(r)}}var Tr=null;function Mr(e,t){var r=ge(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);Cr?n=Cr.delayedCallbacks:Tr?n=Tr:(n=Tr=[],setTimeout(Nr,0));for(var o=function(e){n.push((function(){return r[e].apply(null,i)}))},l=0;l<r.length;++l)o(l)}}function Nr(){var e=Tr;Tr=null;for(var t=0;t<e.length;++t)e[t]()}function Ar(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Hr(e,t):"gutter"==o?Fr(e,t,r,n):"class"==o?Er(e,t):"widget"==o&&Pr(e,t,n)}t.changes=null}function Or(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 Dr(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=Or(t);t.background=n.insertBefore(A("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function Wr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):dr(e,t)}function Hr(e,t){var r=t.text.className,n=Wr(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Er(e,t)):r&&(t.text.className=r)}function Er(e,t){Dr(e,t),t.line.wrapClass?Or(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Fr(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Or(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=Or(t),a=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.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",nt(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,c=o.hasOwnProperty(u)&&o[u];c&&a.appendChild(A("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function Pr(e,t,r){t.alignable&&(t.alignable=null);for(var n=S("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);zr(e,t,r)}function Ir(e,t,r,n){var i=Wr(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Er(e,t),Fr(e,t,r,n),zr(e,t,n),t.node}function zr(e,t,r){if(Rr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Rr(e,t.rest[n],t,r,!1)}function Rr(e,t,r,n,i){if(t.widgets)for(var o=Or(r),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"),Br(s,u,r,n),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),Mr(s,"redraw")}}function Br(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function jr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!D(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,A("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Vr(e,t){for(var r=Te(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Gr(e){return e.lineSpace.offsetTop}function Ur(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Kr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=N(e.measure,A("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function _r(e){return j-e.display.nativeBarWidth}function Xr(e){return e.display.scroller.clientWidth-_r(e)-e.display.barWidth}function $r(e){return e.display.scroller.clientHeight-_r(e)-e.display.barHeight}function Yr(e,t,r){var n=e.options.lineWrapping,i=n&&Xr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){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-r.top)}}o.push(r.bottom-r.top)}}function qr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(et(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Zr(e,t){t=Zt(t);var r=et(t),n=e.display.externalMeasured=new wr(e.doc,t,r);n.lineN=r;var i=n.built=dr(e,n);return n.text=i.pre,N(e.display.lineMeasure,i.pre),n}function Qr(e,t,r,n){return tn(e,en(e,t),r,n)}function Jr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Fn(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function en(e,t){var r=et(t),n=Jr(e,r);n&&!n.text?n=null:n&&n.changes&&(Ar(e,n,r,On(e)),e.curOp.forceUpdate=!0),n||(n=Zr(e,t));var i=qr(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function tn(e,t,r,n,i){t.before&&(r=-1);var o,l=r+(n||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Yr(e,t.view,t.rect),t.hasHeights=!0),o=an(e,t,r,n),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 rn,nn={left:0,right:0,top:0,bottom:0};function on(e,t,r){for(var n,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(n=e[u+2],a==s&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)while(u&&e[u-2]==e[u-3]&&e[u-1].insertLeft)n=e[2+(u-=3)],l="left";if("right"==r&&i==s-a)while(u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft)n=e[(u+=3)+2],l="right";break}return{node:n,start:i,end:o,collapse:l,coverStart:a,coverEnd:s}}function ln(e,t){var r=nn;if("left"==t){for(var n=0;n<e.length;n++)if((r=e[n]).left!=r.right)break}else for(var i=e.length-1;i>=0;i--)if((r=e[i]).left!=r.right)break;return r}function an(e,t,r,n){var i,o=on(t.map,r,n),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&&oe(t.line.text.charAt(o.coverStart+u)))--u;while(o.coverStart+c<o.coverEnd&&oe(t.line.text.charAt(o.coverStart+c)))++c;if(i=l&&a<9&&0==u&&c==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():ln(L(s,u,c).getClientRects(),n),i.left||i.right||0==u)break;c=u,u-=1,f="right"}l&&a<11&&(i=sn(e.display.measure,i))}else{var d;u>0&&(f=n="right"),i=e.options.lineWrapping&&(d=s.getClientRects()).length>1?d["right"==n?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+An(e.display),top:p.top,bottom:p.bottom}:nn}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 sn(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ie(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function un(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 cn(e){e.display.externalMeasure=null,M(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)un(e.display.view[t])}function fn(e){cn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function hn(){return c&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function dn(){return c&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pn(e){var t=Zt(e),r=t.widgets,n=0;if(r)for(var i=0;i<r.length;++i)r[i].above&&(n+=jr(r[i]));return n}function gn(e,t,r,n,i){if(!i){var o=pn(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var l=ir(t);if("local"==n?l+=Gr(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var a=e.display.lineSpace.getBoundingClientRect();l+=a.top+("window"==n?0:dn());var s=a.left+("window"==n?0:hn());r.left+=s,r.right+=s}return r.top+=l,r.bottom+=l,r}function vn(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=hn(),i-=dn();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function mn(e,t,r,n,i){return n||(n=qe(e.doc,t.line)),gn(e,n,Qr(e,n,t.ch,i),r)}function yn(e,t,r,n,i,o){function l(t,l){var a=tn(e,i,t,l?"right":"left",o);return l?a.left=a.right:a.right=a.left,gn(e,n,a,r)}n=n||qe(e.doc,t.line),i||(i=en(e,n));var a=he(n,e.doc.direction),s=t.ch,u=t.sticky;if(s>=n.text.length?(s=n.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l("before"==u?s-1:s,"before"==u);function c(e,t,r){var n=a[t],i=1==n.level;return l(r?e-1:e,i!=r)}var f=ce(a,s,u),h=ue,d=c(s,f,"before"==u);return null!=h&&(d.other=c(s,h,"before"!=u)),d}function bn(e,t){var r=0;t=ft(e.doc,t),e.options.lineWrapping||(r=An(e.display)*t.ch);var n=qe(e.doc,t.line),i=ir(n)+Gr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function wn(e,t,r,n,i){var o=it(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function xn(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return wn(n.first,0,null,-1,-1);var i=tt(n,r),o=n.first+n.size-1;if(i>o)return wn(n.first+n.size-1,qe(n,o).text.length,null,1,1);t<0&&(t=0);for(var l=qe(n,i);;){var a=Ln(e,l,i,t,r),s=Yt(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=qe(n,i=u.line)}}function Cn(e,t,r,n){n-=pn(t);var i=t.text.length,o=ae((function(t){return tn(e,r,t-1).bottom<=n}),i,0);return i=ae((function(t){return tn(e,r,t).top>n}),o,i),{begin:o,end:i}}function kn(e,t,r,n){r||(r=en(e,t));var i=gn(e,t,tn(e,r,n),"line").top;return Cn(e,t,r,i)}function Sn(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Ln(e,t,r,n,i){i-=ir(t);var o=en(e,t),l=pn(t),a=0,s=t.text.length,u=!0,c=he(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?Mn:Tn)(e,t,r,o,c,n,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=ae((function(t){var r=tn(e,o,t);return r.top+=l,r.bottom+=l,!!Sn(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)}),a,s),m=!1;if(g){var y=n-g.left<g.right-n,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":tn(e,o,v-(u?1:0)).bottom+l<=i==u?"after":"before";var w=yn(e,it(r,v,d),"line",t,o);h=w.left,m=i<w.top?-1:i>=w.bottom?1:0}return v=le(t.text,v,1),wn(r,v,d,m,n-h)}function Tn(e,t,r,n,i,o,l){var a=ae((function(a){var s=i[a],u=1!=s.level;return Sn(yn(e,it(r,u?s.to:s.from,u?"before":"after"),"line",t,n),o,l,!0)}),0,i.length-1),s=i[a];if(a>0){var u=1!=s.level,c=yn(e,it(r,u?s.from:s.to,u?"after":"before"),"line",t,n);Sn(c,o,l,!0)&&c.top>l&&(s=i[a-1])}return s}function Mn(e,t,r,n,i,o,l){var a=Cn(e,t,n,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=tn(e,n,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 Nn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==rn){rn=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)rn.appendChild(document.createTextNode("x")),rn.appendChild(A("br"));rn.appendChild(document.createTextNode("x"))}N(e.measure,rn);var r=rn.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),M(e.measure),r||1}function An(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),r=A("pre",[t],"CodeMirror-line-like");N(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function On(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;r[a]=o.offsetLeft+o.clientLeft+i,n[a]=o.clientWidth}return{fixedPos:Dn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Dn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Wn(e){var t=Nn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/An(e.display)-3);return function(i){if(rr(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 r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function Hn(e){var t=e.doc,r=Wn(e);t.iter((function(e){var t=r(e);t!=e.height&&Je(e,t)}))}function En(e,t,r,n){var i=e.display;if(!r&&"true"==Te(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=xn(e,o,l);if(n&&u.xRel>0&&(s=qe(e.doc,u.line).text).length==u.ch){var c=z(s,s.length,e.options.tabSize)-s.length;u=it(u.line,Math.max(0,Math.round((o-Kr(e.display).left)/An(e.display))-c))}return u}function Fn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Pn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)At&&er(e.doc,t)<i.viewTo&&zn(e);else if(r<=i.viewFrom)At&&tr(e.doc,r+n)>i.viewFrom?zn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)zn(e);else if(t<=i.viewFrom){va