/* CodeMirror - Minified & Bundled
   Generated on 9/15/22
   Version: 5.65.8

   CodeMirror Library:
   - codemirror.js
   Modes:
   - clike.js
   - css.js
   - htmlmixed.js
   - javascript.js
   - php.js
   - xml.js
   Add-ons:
   - closebrackets.js
   - closetag.js
   - mark-selection.js
   - matchbrackets.js
   - matchtags.js
   - xml-fold.js
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,e.CodeMirror=t())}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function n(e,n){return t(e).appendChild(n)}function r(e,t,n,r){var i,o=document.createElement(e);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(i=0;i<t.length;++i)o.appendChild(t[i]);return o}function i(e,t,n,i){var o=r(e,t,n,i);return o.setAttribute("role","presentation"),o}function o(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 l(e){var t;try{t=e.activeElement}catch(n){t=e.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function a(t,n){var r=t.className;e(n).test(r)||(t.className+=(r?" ":"")+n)}function s(t,n){var r,i=t.split(" ");for(r=0;r<i.length;r++)i[r]&&!e(i[r]).test(n)&&(n+=" "+i[r]);return n}function c(e){return e.display.wrapper.ownerDocument}function u(e){return c(e).defaultView}function d(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function f(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||n===!1&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function h(e,t,n,r,i){var o,l,a;for(null==t&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length)),o=r||0,l=i||0;;){if(a=e.indexOf("\t",o),a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}function p(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function m(e,t,n){var r,i,o,l;for(r=0,i=0;;){if(o=e.indexOf("\t",r),o==-1&&(o=e.length),l=o-r,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}}function g(e){for(;Nl.length<=e;)Nl.push(y(Nl)+" ");return Nl[e]}function y(e){return e[e.length-1]}function v(e,t){var n,r=[];for(n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function b(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function x(){}function w(e,t){var n;return Object.create?n=Object.create(e):(x.prototype=e,n=new x),t&&f(t,n),n}function k(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Al.test(e))}function _(e,t){return t?!!(t.source.indexOf("\\w")>-1&&k(e))||t.test(e):k(e)}function C(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function S(e){return e.charCodeAt(0)>=768&&Ol.test(e)}function T(e,t,n){for(;(n<0?t>0:t<e.length)&&S(e.charAt(t));)t+=n;return t}function M(e,t,n){for(var r,i,o=t>n?-1:1;;){if(t==n)return t;if(r=(t+n)/2,i=o<0?Math.ceil(r):Math.floor(r),i==t)return e(i)?t:n;e(i)?n=i:t=i+o}}function L(e,t,n,r){var i,o,l;if(!e)return r(t,n,"ltr",0);for(i=!1,o=0;o<e.length;++o)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")}function N(e,t,n){var r,i,o;for(zl=null,i=0;i<e.length;++i){if(o=e[i],o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:zl=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:zl=i)}return null!=r?r:zl}function A(e,t){var n=e.order;return null==n&&(n=e.order=Dl(e.text,t)),n}function O(e,t){return e._handlers&&e._handlers[t]||Pl}function z(e,t,n){var r,i,o;e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):(r=e._handlers,i=r&&r[t],i&&(o=p(i,n),o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))))}function D(e,t){var n,r,i=O(e,t);if(i.length)for(n=Array.prototype.slice.call(arguments,2),r=0;r<i.length;++r)i[r].apply(null,n)}function P(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),D(e,n||t.type,e,t),H(t)||t.codemirrorIgnore}function I(e){var t,n,r=e._handlers&&e._handlers.cursorActivity;if(r)for(t=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<r.length;++n)p(t,r[n])==-1&&t.push(r[n])}function E(e,t){return O(e,t).length>0}function F(e){e.prototype.on=function(e,t){Il(this,e,t)},e.prototype.off=function(e,t){z(this,e,t)}}function q(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function W(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function H(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function R(e){q(e),W(e)}function B(e){return e.target||e.srcElement}function j(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),ss&&e.ctrlKey&&1==t&&(t=3),t}function U(e){var t,i;return null==Fl&&(t=r("span","​"),n(e,r("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Fl=t.offsetWidth<=1&&t.offsetHeight>2&&!(Xa&&Ya<8))),i=Fl?r("span","​"):r("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px"),i.setAttribute("cm-text",""),i}function K(e){var r,i,o;return null!=ql?ql:(r=n(e,document.createTextNode("AخA")),i=wl(r,0,1).getBoundingClientRect(),o=wl(r,1,2).getBoundingClientRect(),t(e),!(!i||i.left==i.right)&&(ql=o.right-i.right<3))}function V(e){var t,i,o;return null!=Bl?Bl:(t=n(e,r("span","x")),i=t.getBoundingClientRect(),o=wl(t,0,1).getBoundingClientRect(),Bl=Math.abs(i.left-o.left)>1)}function $(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),jl[e]=t}function G(e,t){Ul[e]=t}function X(e){if("string"==typeof e&&Ul.hasOwnProperty(e))e=Ul[e];else if(e&&"string"==typeof e.name&&Ul.hasOwnProperty(e.name)){var t=Ul[e.name];"string"==typeof t&&(t={name:t}),e=w(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return X("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return X("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Y(e,t){var n,r,i,o,l;if(t=X(t),n=jl[t.name],!n)return Y(e,"text/plain");if(r=n(e,t),Kl.hasOwnProperty(t.name)){i=Kl[t.name];for(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(l in t.modeProps)r[l]=t.modeProps[l];return r}function Z(e,t){var n=Kl.hasOwnProperty(e)?Kl[e]:Kl[e]={};f(t,n)}function Q(e,t){var n,r,i;if(t===!0)return t;if(e.copyState)return e.copyState(t);n={};for(r in t)i=t[r],i instanceof Array&&(i=i.concat([])),n[r]=i;return n}function J(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),n&&n.mode!=e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function ee(e,t,n){return!e.startState||e.startState(t,n)}function te(e,t){var n,r,i,o;if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(n=e;!n.lines;)for(r=0;;++r){if(i=n.children[r],o=i.chunkSize(),t<o){n=i;break}t-=o}return n.lines[t]}function ne(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 re(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function ie(e,t){var n,r=t-e.height;if(r)for(n=e;n;n=n.parent)n.height+=r}function oe(e){var t,n,r,i;if(null==e.parent)return null;for(t=e.parent,n=p(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function le(e,t){var n,r,i,o,l,a,s=e.first;e:do{for(n=0;n<e.children.length;++n){if(r=e.children[n],i=r.height,t<i){e=r;continue e}t-=i,s+=r.chunkSize()}return s}while(!e.lines);for(o=0;o<e.lines.length&&(l=e.lines[o],a=l.height,!(t<a));++o)t-=a;return s+o}function ae(e,t){return t>=e.first&&t<e.first+e.size}function se(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ce(e,t,n){return void 0===n&&(n=null),this instanceof ce?(this.line=e,this.ch=t,void(this.sticky=n)):new ce(e,t,n)}function ue(e,t){return e.line-t.line||e.ch-t.ch}function de(e,t){return e.sticky==t.sticky&&0==ue(e,t)}function fe(e){return ce(e.line,e.ch)}function he(e,t){return ue(e,t)<0?t:e}function pe(e,t){return ue(e,t)<0?e:t}function me(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ge(e,t){if(t.line<e.first)return ce(e.first,0);var n=e.first+e.size-1;return t.line>n?ce(n,te(e,n).text.length):ye(t,te(e,t.line).text.length)}function ye(e,t){var n=e.ch;return null==n||n>t?ce(e.line,t):n<0?ce(e.line,0):e}function ve(e,t){var n,r=[];for(n=0;n<t.length;n++)r[n]=ge(e,t[n]);return r}function be(e,t,n,r){var i,o,l,a=[e.state.modeGen],s={};for(Me(e,t.text,e.doc.mode,n,function(e,t){return a.push(e,t)},s,r),i=n.state,o=function(r){n.baseTokens=a;var o=e.state.overlays[r],l=1,c=0;n.state=!0,Me(e,t.text,o.mode,n,function(e,t){for(var n,r,i=l;c<e;)n=a[l],n>e&&a.splice(l,1,e,a[l+1],n),l+=2,c=Math.min(e,n);if(t)if(o.opaque)a.splice(i,l-i,e,"overlay "+t),l=i+2;else for(;i<l;i+=2)r=a[i+1],a[i+1]=(r?r+" ":"")+"overlay "+t},s),n.state=i,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)o(l);return{styles:a,classes:s.bgClass||s.textClass?s:null}}function xe(e,t,n){var r,i,o;return t.styles&&t.styles[0]==e.state.modeGen||(r=we(e,oe(t)),i=t.text.length>e.options.maxHighlightLength&&Q(e.doc.mode,r.state),o=be(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))),t.styles}function we(e,t,n){var r,i,o,l=e.doc,a=e.display;return l.mode.startState?(r=Le(e,t,n),i=r>l.first&&te(l,r-1).stateAfter,o=i?Gl.fromSaved(l,i,r):new Gl(l,ee(l.mode),r),l.iter(r,t,function(n){ke(e,n.text,o);var r=o.line;n.stateAfter=r==t-1||r%5==0||r>=a.viewFrom&&r<a.viewTo?o.save():null,o.nextLine()}),n&&(l.modeFrontier=o.line),o):new Gl(l,!0,t)}function ke(e,t,n,r){var i=e.doc.mode,o=new Vl(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&_e(i,n.state);!o.eol();)Ce(i,o,n.state),o.start=o.pos}function _e(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=J(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Ce(e,t,n,r){var i,o;for(i=0;i<10;i++)if(r&&(r[0]=J(e,n).mode),o=e.token(t,n),t.pos>t.start)return o;throw new Error("Mode "+e.name+" failed to advance stream.")}function Se(e,t,n,r){var i,o,l,a,s,c=e.doc,u=c.mode;for(t=ge(c,t),o=te(c,t.line),l=we(e,t.line,n),a=new Vl(o.text,e.options.tabSize,l),r&&(s=[]);(r||a.pos<t.ch)&&!a.eol();)a.start=a.pos,i=Ce(u,a,l.state),r&&s.push(new Xl(a,i,Q(c.mode,l.state)));return r?s:new Xl(a,i,l.state)}function Te(e,t){var n,r;if(e)for(;n=e.match(/(?:^|\s+)line-(background-)?(\S+)/),n;)e=e.slice(0,n.index)+e.slice(n.index+n[0].length),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 Me(e,t,n,r,i,o,l){var a,s,c,u,d,f,h,p=n.flattenSpans;for(null==p&&(p=e.options.flattenSpans),a=0,s=null,c=new Vl(t,e.options.tabSize,r),d=e.options.addModeClass&&[null],""==t&&Te(_e(n,r.state),o);!c.eol();){if(c.pos>e.options.maxHighlightLength?(p=!1,l&&ke(e,t,r,c.pos),c.pos=t.length,u=null):u=Te(Ce(n,c,r.state,d),o),d&&(f=d[0].name,f&&(u="m-"+(u?f+" "+u:f))),!p||s!=u){for(;a<c.start;)a=Math.min(c.start,a+5e3),i(a,s);s=u}c.start=c.pos}for(;a<c.pos;)h=Math.min(c.pos,a+5e3),i(h,s),a=h}function Le(e,t,n){var r,i,o,l,a,s,c=e.doc,u=n?-1:t-(e.doc.mode.innerMode?1e3:100);for(o=t;o>u;--o){if(o<=c.first)return c.first;if(l=te(c,o-1),a=l.stateAfter,a&&(!n||o+(a instanceof $l?a.lookAhead:0)<=c.modeFrontier))return o;s=h(l.text,null,e.options.tabSize),(null==i||r>s)&&(i=o-1,r=s)}return i}function Ne(e,t){var n,r,i;if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(n=e.first,r=t-1;r>n;r--)if(i=te(e,r).stateAfter,i&&(!(i instanceof $l)||r+i.lookAhead<t)){n=r+1;break}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}function Ae(){Yl=!0}function Oe(){Zl=!0}function ze(e,t,n){this.marker=e,this.from=t,this.to=n}function De(e,t){var n,r;if(e)for(n=0;n<e.length;++n)if(r=e[n],r.marker==t)return r}function Pe(e,t){var n,r;for(r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Ie(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 Ee(e,t,n){var r,i,o,l,a,s;if(e)for(i=0;i<e.length;++i)o=e[i],l=o.marker,a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t),!a&&(o.from!=t||"bookmark"!=l.type||n&&o.marker.insertLeft)||(s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t),(r||(r=[])).push(new ze(l,o.from,s?null:o.to)));return r}function Fe(e,t,n){var r,i,o,l,a,s;if(e)for(i=0;i<e.length;++i)o=e[i],l=o.marker,a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t),(a||o.from==t&&"bookmark"==l.type&&(!n||o.marker.insertLeft))&&(s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t),(r||(r=[])).push(new ze(l,s?null:o.from-t,null==o.to?null:o.to-t)));return r}function qe(e,t){var n,r,i,o,l,a,s,c,u,d,f,h,p,m,g,v,b,x,w,k;if(t.full)return null;if(n=ae(e,t.from.line)&&te(e,t.from.line).markedSpans,r=ae(e,t.to.line)&&te(e,t.to.line).markedSpans,!n&&!r)return null;if(i=t.from.ch,o=t.to.ch,l=0==ue(t.from,t.to),a=Ee(n,i,l),s=Fe(r,o,l),c=1==t.text.length,u=y(t.text).length+(c?i:0),a)for(d=0;d<a.length;++d)f=a[d],null==f.to&&(h=De(s,f.marker),h?c&&(f.to=null==h.to?null:h.to+u):f.to=i);if(s)for(p=0;p<s.length;++p)m=s[p],null!=m.to&&(m.to+=u),null==m.from?(g=De(a,m.marker),g||(m.from=u,c&&(a||(a=[])).push(m))):(m.from+=u,c&&(a||(a=[])).push(m));if(a&&(a=We(a)),s&&s!=a&&(s=We(s)),v=[a],!c){if(b=t.text.length-2,b>0&&a)for(w=0;w<a.length;++w)null==a[w].to&&(x||(x=[])).push(new ze(a[w].marker,null,null));for(k=0;k<b;++k)v.push(x);v.push(s)}return v}function We(e){var t,n;for(t=0;t<e.length;++t)n=e[t],null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1);return e.length?e:null}function He(e,t,n){var r,i,o,l,a,s,c,u,d,f=null;if(e.iter(t.line,n.line+1,function(e){var t,n;if(e.markedSpans)for(t=0;t<e.markedSpans.length;++t)n=e.markedSpans[t].marker,!n.readOnly||f&&p(f,n)!=-1||(f||(f=[])).push(n)}),!f)return null;for(r=[{from:t,to:n}],i=0;i<f.length;++i)for(o=f[i],l=o.find(0),a=0;a<r.length;++a)s=r[a],ue(s.to,l.from)<0||ue(s.from,l.to)>0||(c=[a,1],u=ue(s.from,l.from),d=ue(s.to,l.to),(u<0||!o.inclusiveLeft&&!u)&&c.push({from:s.from,to:l.from}),(d>0||!o.inclusiveRight&&!d)&&c.push({from:l.to,to:s.to}),r.splice.apply(r,c),a+=c.length-3);return r}function Re(e){var t,n=e.markedSpans;if(n){for(t=0;t<n.length;++t)n[t].marker.detachLine(e);e.markedSpans=null}}function Be(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function je(e){return e.inclusiveLeft?-1:0}function Ue(e){return e.inclusiveRight?1:0}function Ke(e,t){var n,r,i,o,l=e.lines.length-t.lines.length;return 0!=l?l:(n=e.find(),r=t.find(),(i=ue(n.from,r.from)||je(e)-je(t))?-i:(o=ue(n.to,r.to)||Ue(e)-Ue(t),o?o:t.id-e.id))}function Ve(e,t){var n,r,i,o=Zl&&e.markedSpans;if(o)for(r=void 0,i=0;i<o.length;++i)r=o[i],r.marker.collapsed&&null==(t?r.from:r.to)&&(!n||Ke(n,r.marker)<0)&&(n=r.marker);return n}function $e(e){return Ve(e,!0)}function Ge(e){return Ve(e,!1)}function Xe(e,t){var n,r,i,o=Zl&&e.markedSpans;if(o)for(r=0;r<o.length;++r)i=o[r],i.marker.collapsed&&(null==i.from||i.from<t)&&(null==i.to||i.to>t)&&(!n||Ke(n,i.marker)<0)&&(n=i.marker);return n}function Ye(e,t,n,r,i){var o,l,a,s,c,u=te(e,t),d=Zl&&u.markedSpans;if(d)for(o=0;o<d.length;++o)if(l=d[o],l.marker.collapsed&&(a=l.marker.find(0),s=ue(a.from,n)||je(l.marker)-je(i),c=ue(a.to,r)||Ue(l.marker)-Ue(i),!(s>=0&&c<=0||s<=0&&c>=0)&&(s<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ue(a.to,n)>=0:ue(a.to,n)>0)||s>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ue(a.from,r)<=0:ue(a.from,r)<0))))return!0}function Ze(e){for(var t;t=$e(e);)e=t.find(-1,!0).line;return e}function Qe(e){for(var t;t=Ge(e);)e=t.find(1,!0).line;return e}function Je(e){for(var t,n;t=Ge(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function et(e,t){var n=te(e,t),r=Ze(n);return n==r?t:oe(r)}function tt(e,t){if(t>e.lastLine())return t;var n,r=te(e,t);if(!nt(e,r))return t;for(;n=Ge(r);)r=n.find(1,!0).line;return oe(r)+1}function nt(e,t){var n,r,i=Zl&&t.markedSpans;if(i)for(n=void 0,r=0;r<i.length;++r)if(n=i[r],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&rt(e,t,n))return!0}}function rt(e,t,n){var r,i,o;if(null==n.to)return r=n.marker.find(1,!0),rt(e,r.line,De(r.line.markedSpans,n.marker));if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(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)&&rt(e,t,i))return!0}function it(e){var t,n,r,i,o,l,a;for(e=Ze(e),t=0,n=e.parent,r=0;r<n.lines.length&&(i=n.lines[r],i!=e);++r)t+=i.height;for(o=n.parent;o;n=o,o=n.parent)for(l=0;l<o.children.length&&(a=o.children[l],a!=n);++l)t+=a.height;return t}function ot(e){var t,n,r,i,o;if(0==e.height)return 0;for(t=e.text.length,r=e;n=$e(r);)i=n.find(0,!0),r=i.from.line,t+=i.from.ch-i.to.ch;for(r=e;n=Ge(r);)o=n.find(0,!0),t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch;return t}function lt(e){var t=e.display,n=e.doc;t.maxLine=te(n,n.first),t.maxLineLength=ot(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=ot(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function at(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Re(e),Be(e,n);var i=r?r(e):1;i!=e.height&&ie(e,i)}function st(e){e.parent=null,Re(e)}function ct(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ea:Jl;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function ut(e,t){var n,r,o,l,a,c=i("span",null,null,Za?"padding-right: .1px":null),u={pre:i("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};for(t.measure={},n=0;n<=(t.rest?t.rest.length:0);n++)r=n?t.rest[n-1]:t.line,o=void 0,u.pos=0,u.addToken=ft,K(e.display.measure)&&(o=A(r,e.doc.direction))&&(u.addToken=pt(u.addToken,o)),u.map=[],l=t!=e.display.externalMeasured&&oe(r),gt(r,u,xe(e,r,l)),r.styleClasses&&(r.styleClasses.bgClass&&(u.bgClass=s(r.styleClasses.bgClass,u.bgClass||"")),r.styleClasses.textClass&&(u.textClass=s(r.styleClasses.textClass,u.textClass||""))),0==u.map.length&&u.map.push(0,0,u.content.appendChild(U(e.display.measure))),0==n?(t.measure.map=u.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(u.map),(t.measure.caches||(t.measure.caches=[])).push({}));return Za&&(a=u.content.lastChild,(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(u.content.className="cm-tab-wrap-hack")),D(e,"renderLine",e,t.line,u.pre),u.pre.className&&(u.textClass=s(u.pre.className,u.textClass||"")),u}function dt(e){var t=r("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ft(e,t,n,i,o,l,a){var s,c,u,d,f,h,p,m,y,v,b,x,w,k;if(t){if(s=e.splitSpaces?ht(t,e.trailingSpace):t,c=e.cm.state.specialChars,u=!1,c.test(t))for(d=document.createDocumentFragment(),f=0;;){if(c.lastIndex=f,h=c.exec(t),p=h?h.index-f:t.length-f,p&&(m=document.createTextNode(s.slice(f,f+p)),Xa&&Ya<9?d.appendChild(r("span",[m])):d.appendChild(m),e.map.push(e.pos,e.pos+p,m),e.col+=p,e.pos+=p),!h)break;f+=p+1,y=void 0,"\t"==h[0]?(v=e.cm.options.tabSize,b=v-e.col%v,y=d.appendChild(r("span",g(b),"cm-tab")),y.setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),e.col+=b):"\r"==h[0]||"\n"==h[0]?(y=d.appendChild(r("span","\r"==h[0]?"␍":"␤","cm-invalidchar")),y.setAttribute("cm-text",h[0]),e.col+=1):(y=e.cm.options.specialCharPlaceholder(h[0]),y.setAttribute("cm-text",h[0]),Xa&&Ya<9?d.appendChild(r("span",[y])):d.appendChild(y),e.col+=1),e.map.push(e.pos,e.pos+1,y),e.pos++}else e.col+=t.length,d=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,d),Xa&&Ya<9&&(u=!0),e.pos+=t.length;if(e.trailingSpace=32==s.charCodeAt(t.length-1),n||i||o||u||l||a){if(x=n||"",i&&(x+=i),o&&(x+=o),w=r("span",[d],x,l),a)for(k in a)a.hasOwnProperty(k)&&"style"!=k&&"class"!=k&&w.setAttribute(k,a[k]);return e.content.appendChild(w)}e.content.appendChild(d)}}function ht(e,t){var n,r,i,o;if(e.length>1&&!/  /.test(e))return e;for(n=t,r="",i=0;i<e.length;i++)o=e.charAt(i)," "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o;return r}function pt(e,t){return function(n,r,i,o,l,a,s){var c,u,d,f;for(i=i?i+" cm-force-border":"cm-force-border",c=n.pos,u=c+r.length;;){for(d=void 0,f=0;f<t.length&&(d=t[f],!(d.to>c&&d.from<=c));f++);if(d.to>=u)return e(n,r,i,o,l,a,s);e(n,r.slice(0,d.to-c),i,o,null,a,s),o=null,r=r.slice(d.to-c),c=d.to}}}function mt(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 gt(e,t,n){var r,i,o,l,a,s,c,u,d,f,h,p,m,g,y,v,b,x,w,k,_,C,S,T,M=e.markedSpans,L=e.text,N=0;if(M)for(i=L.length,o=0,l=1,a="",u=0;;){if(u==o){for(d=f=h=c="",m=null,p=null,u=1/0,g=[],y=void 0,v=0;v<M.length;++v)if(b=M[v],x=b.marker,"bookmark"==x.type&&b.from==o&&x.widgetNode)g.push(x);else if(b.from<=o&&(null==b.to||b.to>o||x.collapsed&&b.to==o&&b.from==o)){if(null!=b.to&&b.to!=o&&u>b.to&&(u=b.to,f=""),x.className&&(d+=" "+x.className),x.css&&(c=(c?c+";":"")+x.css),x.startStyle&&b.from==o&&(h+=" "+x.startStyle),x.endStyle&&b.to==u&&(y||(y=[])).push(x.endStyle,b.to),x.title&&((m||(m={})).title=x.title),x.attributes)for(w in x.attributes)(m||(m={}))[w]=x.attributes[w];x.collapsed&&(!p||Ke(p.marker,x)<0)&&(p=b)}else b.from>o&&u>b.from&&(u=b.from);if(y)for(k=0;k<y.length;k+=2)y[k+1]==u&&(f+=" "+y[k]);if(!p||p.from==o)for(_=0;_<g.length;++_)mt(t,0,g[_]);if(p&&(p.from||0)==o){if(mt(t,(null==p.to?i+1:p.to)-o,p.marker,null==p.from),null==p.to)return;p.to==o&&(p=!1)}}if(o>=i)break;for(C=Math.min(i,u);;){if(a){if(S=o+a.length,p||(T=S>C?a.slice(0,C-o):a,t.addToken(t,T,s?s+d:d,h,o+T.length==u?f:"",c,m)),S>=C){a=a.slice(C-o),o=C;break}o=S,h=""}a=L.slice(N,N=n[l++]),s=ct(n[l++],t.cm.options)}}else for(r=1;r<n.length;r+=2)t.addToken(t,L.slice(N,N=n[r]),ct(n[r+1],t.cm.options))}function yt(e,t,n){this.line=t,this.rest=Je(t),this.size=this.rest?oe(y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=nt(e,t)}function vt(e,t,n){var r,i,o,l=[];for(i=t;i<n;i=r)o=new yt(e.doc,te(e.doc,i),i),r=i+o.size,l.push(o);return l}function bt(e){ta?ta.ops.push(e):e.ownsGroup=ta={ops:[e],delayedCallbacks:[]}}function xt(e){var t,n,r=e.delayedCallbacks,i=0;do{for(;i<r.length;i++)r[i].call(null);for(t=0;t<e.ops.length;t++)if(n=e.ops[t],n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}while(i<r.length)}function wt(e,t){var n=e.ownsGroup;if(n)try{xt(n)}finally{ta=null,t(n)}}function kt(e,t){var n,r,i,o,l=O(e,t);if(l.length)for(n=Array.prototype.slice.call(arguments,2),ta?r=ta.delayedCallbacks:na?r=na:(r=na=[],setTimeout(_t,0)),i=function(e){r.push(function(){return l[e].apply(null,n)})},o=0;o<l.length;++o)i(o)}function _t(){var e,t=na;for(na=null,e=0;e<t.length;++e)t[e]()}function Ct(e,t,n,r){var i,o;for(i=0;i<t.changes.length;i++)o=t.changes[i],"text"==o?Lt(e,t):"gutter"==o?At(e,t,n,r):"class"==o?Nt(e,t):"widget"==o&&Ot(e,t,r);t.changes=null}function St(e){return e.node==e.text&&(e.node=r("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Xa&&Ya<8&&(e.node.style.zIndex=2)),e.node}function Tt(e,t){var n,i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;i&&(i+=" CodeMirror-linebackground"),t.background?i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null):i&&(n=St(t),t.background=n.insertBefore(r("div",null,i),n.firstChild),e.display.input.setUneditable(t.background))}function Mt(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):ut(e,t)}function Lt(e,t){var n=t.text.className,r=Mt(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,Nt(e,t)):n&&(t.text.className=n)}function Nt(e,t){Tt(e,t),t.line.wrapClass?St(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 At(e,t,n,i){var o,l,a,s,c,u,d;if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass&&(o=St(t),t.gutterBackground=r("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)),l=t.line.gutterMarkers,(e.options.lineNumbers||l)&&(a=St(t),s=t.gutter=r("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px"),s.setAttribute("aria-hidden","true"),e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||l&&l["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(r("div",se(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),l))for(c=0;c<e.display.gutterSpecs.length;++c)u=e.display.gutterSpecs[c].className,d=l.hasOwnProperty(u)&&l[u],d&&s.appendChild(r("div",[d],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}function Ot(t,n,r){var i,o,l;for(n.alignable&&(n.alignable=null),i=e("CodeMirror-linewidget"),o=n.node.firstChild,l=void 0;o;o=l)l=o.nextSibling,i.test(o.className)&&n.node.removeChild(o);Dt(t,n,r)}function zt(e,t,n,r){var i=Mt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Nt(e,t),At(e,t,n,r),Dt(e,t,r),t.node}function Dt(e,t,n){if(Pt(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Pt(e,t.rest[r],t,n,!1)}function Pt(e,t,n,i,o){var l,a,s,c,u;if(t.widgets)for(l=St(n),a=0,s=t.widgets;a<s.length;++a)c=s[a],u=r("div",[c.node],"CodeMirror-linewidget"+(c.className?" "+c.className:"")),c.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),It(c,u,n,i),e.display.input.setUneditable(u),o&&c.above?l.insertBefore(u,n.gutter||n.text):l.appendChild(u),kt(c,"redraw")}function It(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 Et(e){var t,i;return null!=e.height?e.height:(t=e.doc.cm)?(o(document.body,e.node)||(i="position: relative;",e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),n(t.display.measure,r("div",[e.node],null,i))),e.height=e.node.parentNode.offsetHeight):0}function Ft(e,t){for(var n=B(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 qt(e){return e.lineSpace.offsetTop}function Wt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ht(e){var t,i,o;return e.cachedPaddingH?e.cachedPaddingH:(t=n(e.measure,r("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)},isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o)}function Rt(e){return Cl-e.display.nativeBarWidth}function Bt(e){return e.display.scroller.clientWidth-Rt(e)-e.display.barWidth}function jt(e){return e.display.scroller.clientHeight-Rt(e)-e.display.barHeight}function Ut(e,t,n){var r,i,o,l,a,s=e.options.lineWrapping,c=s&&Bt(e);if(!t.measure.heights||s&&t.measure.width!=c){if(r=t.measure.heights=[],s)for(t.measure.width=c,i=t.text.firstChild.getClientRects(),o=0;o<i.length-1;o++)l=i[o],a=i[o+1],Math.abs(l.bottom-a.bottom)>2&&r.push((l.bottom+a.top)/2-n.top);r.push(n.bottom-n.top)}}function Kt(e,t,n){var r,i;if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(i=0;i<e.rest.length;i++)if(oe(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Vt(e,t){var r,i,o;return t=Ze(t),r=oe(t),i=e.display.externalMeasured=new yt(e.doc,t,r),i.lineN=r,o=i.built=ut(e,i),i.text=o.pre,n(e.display.lineMeasure,o.pre),i}function $t(e,t,n,r){return Yt(e,Xt(e,t),n,r)}function Gt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ln(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Xt(e,t){var n,r=oe(t),i=Gt(e,r);return i&&!i.text?i=null:i&&i.changes&&(Ct(e,i,r,_n(e)),e.curOp.forceUpdate=!0),i||(i=Vt(e,t)),n=Kt(i,t,r),{line:t,view:i,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function Yt(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||(Ut(e,t.view,t.rect),t.hasHeights=!0),o=Jt(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}}function Zt(e,t,n){var r,i,o,l,a,s,c;for(c=0;c<e.length;c+=3)if(a=e[c],s=e[c+1],t<a?(i=0,o=1,l="left"):t<s?(i=t-a,o=i+1):(c==e.length-3||t==s&&e[c+3]>t)&&(o=s-a,i=o-1,t>=s&&(l="right")),null!=i){if(r=e[c+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[(c-=3)+2],l="left";if("right"==n&&i==s-a)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],l="right";break}return{node:r,start:i,end:o,collapse:l,coverStart:a,coverEnd:s}}function Qt(e,t){var n,r,i=ra;if("left"==t)for(n=0;n<e.length&&(i=e[n]).left==i.right;n++);else for(r=e.length-1;r>=0&&(i=e[r]).left==i.right;r--);return i}function Jt(e,t,n,r){var i,o,l,a,s,c,u,d,f,h,p,m,g=Zt(t.map,n,r),y=g.node,v=g.start,b=g.end,x=g.collapse;if(3==y.nodeType){for(o=0;o<4;o++){for(;v&&S(t.line.text.charAt(g.coverStart+v));)--v;for(;g.coverStart+b<g.coverEnd&&S(t.line.text.charAt(g.coverStart+b));)++b;if(i=Xa&&Ya<9&&0==v&&b==g.coverEnd-g.coverStart?y.parentNode.getBoundingClientRect():Qt(wl(y,v,b).getClientRects(),r),i.left||i.right||0==v)break;b=v,v-=1,x="right"}Xa&&Ya<11&&(i=en(e.display.measure,i))}else v>0&&(x=r="right"),i=e.options.lineWrapping&&(l=y.getClientRects()).length>1?l["right"==r?l.length-1:0]:y.getBoundingClientRect();for(!(Xa&&Ya<9)||v||i&&(i.left||i.right)||(a=y.parentNode.getClientRects()[0],i=a?{left:a.left,right:a.left+kn(e.display),top:a.top,bottom:a.bottom}:ra),s=i.top-t.rect.top,c=i.bottom-t.rect.top,u=(s+c)/2,d=t.view.measure.heights,f=0;f<d.length-1&&!(u<d[f]);f++);return h=f?d[f-1]:0,p=d[f],m={left:("right"==x?i.right:i.left)-t.rect.left,right:("left"==x?i.left:i.right)-t.rect.left,top:h,bottom:p},i.left||i.right||(m.bogus=!0),e.options.singleCursorHeightPerLine||(m.rtop=s,m.rbottom=c),m}function en(e,t){var n,r;return window.screen&&null!=screen.logicalXDPI&&screen.logicalXDPI!=screen.deviceXDPI&&V(e)?(n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI,{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}):t;
}function tn(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 nn(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)tn(e.display.view[n])}function rn(e){nn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function on(e){return Ja&&ls?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function ln(e){return Ja&&ls?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function an(e){var t,n=Ze(e),r=n.widgets,i=0;if(r)for(t=0;t<r.length;++t)r[t].above&&(i+=Et(r[t]));return i}function sn(e,t,n,r,i){var o,l,a,s;return i||(o=an(t),n.top+=o,n.bottom+=o),"line"==r?n:(r||(r="local"),l=it(t),"local"==r?l+=qt(e.display):l-=e.display.viewOffset,"page"!=r&&"window"!=r||(a=e.display.lineSpace.getBoundingClientRect(),l+=a.top+("window"==r?0:ln(c(e))),s=a.left+("window"==r?0:on(c(e))),n.left+=s,n.right+=s),n.top+=l,n.bottom+=l,n)}function cn(e,t,n){var r,i,o,l;return"div"==n?t:(r=t.left,i=t.top,"page"==n?(r-=on(c(e)),i-=ln(c(e))):"local"!=n&&n||(o=e.display.sizer.getBoundingClientRect(),r+=o.left,i+=o.top),l=e.display.lineSpace.getBoundingClientRect(),{left:r-l.left,top:i-l.top})}function un(e,t,n,r,i){return r||(r=te(e.doc,t.line)),sn(e,r,$t(e,r,t.ch,i),n)}function dn(e,t,n,r,i,o){function l(t,l){var a=Yt(e,i,t,l?"right":"left",o);return l?a.left=a.right:a.right=a.left,sn(e,r,a,n)}function a(e,t,n){var r=s[t],i=1==r.level;return l(n?e-1:e,i!=n)}var s,c,u,d,f,h;return r=r||te(e.doc,t.line),i||(i=Xt(e,r)),s=A(r,e.doc.direction),c=t.ch,u=t.sticky,c>=r.text.length?(c=r.text.length,u="before"):c<=0&&(c=0,u="after"),s?(d=N(s,c,u),f=zl,h=a(c,d,"before"==u),null!=f&&(h.other=a(c,f,"before"!=u)),h):l("before"==u?c-1:c,"before"==u)}function fn(e,t){var n,r,i=0;return t=ge(e.doc,t),e.options.lineWrapping||(i=kn(e.display)*t.ch),n=te(e.doc,t.line),r=it(n)+qt(e.display),{left:i,right:i,top:r,bottom:r+n.height}}function hn(e,t,n,r,i){var o=ce(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function pn(e,t,n){var r,i,o,l,a,s,c=e.doc;if(n+=e.display.viewOffset,n<0)return hn(c.first,0,null,-1,-1);if(r=le(c,n),i=c.first+c.size-1,r>i)return hn(c.first+c.size-1,te(c,i).text.length,null,1,1);for(t<0&&(t=0),o=te(c,r);;){if(l=vn(e,o,r,t,n),a=Xe(o,l.ch+(l.xRel>0||l.outside>0?1:0)),!a)return l;if(s=a.find(1),s.line==r)return s;o=te(c,r=s.line)}}function mn(e,t,n,r){var i,o;return r-=an(t),i=t.text.length,o=M(function(t){return Yt(e,n,t-1).bottom<=r},i,0),i=M(function(t){return Yt(e,n,t).top>r},o,i),{begin:o,end:i}}function gn(e,t,n,r){n||(n=Xt(e,t));var i=sn(e,t,Yt(e,n,r),"line").top;return mn(e,t,n,i)}function yn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function vn(e,t,n,r,i){var o,l,a,s,c,u,d,f,h,p,m,g,y,v,b,x;return i-=it(t),o=Xt(e,t),l=an(t),a=0,s=t.text.length,c=!0,u=A(t,e.doc.direction),u&&(d=(e.options.lineWrapping?xn:bn)(e,t,n,o,u,r,i),c=1!=d.level,a=c?d.from:d.to-1,s=c?d.to:d.from-1),f=null,h=null,p=M(function(t){var n=Yt(e,o,t);return n.top+=l,n.bottom+=l,!!yn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(f=t,h=n),!0)},a,s),y=!1,h?(v=r-h.left<h.right-r,b=v==c,p=f+(b?0:1),g=b?"after":"before",m=v?h.left:h.right):(c||p!=s&&p!=a||p++,g=0==p?"after":p==t.text.length?"before":Yt(e,o,p-(c?1:0)).bottom+l<=i==c?"after":"before",x=dn(e,ce(n,p,g),"line",t,o),m=x.left,y=i<x.top?-1:i>=x.bottom?1:0),p=T(t.text,p,1),hn(n,p,g,y,r-m)}function bn(e,t,n,r,i,o,l){var a,s,c=M(function(a){var s=i[a],c=1!=s.level;return yn(dn(e,ce(n,c?s.to:s.from,c?"before":"after"),"line",t,r),o,l,!0)},0,i.length-1),u=i[c];return c>0&&(a=1!=u.level,s=dn(e,ce(n,a?u.from:u.to,a?"after":"before"),"line",t,r),yn(s,o,l,!0)&&s.top>l&&(u=i[c-1])),u}function xn(e,t,n,r,i,o,l){var a,s,c,u,d,f,h,p=mn(e,t,r,l),m=p.begin,g=p.end;for(/\s/.test(t.text.charAt(g-1))&&g--,a=null,s=null,c=0;c<i.length;c++)u=i[c],u.from>=g||u.to<=m||(d=1!=u.level,f=Yt(e,r,d?Math.min(g,u.to)-1:Math.max(m,u.from)).right,h=f<o?o-f+1e9:f-o,(!a||s>h)&&(a=u,s=h));return a||(a=i[i.length-1]),a.from<m&&(a={from:m,to:a.to,level:a.level}),a.to>g&&(a={from:a.from,to:g,level:a.level}),a}function wn(e){var i,o;if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ia){for(ia=r("pre",null,"CodeMirror-line-like"),i=0;i<49;++i)ia.appendChild(document.createTextNode("x")),ia.appendChild(r("br"));ia.appendChild(document.createTextNode("x"))}return n(e.measure,ia),o=ia.offsetHeight/50,o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function kn(e){var t,i,o,l;return null!=e.cachedCharWidth?e.cachedCharWidth:(t=r("span","xxxxxxxxxx"),i=r("pre",[t],"CodeMirror-line-like"),n(e.measure,i),o=t.getBoundingClientRect(),l=(o.right-o.left)/10,l>2&&(e.cachedCharWidth=l),l||10)}function _n(e){var t,n,r,i=e.display,o={},l={},a=i.gutters.clientLeft;for(t=i.gutters.firstChild,n=0;t;t=t.nextSibling,++n)r=e.display.gutterSpecs[n].className,o[r]=t.offsetLeft+t.clientLeft+a,l[r]=t.clientWidth;return{fixedPos:Cn(i),gutterTotalWidth:i.gutters.offsetWidth,gutterLeft:o,gutterWidth:l,wrapperWidth:i.wrapper.clientWidth}}function Cn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Sn(e){var t=wn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/kn(e.display)-3);return function(i){var o,l;if(nt(e.doc,i))return 0;if(o=0,i.widgets)for(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 Tn(e){var t=e.doc,n=Sn(e);t.iter(function(e){var t=n(e);t!=e.height&&ie(e,t)})}function Mn(e,t,n,r){var i,o,l,a,s,c,u=e.display;if(!n&&"true"==B(t).getAttribute("cm-not-content"))return null;l=u.lineSpace.getBoundingClientRect();try{i=t.clientX-l.left,o=t.clientY-l.top}catch(e){return null}return a=pn(e,i,o),r&&a.xRel>0&&(s=te(e.doc,a.line).text).length==a.ch&&(c=h(s,s.length,e.options.tabSize)-s.length,a=ce(a.line,Math.max(0,Math.round((i-Ht(e.display).left)/kn(e.display))-c))),a}function Ln(e,t){var n,r;if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Nn(e,t,n,r){var i,o,l,a,s,c;null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0),i=e.display,r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo?Zl&&et(e.doc,t)<i.viewTo&&On(e):n<=i.viewFrom?Zl&&tt(e.doc,n+r)>i.viewFrom?On(e):(i.viewFrom+=r,i.viewTo+=r):t<=i.viewFrom&&n>=i.viewTo?On(e):t<=i.viewFrom?(o=zn(e,n,n+r,1),o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):On(e)):n>=i.viewTo?(l=zn(e,t,t,-1),l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):On(e)):(a=zn(e,t,t,-1),s=zn(e,n,n+r,1),a&&s?(i.view=i.view.slice(0,a.index).concat(vt(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):On(e)),c=i.externalMeasured,c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function An(e,t,n){var r,i,o,l;e.curOp.viewChanged=!0,r=e.display,i=e.display.externalMeasured,i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo||(o=r.view[Ln(e,t)],null!=o.node&&(l=o.changes||(o.changes=[]),p(l,n)==-1&&l.push(n)))}function On(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zn(e,t,n,r){var i,o,l,a=Ln(e,t),s=e.display.view;if(!Zl||n==e.doc.first+e.doc.size)return{index:a,lineN:n};for(o=e.display.viewFrom,l=0;l<a;l++)o+=s[l].size;if(o!=t){if(r>0){if(a==s.length-1)return null;i=o+s[a].size-t,a++}else i=o-t;t+=i,n+=i}for(;et(e.doc,n)!=n;){if(a==(r<0?0:s.length-1))return null;n+=r*s[a-(r<0?1:0)].size,a+=r}return{index:a,lineN:n}}function Dn(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=vt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=vt(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Ln(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(vt(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Ln(e,n)))),r.viewTo=n}function Pn(e){var t,n,r=e.display.view,i=0;for(t=0;t<r.length;t++)n=r[t],n.hidden||n.node&&!n.changes||++i;return i}function In(e){e.display.input.showSelection(e.display.input.prepareSelection())}function En(e,t){var n,r,i,o,l,a,s,c,u;for(void 0===t&&(t=!0),n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),l=e.options.$customCursor,l&&(t=!0),a=0;a<n.sel.ranges.length;a++)(t||a!=n.sel.primIndex)&&(s=n.sel.ranges[a],s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom||(c=s.empty(),l?(u=l(e,s),u&&Fn(e,u,i)):(c||e.options.showCursorWhenSelecting)&&Fn(e,s.head,i),c||Wn(e,s,o)));return r}function Fn(e,t,n){var i,o,l,a=dn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),s=n.appendChild(r("div"," ","CodeMirror-cursor"));s.style.left=a.left+"px",s.style.top=a.top+"px",s.style.height=Math.max(0,a.bottom-a.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)&&(i=un(e,t,"div",null,null),o=i.right-i.left,s.style.width=(o>0?o:e.defaultCharWidth())+"px"),a.other&&(l=n.appendChild(r("div"," ","CodeMirror-cursor CodeMirror-secondarycursor")),l.style.display="",l.style.left=a.other.left+"px",l.style.top=a.other.top+"px",l.style.height=.85*(a.other.bottom-a.other.top)+"px")}function qn(e,t){return e.top-t.top||e.left-t.left}function Wn(e,t,n){function i(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),h.appendChild(r("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==n?g-e:n)+"px;\n                             height: "+(i-t)+"px"))}function o(t,n,r){function o(n,r){return un(e,ce(t,n),"div",c,r)}function l(t,n,r){var i=gn(e,c,null,t),l="ltr"==n==("after"==r)?"left":"right",a="after"==r?i.begin:i.end-(/\s/.test(c.text.charAt(i.end-1))?2:1);return o(a,l)[l]}var a,s,c=te(f,t),u=c.text.length,d=A(c,f.direction);return L(d,n||0,null==r?u:r,function(e,t,c,f){var h,p,v,b,x,w,k,_,C="ltr"==c,S=o(e,C?"left":"right"),T=o(t-1,C?"right":"left"),M=null==n&&0==e,L=null==r&&t==u,N=0==f,A=!d||f==d.length-1;T.top-S.top<=3?(h=(y?M:L)&&N,p=(y?L:M)&&A,v=h?m:(C?S:T).left,b=p?g:(C?T:S).right,i(v,S.top,b-v,S.bottom)):(C?(x=y&&M&&N?m:S.left,w=y?g:l(e,c,"before"),k=y?m:l(t,c,"after"),_=y&&L&&A?g:T.right):(x=y?l(e,c,"before"):m,w=!y&&M&&N?g:S.right,k=!y&&L&&A?m:T.left,_=y?l(t,c,"after"):g),i(x,S.top,w-x,S.bottom),S.bottom<T.top&&i(m,S.bottom,null,T.top),i(k,T.top,_-k,T.bottom)),(!a||qn(S,a)<0)&&(a=S),qn(T,a)<0&&(a=T),(!s||qn(S,s)<0)&&(s=S),qn(T,s)<0&&(s=T)}),{start:a,end:s}}var l,a,s,c,u,d=e.display,f=e.doc,h=document.createDocumentFragment(),p=Ht(e.display),m=p.left,g=Math.max(d.sizerWidth,Bt(e)-d.sizer.offsetLeft)-p.right,y="ltr"==f.direction,v=t.from(),b=t.to();v.line==b.line?o(v.line,v.ch,b.ch):(l=te(f,v.line),a=te(f,b.line),s=Ze(l)==Ze(a),c=o(v.line,v.ch,s?l.text.length+1:null).end,u=o(b.line,s?0:null,b.ch).start,s&&(c.top<u.top-2?(i(c.right,c.top,null,c.bottom),i(m,u.top,u.left,u.bottom)):i(c.right,c.top,u.left-c.right,c.bottom)),c.bottom<u.top&&i(m,c.bottom,null,u.top)),n.appendChild(h)}function Hn(e){var t,n;e.state.focused&&(t=e.display,clearInterval(t.blinker),n=!0,t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Un(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden"))}function Rn(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||jn(e))}function Bn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Un(e))},100)}function jn(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(D(e,"focus",e,t),e.state.focused=!0,a(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Za&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Hn(e))}function Un(e,t){e.state.delayingBlurEvent||(e.state.focused&&(D(e,"blur",e,t),e.state.focused=!1,xl(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Kn(e){var t,n,r,i,o,l,a,s,c,u,d=e.display,f=d.lineDiv.offsetTop,h=Math.max(0,d.scroller.getBoundingClientRect().top),p=d.lineDiv.getBoundingClientRect().top,m=0;for(t=0;t<d.view.length;t++)if(n=d.view[t],r=e.options.lineWrapping,i=void 0,o=0,!n.hidden){if(p+=n.line.height,Xa&&Ya<8?(l=n.node.offsetTop+n.node.offsetHeight,i=l-f,f=l):(a=n.node.getBoundingClientRect(),i=a.bottom-a.top,!r&&n.text.firstChild&&(o=n.text.firstChild.getBoundingClientRect().right-a.left-1)),s=n.line.height-i,(s>.005||s<-.005)&&(p<h&&(m-=s),ie(n.line,i),Vn(n.line),n.rest))for(c=0;c<n.rest.length;c++)Vn(n.rest[c]);o>e.display.sizerWidth&&(u=Math.ceil(o/kn(e.display)),u>e.display.maxLineLength&&(e.display.maxLineLength=u,e.display.maxLine=n.line,e.display.maxLineChanged=!0))}Math.abs(m)>2&&(d.scroller.scrollTop+=m)}function Vn(e){var t,n,r;if(e.widgets)for(t=0;t<e.widgets.length;++t)n=e.widgets[t],r=n.node.parentNode,r&&(n.height=r.offsetHeight)}function $n(e,t,n){var r,i,o,l,a,s=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;return s=Math.floor(s-qt(e)),r=n&&null!=n.bottom?n.bottom:s+e.wrapper.clientHeight,i=le(t,s),o=le(t,r),n&&n.ensure&&(l=n.ensure.from.line,a=n.ensure.to.line,l<i?(i=l,o=le(t,it(te(t,l))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=o&&(i=le(t,it(te(t,a))-e.wrapper.clientHeight),o=a)),{from:i,to:Math.max(o,i+1)}}function Gn(e,t){var n,i,o,l,a;P(e,"scrollCursorIntoView")||(n=e.display,i=n.sizer.getBoundingClientRect(),o=null,l=n.wrapper.ownerDocument,t.top+i.top<0?o=!0:t.bottom+i.top>(l.defaultView.innerHeight||l.documentElement.clientHeight)&&(o=!1),null==o||is||(a=r("div","​",null,"position: absolute;\n                         top: "+(t.top-n.viewOffset-qt(e.display))+"px;\n                         height: "+(t.bottom-t.top+Rt(e)+n.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;"),e.display.lineSpace.appendChild(a),a.scrollIntoView(o),e.display.lineSpace.removeChild(a)))}function Xn(e,t,n,r){var i,o,l,a,s,c,u,d;for(null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?ce(t.line,t.ch+1,"before"):t,t=t.ch?ce(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t),o=0;o<5&&(l=!1,a=dn(e,t),s=n&&n!=t?dn(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},c=Zn(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft,null!=c.scrollTop&&(ir(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(l=!0)),null!=c.scrollLeft&&(lr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(l=!0)),l);o++);return i}function Yn(e,t){var n=Zn(e,t);null!=n.scrollTop&&ir(e,n.scrollTop),null!=n.scrollLeft&&lr(e,n.scrollLeft)}function Zn(e,t){var n,r,i,o,l,a,s,c,u,d,f,h=e.display,p=wn(e.display);return t.top<0&&(t.top=0),n=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:h.scroller.scrollTop,r=jt(e),i={},t.bottom-t.top>r&&(t.bottom=t.top+r),o=e.doc.height+Wt(h),l=t.top<p,a=t.bottom>o-p,t.top<n?i.scrollTop=l?0:t.top:t.bottom>n+r&&(s=Math.min(t.top,(a?o:t.bottom)-r),s!=n&&(i.scrollTop=s)),c=e.options.fixedGutter?0:h.gutters.offsetWidth,u=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:h.scroller.scrollLeft-c,d=Bt(e)-h.gutters.offsetWidth,f=t.right-t.left>d,f&&(t.right=t.left+d),t.left<10?i.scrollLeft=0:t.left<u?i.scrollLeft=Math.max(0,t.left+c-(f?0:10)):t.right>d+u-3&&(i.scrollLeft=t.right+(f?0:10)-d),i}function Qn(e,t){null!=t&&(nr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Jn(e){nr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function er(e,t,n){null==t&&null==n||nr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function tr(e,t){nr(e),e.curOp.scrollToPos=t}function nr(e){var t,n,r=e.curOp.scrollToPos;r&&(e.curOp.scrollToPos=null,t=fn(e,r.from),n=fn(e,r.to),rr(e,t,n,r.margin))}function rr(e,t,n,r){var i=Zn(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});er(e,i.scrollLeft,i.scrollTop)}function ir(e,t){Math.abs(e.doc.scrollTop-t)<2||(Ka||Ar(e,{top:t}),or(e,t,!0),Ka&&Ar(e),_r(e,100))}function or(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 lr(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,Pr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function ar(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Wt(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+Rt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function sr(e,t){var n,r,i;for(t||(t=ar(e)),n=e.display.barWidth,r=e.display.barHeight,cr(e,t),i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Kn(e),cr(e,ar(e)),n=e.display.barWidth,r=e.display.barHeight}function cr(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=""}function ur(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&xl(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new aa[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Il(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?lr(e,t):ir(e,t)},e),e.display.scrollbars.addClass&&a(e.display.wrapper,e.display.scrollbars.addClass)}function dr(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:++sa,markArrays:null},bt(e.curOp)}function fr(e){var t=e.curOp;t&&wt(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;hr(e)})}function hr(e){var t,n,r,i,o,l=e.ops;for(t=0;t<l.length;t++)pr(l[t]);for(n=0;n<l.length;n++)mr(l[n]);for(r=0;r<l.length;r++)gr(l[r]);for(i=0;i<l.length;i++)yr(l[i]);for(o=0;o<l.length;o++)vr(l[o])}function pr(e){var t=e.cm,n=t.display;Sr(t),e.updateMaxLine&&lt(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 ca(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function mr(e){e.updatedDisplay=e.mustUpdate&&Lr(e.cm,e.update)}function gr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Kn(t),e.barMeasure=ar(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$t(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+Rt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Bt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function yr(e){var t,n=e.cm;null!=e.adjustWidthTo&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&lr(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1),t=e.focus&&e.focus==l(c(n)),e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,t),(e.updatedDisplay||e.startHeight!=n.doc.height)&&sr(n,e.barMeasure),e.updatedDisplay&&Dr(n,e.barMeasure),e.selectionChanged&&Hn(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),t&&Rn(e.cm)}function vr(e){var t,n,r,i,o,l=e.cm,a=l.display,s=l.doc;if(e.updatedDisplay&&Nr(l,e.update),null==a.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(a.wheelStartX=a.wheelStartY=null),null!=e.scrollTop&&or(l,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&lr(l,e.scrollLeft,!0,!0),e.scrollToPos&&(t=Xn(l,ge(s,e.scrollToPos.from),ge(s,e.scrollToPos.to),e.scrollToPos.margin),Gn(l,t)),n=e.maybeHiddenMarkers,r=e.maybeUnhiddenMarkers,n)for(i=0;i<n.length;++i)n[i].lines.length||D(n[i],"hide");if(r)for(o=0;o<r.length;++o)r[o].lines.length&&D(r[o],"unhide");a.wrapper.offsetHeight&&(s.scrollTop=l.display.scroller.scrollTop),e.changeObjs&&D(l,"changes",l,e.changeObjs),e.update&&e.update.finish()}function br(e,t){if(e.curOp)return t();dr(e);try{return t()}finally{fr(e)}}function xr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);dr(e);try{return t.apply(e,arguments)}finally{fr(e)}}}function wr(e){return function(){if(this.curOp)return e.apply(this,arguments);dr(this);try{return e.apply(this,arguments)}finally{fr(this)}}}function kr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);dr(t);try{return e.apply(this,arguments)}finally{fr(t)}}}function _r(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,d(Cr,e))}function Cr(e){var t,n,r,i=e.doc;i.highlightFrontier>=e.display.viewTo||(t=+new Date+e.options.workTime,n=we(e,i.highlightFrontier),r=[],i.iter(n.line,Math.min(i.first+i.size,e.display.viewTo+500),function(o){var l,a,s,c,u,d,f;if(n.line>=e.display.viewFrom){for(l=o.styles,a=o.text.length>e.options.maxHighlightLength?Q(i.mode,n.state):null,s=be(e,o,n,!0),a&&(n.state=a),o.styles=s.styles,c=o.styleClasses,u=s.classes,u?o.styleClasses=u:c&&(o.styleClasses=null),d=!l||l.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&f<l.length;++f)d=l[f]!=o.styles[f];d&&r.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&ke(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>t)return _r(e,e.options.workDelay),!0}),i.highlightFrontier=n.line,i.modeFrontier=Math.max(i.modeFrontier,n.line),r.length&&br(e,function(){for(var t=0;t<r.length;t++)An(e,r[t],"text")}))}function Sr(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Rt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Rt(e)+"px",t.scrollbarsClipped=!0)}function Tr(e){var t,n,r;return e.hasFocus()?null:(t=l(c(e)),t&&o(e.display.lineDiv,t)?(n={activeElt:t},window.getSelection&&(r=u(e).getSelection(),r.anchorNode&&r.extend&&o(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)),n):null)}function Mr(e){var t,n,r;e&&e.activeElt&&e.activeElt!=l(e.activeElt.ownerDocument)&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&o(document.body,e.anchorNode)&&o(document.body,e.focusNode)&&(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 Lr(e,n){var r,i,o,l,a,s,c=e.display,u=e.doc;return n.editorIsHidden?(On(e),!1):!(!n.force&&n.visible.from>=c.viewFrom&&n.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Pn(e))&&(Ir(e)&&(On(e),n.dims=_n(e)),r=u.first+u.size,i=Math.max(n.visible.from-e.options.viewportMargin,u.first),o=Math.min(r,n.visible.to+e.options.viewportMargin),c.viewFrom<i&&i-c.viewFrom<20&&(i=Math.max(u.first,c.viewFrom)),c.viewTo>o&&c.viewTo-o<20&&(o=Math.min(r,c.viewTo)),Zl&&(i=et(e.doc,i),o=tt(e.doc,o)),l=i!=c.viewFrom||o!=c.viewTo||c.lastWrapHeight!=n.wrapperHeight||c.lastWrapWidth!=n.wrapperWidth,Dn(e,i,o),c.viewOffset=it(te(e.doc,c.viewFrom)),e.display.mover.style.top=c.viewOffset+"px",a=Pn(e),!(!l&&0==a&&!n.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))&&(s=Tr(e),a>4&&(c.lineDiv.style.display="none"),Or(e,c.updateLineNumbers,n.dims),a>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,Mr(s),t(c.cursorDiv),t(c.selectionDiv),c.gutters.style.height=c.sizer.style.minHeight=0,l&&(c.lastWrapHeight=n.wrapperHeight,c.lastWrapWidth=n.wrapperWidth,_r(e,400)),c.updateLineNumbers=null,!0))}function Nr(e,t){var n,r,i=t.viewport;for(n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Bt(e))n&&(t.visible=$n(e.display,e.doc,i));else if(i&&null!=i.top&&(i={top:Math.min(e.doc.height+Wt(e.display)-jt(e),i.top)}),t.visible=$n(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Lr(e,t))break;Kn(e),r=ar(e),In(e),sr(e,r),Dr(e,r),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 Ar(e,t){var n,r=new ca(e,t);Lr(e,r)&&(Kn(e),Nr(e,r),n=ar(e),In(e),sr(e,n),Dr(e,n),r.finish())}function Or(e,n,r){function i(t){var n=t.nextSibling;return Za&&ss&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}var o,l,a,s,c=e.display,u=e.options.lineNumbers,d=c.lineDiv,f=d.firstChild,h=c.view,m=c.viewFrom;for(o=0;o<h.length;o++){if(l=h[o],l.hidden);else if(l.node&&l.node.parentNode==d){for(;f!=l.node;)f=i(f);s=u&&null!=n&&n<=m&&l.lineNumber,l.changes&&(p(l.changes,"gutter")>-1&&(s=!1),Ct(e,l,m,r)),s&&(t(l.lineNumber),l.lineNumber.appendChild(document.createTextNode(se(e.options,m)))),f=l.node.nextSibling}else a=zt(e,l,m,r),d.insertBefore(a,f);m+=l.size}for(;f;)f=i(f)}function zr(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",kt(e,"gutterChanged",e)}function Dr(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+Rt(e)+"px"}function Pr(e){var t,n,r,i,o,l,a=e.display,s=a.view;if(a.alignWidgets||a.gutters.firstChild&&e.options.fixedGutter){for(t=Cn(a)-a.scroller.scrollLeft+e.doc.scrollLeft,n=a.gutters.offsetWidth,r=t+"px",i=0;i<s.length;i++)if(!s[i].hidden&&(e.options.fixedGutter&&(s[i].gutter&&(s[i].gutter.style.left=r),s[i].gutterBackground&&(s[i].gutterBackground.style.left=r)),o=s[i].alignable))for(l=0;l<o.length;l++)o[l].style.left=r;e.options.fixedGutter&&(a.gutters.style.left=t+n+"px")}}function Ir(e){var t,n,i,o,l,a;return!!e.options.lineNumbers&&(t=e.doc,n=se(e.options,t.first+t.size-1),i=e.display,n.length!=i.lineNumChars&&(o=i.measure.appendChild(r("div",[r("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),l=o.firstChild.offsetWidth,a=o.offsetWidth-l,i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(l,i.lineGutter.offsetWidth-a)+1,i.lineNumWidth=i.lineNumInnerWidth+a,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",zr(e.display),!0))}function Er(e,t){var n,r,i,o=[],l=!1;for(n=0;n<e.length;n++){if(r=e[n],i=null,"string"!=typeof r&&(i=r.style,r=r.className),"CodeMirror-linenumbers"==r){if(!t)continue;l=!0}o.push({className:r,style:i})}return t&&!l&&o.push({className:"CodeMirror-linenumbers",style:null}),o}function Fr(e){var n,i,o,l,a,s=e.gutters,c=e.gutterSpecs;for(t(s),e.lineGutter=null,n=0;n<c.length;++n)i=c[n],o=i.className,l=i.style,a=s.appendChild(r("div",null,"CodeMirror-gutter "+o)),l&&(a.style.cssText=l),"CodeMirror-linenumbers"==o&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px");s.style.display=c.length?"":"none",zr(e)}function qr(e){Fr(e.display),Nn(e),Pr(e)}function Wr(e,t,n,o){var l,a=this;this.input=n,a.scrollbarFiller=r("div",null,"CodeMirror-scrollbar-filler"),a.scrollbarFiller.setAttribute("cm-not-content","true"),a.gutterFiller=r("div",null,"CodeMirror-gutter-filler"),a.gutterFiller.setAttribute("cm-not-content","true"),a.lineDiv=i("div",null,"CodeMirror-code"),a.selectionDiv=r("div",null,null,"position: relative; z-index: 1"),a.cursorDiv=r("div",null,"CodeMirror-cursors"),a.measure=r("div",null,"CodeMirror-measure"),a.lineMeasure=r("div",null,"CodeMirror-measure"),a.lineSpace=i("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none"),l=i("div",[a.lineSpace],"CodeMirror-lines"),a.mover=r("div",[l],null,"position: relative"),a.sizer=r("div",[a.mover],"CodeMirror-sizer"),a.sizerWidth=null,a.heightForcer=r("div",null,null,"position: absolute; height: "+Cl+"px; width: 1px;"),a.gutters=r("div",null,"CodeMirror-gutters"),a.lineGutter=null,a.scroller=r("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll"),a.scroller.setAttribute("tabIndex","-1"),a.wrapper=r("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror"),a.wrapper.setAttribute("translate","no"),Xa&&Ya<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),Za||Ka&&as||(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=Er(o.gutters,o.lineNumbers),Fr(a),n.init(a)}function Hr(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 Rr(e){var t=Hr(e);return t.x*=da,t.y*=da,t}function Br(e,t){var n,r,i,o,l,a,s,c,u,d,f,h,p,m;if(Ja&&102==es&&(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)),n=Hr(t),r=n.x,i=n.y,o=da,0===t.deltaMode&&(r=t.deltaX,i=t.deltaY,o=1),l=e.display,a=l.scroller,s=a.scrollWidth>a.clientWidth,c=a.scrollHeight>a.clientHeight,r&&s||i&&c){if(i&&ss&&Za)e:for(u=t.target,d=l.view;u!=a;u=u.parentNode)for(f=0;f<d.length;f++)if(d[f].node==u){e.display.currentWheelTarget=u;break e}if(r&&!Ka&&!ts&&null!=o)return i&&c&&ir(e,Math.max(0,a.scrollTop+i*o)),
lr(e,Math.max(0,a.scrollLeft+r*o)),(!i||i&&c)&&q(t),void(l.wheelStartX=null);i&&null!=o&&(h=i*o,p=e.doc.scrollTop,m=p+l.wrapper.clientHeight,h<0?p=Math.max(0,p+h-50):m=Math.min(e.doc.height,m+h+50),Ar(e,{top:p,bottom:m})),ua<20&&0!==t.deltaMode&&(null==l.wheelStartX?(l.wheelStartX=a.scrollLeft,l.wheelStartY=a.scrollTop,l.wheelDX=r,l.wheelDY=i,setTimeout(function(){var e,t,n;null!=l.wheelStartX&&(e=a.scrollLeft-l.wheelStartX,t=a.scrollTop-l.wheelStartY,n=t&&l.wheelDY&&t/l.wheelDY||e&&l.wheelDX&&e/l.wheelDX,l.wheelStartX=l.wheelStartY=null,n&&(da=(da*ua+n)/(ua+1),++ua))},200)):(l.wheelDX+=r,l.wheelDY+=i))}}function jr(e,t,n){var r,i,o,l,a,s,c,u=e&&e.options.selectionsMayTouch,d=t[n];for(t.sort(function(e,t){return ue(e.from(),t.from())}),n=p(t,d),r=1;r<t.length;r++)i=t[r],o=t[r-1],l=ue(o.to(),i.from()),(u&&!i.empty()?l>0:l>=0)&&(a=pe(o.from(),i.from()),s=he(o.to(),i.to()),c=o.empty()?i.from()==i.head:o.from()==o.head,r<=n&&--n,t.splice(--r,2,new ha(c?s:a,c?a:s)));return new fa(t,n)}function Ur(e,t){return new fa([new ha(e,t||e)],0)}function Kr(e){return e.text?ce(e.from.line+e.text.length-1,y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Vr(e,t){if(ue(e,t.from)<0)return e;if(ue(e,t.to)<=0)return Kr(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+=Kr(t).ch-t.to.ch),ce(n,r)}function $r(e,t){var n,r,i=[];for(n=0;n<e.sel.ranges.length;n++)r=e.sel.ranges[n],i.push(new ha(Vr(r.anchor,t),Vr(r.head,t)));return jr(e.cm,i,e.sel.primIndex)}function Gr(e,t,n){return e.line==t.line?ce(n.line,e.ch-t.ch+n.ch):ce(n.line+(e.line-t.line),e.ch)}function Xr(e,t,n){var r,i,o,l,a,s,c=[],u=ce(e.first,0),d=u;for(r=0;r<t.length;r++)i=t[r],o=Gr(i.from,u,d),l=Gr(Kr(i),u,d),u=i.to,d=l,"around"==n?(a=e.sel.ranges[r],s=ue(a.head,a.anchor)<0,c[r]=new ha(s?l:o,s?o:l)):c[r]=new ha(o,o);return new fa(c,e.sel.primIndex)}function Yr(e){e.doc.mode=Y(e.options,e.doc.modeOption),Zr(e)}function Zr(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,_r(e,100),e.state.modeGen++,e.curOp&&Nn(e)}function Qr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Jr(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){at(e,n,i,r),kt(e,"change",e,t)}function l(e,t){var n,o=[];for(n=e;n<t;++n)o.push(new Ql(f[n],i(n),r));return o}var a,s,c,u=t.from,d=t.to,f=t.text,h=te(e,u.line),p=te(e,d.line),m=y(f),g=i(f.length-1),v=d.line-u.line;t.full?(e.insert(0,l(0,f.length)),e.remove(f.length,e.size-f.length)):Qr(e,t)?(a=l(0,f.length-1),o(p,p.text,g),v&&e.remove(u.line,v),a.length&&e.insert(u.line,a)):h==p?1==f.length?o(h,h.text.slice(0,u.ch)+m+h.text.slice(d.ch),g):(s=l(1,f.length-1),s.push(new Ql(m+h.text.slice(d.ch),g,r)),o(h,h.text.slice(0,u.ch)+f[0],i(0)),e.insert(u.line+1,s)):1==f.length?(o(h,h.text.slice(0,u.ch)+f[0]+p.text.slice(d.ch),i(0)),e.remove(u.line+1,v)):(o(h,h.text.slice(0,u.ch)+f[0],i(0)),o(p,m+p.text.slice(d.ch),g),c=l(1,f.length-1),v>1&&e.remove(u.line+1,v-1),e.insert(u.line+1,c)),kt(e,"change",e,t)}function ei(e,t,n){function r(e,i,o){var l,a,s;if(e.linked)for(l=0;l<e.linked.length;++l)a=e.linked[l],a.doc!=i&&(s=o&&a.sharedHist,n&&!s||(t(a.doc,s),r(a.doc,e,s)))}r(e,null,!0)}function ti(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Tn(e),Yr(e),ni(e),e.options.direction=t.direction,e.options.lineWrapping||lt(e),e.options.mode=t.modeOption,Nn(e)}function ni(e){("rtl"==e.doc.direction?a:xl)(e.display.lineDiv,"CodeMirror-rtl")}function ri(e){br(e,function(){ni(e),Nn(e)})}function ii(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 oi(e,t){var n={from:fe(t.from),to:Kr(t),text:ne(e,t.from,t.to)};return fi(e,n,t.from.line,t.to.line+1),ei(e,function(e){return fi(e,n,t.from.line,t.to.line+1)},!0),n}function li(e){for(;e.length;){var t=y(e);if(!t.ranges)break;e.pop()}}function ai(e,t){return t?(li(e.done),y(e.done)):e.done.length&&!y(e.done).ranges?y(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),y(e.done)):void 0}function si(e,t,n,r){var i,o,l,a,s=e.history;if(s.undone.length=0,i=+new Date,(s.lastOp==r||s.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&s.lastModTime>i-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=ai(s,s.lastOp==r)))l=y(o.changes),0==ue(t.from,t.to)&&0==ue(t.from,l.to)?l.to=Kr(t):o.changes.push(oi(e,t));else for(a=y(s.done),a&&a.ranges||di(e.sel,s.done),o={changes:[oi(e,t)],generation:s.generation},s.done.push(o);s.done.length>s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift();s.done.push(n),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=i,s.lastOp=s.lastSelOp=r,s.lastOrigin=s.lastSelOrigin=t.origin,l||D(e,"historyAdded")}function ci(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 ui(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||ci(e,o,y(i.done),t))?i.done[i.done.length-1]=t:di(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&li(i.undone)}function di(e,t){var n=y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function fi(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 hi(e){var t,n;if(!e)return null;for(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 pi(e,t){var n,r,i=t["spans_"+e.id];if(!i)return null;for(n=[],r=0;r<t.text.length;++r)n.push(hi(i[r]));return n}function mi(e,t){var n,r,i,o,l,a,s=pi(e,t),c=qe(e,t);if(!s)return c;if(!c)return s;for(n=0;n<s.length;++n)if(r=s[n],i=c[n],r&&i)e:for(o=0;o<i.length;++o){for(l=i[o],a=0;a<r.length;++a)if(r[a].marker==l.marker)continue e;r.push(l)}else i&&(s[n]=i);return s}function gi(e,t,n){var r,i,o,l,a,s,c,u,d=[];for(r=0;r<e.length;++r)if(i=e[r],i.ranges)d.push(n?fa.prototype.deepCopy.call(i):i);else for(o=i.changes,l=[],d.push({changes:l}),a=0;a<o.length;++a)if(s=o[a],c=void 0,l.push({from:s.from,to:s.to,text:s.text}),t)for(u in s)(c=u.match(/^spans_(\d+)$/))&&p(t,Number(c[1]))>-1&&(y(l)[u]=s[u],delete s[u]);return d}function yi(e,t,n,r){var i,o;return r?(i=e.anchor,n&&(o=ue(t,i)<0,o!=ue(n,i)<0?(i=t,t=n):o!=ue(t,n)<0&&(t=n)),new ha(i,t)):new ha(n||t,t)}function vi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ci(e,new fa([yi(e.sel.primary(),t,n,i)],0),r)}function bi(e,t,n){var r,i,o=[],l=e.cm&&(e.cm.display.shift||e.extend);for(r=0;r<e.sel.ranges.length;r++)o[r]=yi(e.sel.ranges[r],t[r],null,l);i=jr(e.cm,o,e.sel.primIndex),Ci(e,i,n)}function xi(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Ci(e,jr(e.cm,i,e.sel.primIndex),r)}function wi(e,t,n,r){Ci(e,Ur(t,n),r)}function ki(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 ha(ge(e,t[n].anchor),ge(e,t[n].head))},origin:n&&n.origin};return D(e,"beforeSelectionChange",e,r),e.cm&&D(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?jr(e.cm,r.ranges,r.ranges.length-1):t}function _i(e,t,n){var r=e.history.done,i=y(r);i&&i.ranges?(r[r.length-1]=t,Si(e,t,n)):Ci(e,t,n)}function Ci(e,t,n){Si(e,t,n),ui(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Si(e,t,n){(E(e,"beforeSelectionChange")||e.cm&&E(e.cm,"beforeSelectionChange"))&&(t=ki(e,t,n));var r=n&&n.bias||(ue(t.primary().head,e.sel.primary().head)<0?-1:1);Ti(e,Li(e,t,r,!0)),n&&n.scroll===!1||!e.cm||"nocursor"==e.cm.getOption("readOnly")||Jn(e.cm)}function Ti(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,I(e.cm)),kt(e,"cursorActivity",e))}function Mi(e){Ti(e,Li(e,e.sel,null,!1))}function Li(e,t,n,r){var i,o,l,a,s,c;for(o=0;o<t.ranges.length;o++)l=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Ai(e,l.anchor,a&&a.anchor,n,r),c=l.head==l.anchor?s:Ai(e,l.head,a&&a.head,n,r),(i||s!=l.anchor||c!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new ha(s,c));return i?jr(e.cm,i,t.primIndex):t}function Ni(e,t,n,r,i){var o,l,a,s,c,u,d,f,h=te(e,t.line);if(h.markedSpans)for(o=0;o<h.markedSpans.length;++o)if(l=h.markedSpans[o],a=l.marker,s="selectLeft"in a?!a.selectLeft:a.inclusiveLeft,c="selectRight"in a?!a.selectRight:a.inclusiveRight,(null==l.from||(s?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(c?l.to>=t.ch:l.to>t.ch))){if(i&&(D(a,"beforeCursorEnter"),a.explicitlyCleared)){if(h.markedSpans){--o;continue}break}if(!a.atomic)continue;return n&&(u=a.find(r<0?1:-1),d=void 0,(r<0?c:s)&&(u=Oi(e,u,-r,u&&u.line==t.line?h:null)),u&&u.line==t.line&&(d=ue(u,n))&&(r<0?d<0:d>0))?Ni(e,u,t,r,i):(f=a.find(r<0?-1:1),(r<0?s:c)&&(f=Oi(e,f,r,f.line==t.line?h:null)),f?Ni(e,f,t,r,i):null)}return t}function Ai(e,t,n,r,i){var o=r||1,l=Ni(e,t,n,o,i)||!i&&Ni(e,t,n,o,!0)||Ni(e,t,n,-o,i)||!i&&Ni(e,t,n,-o,!0);return l?l:(e.cantEdit=!0,ce(e.first,0))}function Oi(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ge(e,ce(t.line-1)):null:n>0&&t.ch==(r||te(e,t.line)).text.length?t.line<e.first+e.size-1?ce(t.line+1,0):null:new ce(t.line,t.ch+n)}function zi(e){e.setSelection(ce(e.firstLine(),0),ce(e.lastLine()),Tl)}function Di(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=ge(e,t)),n&&(r.to=ge(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),D(e,"beforeChange",e,r),e.cm&&D(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 Pi(e,t,n){var r,i;if(e.cm){if(!e.cm.curOp)return xr(e.cm,Pi)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(E(e,"beforeChange")||e.cm&&E(e.cm,"beforeChange"))||(t=Di(e,t,!0)))if(r=Yl&&!n&&He(e,t.from,t.to))for(i=r.length-1;i>=0;--i)Ii(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Ii(e,t)}function Ii(e,t){var n,r;1==t.text.length&&""==t.text[0]&&0==ue(t.from,t.to)||(n=$r(e,t),si(e,t,n,e.cm?e.cm.curOp.id:NaN),qi(e,t,n,qe(e,t)),r=[],ei(e,function(e,n){n||p(r,e.history)!=-1||(ji(e.history,t),r.push(e.history)),qi(e,t,null,qe(e,t))}))}function Ei(e,t,n){var r,i,o,l,a,s,c,u,d,f,h,m=e.cm&&e.cm.state.suppressEdits;if(!m||n){for(r=e.history,o=e.sel,l="undo"==t?r.done:r.undone,a="undo"==t?r.undone:r.done,s=0;s<l.length&&(i=l[s],n?!i.ranges||i.equals(e.sel):i.ranges);s++);if(s!=l.length){for(r.lastOrigin=r.lastSelOrigin=null;;){if(i=l.pop(),!i.ranges){if(m)return void l.push(i);break}if(di(i,a),n&&!i.equals(e.sel))return void Ci(e,i,{clearRedo:!1});o=i}for(c=[],di(o,a),a.push({changes:c,generation:r.generation}),r.generation=i.generation||++r.maxGeneration,u=E(e,"beforeChange")||e.cm&&E(e.cm,"beforeChange"),d=function(n){var r,o,a=i.changes[n];return a.origin=t,u&&!Di(e,a,!1)?(l.length=0,{}):(c.push(oi(e,a)),r=n?$r(e,a):y(l),qi(e,a,r,mi(e,a)),!n&&e.cm&&e.cm.scrollIntoView({from:a.from,to:Kr(a)}),o=[],void ei(e,function(e,t){t||p(o,e.history)!=-1||(ji(e.history,a),o.push(e.history)),qi(e,a,null,mi(e,a))}))},f=i.changes.length-1;f>=0;--f)if(h=d(f))return h.v}}}function Fi(e,t){if(0!=t&&(e.first+=t,e.sel=new fa(v(e.sel.ranges,function(e){return new ha(ce(e.anchor.line+t,e.anchor.ch),ce(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Nn(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)An(e.cm,r,"gutter")}}function qi(e,t,n,r){var i,o;return e.cm&&!e.cm.curOp?xr(e.cm,qi)(e,t,n,r):t.to.line<e.first?void Fi(e,t.text.length-1-(t.to.line-t.from.line)):void(t.from.line>e.lastLine()||(t.from.line<e.first&&(i=t.text.length-1-(e.first-t.from.line),Fi(e,i),t={from:ce(e.first,0),to:ce(t.to.line+i,t.to.ch),text:[y(t.text)],origin:t.origin}),o=e.lastLine(),t.to.line>o&&(t={from:t.from,to:ce(o,te(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ne(e,t.from,t.to),n||(n=$r(e,t)),e.cm?Wi(e.cm,t,r):Jr(e,t,r),Si(e,n,Tl),e.cantEdit&&Ai(e,ce(e.firstLine(),0))&&(e.cantEdit=!1)))}function Wi(e,t,n){var r,i,o,l,a=e.doc,s=e.display,c=t.from,u=t.to,d=!1,f=c.line;e.options.lineWrapping||(f=oe(Ze(te(a,c.line))),a.iter(f,u.line+1,function(e){if(e==s.maxLine)return d=!0,!0})),a.sel.contains(t.from,t.to)>-1&&I(e),Jr(a,t,n,Sn(e)),e.options.lineWrapping||(a.iter(f,c.line+t.text.length,function(e){var t=ot(e);t>s.maxLineLength&&(s.maxLine=e,s.maxLineLength=t,s.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0)),Ne(a,c.line),_r(e,400),r=t.text.length-(u.line-c.line)-1,t.full?Nn(e):c.line!=u.line||1!=t.text.length||Qr(e.doc,t)?Nn(e,c.line,u.line+1,r):An(e,c.line,"text"),i=E(e,"changes"),o=E(e,"change"),(o||i)&&(l={from:c,to:u,text:t.text,removed:t.removed,origin:t.origin},o&&kt(e,"change",e,l),i&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(l)),e.display.selForContextMenu=null}function Hi(e,t,n,r,i){var o;r||(r=n),ue(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Pi(e,{from:n,to:r,text:t,origin:i})}function Ri(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Bi(e,t,n,r){var i,o,l,a,s,c;for(i=0;i<e.length;++i)if(o=e[i],l=!0,o.ranges)for(o.copied||(o=e[i]=o.deepCopy(),o.copied=!0),a=0;a<o.ranges.length;a++)Ri(o.ranges[a].anchor,t,n,r),Ri(o.ranges[a].head,t,n,r);else{for(s=0;s<o.changes.length;++s)if(c=o.changes[s],n<c.from.line)c.from=ce(c.from.line+r,c.from.ch),c.to=ce(c.to.line+r,c.to.ch);else if(t<=c.to.line){l=!1;break}l||(e.splice(0,i+1),i=0)}}function ji(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Bi(e.done,n,r,i),Bi(e.undone,n,r,i)}function Ui(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=te(e,me(e,t)):i=oe(t),null==i?null:(r(o,i)&&e.cm&&An(e.cm,i,n),o)}function Ki(e){var t,n;for(this.lines=e,this.parent=null,t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function Vi(e){var t,n,r,i;for(this.children=e,t=0,n=0,r=0;r<e.length;++r)i=e[r],t+=i.chunkSize(),n+=i.height,i.parent=this;this.size=t,this.height=n,this.parent=null}function $i(e,t,n){it(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Qn(e,n)}function Gi(e,t,n,r){var i=new pa(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Ui(e,t,"widget",function(t){var n,r=t.widgets||(t.widgets=[]);return null==i.insertAt?r.push(i):r.splice(Math.min(r.length,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!nt(e,t)&&(n=it(t)<e.scrollTop,ie(t,t.height+Et(i)),n&&Qn(o,i.height),o.curOp.forceUpdate=!0),!0}),o&&kt(o,"lineWidgetAdded",o,i,"number"==typeof t?t:oe(t)),i}function Xi(e,t,n,r,o){var l,a,s,c,u,d;if(r&&r.shared)return Yi(e,t,n,r,o);if(e.cm&&!e.cm.curOp)return xr(e.cm,Xi)(e,t,n,r,o);if(l=new ga(e,o),a=ue(t,n),r&&f(r,l,!1),a>0||0==a&&l.clearWhenEmpty!==!1)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=i("span",[l.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(Ye(e,t.line,t,n,l)||t.line!=n.line&&Ye(e,n.line,t,n,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");Oe()}if(l.addToHistory&&si(e,{from:t,to:n,origin:"markText"},e.sel,NaN),s=t.line,c=e.cm,e.iter(s,n.line+1,function(r){c&&l.collapsed&&!c.options.lineWrapping&&Ze(r)==c.display.maxLine&&(u=!0),l.collapsed&&s!=t.line&&ie(r,0),Ie(r,new ze(l,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s}),l.collapsed&&e.iter(t.line,n.line+1,function(t){nt(e,t)&&ie(t,0)}),l.clearOnEnter&&Il(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(Ae(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++ma,l.atomic=!0),c){if(u&&(c.curOp.updateMaxLine=!0),l.collapsed)Nn(c,t.line,n.line+1);else if(l.className||l.startStyle||l.endStyle||l.css||l.attributes||l.title)for(d=t.line;d<=n.line;d++)An(c,d,"text");l.atomic&&Mi(c.doc),kt(c,"markerAdded",c,l)}return l}function Yi(e,t,n,r,i){var o,l,a;return r=f(r),r.shared=!1,o=[Xi(e,t,n,r,i)],l=o[0],a=r.widgetNode,ei(e,function(e){a&&(r.widgetNode=a.cloneNode(!0)),o.push(Xi(e,ge(e,t),ge(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;l=y(o)}),new ya(o,l)}function Zi(e){return e.findMarks(ce(e.first,0),e.clipPos(ce(e.lastLine())),function(e){return e.parent})}function Qi(e,t){var n,r,i,o,l,a;for(n=0;n<t.length;n++)r=t[n],i=r.find(),o=e.clipPos(i.from),l=e.clipPos(i.to),ue(o,l)&&(a=Xi(e,o,l,r.primary,r.primary.type),r.markers.push(a),a.parent=r)}function Ji(e){var t,n=function(t){var n,r,i=e[t],o=[i.primary.doc];for(ei(i.primary.doc,function(e){return o.push(e)}),n=0;n<i.markers.length;n++)r=i.markers[n],p(o,r.doc)==-1&&(r.parent=null,i.markers.splice(n--,1))};for(t=0;t<e.length;t++)n(t)}function eo(e){var t,n,r,i,o,l,a,s,c,u,d,f=this;if(ro(f),!P(f,e)&&!Ft(f.display,e)&&(q(e),Xa&&(xa=+new Date),t=Mn(f,e,!0),n=e.dataTransfer.files,t&&!f.isReadOnly()))if(n&&n.length&&window.FileReader&&window.File)for(r=n.length,i=Array(r),o=0,l=function(){++o==r&&xr(f,function(){t=ge(f.doc,t);var e={from:t,to:t,text:f.doc.splitLines(i.filter(function(e){return null!=e}).join(f.doc.lineSeparator())),origin:"paste"};Pi(f.doc,e),_i(f.doc,Ur(ge(f.doc,t),ge(f.doc,Kr(e))))})()},a=function(e,t){if(f.options.allowDropFileTypes&&p(f.options.allowDropFileTypes,e.type)==-1)return void l();var n=new FileReader;n.onerror=function(){return l()},n.onload=function(){var e=n.result;return/[\x00-\x08\x0e-\x1f]{2}/.test(e)?void l():(i[t]=e,void l())},n.readAsText(e)},s=0;s<n.length;s++)a(n[s],s);else{if(f.state.draggingText&&f.doc.sel.contains(t)>-1)return f.state.draggingText(e),void setTimeout(function(){return f.display.input.focus()},20);try{if(c=e.dataTransfer.getData("Text")){if(f.state.draggingText&&!f.state.draggingText.copy&&(u=f.listSelections()),Si(f.doc,Ur(t,t)),u)for(d=0;d<u.length;++d)Hi(f.doc,"",u[d].anchor,u[d].head,"drag");f.replaceSelection(c,"around","paste"),f.display.input.focus()}}catch(e){}}}function to(e,t){if(Xa&&(!e.state.draggingText||+new Date-xa<100))return void R(t);if(!P(e,t)&&!Ft(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ns)){var n=r("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ts&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),ts&&n.parentNode.removeChild(n)}}function no(e,t){var i,o=Mn(e,t);o&&(i=document.createDocumentFragment(),Fn(e,o,i),e.display.dragCursor||(e.display.dragCursor=r("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),n(e.display.dragCursor,i))}function ro(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function io(e){var t,n,r,i;if(document.getElementsByClassName){for(t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++)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])})}}function oo(){wa||(lo(),wa=!0)}function lo(){var e;Il(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,io(ao)},100))}),Il(window,"blur",function(){return io(Un)})}function ao(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}function so(e){var t,n,r,i,o,l,a=e.split(/-(?!$)/);for(e=a[a.length-1],o=0;o<a.length-1;o++)if(l=a[o],/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function co(e){var t,n,r,i,o,l,a,s,c={};for(t in e)if(e.hasOwnProperty(t)){if(n=e[t],/^(name|fallthrough|(de|at)tach)$/.test(t))continue;if("..."==n){delete e[t];continue}for(r=v(t.split(" "),so),i=0;i<r.length;i++)if(o=void 0,l=void 0,i==r.length-1?(l=r.join(" "),o=n):(l=r.slice(0,i+1).join(" "),o="..."),a=c[l]){if(a!=o)throw new Error("Inconsistent bindings for "+l)}else c[l]=o;delete e[t]}for(s in c)e[s]=c[s];return e}function uo(e,t,n,r){var i,o,l;if(t=mo(t),i=t.call?t.call(e,r):t[e],i===!1)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 uo(e,t.fallthrough,n,r);for(o=0;o<t.fallthrough.length;o++)if(l=uo(e,t.fallthrough[o],n,r))return l}}function fo(e){var t="string"==typeof e?e:ka[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function ho(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(vl?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(vl?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function po(e,t){if(ts&&34==e.keyCode&&e.char)return!1;var n=ka[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),ho(n,e,t))}function mo(e){return"string"==typeof e?Ta[e]:e}function go(e,t){var n,r,i,o=e.doc.sel.ranges,l=[];for(n=0;n<o.length;n++){for(r=t(o[n]);l.length&&ue(r.from,y(l).to)<=0;)if(i=l.pop(),ue(i.from,r.from)<0){r.from=i.from;break}l.push(r)}br(e,function(){for(var t=l.length-1;t>=0;t--)Hi(e.doc,"",l[t].from,l[t].to,"+delete");Jn(e)})}function yo(e,t,n){var r=T(e.text,t+n,n);return r<0||r>e.text.length?null:r}function vo(e,t,n){var r=yo(e,t.ch,n);return null==r?null:new ce(t.line,r,n<0?"after":"before")}function bo(e,t,n,r,i){var o,l,a,s,c,u,d;return e&&("rtl"==t.doc.direction&&(i=-i),o=A(n,t.doc.direction))?(l=i<0?y(o):o[0],a=i<0==(1==l.level),s=a?"after":"before",l.level>0||"rtl"==t.doc.direction?(u=Xt(t,n),c=i<0?n.text.length-1:0,d=Yt(t,u,c).top,c=M(function(e){return Yt(t,u,e).top==d},i<0==(1==l.level)?l.from:l.to-1,c),"before"==s&&(c=yo(n,c,1))):c=i<0?l.to:l.from,new ce(r,c,s)):new ce(r,i<0?n.text.length:0,i<0?"before":"after")}function xo(e,t,n,r){var i,o,l,a,s,c,u,d,f,h,p,m,g=A(t,e.doc.direction);return g?(n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after"),i=N(g,n.ch,n.sticky),o=g[i],"ltr"==e.doc.direction&&o.level%2==0&&(r>0?o.to>n.ch:o.from<n.ch)?vo(t,n,r):(l=function(e,n){return yo(t,e instanceof ce?e.ch:e,n)},s=function(n){return e.options.lineWrapping?(a=a||Xt(e,t),gn(e,t,a,n)):{begin:0,end:t.text.length}},c=s("before"==n.sticky?l(n,-1):n.ch),"rtl"!=e.doc.direction&&1!=o.level||(u=1==o.level==r<0,d=l(n,u?1:-1),null==d||!(u?d<=o.to&&d<=c.end:d>=o.from&&d>=c.begin))?(h=function(e,t,r){for(var i,o,a,s=function(e,t){return t?new ce(n.line,l(e,1),"before"):new ce(n.line,e,"after")};e>=0&&e<g.length;e+=t){if(i=g[e],o=t>0==(1!=i.level),a=o?r.begin:l(r.end,-1),i.from<=a&&a<i.to)return s(a,o);if(a=o?i.from:l(i.to,-1),r.begin<=a&&a<r.end)return s(a,o)}},(p=h(i+r,r,c))?p:(m=r>0?c.end:l(c.begin,-1),null==m||r>0&&m==t.text.length||!(p=h(r>0?0:g.length-1,r,s(m)))?null:p)):(f=u?"before":"after",new ce(n.line,d,f)))):vo(t,n,r)}function wo(e,t){var n=te(e.doc,t),r=Ze(n);return r!=n&&(t=oe(r)),bo(!0,e,r,t,1)}function ko(e,t){var n=te(e.doc,t),r=Qe(n);return r!=n&&(t=oe(r)),bo(!0,e,n,t,-1)}function _o(e,t){var n,r,i=wo(e,t.line),o=te(e.doc,i.line),l=A(o,e.doc.direction);return l&&0!=l[0].level?i:(n=Math.max(i.ch,o.text.search(/\S/)),r=t.line==i.line&&t.ch<=n&&t.ch,ce(i.line,r?0:n,i.sticky))}function Co(e,t,n){if("string"==typeof t&&(t=Ma[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)!=Sl}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function So(e,t,n){var r,i;for(r=0;r<e.state.keyMaps.length;r++)if(i=uo(t,e.state.keyMaps[r],n,e))return i;return e.options.extraKeys&&uo(t,e.options.extraKeys,n,e)||uo(t,e.options.keyMap,n,e)}function To(e,t,n,r){var i=e.state.keySeq;if(i){if(fo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:La.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Mo(e,i+" "+t,n,r))return!0}return Mo(e,t,n,r)}function Mo(e,t,n,r){var i=So(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&kt(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(q(n),Hn(e)),!!i}function Lo(e,t){var n=po(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?To(e,"Shift-"+n,t,function(t){return Co(e,t,!0)})||To(e,n,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return Co(e,t)}):To(e,n,t,function(t){return Co(e,t)}))}function No(e,t,n){return To(e,"'"+n+"'",t,function(t){return Co(e,t,!0)})}function Ao(e){var t,n,r=this;e.target&&e.target!=r.display.input.getField()||(r.curOp.focus=l(c(r)),P(r,e)||(Xa&&Ya<11&&27==e.keyCode&&(e.returnValue=!1),t=e.keyCode,r.display.shift=16==t||e.shiftKey,n=Lo(r,e),ts&&(Na=n?t:null,!n&&88==t&&!Rl&&(ss?e.metaKey:e.ctrlKey)&&r.replaceSelection("",null,"cut")),Ka&&!ss&&!n&&46==t&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=t||/\bCodeMirror-crosshair\b/.test(r.display.lineDiv.className)||Oo(r)))}function Oo(e){function t(e){18!=e.keyCode&&e.altKey||(xl(n,"CodeMirror-crosshair"),z(document,"keyup",t),z(document,"mouseover",t))}var n=e.display.lineDiv;a(n,"CodeMirror-crosshair"),Il(document,"keyup",t),Il(document,"mouseover",t)}function zo(e){16==e.keyCode&&(this.doc.sel.shift=!1),P(this,e)}function Do(e){var t,n,r,i=this;if(!(e.target&&e.target!=i.display.input.getField()||Ft(i.display,e)||P(i,e)||e.ctrlKey&&!e.altKey||ss&&e.metaKey))return t=e.keyCode,n=e.charCode,ts&&t==Na?(Na=null,void q(e)):void(ts&&(!e.which||e.which<10)&&Lo(i,e)||(r=String.fromCharCode(null==n?t:n),"\b"!=r&&(No(i,e,r)||i.display.input.onKeyPress(e))))}function Po(e,t){var n=+new Date;return Da&&Da.compare(n,e,t)?(za=Da=null,"triple"):za&&za.compare(n,e,t)?(Da=new Oa(n,e,t),za=null,"double"):(za=new Oa(n,e,t),Da=null,"single")}function Io(e){var t,n,r,i=this,o=i.display;if(!(P(i,e)||o.activeTouch&&o.input.supportsTouch()))return o.input.ensurePolled(),o.shift=e.shiftKey,Ft(o,e)?void(Za||(o.scroller.draggable=!1,setTimeout(function(){return o.scroller.draggable=!0},100))):void(Uo(i,e)||(t=Mn(i,e),n=j(e),r=t?Po(t,n):"single",u(i).focus(),1==n&&i.state.selectingText&&i.state.selectingText(e),t&&Eo(i,n,t,r,e)||(1==n?t?qo(i,t,r,e):B(e)==o.scroller&&q(e):2==n?(t&&vi(i.doc,t),setTimeout(function(){return o.input.focus()},20)):3==n&&(bl?i.display.input.onContextMenu(e):Bn(i)))))}function Eo(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,To(e,ho(o,i),i,function(t){if("string"==typeof t&&(t=Ma[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=Sl}finally{e.state.suppressEdits=!1}return r})}function Fo(e,t,n){var r,i=e.getOption("configureMouse"),o=i?i(e,t,n):{};return null==o.unit&&(r=cs?n.shiftKey&&n.metaKey:n.altKey,o.unit=r?"rectangle":"single"==t?"char":"double"==t?"word":"line"),(null==o.extend||e.doc.extend)&&(o.extend=e.doc.extend||n.shiftKey),null==o.addNew&&(o.addNew=ss?n.metaKey:n.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(ss?n.altKey:n.ctrlKey)),o}function qo(e,t,n,r){var i,o,a;Xa?setTimeout(d(Rn,e),0):e.curOp.focus=l(c(e)),i=Fo(e,n,r),o=e.doc.sel,e.options.dragDrop&&El&&!e.isReadOnly()&&"single"==n&&(a=o.contains(t))>-1&&(ue((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(ue(a.to(),t)>0||t.xRel<0)?Wo(e,r,t,i):Ro(e,r,t,i)}function Wo(e,t,n,r){var i=e.display,o=!1,l=xr(e,function(t){Za&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Bn(e)),z(i.wrapper.ownerDocument,"mouseup",l),z(i.wrapper.ownerDocument,"mousemove",a),z(i.scroller,"dragstart",s),z(i.scroller,"drop",l),o||(q(t),r.addNew||vi(e.doc,n,null,null,r.extend),Za&&!ns||Xa&&9==Ya?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),a=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},s=function(){return o=!0};Za&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,Il(i.wrapper.ownerDocument,"mouseup",l),Il(i.wrapper.ownerDocument,"mousemove",a),Il(i.scroller,"dragstart",s),Il(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ho(e,t,n){if("char"==n)return new ha(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new ha(ce(t.line,0),ge(e.doc,ce(t.line+1,0)));var r=n(e,t);return new ha(r.from,r.to)}function Ro(e,t,n,r){function i(t){var i,o,l,a,s,c,g,y,b,x,w,k,_,C,S;if(0!=ue(v,t))if(v=t,"rectangle"==r.unit){for(i=[],o=e.options.tabSize,l=h(te(u,n.line).text,n.ch,o),a=h(te(u,t.line).text,t.ch,o),s=Math.min(l,a),c=Math.max(l,a),g=Math.min(n.line,t.line),y=Math.min(e.lastLine(),Math.max(n.line,t.line));g<=y;g++)b=te(u,g).text,x=m(b,s,o),s==c?i.push(new ha(ce(g,x),ce(g,x))):b.length>x&&i.push(new ha(ce(g,x),ce(g,m(b,c,o))));i.length||i.push(new ha(n,n)),Ci(u,jr(e,p.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else w=d,k=Ho(e,t,r.unit),_=w.anchor,ue(k.anchor,_)>0?(C=k.head,_=pe(w.from(),k.anchor)):(C=k.anchor,_=he(w.to(),k.head)),S=p.ranges.slice(0),S[f]=Bo(e,new ha(ge(u,_),C)),Ci(u,jr(e,S,f),Ml)}function o(t){var n,a,d=++x,f=Mn(e,t,!0,"rectangle"==r.unit);f&&(0!=ue(f,v)?(e.curOp.focus=l(c(e)),i(f),n=$n(s,u),(f.line>=n.to||f.line<n.from)&&setTimeout(xr(e,function(){x==d&&o(t)}),150)):(a=t.clientY<b.top?-20:t.clientY>b.bottom?20:0,a&&setTimeout(xr(e,function(){x==d&&(s.scroller.scrollTop+=a,o(t))}),50)))}function a(t){e.state.selectingText=!1,x=1/0,t&&(q(t),s.input.focus()),z(s.wrapper.ownerDocument,"mousemove",w),z(s.wrapper.ownerDocument,"mouseup",k),u.history.lastSelOrigin=null}var s,u,d,f,p,g,y,v,b,x,w,k;Xa&&Bn(e),s=e.display,u=e.doc,q(t),p=u.sel,g=p.ranges,r.addNew&&!r.extend?(f=u.sel.contains(n),d=f>-1?g[f]:new ha(n,n)):(d=u.sel.primary(),f=u.sel.primIndex),"rectangle"==r.unit?(r.addNew||(d=new ha(n,n)),n=Mn(e,t,!0,!0),f=-1):(y=Ho(e,n,r.unit),d=r.extend?yi(d,y.anchor,y.head,r.extend):y),r.addNew?f==-1?(f=g.length,Ci(u,jr(e,g.concat([d]),f),{scroll:!1,origin:"*mouse"})):g.length>1&&g[f].empty()&&"char"==r.unit&&!r.extend?(Ci(u,jr(e,g.slice(0,f).concat(g.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),p=u.sel):xi(u,f,d,Ml):(f=0,Ci(u,new fa([d],0),Ml),p=u.sel),v=n,b=s.wrapper.getBoundingClientRect(),x=0,w=xr(e,function(e){0!==e.buttons&&j(e)?o(e):a(e)}),k=xr(e,a),e.state.selectingText=k,Il(s.wrapper.ownerDocument,"mousemove",w),Il(s.wrapper.ownerDocument,"mouseup",k)}function Bo(e,t){var n,r,i,o,l,a,s,c,u,d,f,h=t.anchor,p=t.head,m=te(e.doc,h.line);return 0==ue(h,p)&&h.sticky==p.sticky?t:(n=A(m))?(r=N(n,h.ch,h.sticky),i=n[r],i.from!=h.ch&&i.to!=h.ch?t:(o=r+(i.from==h.ch==(1!=i.level)?0:1),0==o||o==n.length?t:(p.line!=h.line?l=(p.line-h.line)*("ltr"==e.doc.direction?1:-1)>0:(a=N(n,p.ch,p.sticky),s=a-r||(p.ch-h.ch)*(1==i.level?-1:1),l=a==o-1||a==o?s<0:s>0),c=n[o+(l?-1:0)],u=l==(1==c.level),d=u?c.from:c.to,f=u?"after":"before",h.ch==d&&h.sticky==f?t:new ha(new ce(h.line,d,f),p)))):t}function jo(e,t,n,r){var i,o,l,a,s,c,u,d;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;if(r&&q(t),l=e.display,a=l.lineDiv.getBoundingClientRect(),o>a.bottom||!E(e,n))return H(t);for(o-=a.top-l.viewOffset,s=0;s<e.display.gutterSpecs.length;++s)if(c=l.gutters.childNodes[s],c&&c.getBoundingClientRect().right>=i)return u=le(e.doc,o),d=e.display.gutterSpecs[s],D(e,n,e,u,d.className,t),H(t)}function Uo(e,t){return jo(e,t,"gutterClick",!0)}function Ko(e,t){Ft(e.display,t)||Vo(e,t)||P(e,t,"contextmenu")||bl||e.display.input.onContextMenu(t);
}function Vo(e,t){return!!E(e,"gutterContextMenu")&&jo(e,t,"gutterContextMenu",!1)}function $o(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),rn(e)}function Go(e){function t(t,r,i,o){e.defaults[t]=r,i&&(n[t]=o?function(e,t,n){n!=Pa&&i(e,t,n)}:i)}var n=e.optionHandlers;e.defineOption=t,e.Init=Pa,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Yr(e)},!0),t("indentUnit",2,Yr,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Zr(e),rn(e),Nn(e)},!0),t("lineSeparator",null,function(e,t){var n,r,i;if(e.doc.lineSep=t,t)for(n=[],r=e.doc.first,e.doc.iter(function(e){var i,o;for(i=0;o=e.text.indexOf(t,i),o!=-1;)i=o+t.length,n.push(ce(r,o));r++}),i=n.length-1;i>=0;i--)Hi(e.doc,t,n[i],ce(n[i].line,n[i].ch+t.length))}),t("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!=Pa&&e.refresh()}),t("specialCharPlaceholder",dt,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",as?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),t("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),t("rtlMoveVisually",!us),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){$o(e),qr(e)},!0),t("keyMap","default",function(e,t,n){var r=mo(t),i=n!=Pa&&mo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),t("extraKeys",null),t("configureMouse",null),t("lineWrapping",!1,Yo,!0),t("gutters",[],function(e,t){e.display.gutterSpecs=Er(t,e.options.lineNumbers),qr(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?Cn(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return sr(e)},!0),t("scrollbarStyle","native",function(e){ur(e),sr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e,t){e.display.gutterSpecs=Er(e.options.gutters,t),qr(e)},!0),t("firstLineNumber",1,qr,!0),t("lineNumberFormatter",function(e){return e},qr,!0),t("showCursorWhenSelecting",!1,In,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("pasteLinesPerSelection",!0),t("selectionsMayTouch",!1),t("readOnly",!1,function(e,t){"nocursor"==t&&(Un(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),t("screenReaderLabel",null,function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Xo),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,In,!0),t("singleCursorHeightPerLine",!0,In,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Zr,!0),t("addModeClass",!1,Zr,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Zr,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),t("phrases",null)}function Xo(e,t,n){var r,i,o=n&&n!=Pa;!t!=!o&&(r=e.display.dragFunctions,i=t?Il:z,i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop))}function Yo(e){e.options.lineWrapping?(a(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(xl(e.display.wrapper,"CodeMirror-wrap"),lt(e)),Tn(e),Nn(e),rn(e),setTimeout(function(){return sr(e)},100)}function Zo(e,t){var n,r,i,o,l,a=this;if(!(this instanceof Zo))return new Zo(e,t);this.options=t=t?f(t):{},f(Ia,t,!1),n=t.value,"string"==typeof n?n=new ba(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n,r=new Zo.inputStyles[t.inputStyle](this),i=this.display=new Wr(e,n,r,t),i.wrapper.CodeMirror=this,$o(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ur(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 _l,keySeq:null,specialChars:null},t.autofocus&&!as&&i.input.focus(),Xa&&Ya<11&&setTimeout(function(){return a.display.input.reset(!0)},20),Qo(this),oo(),dr(this),this.curOp.forceUpdate=!0,ti(this,n),t.autofocus&&!as||this.hasFocus()?setTimeout(function(){a.hasFocus()&&!a.state.focused&&jn(a)},20):Un(this);for(o in Ea)Ea.hasOwnProperty(o)&&Ea[o](this,t[o],Pa);for(Ir(this),t.finishInit&&t.finishInit(this),l=0;l<Fa.length;++l)Fa[l](this);fr(this),Za&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}function Qo(e){function t(){a.activeTouch&&(i=setTimeout(function(){return a.activeTouch=null},1e3),o=a.activeTouch,o.end=+new Date)}function n(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function r(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}var i,o,l,a=e.display;Il(a.scroller,"mousedown",xr(e,Io)),Xa&&Ya<11?Il(a.scroller,"dblclick",xr(e,function(t){var n,r;P(e,t)||(n=Mn(e,t),!n||Uo(e,t)||Ft(e.display,t)||(q(t),r=e.findWordAt(n),vi(e.doc,r.anchor,r.head)))})):Il(a.scroller,"dblclick",function(t){return P(e,t)||q(t)}),Il(a.scroller,"contextmenu",function(t){return Ko(e,t)}),Il(a.input.getField(),"contextmenu",function(t){a.scroller.contains(t.target)||Ko(e,t)}),o={end:0},Il(a.scroller,"touchstart",function(t){if(!P(e,t)&&!n(t)&&!Uo(e,t)){a.input.ensurePolled(),clearTimeout(i);var r=+new Date;a.activeTouch={start:r,moved:!1,prev:r-o.end<=300?o:null},1==t.touches.length&&(a.activeTouch.left=t.touches[0].pageX,a.activeTouch.top=t.touches[0].pageY)}}),Il(a.scroller,"touchmove",function(){a.activeTouch&&(a.activeTouch.moved=!0)}),Il(a.scroller,"touchend",function(n){var i,o,l=a.activeTouch;l&&!Ft(a,n)&&null!=l.left&&!l.moved&&new Date-l.start<300&&(i=e.coordsChar(a.activeTouch,"page"),o=!l.prev||r(l,l.prev)?new ha(i,i):!l.prev.prev||r(l,l.prev.prev)?e.findWordAt(i):new ha(ce(i.line,0),ge(e.doc,ce(i.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),q(n)),t()}),Il(a.scroller,"touchcancel",t),Il(a.scroller,"scroll",function(){a.scroller.clientHeight&&(ir(e,a.scroller.scrollTop),lr(e,a.scroller.scrollLeft,!0),D(e,"scroll",e))}),Il(a.scroller,"mousewheel",function(t){return Br(e,t)}),Il(a.scroller,"DOMMouseScroll",function(t){return Br(e,t)}),Il(a.wrapper,"scroll",function(){return a.wrapper.scrollTop=a.wrapper.scrollLeft=0}),a.dragFunctions={enter:function(t){P(e,t)||R(t)},over:function(t){P(e,t)||(no(e,t),R(t))},start:function(t){return to(e,t)},drop:xr(e,eo),leave:function(t){P(e,t)||ro(e)}},l=a.input.getField(),Il(l,"keyup",function(t){return zo.call(e,t)}),Il(l,"keydown",xr(e,Ao)),Il(l,"keypress",xr(e,Do)),Il(l,"focus",function(t){return jn(e,t)}),Il(l,"blur",function(t){return Un(e,t)})}function Jo(e,t,n,r){var i,o,l,a,s,c,u,d,f,p,m,y,v=e.doc;if(null==n&&(n="add"),"smart"==n&&(v.mode.indent?i=we(e,t).state:n="prev"),o=e.options.tabSize,l=te(v,t),a=h(l.text,null,o),l.stateAfter&&(l.stateAfter=null),s=l.text.match(/^\s*/)[0],r||/\S/.test(l.text)){if("smart"==n&&(c=v.mode.indent(i,l.text.slice(s.length),l.text),c==Sl||c>150)){if(!r)return;n="prev"}}else c=0,n="not";if("prev"==n?c=t>v.first?h(te(v,t-1).text,null,o):0:"add"==n?c=a+e.options.indentUnit:"subtract"==n?c=a-e.options.indentUnit:"number"==typeof n&&(c=a+n),c=Math.max(0,c),u="",d=0,e.options.indentWithTabs)for(f=Math.floor(c/o);f;--f)d+=o,u+="\t";if(d<c&&(u+=g(c-d)),u!=s)return Hi(v,u,ce(t,0),ce(t,s.length),"+input"),l.stateAfter=null,!0;for(p=0;p<v.sel.ranges.length;p++)if(m=v.sel.ranges[p],m.head.line==t&&m.head.ch<s.length){y=ce(t,s.length),xi(v,p,new ha(y,y));break}}function el(e){qa=e}function tl(e,t,n,r,i){var o,l,a,s,c,u,d,f,h,p,m,g=e.doc;if(e.display.shift=!1,r||(r=g.sel),o=+new Date-200,l="paste"==i||e.state.pasteIncoming>o,a=Wl(t),s=null,l&&r.ranges.length>1)if(qa&&qa.text.join("\n")==t){if(r.ranges.length%qa.text.length==0)for(s=[],c=0;c<qa.text.length;c++)s.push(g.splitLines(qa.text[c]))}else a.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(s=v(a,function(e){return[e]}));for(u=e.curOp.updateInput,d=r.ranges.length-1;d>=0;d--)f=r.ranges[d],h=f.from(),p=f.to(),f.empty()&&(n&&n>0?h=ce(h.line,h.ch-n):e.state.overwrite&&!l?p=ce(p.line,Math.min(te(g,p.line).text.length,p.ch+y(a).length)):l&&qa&&qa.lineWise&&qa.text.join("\n")==a.join("\n")&&(h=p=ce(h.line,0))),m={from:h,to:p,text:s?s[d%s.length]:a,origin:i||(l?"paste":e.state.cutIncoming>o?"cut":"+input")},Pi(e.doc,m),kt(e,"inputRead",e,m);t&&!l&&rl(e,t),Jn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=u),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function nl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||br(t,function(){return tl(t,n,0,null,"paste")}),!0}function rl(e,t){var n,r,i,o,l,a;if(e.options.electricChars&&e.options.smartIndent)for(n=e.doc.sel,r=n.ranges.length-1;r>=0;r--)if(i=n.ranges[r],!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){if(o=e.getModeAt(i.head),l=!1,o.electricChars){for(a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){l=Jo(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(te(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Jo(e,i.head.line,"smart"));l&&kt(e,"electricInput",e,i.head.line)}}function il(e){var t,n,r,i=[],o=[];for(t=0;t<e.doc.sel.ranges.length;t++)n=e.doc.sel.ranges[t].head.line,r={anchor:ce(n,0),head:ce(n+1,0)},o.push(r),i.push(e.getRange(r.anchor,r.head));return{text:i,ranges:o}}function ol(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function ll(){var e=r("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=r("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Za?e.style.width="1000px":e.setAttribute("wrap","off"),os&&(e.style.border="1px solid black"),ol(e),t}function al(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){u(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)&&xr(this,t[e])(this,n,i),D(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"](mo(e))},removeKeyMap:function(e){var t,n=this.state.keyMaps;for(t=0;t<n.length;++t)if(n[t]==e||n[t].name==e)return n.splice(t,1),!0},addOverlay:wr(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");b(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,Nn(this)}),removeOverlay:wr(function(e){var t,n,r=this.state.overlays;for(t=0;t<r.length;++t)if(n=r[t].modeSpec,n==e||"string"==typeof e&&n.name==e)return r.splice(t,1),this.state.modeGen++,void Nn(this)}),indentLine:wr(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),ae(this.doc,e)&&Jo(this,e,t,n)}),indentSelection:wr(function(e){var t,n,r,i,o,l,a,s=this.doc.sel.ranges,c=-1;for(t=0;t<s.length;t++)if(n=s[t],n.empty())n.head.line>c&&(Jo(this,n.head.line,e,!0),c=n.head.line,t==this.doc.sel.primIndex&&Jn(this));else{for(r=n.from(),i=n.to(),o=Math.max(c,r.line),c=Math.min(this.lastLine(),i.line-(i.ch?0:1))+1,l=o;l<c;++l)Jo(this,l,e);a=this.doc.sel.ranges,0==r.ch&&s.length==a.length&&a[t].from().ch>0&&xi(this.doc,t,new ha(r,a[t].to()),Tl)}}),getTokenAt:function(e,t){return Se(this,e,t)},getLineTokens:function(e,t){return Se(this,ce(e),t,!0)},getTokenTypeAt:function(e){var t,n,r,i,o,l,a;if(e=ge(this.doc,e),t=xe(this,te(this.doc,e.line)),n=0,r=(t.length-1)/2,i=e.ch,0==i)o=t[2];else for(;;)if(l=n+r>>1,(l?t[2*l-1]:0)>=i)r=l;else{if(!(t[2*l+1]<i)){o=t[2*l+2];break}n=l+1}return a=o?o.indexOf("overlay "):-1,a<0?o:0==a?null:o.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,i,o,l,a,s,c=[];if(!n.hasOwnProperty(t))return c;if(r=n[t],i=this.getModeAt(e),"string"==typeof i[t])r[i[t]]&&c.push(r[i[t]]);else if(i[t])for(o=0;o<i[t].length;o++)l=r[i[t][o]],l&&c.push(l);else i.helperType&&r[i.helperType]?c.push(r[i.helperType]):r[i.name]&&c.push(r[i.name]);for(a=0;a<r._global.length;a++)s=r._global[a],s.pred(i,this)&&p(c,s.val)==-1&&c.push(s.val);return c},getStateAfter:function(e,t){var n=this.doc;return e=me(n,null==e?n.first+n.size-1:e),we(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?ge(this.doc,e):e?r.from():r.to(),dn(this,n,t||"page")},charCoords:function(e,t){return un(this,ge(this.doc,e),t||"page")},coordsChar:function(e,t){return e=cn(this,e,t||"page"),pn(this,e.left,e.top)},lineAtHeight:function(e,t){return e=cn(this,{top:e,left:0},t||"page").top,le(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i,o=!1;return"number"==typeof e?(i=this.doc.first+this.doc.size-1,e<this.doc.first?e=this.doc.first:e>i&&(e=i,o=!0),r=te(this.doc,e)):r=e,sn(this,r,{top:0,left:0},t||"page",n||o).top+(o?this.doc.height-it(r):0)},defaultTextHeight:function(){return wn(this.display)},defaultCharWidth:function(){return kn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,l,a,s,c=this.display;e=dn(this,ge(this.doc,e)),o=e.bottom,l=e.left,t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),c.sizer.appendChild(t),"over"==r?o=e.top:"above"!=r&&"near"!=r||(a=Math.max(c.wrapper.clientHeight,this.doc.height),s=Math.max(c.sizer.clientWidth,c.lineSpace.clientWidth),("above"==r||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?o=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(o=e.bottom),l+t.offsetWidth>s&&(l=s-t.offsetWidth)),t.style.top=o+"px",t.style.left=t.style.right="","right"==i?(l=c.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(c.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&Yn(this,{left:l,top:o,right:l+t.offsetWidth,bottom:o+t.offsetHeight})},triggerOnKeyDown:wr(Ao),triggerOnKeyPress:wr(Do),triggerOnKeyUp:zo,triggerOnMouseDown:wr(Io),execCommand:function(e){if(Ma.hasOwnProperty(e))return Ma[e].call(null,this)},triggerElectric:wr(function(e){rl(this,e)}),findPosH:function(e,t,n,r){var i,o,l=1;for(t<0&&(l=-1,t=-t),i=ge(this.doc,e),o=0;o<t&&(i=sl(this.doc,i,l,n,r),!i.hitSide);++o);return i},moveH:wr(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?sl(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},Ll)}),deleteH:wr(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):go(this,function(n){var i=sl(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,o,l,a=1,s=r;for(t<0&&(a=-1,t=-t),i=ge(this.doc,e),o=0;o<t&&(l=dn(this,i,"div"),null==s?s=l.left:l.left=s,i=cl(this,l,a,n),!i.hitSide);++o);return i},moveV:wr(function(e,t){var n,r=this,i=this.doc,o=[],l=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy(function(n){var a,s;return l?e<0?n.from():n.to():(a=dn(r,n.head,"div"),null!=n.goalColumn&&(a.left=n.goalColumn),o.push(a.left),s=cl(r,a,e,t),"page"==t&&n==i.sel.primary()&&Qn(r,un(r,s,"div").top-a.top),s)},Ll),o.length)for(n=0;n<i.sel.ranges.length;n++)i.sel.ranges[n].goalColumn=o[n]}),findWordAt:function(e){var t,n,r,i=this.doc,o=te(i,e.line).text,l=e.ch,a=e.ch;if(o){for(t=this.getHelper(e,"wordChars"),"before"!=e.sticky&&a!=o.length||!l?++a:--l,n=o.charAt(l),r=_(n,t)?function(e){return _(e,t)}:/\s/.test(n)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!_(e)};l>0&&r(o.charAt(l-1));)--l;for(;a<o.length&&r(o.charAt(a));)++a}return new ha(ce(e.line,l),ce(e.line,a))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?a(this.display.cursorDiv,"CodeMirror-overwrite"):xl(this.display.cursorDiv,"CodeMirror-overwrite"),D(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==l(c(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:wr(function(e,t){er(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Rt(this)-this.display.barHeight,width:e.scrollWidth-Rt(this)-this.display.barWidth,clientHeight:jt(this),clientWidth:Bt(this)}},scrollIntoView:wr(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:ce(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?tr(this,e):rr(this,e.from,e.to,e.margin)}),setSize:wr(function(e,t){var n,r=this,i=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=i(e)),null!=t&&(this.display.wrapper.style.height=i(t)),this.options.lineWrapping&&nn(this),n=this.display.viewFrom,this.doc.iter(n,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){An(r,n,"widget");break}++n}),this.curOp.forceUpdate=!0,D(this,"refresh",this)}),operation:function(e){return br(this,e)},startOperation:function(){return dr(this)},endOperation:function(){return fr(this)},refresh:wr(function(){var e=this.display.cachedTextHeight;Nn(this),this.curOp.forceUpdate=!0,rn(this),er(this,this.doc.scrollLeft,this.doc.scrollTop),zr(this.display),(null==e||Math.abs(e-wn(this.display))>.5||this.options.lineWrapping)&&Tn(this),D(this,"refresh",this)}),swapDoc:wr(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),ti(this,e),rn(this),this.display.input.reset(),er(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,kt(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}},F(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 sl(e,t,n,r,i){function o(){var n=t.line+y;return!(n<e.first||n>=e.first+e.size)&&(t=new ce(n,t.ch,t.sticky),g=te(e,n))}function l(l){var a,s,c;if("codepoint"==r?(s=g.text.charCodeAt(t.ch+(n>0?0:-1)),isNaN(s)?a=null:(c=n>0?s>=55296&&s<56320:s>=56320&&s<57343,a=new ce(t.line,Math.max(0,Math.min(g.text.length,t.ch+n*(c?2:1))),-n))):a=i?xo(e.cm,g,t,n):vo(g,t,n),null==a){if(l||!o())return!1;t=bo(i,e.cm,g,t.line,y)}else t=a;return!0}var a,s,c,u,d,f,h,p=t,m=n,g=te(e,t.line),y=i&&"rtl"==e.direction?-n:n;if("char"==r||"codepoint"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(a=null,s="group"==r,c=e.cm&&e.cm.getHelper(t,"wordChars"),u=!0;!(n<0)||l(!u);u=!1){if(d=g.text.charAt(t.ch)||"\n",f=_(d,c)?"w":s&&"\n"==d?"n":!s||/\s/.test(d)?null:"p",!s||u||f||(f="s"),a&&a!=f){n<0&&(n=1,l(),t.sticky="after");break}if(f&&(a=f),n>0&&!l(!u))break}return h=Ai(e,t,p,m,!0),de(p,h)&&(h.hitSide=!0),h}function cl(e,t,n,r){var i,o,l,a,s=e.doc,c=t.left;for("page"==r?(o=Math.min(e.display.wrapper.clientHeight,u(e).innerHeight||s(e).documentElement.clientHeight),l=Math.max(o-.5*wn(e.display),3),i=(n>0?t.bottom:t.top)+n*l):"line"==r&&(i=n>0?t.bottom+3:t.top-3);a=pn(e,c,i),a.outside;){if(n<0?i<=0:i>=s.height){a.hitSide=!0;break}i+=5*n}return a}function ul(e,t){var n,r,i,o,l,a,s=Gt(e,t.line);return!s||s.hidden?null:(n=te(e.doc,t.line),r=Kt(s,n,t.line),i=A(n,e.doc.direction),o="left",i&&(l=N(i,t.ch),o=l%2?"right":"left"),a=Zt(r.map,t.ch,o),a.offset="right"==a.collapse?a.end:a.start,a)}function dl(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function fl(e,t){return t&&(e.bad=!0),e}function hl(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function l(){u&&(c+=d,f&&(c+=d),u=f=!1)}function a(e){e&&(l(),c+=e)}function s(t){var n,c,h,p,m,g;if(1==t.nodeType){if(n=t.getAttribute("cm-text"))return void a(n);if(c=t.getAttribute("cm-marker"))return p=e.findMarks(ce(r,0),ce(i+1,0),o(+c)),void(p.length&&(h=p[0].find(0))&&a(ne(e.doc,h.from,h.to).join(d)));if("false"==t.getAttribute("contenteditable"))return;if(m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName),!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;for(m&&l(),g=0;g<t.childNodes.length;g++)s(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(f=!0),m&&(u=!0)}else 3==t.nodeType&&a(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(var c="",u=!1,d=e.doc.lineSeparator(),f=!1;s(t),t!=n;)t=t.nextSibling,f=!1;return c}function pl(e,t,n){var r,i,o;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return fl(e.clipPos(ce(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(i=0;i<e.display.view.length;i++)if(o=e.display.view[i],o.node==r)return ml(o,t,n)}function ml(e,t,n){function r(t,n,r){var i,o,l,a,u,d;for(i=-1;i<(c?c.length:0);i++)for(o=i<0?s.map:c[i],l=0;l<o.length;l+=3)if(a=o[l+2],a==t||a==n)return u=oe(i<0?e.line:e.rest[i]),d=o[l]+r,(r<0||a!=t)&&(d=o[l+(r?1:0)]),ce(u,d)}var i,l,a,s,c,u,d,f,h,p,m=e.text.firstChild,g=!1;if(!t||!o(m,t))return fl(ce(oe(e.line),0),!0);if(t==m&&(g=!0,t=m.childNodes[n],n=0,!t))return i=e.rest?y(e.rest):e.line,fl(ce(oe(i),i.text.length),g);for(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));a.parentNode!=m;)a=a.parentNode;if(s=e.measure,c=s.maps,u=r(l,a,n))return fl(u,g);for(d=a.nextSibling,f=l?l.nodeValue.length-n:0;d;d=d.nextSibling){if(u=r(d,d.firstChild,0))return fl(ce(u.line,u.ch-f),g);f+=d.textContent.length}for(h=a.previousSibling,p=n;h;h=h.previousSibling){if(u=r(h,h.firstChild,-1))return fl(ce(u.line,u.ch+p),g);p+=h.textContent.length}}function gl(e,t){function n(){e.value=s.getValue()}var r,i,o,a,s;if(t=t?f(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus&&(r=l(e.ownerDocument),t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body),e.form&&(Il(e.form,"submit",n),!t.leaveSubmitMethodAlone)){o=e.form,i=o.submit;try{a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}return t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(z(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none",s=Zo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t)}function yl(e){e.off=z,e.on=Il,e.wheelEventPixels=Rr,e.Doc=ba,e.splitLines=Wl,e.countColumn=h,e.findColumn=m,e.isWordChar=k,e.Pass=Sl,e.signal=D,e.Line=Ql,e.changeEnd=Kr,e.scrollbarModel=aa,e.Pos=ce,e.cmpPos=ue,e.modes=jl,e.mimeModes=Ul,e.resolveMode=X,e.getMode=Y,e.modeExtensions=Kl,e.extendMode=Z,e.copyState=Q,e.startState=ee,e.innerMode=J,e.commands=Ma,e.keyMap=Ta,e.keyName=po,e.isModifierKey=fo,e.lookupKey=uo,e.normalizeKeyMap=co,e.StringStream=Vl,e.SharedTextMarker=ya,e.TextMarker=ga,e.LineWidget=pa,e.e_preventDefault=q,e.e_stopPropagation=W,e.e_stop=R,e.addClass=a,e.contains=o,e.rmClass=xl,e.keyNames=ka}var vl,bl,xl,wl,kl,_l,Cl,Sl,Tl,Ml,Ll,Nl,Al,Ol,zl,Dl,Pl,Il,El,Fl,ql,Wl,Hl,Rl,Bl,jl,Ul,Kl,Vl,$l,Gl,Xl,Yl,Zl,Ql,Jl,ea,ta,na,ra,ia,oa,la,aa,sa,ca,ua,da,fa,ha,pa,ma,ga,ya,va,ba,xa,wa,ka,_a,Ca,Sa,Ta,Ma,La,Na,Aa,Oa,za,Da,Pa,Ia,Ea,Fa,qa,Wa,Ha,Ra,Ba,ja=navigator.userAgent,Ua=navigator.platform,Ka=/gecko\/\d/i.test(ja),Va=/MSIE \d/.test(ja),$a=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ja),Ga=/Edge\/(\d+)/.exec(ja),Xa=Va||$a||Ga,Ya=Xa&&(Va?document.documentMode||6:+(Ga||$a)[1]),Za=!Ga&&/WebKit\//.test(ja),Qa=Za&&/Qt\/\d+\.\d+/.test(ja),Ja=!Ga&&/Chrome\/(\d+)/.exec(ja),es=Ja&&+Ja[1],ts=/Opera\//.test(ja),ns=/Apple Computer/.test(navigator.vendor),rs=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ja),is=/PhantomJS/.test(ja),os=ns&&(/Mobile\/\w+/.test(ja)||navigator.maxTouchPoints>2),ls=/Android/.test(ja),as=os||ls||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ja),ss=os||/Mac/.test(Ua),cs=/\bCrOS\b/.test(ja),us=/win/i.test(Ua),ds=ts&&ja.match(/Version\/(\d*\.\d*)/);ds&&(ds=Number(ds[1])),ds&&ds>=15&&(ts=!1,Za=!0),vl=ss&&(Qa||ts&&(null==ds||ds<12.11)),bl=Ka||Xa&&Ya>=9,xl=function(t,n){var r,i=t.className,o=e(n).exec(i);o&&(r=i.slice(o.index+o[0].length),t.className=i.slice(0,o.index)+(r?o[1]+r:""))},wl=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(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r},kl=function(e){e.select()},os?kl=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Xa&&(kl=function(e){try{e.select()}catch(e){}}),_l=function(){this.id=null,this.f=null,this.time=0,this.handler=d(this.onTimeout,this)},_l.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},_l.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)},Cl=50,Sl={toString:function(){return"CodeMirror.Pass"}},Tl={scroll:!1},Ml={origin:"*mouse"},Ll={origin:"+move"},Nl=[""],Al=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ol=/[\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]/,zl=null,Dl=function(){function e(e){return e<=247?n.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?r.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;return function(n,r){var c,u,d,f,h,p,m,g,v,b,x,w,k,_,C,S,T,M,L,N,A,O,z,D,P,I,E,F,q,W,H,R,B,j,U,K="ltr"==r?"L":"R";if(0==n.length||"ltr"==r&&!i.test(n))return!1;for(c=n.length,u=[],d=0;d<c;++d)u.push(e(n.charCodeAt(d)));for(f=0,h=K;f<c;++f)p=u[f],"m"==p?u[f]=h:h=p;for(m=0,g=K;m<c;++m)v=u[m],"1"==v&&"r"==g?u[m]="n":l.test(v)&&(g=v,"r"==v&&(u[m]="R"));for(b=1,x=u[0];b<c-1;++b)w=u[b],"+"==w&&"1"==x&&"1"==u[b+1]?u[b]="1":","!=w||x!=u[b+1]||"1"!=x&&"n"!=x||(u[b]=x),x=w;for(k=0;k<c;++k)if(_=u[k],","==_)u[k]="N";else if("%"==_){for(C=void 0,C=k+1;C<c&&"%"==u[C];++C);for(S=k&&"!"==u[k-1]||C<c&&"1"==u[C]?"1":"N",T=k;T<C;++T)u[T]=S;k=C-1}for(M=0,L=K;M<c;++M)N=u[M],"L"==L&&"1"==N?u[M]="L":l.test(N)&&(L=N);for(A=0;A<c;++A)if(o.test(u[A])){for(O=void 0,O=A+1;O<c&&o.test(u[O]);++O);for(z="L"==(A?u[A-1]:K),D="L"==(O<c?u[O]:K),P=z==D?z?"L":"R":K,I=A;I<O;++I)u[I]=P;A=O-1}for(E=[],q=0;q<c;)if(a.test(u[q])){for(W=q,++q;q<c&&a.test(u[q]);++q);E.push(new t(0,W,q))}else{for(H=q,R=E.length,B="rtl"==r?1:0,++q;q<c&&"L"!=u[q];++q);for(j=H;j<q;)if(s.test(u[j])){for(H<j&&(E.splice(R,0,new t(1,H,j)),R+=B),U=j,++j;j<q&&s.test(u[j]);++j);E.splice(R,0,new t(2,U,j)),R+=B,H=j}else++j;H<q&&E.splice(R,0,new t(1,H,q))}return"ltr"==r&&(1==E[0].level&&(F=n.match(/^\s+/))&&(E[0].from=F[0].length,E.unshift(new t(0,0,F[0].length))),1==y(E).level&&(F=n.match(/\s+$/))&&(y(E).to-=F[0].length,E.push(new t(0,c-F[0].length,c)))),"rtl"==r?E.reverse():E}}(),Pl=[],Il=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]||Pl).concat(n)}},El=function(){if(Xa&&Ya<9)return!1;var e=r("div");return"draggable"in e||"dragDrop"in e}(),Wl=3!="\n\nb".split(/\n/).length?function(e){for(var t,n,r,i=0,o=[],l=e.length;i<=l;)t=e.indexOf("\n",i),t==-1&&(t=e.length),n=e.slice(i,"\r"==e.charAt(t-1)?t-1:t),r=n.indexOf("\r"),r!=-1?(o.push(n.slice(0,r)),i+=r+1):(o.push(n),i=t+1);return o}:function(e){return e.split(/\r\n?|\n/)},Hl=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){
return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Rl=function(){var e=r("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Bl=null,jl={},Ul={},Kl={},Vl=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},Vl.prototype.eol=function(){return this.pos>=this.string.length},Vl.prototype.sol=function(){return this.pos==this.lineStart},Vl.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Vl.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Vl.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)))return++this.pos,n},Vl.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Vl.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Vl.prototype.skipToEnd=function(){this.pos=this.string.length},Vl.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Vl.prototype.backUp=function(e){this.pos-=e},Vl.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=h(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?h(this.string,this.lineStart,this.tabSize):0)},Vl.prototype.indentation=function(){return h(this.string,null,this.tabSize)-(this.lineStart?h(this.string,this.lineStart,this.tabSize):0)},Vl.prototype.match=function(e,t,n){var r,i,o;return"string"!=typeof e?(o=this.string.slice(this.pos).match(e),o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)):(r=function(e){return n?e.toLowerCase():e},i=this.string.substr(this.pos,e.length),r(i)==r(e)?(t!==!1&&(this.pos+=e.length),!0):void 0)},Vl.prototype.current=function(){return this.string.slice(this.start,this.pos)},Vl.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Vl.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Vl.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)},$l=function(e,t){this.state=e,this.lookAhead=t},Gl=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1},Gl.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Gl.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Gl.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Gl.fromSaved=function(e,t,n){return t instanceof $l?new Gl(e,Q(e.mode,t.state),n,t.lookAhead):new Gl(e,Q(e.mode,t),n)},Gl.prototype.save=function(e){var t=e!==!1?Q(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new $l(t,this.maxLookAhead):t},Xl=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n},Yl=!1,Zl=!1,Ql=function(e,t,n){this.text=e,Be(this,t),this.height=n?n(this):1},Ql.prototype.lineNo=function(){return oe(this)},F(Ql),Jl={},ea={},ta=null,na=null,ra={left:0,right:0,top:0,bottom:0},oa=function(e,t,n){var i,o;this.cm=n,i=this.vert=r("div",[r("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=r("div",[r("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar"),i.tabIndex=o.tabIndex=-1,e(i),e(o),Il(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Il(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Xa&&Ya<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")},oa.prototype.update=function(e){var t,n,r=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;return i?(this.vert.style.display="block",this.vert.style.bottom=r?o+"px":"0",t=e.viewHeight-(r?o:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+"px"):(this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0"),r?(this.horiz.style.display="block",this.horiz.style.right=i?o+"px":"0",this.horiz.style.left=e.barLeft+"px",n=e.viewWidth-e.barLeft-(i?o:0),this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+n)+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&e.clientHeight>0&&(0==o&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?o:0,bottom:r?o:0}},oa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},oa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},oa.prototype.zeroWidthHack=function(){var e=ss&&!rs?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new _l,this.disableVert=new _l},oa.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)},oa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)},la=function(){},la.prototype.update=function(){return{bottom:0,right:0}},la.prototype.setScrollLeft=function(){},la.prototype.setScrollTop=function(){},la.prototype.clear=function(){},aa={native:oa,null:la},sa=0,ca=function(e,t,n){var r=e.display;this.viewport=t,this.visible=$n(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Bt(e),this.force=n,this.dims=_n(e),this.events=[]},ca.prototype.signal=function(e,t){E(e,t)&&this.events.push(arguments)},ca.prototype.finish=function(){for(var e=0;e<this.events.length;e++)D.apply(null,this.events[e])},ua=0,da=null,Xa?da=-.53:Ka?da=15:Ja?da=-.7:ns&&(da=-1/3),fa=function(e,t){this.ranges=e,this.primIndex=t},fa.prototype.primary=function(){return this.ranges[this.primIndex]},fa.prototype.equals=function(e){var t,n,r;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(t=0;t<this.ranges.length;t++)if(n=this.ranges[t],r=e.ranges[t],!de(n.anchor,r.anchor)||!de(n.head,r.head))return!1;return!0},fa.prototype.deepCopy=function(){var e,t=[];for(e=0;e<this.ranges.length;e++)t[e]=new ha(fe(this.ranges[e].anchor),fe(this.ranges[e].head));return new fa(t,this.primIndex)},fa.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},fa.prototype.contains=function(e,t){var n,r;for(t||(t=e),n=0;n<this.ranges.length;n++)if(r=this.ranges[n],ue(t,r.from())>=0&&ue(e,r.to())<=0)return n;return-1},ha=function(e,t){this.anchor=e,this.head=t},ha.prototype.from=function(){return pe(this.anchor,this.head)},ha.prototype.to=function(){return he(this.anchor,this.head)},ha.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Ki.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){var n,r,i;for(n=e,r=e+t;n<r;++n)i=this.lines[n],this.height-=i.height,st(i),kt(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}},Vi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var n,r,i,o,l,a;for(this.size-=t,n=0;n<this.children.length;++n)if(r=this.children[n],i=r.chunkSize(),e<i){if(o=Math.min(t,i-e),l=r.height,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;this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ki))&&(a=[],this.collapse(a),this.children=[new Ki(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){var r,i,o,l,a,s;for(this.size+=t.length,this.height+=n,r=0;r<this.children.length;++r){if(i=this.children[r],o=i.chunkSize(),e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(l=i.lines.length%25+25,a=l;a<i.lines.length;)s=new Ki(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(){var e,t,n,r,i;if(!(this.children.length<=10)){e=this;do t=e.children.splice(e.children.length-5,5),n=new Vi(t),e.parent?(e.size-=n.size,e.height-=n.height,i=p(e.parent.children,e),e.parent.children.splice(i+1,0,n)):(r=new Vi(e.children),r.parent=e,e.children=[r,n],e=r),n.parent=e.parent;while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){var r,i,o,l;for(r=0;r<this.children.length;++r)if(i=this.children[r],o=i.chunkSize(),e<o){if(l=Math.min(t,o-e),i.iterN(e,l,n))return!0;if(0==(t-=l))break;e=0}else e-=o}},pa=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t},pa.prototype.clear=function(){var e,t,n=this.doc.cm,r=this.line.widgets,i=this.line,o=oe(i);if(null!=o&&r){for(e=0;e<r.length;++e)r[e]==this&&r.splice(e--,1);r.length||(i.widgets=null),t=Et(this),ie(i,Math.max(0,i.height-t)),n&&(br(n,function(){$i(n,i,-t),An(n,o,"widget")}),kt(n,"lineWidgetCleared",n,this,o))}},pa.prototype.changed=function(){var e,t=this,n=this.height,r=this.doc.cm,i=this.line;this.height=null,e=Et(this)-n,e&&(nt(this.doc,i)||ie(i,i.height+e),r&&br(r,function(){r.curOp.forceUpdate=!0,$i(r,i,e),kt(r,"lineWidgetChanged",r,t,oe(i))}))},F(pa),ma=0,ga=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ma},ga.prototype.clear=function(){var e,t,n,r,i,o,l,a,s,c,u;if(!this.explicitlyCleared){for(e=this.doc.cm,t=e&&!e.curOp,t&&dr(e),E(this,"clear")&&(n=this.find(),n&&kt(this,"clear",n.from,n.to)),r=null,i=null,o=0;o<this.lines.length;++o)l=this.lines[o],a=De(l.markedSpans,this),e&&!this.collapsed?An(e,oe(l),"text"):e&&(null!=a.to&&(i=oe(l)),null!=a.from&&(r=oe(l))),l.markedSpans=Pe(l.markedSpans,a),null==a.from&&this.collapsed&&!nt(this.doc,l)&&e&&ie(l,wn(e.display));if(e&&this.collapsed&&!e.options.lineWrapping)for(s=0;s<this.lines.length;++s)c=Ze(this.lines[s]),u=ot(c),u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0);null!=r&&e&&this.collapsed&&Nn(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Mi(e.doc)),e&&kt(e,"markerCleared",e,this,r,i),t&&fr(e),this.parent&&this.parent.clear()}},ga.prototype.find=function(e,t){var n,r,i,o,l;for(null==e&&"bookmark"==this.type&&(e=1),i=0;i<this.lines.length;++i){if(o=this.lines[i],l=De(o.markedSpans,this),null!=l.from&&(n=ce(t?o:oe(o),l.from),e==-1))return n;if(null!=l.to&&(r=ce(t?o:oe(o),l.to),1==e))return r}return n&&{from:n,to:r}},ga.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&br(r,function(){var i,o,l=t.line,a=oe(t.line),s=Gt(r,a);s&&(tn(s),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,nt(n.doc,l)||null==n.height||(i=n.height,n.height=null,o=Et(n)-i,o&&ie(l,l.height+o)),kt(r,"markerChanged",r,e)})},ga.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&p(t.maybeHiddenMarkers,this)!=-1||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ga.prototype.detachLine=function(e){if(this.lines.splice(p(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},F(ga),ya=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this},ya.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();kt(this,"clear")}},ya.prototype.find=function(e,t){return this.primary.find(e,t)},F(ya),va=0,ba=function(e,t,n,r,i){if(!(this instanceof ba))return new ba(e,t,n,r,i);null==n&&(n=0),Vi.call(this,[new Ki([new Ql("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=ce(n,0);this.sel=Ur(o),this.history=new ii(null),this.id=++va,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Jr(this,{from:o,to:o,text:e}),Ci(this,Ur(o),Tl)},ba.prototype=w(Vi.prototype,{constructor:ba,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){var n,r=0;for(n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=re(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:kr(function(e){var t=ce(this.first,0),n=this.first+this.size-1;Pi(this,{from:t,to:ce(n,te(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&er(this.cm,0,0),Ci(this,Ur(t),Tl)}),replaceRange:function(e,t,n,r){t=ge(this,t),n=n?ge(this,n):t,Hi(this,e,t,n,r)},getRange:function(e,t,n){var r=ne(this,ge(this,e),ge(this,t));return n===!1?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(ae(this,e))return te(this,e)},getLineNumber:function(e){return oe(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=te(this,e)),Ze(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ge(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||e===!1?n.to():n.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:kr(function(e,t,n){wi(this,ge(this,"number"==typeof e?ce(e,t||0):e),null,n)}),setSelection:kr(function(e,t,n){wi(this,ge(this,e),ge(this,t||e),n)}),extendSelection:kr(function(e,t,n){vi(this,ge(this,e),t&&ge(this,t),n)}),extendSelections:kr(function(e,t){bi(this,ve(this,e),t)}),extendSelectionsBy:kr(function(e,t){var n=v(this.sel.ranges,e);bi(this,ve(this,n),t)}),setSelections:kr(function(e,t,n){var r,i;if(e.length){for(r=[],i=0;i<e.length;i++)r[i]=new ha(ge(this,e[i].anchor),ge(this,e[i].head||e[i].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ci(this,jr(this.cm,r,t),n)}}),addSelection:kr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new ha(ge(this,e),ge(this,t||e))),Ci(this,jr(this.cm,r,r.length-1),n)}),getSelection:function(e){var t,n,r,i=this.sel.ranges;for(n=0;n<i.length;n++)r=ne(this,i[n].from(),i[n].to()),t=t?t.concat(r):r;return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){var t,n,r=[],i=this.sel.ranges;for(t=0;t<i.length;t++)n=ne(this,i[t].from(),i[t].to()),e!==!1&&(n=n.join(e||this.lineSeparator())),r[t]=n;return r},replaceSelection:function(e,t,n){var r,i=[];for(r=0;r<this.sel.ranges.length;r++)i[r]=e;this.replaceSelections(i,t,n||"+input")},replaceSelections:kr(function(e,t,n){var r,i,o,l,a=[],s=this.sel;for(r=0;r<s.ranges.length;r++)i=s.ranges[r],a[r]={from:i.from(),to:i.to(),text:this.splitLines(e[r]),origin:n};for(o=t&&"end"!=t&&Xr(this,a,t),l=a.length-1;l>=0;l--)Pi(this,a[l]);o?_i(this,o):this.cm&&Jn(this.cm)}),undo:kr(function(){Ei(this,"undo")}),redo:kr(function(){Ei(this,"redo")}),undoSelection:kr(function(){Ei(this,"undo",!0)}),redoSelection:kr(function(){Ei(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){var e,t,n=this.history,r=0,i=0;for(e=0;e<n.done.length;e++)n.done[e].ranges||++r;for(t=0;t<n.undone.length;t++)n.undone[t].ranges||++i;return{undo:r,redo:i}},clearHistory:function(){var e=this;this.history=new ii(this.history),ei(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:gi(this.history.done),undone:gi(this.history.undone)}},setHistory:function(e){var t=this.history=new ii(this.history);t.done=gi(e.done.slice(0),null,!0),t.undone=gi(e.undone.slice(0),null,!0)},setGutterMarker:kr(function(e,t,n){return Ui(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&C(r)&&(e.gutterMarkers=null),!0})}),clearGutter:kr(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Ui(t,n,"gutter",function(){return n.gutterMarkers[e]=null,C(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!ae(this,e))return null;if(t=e,e=te(this,e),!e)return null}else if(t=oe(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:kr(function(t,n,r){return Ui(this,t,"gutter"==n?"gutter":"class",function(t){var i="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass";if(t[i]){if(e(r).test(t[i]))return!1;t[i]+=" "+r}else t[i]=r;return!0})}),removeLineClass:kr(function(t,n,r){return Ui(this,t,"gutter"==n?"gutter":"class",function(t){var i,o,l="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass",a=t[l];if(!a)return!1;if(null==r)t[l]=null;else{if(i=a.match(e(r)),!i)return!1;o=i.index+i[0].length,t[l]=a.slice(0,i.index)+(i.index&&o!=a.length?" ":"")+a.slice(o)||null}return!0})}),addLineWidget:kr(function(e,t,n){return Gi(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Xi(this,ge(this,e),ge(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=ge(this,e),Xi(this,e,e,n,"bookmark")},findMarksAt:function(e){var t,n,r,i;if(e=ge(this,e),t=[],n=te(this,e.line).markedSpans,n)for(r=0;r<n.length;++r)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=ge(this,e),t=ge(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l,a,s=o.markedSpans;if(s)for(l=0;l<s.length;l++)a=s[l],null!=a.to&&i==e.line&&e.ch>=a.to||null==a.from&&i!=e.line||null!=a.from&&i==t.line&&a.from>=t.ch||n&&!n(a.marker)||r.push(a.marker.parent||a.marker);++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n,r=t.markedSpans;if(r)for(n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].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;return o>e?(t=e,!0):(e-=o,void++n)}),ge(this,ce(n,t))},indexFromPos:function(e){var t,n;return e=ge(this,e),t=e.ch,e.line<this.first||e.ch<0?0:(n=this.lineSeparator().length,this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t)},copy:function(e){var t=new ba(re(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){var t,n,r;return e||(e={}),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),r=new ba(re(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction),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}],Qi(r,Zi(this)),r},unlinkDoc:function(e){var t,n,r;if(e instanceof Zo&&(e=e.doc),this.linked)for(t=0;t<this.linked.length;++t)if(n=this.linked[t],n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ji(Zi(this));break}e.history==this.history&&(r=[e.id],ei(e,function(e){return r.push(e.id)},!0),e.history=new ii(null),e.history.done=gi(this.history.done,r),e.history.undone=gi(this.history.undone,r))},iterLinkedDocs:function(e){ei(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Wl(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:kr(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&ri(this.cm))})}),ba.prototype.eachLine=ba.prototype.iter,xa=0,wa=!1,ka={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"};for(_a=0;_a<10;_a++)ka[_a+48]=ka[_a+96]=String(_a);for(Ca=65;Ca<=90;Ca++)ka[Ca]=String.fromCharCode(Ca);for(Sa=1;Sa<=12;Sa++)ka[Sa+111]=ka[Sa+63235]="F"+Sa;Ta={},Ta.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"},Ta.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"},Ta.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"},Ta.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"]},Ta.default=ss?Ta.macDefault:Ta.pcDefault,Ma={selectAll:zi,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Tl)},killLine:function(e){return go(e,function(t){if(t.empty()){var n=te(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ce(t.head.line+1,0)}:{from:t.head,to:ce(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return go(e,function(t){return{from:ce(t.from().line,0),to:ge(e.doc,ce(t.to().line+1,0))}})},delLineLeft:function(e){return go(e,function(e){return{from:ce(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return go(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 go(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(ce(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ce(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return wo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return _o(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return ko(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")},Ll)},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")},Ll)},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/)?_o(e,t.head):r},Ll)},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){var t,n,r,i=[],o=e.listSelections(),l=e.options.tabSize;for(t=0;t<o.length;t++)n=o[t].from(),r=h(e.getLine(n.line),n.ch,l),i.push(g(l-r%l));e.replaceSelections(i)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return br(e,function(){var t,n,r,i,o=e.listSelections(),l=[];for(t=0;t<o.length;t++)o[t].empty()&&(n=o[t].head,r=te(e.doc,n.line).text,r&&(n.ch==r.length&&(n=new ce(n.line,n.ch-1)),n.ch>0?(n=new ce(n.line,n.ch+1),e.replaceRange(r.charAt(n.ch-1)+r.charAt(n.ch-2),ce(n.line,n.ch-2),n,"+transpose")):n.line>e.doc.first&&(i=te(e.doc,n.line-1).text,i&&(n=new ce(n.line,1),e.replaceRange(r.charAt(0)+e.doc.lineSeparator()+i.charAt(i.length-1),ce(n.line-1,i.length-1),n,"+transpose")))),l.push(new ha(n,n)));e.setSelections(l)})},newlineAndIndent:function(e){return br(e,function(){var t,n,r=e.listSelections();for(t=r.length-1;t>=0;t--)e.replaceRange(e.doc.lineSeparator(),r[t].anchor,r[t].head,"+input");for(r=e.listSelections(),n=0;n<r.length;n++)e.indentLine(r[n].from().line,null,!0);Jn(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},La=new _l,Na=null,Aa=400,Oa=function(e,t,n){this.time=e,this.pos=t,this.button=n},Oa.prototype.compare=function(e,t,n){return this.time+Aa>e&&0==ue(t,this.pos)&&n==this.button},Pa={toString:function(){return"CodeMirror.Init"}},Ia={},Ea={},Zo.defaults=Ia,Zo.optionHandlers=Ea,Fa=[],Zo.defineInitHook=function(e){return Fa.push(e)},qa=null,Wa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new _l,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null},Wa.prototype.init=function(e){function t(e){for(var t=e.target;t;t=t.parentNode){if(t==a)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function n(e){var n,r,s,c,u;if(t(e)&&!P(o,e)){if(o.somethingSelected())el({lineWise:!1,text:o.getSelections()}),"cut"==e.type&&o.replaceSelection("",null,"cut");else{if(!o.options.lineWiseCopyCut)return;n=il(o),el({lineWise:!0,text:n.text}),"cut"==e.type&&o.operation(function(){o.setSelections(n.ranges,0,Tl),o.replaceSelection("",null,"cut")})}if(e.clipboardData&&(e.clipboardData.clearData(),r=qa.text.join("\n"),e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r))return void e.preventDefault();s=ll(),c=s.firstChild,o.display.lineSpace.insertBefore(s,o.display.lineSpace.firstChild),c.value=qa.text.join("\n"),u=l(a.ownerDocument),kl(c),setTimeout(function(){o.display.lineSpace.removeChild(s),u.focus(),u==a&&i.showPrimarySelection()},50)}}var r=this,i=this,o=i.cm,a=i.div=e.lineDiv;a.contentEditable=!0,ol(a,o.options.spellcheck,o.options.autocorrect,o.options.autocapitalize),Il(a,"paste",function(e){!t(e)||P(o,e)||nl(e,o)||Ya<=11&&setTimeout(xr(o,function(){return r.updateFromDOM()}),20)}),Il(a,"compositionstart",function(e){r.composing={data:e.data,done:!1}}),Il(a,"compositionupdate",function(e){r.composing||(r.composing={data:e.data,done:!1})}),Il(a,"compositionend",function(e){r.composing&&(e.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),Il(a,"touchstart",function(){return i.forceCompositionEnd()}),Il(a,"input",function(){r.composing||r.readFromDOMSoon()}),Il(a,"copy",n),Il(a,"cut",n)},Wa.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Wa.prototype.prepareSelection=function(){var e=En(this.cm,!1);return e.focus=l(this.div.ownerDocument)==this.div,e},Wa.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Wa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Wa.prototype.showPrimarySelection=function(){var e,t,n,r,i,o,l,a,s,c=this.getSelection(),u=this.cm,d=u.doc.sel.primary(),f=d.from(),h=d.to();if(u.display.viewTo==u.display.viewFrom||f.line>=u.display.viewTo||h.line<u.display.viewFrom)return void c.removeAllRanges();
if(e=pl(u,c.anchorNode,c.anchorOffset),t=pl(u,c.focusNode,c.focusOffset),!e||e.bad||!t||t.bad||0!=ue(pe(e,t),f)||0!=ue(he(e,t),h)){if(n=u.display.view,r=f.line>=u.display.viewFrom&&ul(u,f)||{node:n[0].measure.map[2],offset:0},i=h.line<u.display.viewTo&&ul(u,h),i||(o=n[n.length-1].measure,l=o.maps?o.maps[o.maps.length-1]:o.map,i={node:l[l.length-1],offset:l[l.length-2]-l[l.length-3]}),!r||!i)return void c.removeAllRanges();a=c.rangeCount&&c.getRangeAt(0);try{s=wl(r.node,r.offset,i.offset,i.node)}catch(e){}s&&(!Ka&&u.state.focused?(c.collapse(r.node,r.offset),s.collapsed||(c.removeAllRanges(),c.addRange(s))):(c.removeAllRanges(),c.addRange(s)),a&&null==c.anchorNode?c.addRange(a):Ka&&this.startGracePeriod()),this.rememberSelection()}},Wa.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)},Wa.prototype.showMultipleSelections=function(e){n(this.cm.display.cursorDiv,e.cursors),n(this.cm.display.selectionDiv,e.selection)},Wa.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Wa.prototype.selectionInEditor=function(){var e,t=this.getSelection();return!!t.rangeCount&&(e=t.getRangeAt(0).commonAncestorContainer,o(this.div,e))},Wa.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&l(this.div.ownerDocument)==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Wa.prototype.blur=function(){this.div.blur()},Wa.prototype.getField=function(){return this.div},Wa.prototype.supportsTouch=function(){return!0},Wa.prototype.receivedFocus=function(){function e(){n.cm.state.focused&&(n.pollSelection(),n.polling.set(n.cm.options.pollInterval,e))}var t=this,n=this;this.selectionInEditor()?setTimeout(function(){return t.pollSelection()},20):br(this.cm,function(){return n.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},Wa.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Wa.prototype.pollSelection=function(){var e,t,n,r;if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged())return e=this.getSelection(),t=this.cm,ls&&Ja&&this.cm.display.gutterSpecs.length&&dl(e.anchorNode)?(this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus()):void(this.composing||(this.rememberSelection(),n=pl(t,e.anchorNode,e.anchorOffset),r=pl(t,e.focusNode,e.focusOffset),n&&r&&br(t,function(){Ci(t.doc,Ur(n,r),Tl),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})))},Wa.prototype.pollContent=function(){var e,t,n,r,i,o,l,a,s,c,u,d,f,h,p,m,g,v,b,x,w,k,_;if(null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null),e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to(),0==r.ch&&r.line>e.firstLine()&&(r=ce(r.line-1,te(e.doc,r.line-1).length)),i.ch==te(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=ce(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;if(r.line==t.viewFrom||0==(o=Ln(e,r.line))?(l=oe(t.view[0].line),a=t.view[0].node):(l=oe(t.view[o].line),a=t.view[o-1].node.nextSibling),s=Ln(e,i.line),s==t.view.length-1?(c=t.viewTo-1,u=t.lineDiv.lastChild):(c=oe(t.view[s+1].line)-1,u=t.view[s+1].node.previousSibling),!a)return!1;for(d=e.doc.splitLines(hl(e,a,u,l,c)),f=ne(e.doc,ce(l,0),ce(c,te(e.doc,c).text.length));d.length>1&&f.length>1;)if(y(d)==y(f))d.pop(),f.pop(),c--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),l++}for(h=0,p=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);h<v&&m.charCodeAt(h)==g.charCodeAt(h);)++h;for(b=y(d),x=y(f),w=Math.min(b.length-(1==d.length?h:0),x.length-(1==f.length?h:0));p<w&&b.charCodeAt(b.length-p-1)==x.charCodeAt(x.length-p-1);)++p;if(1==d.length&&1==f.length&&l==r.line)for(;h&&h>r.ch&&b.charCodeAt(b.length-p-1)==x.charCodeAt(x.length-p-1);)h--,p++;return d[d.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,""),k=ce(l,h),_=ce(c,f.length?y(f).length-p:0),d.length>1||d[0]||ue(k,_)?(Hi(e.doc,d,k,_,"+input"),!0):void 0},Wa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Wa.prototype.reset=function(){this.forceCompositionEnd()},Wa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Wa.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))},Wa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||br(this.cm,function(){return Nn(e.cm)})},Wa.prototype.setUneditable=function(e){e.contentEditable="false"},Wa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||xr(this.cm,tl)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Wa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Wa.prototype.onContextMenu=function(){},Wa.prototype.resetPosition=function(){},Wa.prototype.needsContentAttribute=!0,Ha=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new _l,this.hasSelection=!1,this.composing=null,this.resetting=!1},Ha.prototype.init=function(e){function t(e){if(!P(o,e)){if(o.somethingSelected())el({lineWise:!1,text:o.getSelections()});else{if(!o.options.lineWiseCopyCut)return;var t=il(o);el({lineWise:!0,text:t.text}),"cut"==e.type?o.setSelections(t.ranges,null,Tl):(i.prevInput="",n.value=t.text.join("\n"),kl(n))}"cut"==e.type&&(o.state.cutIncoming=+new Date)}}var n,r=this,i=this,o=this.cm;this.createField(e),n=this.textarea,e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),os&&(n.style.width="0px"),Il(n,"input",function(){Xa&&Ya>=9&&r.hasSelection&&(r.hasSelection=null),i.poll()}),Il(n,"paste",function(e){P(o,e)||nl(e,o)||(o.state.pasteIncoming=+new Date,i.fastPoll())}),Il(n,"cut",t),Il(n,"copy",t),Il(e.scroller,"paste",function(t){if(!Ft(e,t)&&!P(o,t)){if(!n.dispatchEvent)return o.state.pasteIncoming=+new Date,void i.focus();var r=new Event("paste");r.clipboardData=t.clipboardData,n.dispatchEvent(r)}}),Il(e.lineSpace,"selectstart",function(t){Ft(e,t)||q(t)}),Il(n,"compositionstart",function(){var e=o.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:e,range:o.markText(e,o.getCursor("to"),{className:"CodeMirror-composing"})}}),Il(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Ha.prototype.createField=function(e){this.wrapper=ll(),this.textarea=this.wrapper.firstChild},Ha.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ha.prototype.prepareSelection=function(){var e,t,n,r=this.cm,i=r.display,o=r.doc,l=En(r);return r.options.moveInputWithCursor&&(e=dn(r,o.sel.primary().head,"div"),t=i.wrapper.getBoundingClientRect(),n=i.lineDiv.getBoundingClientRect(),l.teTop=Math.max(0,Math.min(i.wrapper.clientHeight-10,e.top+n.top-t.top)),l.teLeft=Math.max(0,Math.min(i.wrapper.clientWidth-10,e.left+n.left-t.left))),l},Ha.prototype.showSelection=function(e){var t=this.cm,r=t.display;n(r.cursorDiv,e.cursors),n(r.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ha.prototype.reset=function(e){var t,n;this.contextMenuPending||this.composing&&e||(t=this.cm,this.resetting=!0,t.somethingSelected()?(this.prevInput="",n=t.getSelection(),this.textarea.value=n,t.state.focused&&kl(this.textarea),Xa&&Ya>=9&&(this.hasSelection=n)):e||(this.prevInput=this.textarea.value="",Xa&&Ya>=9&&(this.hasSelection=null)),this.resetting=!1)},Ha.prototype.getField=function(){return this.textarea},Ha.prototype.supportsTouch=function(){return!1},Ha.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!as||l(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(e){}},Ha.prototype.blur=function(){this.textarea.blur()},Ha.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ha.prototype.receivedFocus=function(){this.slowPoll()},Ha.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ha.prototype.fastPoll=function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},Ha.prototype.poll=function(){var e,t,n,r,i=this,o=this.cm,l=this.textarea,a=this.prevInput;if(this.contextMenuPending||this.resetting||!o.state.focused||Hl(l)&&!a&&!this.composing||o.isReadOnly()||o.options.disableInput||o.state.keySeq)return!1;if(e=l.value,e==a&&!o.somethingSelected())return!1;if(Xa&&Ya>=9&&this.hasSelection===e||ss&&/[\uf700-\uf7ff]/.test(e))return o.display.input.reset(),!1;if(o.doc.sel==o.display.selForContextMenu&&(t=e.charCodeAt(0),8203!=t||a||(a="​"),8666==t))return this.reset(),this.cm.execCommand("undo");for(n=0,r=Math.min(a.length,e.length);n<r&&a.charCodeAt(n)==e.charCodeAt(n);)++n;return br(o,function(){tl(o,e.slice(n),a.length-n,null,i.composing?"*compose":null),e.length>1e3||e.indexOf("\n")>-1?l.value=i.prevInput="":i.prevInput=e,i.composing&&(i.composing.range.clear(),i.composing.range=o.markText(i.composing.start,o.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ha.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ha.prototype.onKeyPress=function(){Xa&&Ya>=9&&(this.hasSelection=null),this.fastPoll()},Ha.prototype.onContextMenu=function(e){function t(){var e,t;null!=p.selectionStart&&(e=f.somethingSelected(),t="​"+(e?p.value:""),p.value="⇚",p.value=t,d.prevInput=e?"":"​",p.selectionStart=1,p.selectionEnd=t.length,h.selForContextMenu=f.doc.sel)}function n(){if(d.contextMenuPending==n&&(d.contextMenuPending=!1,d.wrapper.style.cssText=a,p.style.cssText=l,Xa&&Ya<9&&h.scrollbars.setScrollTop(h.scroller.scrollTop=i),null!=p.selectionStart)){(!Xa||Xa&&Ya<9)&&t();var e=0,r=function(){h.selForContextMenu==f.doc.sel&&0==p.selectionStart&&p.selectionEnd>0&&"​"==d.prevInput?xr(f,zi)(f):e++<10?h.detectingSelectAll=setTimeout(r,500):(h.selForContextMenu=null,h.input.reset())};h.detectingSelectAll=setTimeout(r,200)}}var r,i,o,l,a,s,c,u,d=this,f=d.cm,h=f.display,p=d.textarea;d.contextMenuPending&&d.contextMenuPending(),r=Mn(f,e),i=h.scroller.scrollTop,r&&!ts&&(o=f.options.resetSelectionOnContextMenu,o&&f.doc.sel.contains(r)==-1&&xr(f,Ci)(f.doc,Ur(r),Tl),l=p.style.cssText,a=d.wrapper.style.cssText,s=d.wrapper.offsetParent.getBoundingClientRect(),d.wrapper.style.cssText="position: static",p.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-s.top-5)+"px; left: "+(e.clientX-s.left-5)+"px;\n      z-index: 1000; background: "+(Xa?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Za&&(c=p.ownerDocument.defaultView.scrollY),h.input.focus(),Za&&p.ownerDocument.defaultView.scrollTo(null,c),h.input.reset(),f.somethingSelected()||(p.value=d.prevInput=" "),d.contextMenuPending=n,h.selForContextMenu=f.doc.sel,clearTimeout(h.detectingSelectAll),Xa&&Ya>=9&&t(),bl?(R(e),u=function(){z(window,"mouseup",u),setTimeout(n,20)},Il(window,"mouseup",u)):setTimeout(n,50))},Ha.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Ha.prototype.setUneditable=function(){},Ha.prototype.needsContentAttribute=!1,Go(Zo),al(Zo),Ra="iter insert remove copy getEditor constructor".split(" ");for(Ba in ba.prototype)ba.prototype.hasOwnProperty(Ba)&&p(Ra,Ba)<0&&(Zo.prototype[Ba]=function(e){return function(){return e.apply(this.doc,arguments)}}(ba.prototype[Ba]));return F(ba),Zo.inputStyles={textarea:Ha,contenteditable:Wa},Zo.defineMode=function(e){Zo.defaults.mode||"null"==e||(Zo.defaults.mode=e),$.apply(this,arguments)},Zo.defineMIME=G,Zo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Zo.defineMIME("text/plain","null"),Zo.defineExtension=function(e,t){Zo.prototype[e]=t},Zo.defineDocExtension=function(e,t){ba.prototype[e]=t},Zo.fromTextArea=gl,yl(Zo),Zo.version="5.65.8",Zo}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.info=r,this.align=i,this.prev=o}function n(e,n,r,i){var o=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=r&&(o=e.context.indented),e.context=new t(o,n,r,i,null,e.context)}function r(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function i(e,t,n){return"variable"==t.prevToken||"type"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function o(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function l(e){var t,n={},r=e.split(" ");for(t=0;t<r.length;++t)n[r[t]]=!0;return n}function a(e,t){return"function"==typeof e?e(t):e.propertyIsEnumerable(t)}function s(e){return a(M,e)||/.+_t$/.test(e)}function c(e){return s(e)||a(L,e)}function u(e,t){if(!t.startOfLine)return!1;for(var n,r=null;n=e.peek();){if("\\"==n&&e.match(/^.$/)){r=u;break}if("/"==n&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=r,"meta"}function d(e,t){return"type"==t.prevToken&&"type"}function f(e){return!(!e||e.length<2)&&("_"==e[0]&&("_"==e[1]||e[1]!==e[1].toLowerCase()))}function h(e){return e.eatWhile(/[\w\.']/),"number"}function p(e,t){if(e.backUp(1),e.match(/^(?:R|u8R|uR|UR|LR)/)){var n=e.match(/^"([^\s\\()]{0,16})\(/);return!!n&&(t.cpp11RawStringDelim=n[1],t.tokenize=y,y(e,t))}return e.match(/^(?:u8|u|U|L)/)?!!e.match(/^["']/,!1)&&"string":(e.next(),!1)}function m(e){var t=/(\w+)::~?(\w+)$/.exec(e);return t&&t[1]==t[2]}function g(e,t){for(var n;null!=(n=e.next());)if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function y(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),r=e.match(new RegExp(".*?\\)"+n+'"'));return r?t.tokenize=null:e.skipToEnd(),"string"}function v(t,n){function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&i.push(t)}var i,o;for("string"==typeof t&&(t=[t]),i=[],r(n.keywords),r(n.types),r(n.builtin),r(n.atoms),i.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],i)),o=0;o<t.length;++o)e.defineMIME(t[o],n)}function b(e,t){for(var n=!1;!e.eol();){if(!n&&e.match('"""')){t.tokenize=null;break}n="\\"==e.next()&&!n}return"string"}function x(e){return function(t,n){for(var r;r=t.next();){if("*"==r&&t.eat("/")){if(1==e){n.tokenize=null;break}return n.tokenize=x(e-1),n.tokenize(t,n)}if("/"==r&&t.eat("*"))return n.tokenize=x(e+1),n.tokenize(t,n)}return"comment"}}function w(e){return function(t,n){for(var r,i=!1,o=!1;!t.eol();){if(!e&&!i&&t.match('"')){o=!0;break}if(e&&t.match('"""')){o=!0;break}r=t.next(),!i&&"$"==r&&t.match("{")&&t.skipTo("}"),i=!i&&"\\"==r&&!e}return!o&&e||(n.tokenize=null),"string"}}function k(e){return function(t,n){for(var r,i=!1,o=!1;!t.eol();){if(!i&&t.match('"')&&("single"==e||t.match('""'))){o=!0;break}if(!i&&t.match("``")){O=k(e),o=!0;break}r=t.next(),i="single"==e&&!i&&"\\"==r}return o&&(n.tokenize=null),"string"}}var _,C,S,T,M,L,N,A,O;e.defineMode("clike",function(l,s){function c(e,t){var n,r,i=e.next();if(C[i]&&(n=C[i](e,t),n!==!1))return n;if('"'==i||"'"==i)return t.tokenize=u(i),t.tokenize(e,t);if(A.test(i)){if(e.backUp(1),e.match(O))return"number";e.next()}if(N.test(i))return h=i,null;if("/"==i){if(e.eat("*"))return t.tokenize=d,d(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(z.test(i)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(z););return"operator"}if(e.eatWhile(D),L)for(;e.match(L);)e.eatWhile(D);return r=e.current(),a(v,r)?(a(w,r)&&(h="newstatement"),a(k,r)&&(p=!0),"keyword"):a(b,r)?"type":a(x,r)||P&&P(r)?(a(w,r)&&(h="newstatement"),"builtin"):a(_,r)?"atom":"variable"}function u(e){return function(t,n){for(var r,i=!1,o=!1;null!=(r=t.next());){if(r==e&&!i){o=!0;break}i=!i&&"\\"==r}return(o||!i&&!S)&&(n.tokenize=null),"string"}}function d(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=null;break}r="*"==n}return"comment"}function f(e,t){s.typeFirstDefinitions&&e.eol()&&o(t.context)&&(t.typeAtEndOfLine=i(e,t,e.pos))}var h,p,m=l.indentUnit,g=s.statementIndentUnit||m,y=s.dontAlignCalls,v=s.keywords||{},b=s.types||{},x=s.builtin||{},w=s.blockKeywords||{},k=s.defKeywords||{},_=s.atoms||{},C=s.hooks||{},S=s.multiLineStrings,T=s.indentStatements!==!1,M=s.indentSwitch!==!1,L=s.namespaceSeparator,N=s.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,A=s.numberStart||/[\d\.]/,O=s.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,z=s.isOperatorChar||/[+\-*&%=<>!?|\/]/,D=s.isIdentifierChar||/[\w\$_\xa1-\uffff]/,P=s.isReservedIdentifier||!1;return{startState:function(e){return{tokenize:null,context:new t((e||0)-m,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var l,a,u=t.context;if(e.sol()&&(null==u.align&&(u.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return f(e,t),null;if(h=p=null,l=(t.tokenize||c)(e,t),"comment"==l||"meta"==l)return l;if(null==u.align&&(u.align=!0),";"==h||":"==h||","==h&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)r(t);else if("{"==h)n(t,e.column(),"}");else if("["==h)n(t,e.column(),"]");else if("("==h)n(t,e.column(),")");else if("}"==h){for(;"statement"==u.type;)u=r(t);for("}"==u.type&&(u=r(t));"statement"==u.type;)u=r(t)}else h==u.type?r(t):T&&(("}"==u.type||"top"==u.type)&&";"!=h||"statement"==u.type&&"newstatement"==h)&&n(t,e.column(),"statement",e.current());return"variable"==l&&("def"==t.prevToken||s.typeFirstDefinitions&&i(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(l="def"),C.token&&(a=C.token(e,t,l),void 0!==a&&(l=a)),"def"==l&&s.styleDefs===!1&&(l="variable"),t.startOfLine=!1,t.prevToken=p?"def":l||h,f(e,t),l},indent:function(t,n){var r,i,o,l,a;if(t.tokenize!=c&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;if(r=t.context,i=n&&n.charAt(0),o=i==r.type,"statement"==r.type&&"}"==i&&(r=r.prev),s.dontIndentStatements)for(;"statement"==r.type&&s.dontIndentStatements.test(r.info);)r=r.prev;if(C.indent&&(l=C.indent(t,r,n,m),"number"==typeof l))return l;if(a=r.prev&&"switch"==r.prev.info,s.allmanIndentation&&/[{(]/.test(i)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==i?0:g):!r.align||y&&")"==r.type?")"!=r.type||o?r.indented+(o?0:m)+(o||!a||/^(?:case|default)\b/.test(n)?0:m):r.indented+g:r.column+(o?0:1)},electricInput:M?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}}),_="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",C="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",S="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",T="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION  NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",M=l("int long char short double float unsigned signed void bool"),L=l("SEL instancetype id Class Protocol BOOL"),N="case do else for if switch while struct enum union",A="struct enum union",v(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:l(_),types:s,blockKeywords:l(N),defKeywords:l(A),typeFirstDefinitions:!0,atoms:l("NULL true false"),isReservedIdentifier:f,hooks:{"#":u,"*":d},modeProps:{fold:["brace","include"]}}),v(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:l(_+" "+C),types:s,blockKeywords:l(N+" class try catch"),defKeywords:l(A+" class namespace"),typeFirstDefinitions:!0,atoms:l("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:f,hooks:{"#":u,"*":d,u:p,U:p,L:p,R:p,0:h,1:h,2:h,3:h,4:h,5:h,6:h,7:h,8:h,9:h,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&m(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),v("text/x-java",{name:"clike",keywords:l("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:l("var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:l("catch class do else finally for if switch try while"),defKeywords:l("class interface enum @interface"),typeFirstDefinitions:!0,atoms:l("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return!e.match("interface",!1)&&(e.eatWhile(/[\w\$_]/),"meta")},'"':function(e,t){return!!e.match(/""$/)&&(t.tokenize=b,t.tokenize(e,t))}},modeProps:{fold:["brace","import"]}}),v("text/x-csharp",{name:"clike",keywords:l("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:l("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:l("catch class do else finally for foreach if struct switch try while"),defKeywords:l("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:l("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=g,g(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),v("text/x-scala",{name:"clike",keywords:l("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:l("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:l("catch class enum do else finally for forSome if match switch try while"),defKeywords:l("class enum def object package trait type val var"),atoms:l("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=b,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,n){var r=n.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=x(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}}),v("text/x-kotlin",{name:"clike",keywords:l("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:l("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:l("catch class do else finally for if where try while enum"),defKeywords:l("class val var object interface fun"),atoms:l("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,t){return"."==t.prevToken?"variable":"operator"},'"':function(e,t){return t.tokenize=w(e.match('""')),t.tokenize(e,t)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=x(1),t.tokenize(e,t))},indent:function(e,t,n,r){var i=n&&n.charAt(0);return"}"!=e.prevToken&&")"!=e.prevToken||""!=n?"operator"==e.prevToken&&"}"!=n&&"}"!=e.context.type||"variable"==e.prevToken&&"."==i||("}"==e.prevToken||")"==e.prevToken)&&"."==i?2*r+t.indented:t.align&&"}"==t.type?t.indented+(e.context.type==(n||"").charAt(0)?0:r):void 0:e.indented}},modeProps:{closeBrackets:{triples:'"'}}}),v(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:l("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:l("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:l("for while do if else struct"),builtin:l("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:l("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":u},modeProps:{fold:["brace","include"]}}),v("text/x-nesc",{name:"clike",keywords:l(_+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:s,blockKeywords:l(N),atoms:l("null true false"),hooks:{"#":u},modeProps:{fold:["brace","include"]}}),v("text/x-objectivec",{name:"clike",keywords:l(_+" "+S),types:c,builtin:l(T),blockKeywords:l(N+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:l(A+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:l("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:f,hooks:{"#":u,"*":d},modeProps:{fold:["brace","include"]}}),v("text/x-objectivec++",{name:"clike",keywords:l(_+" "+S+" "+C),types:c,builtin:l(T),blockKeywords:l(N+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:l(A+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:l("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:f,hooks:{"#":u,"*":d,u:p,U:p,L:p,R:p,0:h,1:h,2:h,3:h,4:h,5:h,6:h,7:h,8:h,9:h,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&m(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),v("text/x-squirrel",{name:"clike",keywords:l("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:s,blockKeywords:l("case catch class else for foreach if switch try while"),defKeywords:l("function local class"),
typeFirstDefinitions:!0,atoms:l("true false null"),hooks:{"#":u},modeProps:{fold:["brace","include"]}}),O=null,v("text/x-ceylon",{name:"clike",keywords:l("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:l("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:l("class dynamic function interface module object package value"),builtin:l("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:l("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=k(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!O||!e.match("`"))&&(t.tokenize=O,O=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"type"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t,n={};for(t=0;t<e.length;++t)n[e[t].toLowerCase()]=!0;return n}function n(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}var r,i,o,l,a,s,c,u,d,f,h,p,m,g,y,v,b,x,w,k,_;e.defineMode("css",function(t,n){function r(e,t){return N=t,e}function i(e,t){var n,i=e.next();return p[i]&&(n=p[i](e,t),n!==!1)?n:"@"==i?(e.eatWhile(/[\w\\\-]/),r("def",e.current())):"="==i||("~"==i||"|"==i)&&e.eat("=")?r(null,"compare"):'"'==i||"'"==i?(t.tokenize=o(i),t.tokenize(e,t)):"#"==i?(e.eatWhile(/[\w\\\-]/),r("atom","hash")):"!"==i?(e.match(/^\s*\w*/),r("keyword","important")):/\d/.test(i)||"."==i&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),r("number","unit")):"-"!==i?/[,+>*\/]/.test(i)?r(null,"select-op"):"."==i&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(i)?r(null,i):e.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=l),r("variable callee","variable")):/[\w\\\-]/.test(i)?(e.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?r("variable-2","variable-definition"):r("variable-2","variable")):e.match(/^\w+-/)?r("meta","meta"):void 0}function o(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(n.tokenize=null),r("string","string")}}function l(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),r(null,"(")}function a(e,t,n){this.type=e,this.indent=t,this.prev=n}function s(e,t,n,r){return e.context=new a(n,t.indentation()+(r===!1?0:h),e.context),n}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,n){return O[n.context.type](e,t,n)}function d(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(e,t,n)}function f(e){var t=e.current().toLowerCase();A=C.hasOwnProperty(t)?"atom":_.hasOwnProperty(t)?"keyword":"variable"}var h,p,m,g,y,v,b,x,w,k,_,C,S,T,M,L,N,A,O,z=n.inline;return n.propertyKeywords||(n=e.resolveMode("text/css")),h=t.indentUnit,p=n.tokenHooks,m=n.documentTypes||{},g=n.mediaTypes||{},y=n.mediaFeatures||{},v=n.mediaValueKeywords||{},b=n.propertyKeywords||{},x=n.nonStandardPropertyKeywords||{},w=n.fontProperties||{},k=n.counterDescriptors||{},_=n.colorKeywords||{},C=n.valueKeywords||{},S=n.allowNested,T=n.lineComment,M=n.supportsAtComponent===!0,L=t.highlightNonStandardPropertyKeywords!==!1,O={},O.top=function(e,t,n){if("{"==e)return s(n,t,"block");if("}"==e&&n.context.prev)return c(n);if(M&&/@component/i.test(e))return s(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return s(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return s(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(n,t,"at");if("hash"==e)A="builtin";else if("word"==e)A="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(n,t,"interpolation");if(":"==e)return"pseudo";if(S&&"("==e)return s(n,t,"parens")}return n.context.type},O.block=function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return b.hasOwnProperty(r)?(A="property","maybeprop"):x.hasOwnProperty(r)?(A=L?"string-2":"property","maybeprop"):S?(A=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(A+=" error","maybeprop")}return"meta"==e?"block":S||"hash"!=e&&"qualifier"!=e?O.top(e,t,n):(A="error","block")},O.maybeprop=function(e,t,n){return":"==e?s(n,t,"prop"):u(e,t,n)},O.prop=function(e,t,n){if(";"==e)return c(n);if("{"==e&&S)return s(n,t,"propBlock");if("}"==e||"{"==e)return d(e,t,n);if("("==e)return s(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return s(n,t,"interpolation")}else A+=" error";return"prop"},O.propBlock=function(e,t,n){return"}"==e?c(n):"word"==e?(A="property","maybeprop"):n.context.type},O.parens=function(e,t,n){return"{"==e||"}"==e?d(e,t,n):")"==e?c(n):"("==e?s(n,t,"parens"):"interpolation"==e?s(n,t,"interpolation"):("word"==e&&f(t),"parens")},O.pseudo=function(e,t,n){return"meta"==e?"pseudo":"word"==e?(A="variable-3",n.context.type):u(e,t,n)},O.documentTypes=function(e,t,n){return"word"==e&&m.hasOwnProperty(t.current())?(A="tag",n.context.type):O.atBlock(e,t,n)},O.atBlock=function(e,t,n){if("("==e)return s(n,t,"atBlock_parens");if("}"==e||";"==e)return d(e,t,n);if("{"==e)return c(n)&&s(n,t,S?"block":"top");if("interpolation"==e)return s(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();A="only"==r||"not"==r||"and"==r||"or"==r?"keyword":g.hasOwnProperty(r)?"attribute":y.hasOwnProperty(r)?"property":v.hasOwnProperty(r)?"keyword":b.hasOwnProperty(r)?"property":x.hasOwnProperty(r)?L?"string-2":"property":C.hasOwnProperty(r)?"atom":_.hasOwnProperty(r)?"keyword":"error"}return n.context.type},O.atComponentBlock=function(e,t,n){return"}"==e?d(e,t,n):"{"==e?c(n)&&s(n,t,S?"block":"top",!1):("word"==e&&(A="error"),n.context.type)},O.atBlock_parens=function(e,t,n){return")"==e?c(n):"{"==e||"}"==e?d(e,t,n,2):O.atBlock(e,t,n)},O.restricted_atBlock_before=function(e,t,n){return"{"==e?s(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(A="variable","restricted_atBlock_before"):u(e,t,n)},O.restricted_atBlock=function(e,t,n){return"}"==e?(n.stateArg=null,c(n)):"word"==e?(A="@font-face"==n.stateArg&&!w.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!k.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},O.keyframes=function(e,t,n){return"word"==e?(A="variable","keyframes"):"{"==e?s(n,t,"top"):u(e,t,n)},O.at=function(e,t,n){return";"==e?c(n):"{"==e||"}"==e?d(e,t,n):("word"==e?A="tag":"hash"==e&&(A="builtin"),"at")},O.interpolation=function(e,t,n){return"}"==e?c(n):"{"==e||";"==e?d(e,t,n):("word"==e?A="variable":"variable"!=e&&"("!=e&&")"!=e&&(A="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:z?"block":"top",stateArg:null,context:new a(z?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||i)(e,t);return n&&"object"==typeof n&&(N=n[1],n=n[0]),A=n,"comment"!=N&&(t.state=O[t.state](N,e,t)),A},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-h)):(n=n.prev,i=n.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:T,fold:"brace"}}),r=["domain","regexp","url","url-prefix"],i=t(r),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],l=t(o),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme","dynamic-range","video-dynamic-range"],s=t(a),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],u=t(c),d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],f=t(d),h=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],p=t(h),m=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(m),y=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],v=t(y),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],x=t(b),w=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],k=t(w),_=r.concat(o).concat(a).concat(c).concat(d).concat(h).concat(b).concat(w),e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:i,mediaTypes:l,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:g,counterDescriptors:v,colorKeywords:x,valueKeywords:k,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:l,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:x,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:l,mediaFeatures:s,mediaValueKeywords:u,propertyKeywords:f,nonStandardPropertyKeywords:p,colorKeywords:x,valueKeywords:k,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:l,mediaFeatures:s,propertyKeywords:f,nonStandardPropertyKeywords:p,fontProperties:g,counterDescriptors:v,colorKeywords:x,valueKeywords:k,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css",helperType:"gss"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}function n(e){var t=s[e];return t?t:s[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function r(e,t){var r=e.match(n(t));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"</\\s*"+e+"\\s*>","i")}function o(e,t){var n,r,i,o;for(n in e)for(r=t[n]||(t[n]=[]),i=e[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}function l(e,t){var n,i;for(n=0;n<e.length;n++)if(i=e[n],!i[0]||i[1].test(r(t,i[0])))return i[2]}var a={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},s={};e.defineMode("htmlmixed",function(n,r){function s(r,o){var a,c,f,h,p,m,g=u.token(r,o.htmlState),y=/\btag\b/.test(g);return y&&!/[<>\s\/]/.test(r.current())&&(a=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&d.hasOwnProperty(a)?o.inTag=a+" ":o.inTag&&y&&/>$/.test(r.current())?(c=/^([\S]+) (.*)/.exec(o.inTag),o.inTag=null,f=">"==r.current()&&l(d[c[1]],c[2]),h=e.getMode(n,f),p=i(c[1],!0),m=i(c[1],!1),o.token=function(e,n){return e.match(p,!1)?(n.token=s,n.localState=n.localMode=null,null):t(e,m,n.localMode.token(e,n.localState))},o.localMode=h,o.localState=e.startState(h,u.indent(o.htmlState,"",""))):o.inTag&&(o.inTag+=r.current(),r.eol()&&(o.inTag+=" ")),g}var c,u=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag,allowMissingTagName:r.allowMissingTagName}),d={},f=r&&r.tags,h=r&&r.scriptTypes;if(o(a,d),f&&o(f,d),h)for(c=h.length-1;c>=0;c--)d.script.unshift(["type",h[c].matches,h[c].mode]);return{startState:function(){var t=e.startState(u);return{token:s,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(u,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){return!t.localMode||/^\s*<\//.test(n)?u.indent(t.htmlState,n,r):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||u}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror);
}(function(e){"use strict";function t(e){var t,n={},r=e.split(" ");for(t=0;t<r.length;++t)n[r[t]]=!0;return n}function n(e,t,i){return 0==e.length?r(t):function(o,l){var a,s=e[0];for(a=0;a<s.length;a++)if(o.match(s[a][0]))return l.tokenize=n(e.slice(1),t),s[a][1];return l.tokenize=r(t,i),"string"}}function r(e,t){return function(n,r){return i(n,r,e,t)}}function i(e,t,r,i){if(i!==!1&&e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(i!==!1&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=n([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],r,i)),e.match(/^->\w/,!1)&&(t.tokenize=n([[["->",null]],[[/[\w]+/,"variable"]]],r,i)),"variable-2";for(var o=!1;!e.eol()&&(o||i===!1||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!o&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}o="\\"==e.next()&&!o}return"string"}var o,l="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally readonly match",a="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",s="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage memory_get_peak_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[l,a,s].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/),o={name:"clike",helperType:"php",keywords:t(l),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),defKeywords:t("class enum function interface namespace trait"),atoms:t(a),builtin:t(s),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){var n,i,o;return!(!(n=e.match(/^<<\s*/))||(i=e.eat(/['"]/),e.eatWhile(/[\w\.]/),o=e.current().slice(n[0].length+(i?2:1)),i&&e.eat(i),!o))&&((t.tokStack||(t.tokStack=[])).push(o,0),t.tokenize=r(o,"'"!=i),"string")},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=r('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=r(t.tokStack[t.tokStack.length-2])),!1}}},e.defineMode("php",function(t,n){function r(t,n){var r,o,a,s,c=n.curMode==l;if(t.sol()&&n.pending&&'"'!=n.pending&&"'"!=n.pending&&(n.pending=null),c)return c&&null==n.php.tokenize&&t.match("?>")?(n.curMode=i,n.curState=n.html,n.php.context.prev||(n.php=null),"meta"):l.token(t,n.curState);if(t.match(/^<\?\w*/))return n.curMode=l,n.php||(n.php=e.startState(l,i.indent(n.html,"",""))),n.curState=n.php,"meta";if('"'==n.pending||"'"==n.pending){for(;!t.eol()&&t.next()!=n.pending;);r="string"}else n.pending&&t.pos<n.pending.end?(t.pos=n.pending.end,r=n.pending.style):r=i.token(t,n.curState);return n.pending&&(n.pending=null),o=t.current(),a=o.search(/<\?/),a!=-1&&("string"==r&&(s=o.match(/[\'\"]$/))&&!/\?>/.test(o)?n.pending=s[0]:n.pending={end:t.pos,style:r},t.backUp(o.length-a)),r}var i=e.getMode(t,n&&n.htmlMode||"text/html"),l=e.getMode(t,o);return{startState:function(){var t=e.startState(i),r=n.startOpen?e.startState(l):null;return{html:t,php:r,curMode:n.startOpen?l:i,curState:n.startOpen?r:t,pending:null}},copyState:function(t){var n,r=t.html,o=e.copyState(i,r),a=t.php,s=a&&e.copyState(l,a);return n=t.curMode==i?o:s,{html:o,php:s,curMode:t.curMode,curState:n,pending:t.pending}},token:r,indent:function(e,t,n){return e.curMode!=l&&/^\s*<\//.test(t)||e.curMode==l&&/^\?>/.test(t)?i.indent(e.html,t,n):e.curMode.indent(e.curState,t,n)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",o)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",function(r,i){function o(e,t){function n(n){return t.tokenize=n,n(e,t)}var r,i=e.next();return"<"==i?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(s("atom","]]>")):null:e.match("--")?n(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(C=e.eat("/")?"closeTag":"openTag",t.tokenize=l,"tag bracket"):"&"==i?(r=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),r?"atom":"error"):(e.eatWhile(/[^&<]/),null)}function l(e,t){var n,r=e.next();return">"==r||"/"==r&&e.eat(">")?(t.tokenize=o,C=">"==r?"endTag":"selfcloseTag","tag bracket"):"="==r?(C="equals",null):"<"==r?(t.tokenize=o,t.state=p,t.tagName=t.tagStart=null,n=t.tokenize(e,t),n?n+" tag error":"tag error"):/[\'\"]/.test(r)?(t.tokenize=a(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=l;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e){return e&&e.toLowerCase()}function d(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(M.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!M.contextGrabbers.hasOwnProperty(u(n))||!M.contextGrabbers[u(n)].hasOwnProperty(u(t)))return;f(e)}}function p(e,t,n){return"openTag"==e?(n.tagStart=t.column(),m):"closeTag"==e?g:p}function m(e,t,n){return"word"==e?(n.tagName=t.current(),S="tag",b):M.allowMissingTagName&&"endTag"==e?(S="tag bracket",b(e,t,n)):(S="error",m)}function g(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&M.implicitlyClosed.hasOwnProperty(u(n.context.tagName))&&f(n),n.context&&n.context.tagName==r||M.matchClosing===!1?(S="tag",y):(S="tag error",v)}return M.allowMissingTagName&&"endTag"==e?(S="tag bracket",y(e,t,n)):(S="error",v)}function y(e,t,n){return"endTag"!=e?(S="error",y):(f(n),p)}function v(e,t,n){return S="error",y(e,t,n)}function b(e,t,n){if("word"==e)return S="attribute",x;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||M.autoSelfClosers.hasOwnProperty(u(r))?h(n,r):(h(n,r),n.context=new d(n,r,i==n.indented)),p}return S="error",b}function x(e,t,n){return"equals"==e?w:(M.allowMissing||(S="error"),b(e,t,n))}function w(e,t,n){return"string"==e?k:"word"==e&&M.allowUnquoted?(S="string",b):(S="error",b(e,t,n))}function k(e,t,n){return"string"==e?k:b(e,t,n)}var _,C,S,T=r.indentUnit,M={},L=i.htmlMode?t:n;for(_ in L)M[_]=L[_];for(_ in i)M[_]=i[_];return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;C=null;var n=t.tokenize(e,t);return(n||C)&&"comment"!=n&&(S=null,t.state=t.state(C||n,e,t),S&&(n="error"==S?n+" error":S)),n},indent:function(t,n,r){var i,a,s=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+T;if(s&&s.noIndent)return e.Pass;if(t.tokenize!=l&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return M.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+T*(M.multilineTagIndentFactor||1);if(M.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;if(i=n&&/^<(\/)?([\w_:\.-]*)/.exec(n),i&&i[1])for(;s;){if(s.tagName==i[2]){s=s.prev;break}if(!M.implicitlyClosed.hasOwnProperty(u(s.tagName)))break;s=s.prev}else if(i)for(;s&&(a=M.contextGrabbers[u(s.tagName)],a&&a.hasOwnProperty(u(i[2])));)s=s.prev;for(;s&&s.prev&&!s.startOfLine;)s=s.prev;return s?s.indent+T:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:M.htmlMode?"html":"xml",helperType:M.htmlMode?"html":"xml",skipAttribute:function(e){e.state==w&&(e.state=b)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){var t,n=[];for(t=e.context;t;t=t.prev)n.push(t.tagName);return n.reverse()}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,n){function r(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function i(e,t,n){return je=e,Ue=n,t}function o(e,t){var n,o,c=e.next();if('"'==c||"'"==c)return t.tokenize=l(c),t.tokenize(e,t);if("."==c&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return i("number","number");if("."==c&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(c))return i(c);if("="==c&&e.eat(">"))return i("=>","operator");if("0"==c&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return i("number","number");if(/\d/.test(c))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),i("number","number");if("/"==c)return e.eat("*")?(t.tokenize=a,a(e,t)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):Be(e,t,1)?(r(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),i("regexp","string-2")):(e.eat("="),i("operator","operator",e.current()));if("`"==c)return t.tokenize=s,s(e,t);if("#"==c&&"!"==e.peek())return e.skipToEnd(),i("meta","meta");if("#"==c&&e.eatWhile(Ze))return i("variable","property");if("<"==c&&e.match("!--")||"-"==c&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),i("comment","comment");if(Je.test(c))return">"==c&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=c&&"="!=c||e.eat("="):/[<>*+\-|&?]/.test(c)&&(e.eat(c),">"==c&&e.eat(c))),"?"==c&&e.eat(".")?i("."):i("operator","operator",e.current());if(Ze.test(c)){if(e.eatWhile(Ze),n=e.current(),"."!=t.lastType){if(Qe.propertyIsEnumerable(n))return o=Qe[n],i(o.type,o.style,n);if("async"==n&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return i("async","keyword",n)}return i("variable","variable",n)}}function l(e){return function(t,n){var r,l=!1;if($e&&"@"==t.peek()&&t.match(et))return n.tokenize=o,i("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||l);)l=!l&&"\\"==r;return l||(n.tokenize=o),i("string","string")}}function a(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=o;break}r="*"==n}return i("comment","comment")}function s(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=o;break}r=!r&&"\\"==n}return i("quasi","string-2",e.current())}function c(e,t){var n,r,i,o,l,a,s,c;if(t.fatArrowAt&&(t.fatArrowAt=null),n=e.string.indexOf("=>",e.start),!(n<0)){for(Ye&&(r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n)),r&&(n=r.index)),i=0,o=!1,l=n-1;l>=0;--l)if(a=e.string.charAt(l),s=tt.indexOf(a),s>=0&&s<3){if(!i){++l;break}if(0==--i){"("==a&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(Ze.test(a))o=!0;else if(/["'\/`]/.test(a))for(;;--l){if(0==l)return;if(c=e.string.charAt(l-1),c==a&&"\\"!=e.string.charAt(l-2)){l--;break}}else if(o&&!i){++l;break}o&&!i&&(t.fatArrowAt=l)}}function u(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function d(e,t){var n,r;if(!Xe)return!1;for(n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function f(e,t,n,r,i){var o,l=e.cc;for(rt.state=e,rt.stream=i,rt.marked=null,rt.cc=l,rt.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o=l.length?l.pop():Ge?N:M)(n,r)){for(;l.length&&l[l.length-1].lex;)l.pop()();return rt.marked?rt.marked:"variable"==n&&d(e,r)?"variable-2":t}}function h(){for(var e=arguments.length-1;e>=0;e--)rt.cc.push(arguments[e])}function p(){return h.apply(null,arguments),!0}function m(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function g(e){var t,r=rt.state;if(rt.marked="def",Xe){if(r.context)if("var"==r.lexical.info&&r.context&&r.context.block){if(t=y(e,r.context),null!=t)return void(r.context=t)}else if(!m(e,r.localVars))return void(r.localVars=new x(e,r.localVars));n.globalVars&&!m(e,r.globalVars)&&(r.globalVars=new x(e,r.globalVars))}}function y(e,t){if(t){if(t.block){var n=y(e,t.prev);return n?n==t.prev?t:new b(n,t.vars,!0):null}return m(e,t.vars)?t:new b(t.prev,new x(e,t.vars),!1)}return null}function v(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function b(e,t,n){this.prev=e,this.vars=t,this.block=n}function x(e,t){this.name=e,this.next=t}function w(){rt.state.context=new b(rt.state.context,rt.state.localVars,!1),rt.state.localVars=it}function k(){rt.state.context=new b(rt.state.context,rt.state.localVars,!0),rt.state.localVars=null}function _(){rt.state.localVars=rt.state.context.vars,rt.state.context=rt.state.context.prev}function C(e,t){var n=function(){var n,r=rt.state,i=r.indented;if("stat"==r.lexical.type)i=r.lexical.indented;else for(n=r.lexical;n&&")"==n.type&&n.align;n=n.prev)i=n.indented;r.lexical=new u(i,rt.stream.column(),e,null,r.lexical,t)};return n.lex=!0,n}function S(){var e=rt.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function T(e){function t(n){return n==e?p():";"==e||"}"==n||")"==n||"]"==n?h():p(t)}return t}function M(e,t){return"var"==e?p(C("vardef",t),fe,T(";"),S):"keyword a"==e?p(C("form"),O,M,S):"keyword b"==e?p(C("form"),M,S):"keyword d"==e?rt.stream.match(/^\s*$/,!1)?p():p(C("stat"),D,T(";"),S):"debugger"==e?p(T(";")):"{"==e?p(C("}"),k,Y,S,_):";"==e?p():"if"==e?("else"==rt.state.lexical.info&&rt.state.cc[rt.state.cc.length-1]==S&&rt.state.cc.pop()(),p(C("form"),O,M,S,ve)):"function"==e?p(ke):"for"==e?p(C("form"),k,be,M,_,S):"class"==e||Ye&&"interface"==t?(rt.marked="keyword",p(C("form","class"==e?e:t),Me,S)):"variable"==e?Ye&&"declare"==t?(rt.marked="keyword",p(M)):Ye&&("module"==t||"enum"==t||"type"==t)&&rt.stream.match(/^\s*\w/,!1)?(rt.marked="keyword","enum"==t?p(We):"type"==t?p(Ce,T("operator"),te,T(";")):p(C("form"),he,T("{"),C("}"),Y,S,S)):Ye&&"namespace"==t?(rt.marked="keyword",p(C("form"),N,M,S)):Ye&&"abstract"==t?(rt.marked="keyword",p(M)):p(C("stat"),j):"switch"==e?p(C("form"),O,T("{"),C("}","switch"),k,Y,S,S,_):"case"==e?p(N,T(":")):"default"==e?p(T(":")):"catch"==e?p(C("form"),w,L,M,S,_):"export"==e?p(C("stat"),Oe,S):"import"==e?p(C("stat"),De,S):"async"==e?p(M):"@"==t?p(N,M):h(C("stat"),N,T(";"),S)}function L(e){if("("==e)return p(Se,T(")"))}function N(e,t){return z(e,t,!1)}function A(e,t){return z(e,t,!0)}function O(e){return"("!=e?h():p(C(")"),D,T(")"),S)}function z(e,t,n){var r,i;if(rt.state.fatArrowAt==rt.stream.start){if(r=n?W:q,"("==e)return p(w,C(")"),G(Se,")"),S,T("=>"),r,_);if("variable"==e)return h(w,he,T("=>"),r,_)}return i=n?I:P,nt.hasOwnProperty(e)?p(i):"function"==e?p(ke,i):"class"==e||Ye&&"interface"==t?(rt.marked="keyword",p(C("form"),Te,S)):"keyword c"==e||"async"==e?p(n?A:N):"("==e?p(C(")"),D,T(")"),S,i):"operator"==e||"spread"==e?p(n?A:N):"["==e?p(C("]"),qe,S,i):"{"==e?X(K,"}",null,i):"quasi"==e?h(E,i):"new"==e?p(H(n)):p()}function D(e){return e.match(/[;\}\)\],]/)?h():h(N)}function P(e,t){return","==e?p(D):I(e,t,!1)}function I(e,t,n){var r=0==n?P:I,i=0==n?N:A;if("=>"==e)return p(w,n?W:q,_);if("operator"==e)return/\+\+|--/.test(t)||Ye&&"!"==t?p(r):Ye&&"<"==t&&rt.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?p(C(">"),G(te,">"),S,r):"?"==t?p(N,T(":"),i):p(i);if("quasi"==e)return h(E,r);if(";"!=e)return"("==e?X(A,")","call",r):"."==e?p(U,r):"["==e?p(C("]"),D,T("]"),S,r):Ye&&"as"==t?(rt.marked="keyword",p(te,r)):"regexp"==e?(rt.state.lastType=rt.marked="operator",rt.stream.backUp(rt.stream.pos-rt.stream.start-1),p(i)):void 0}function E(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?p(E):p(D,F)}function F(e){if("}"==e)return rt.marked="string-2",rt.state.tokenize=s,p(E)}function q(e){return c(rt.stream,rt.state),h("{"==e?M:N)}function W(e){return c(rt.stream,rt.state),h("{"==e?M:A)}function H(e){return function(t){return"."==t?p(e?B:R):"variable"==t&&Ye?p(ce,e?I:P):h(e?A:N)}}function R(e,t){if("target"==t)return rt.marked="keyword",p(P)}function B(e,t){if("target"==t)return rt.marked="keyword",p(I)}function j(e){return":"==e?p(S,M):h(P,T(";"),S)}function U(e){if("variable"==e)return rt.marked="property",p()}function K(e,t){if("async"==e)return rt.marked="property",p(K);if("variable"==e||"keyword"==rt.style){if(rt.marked="property","get"==t||"set"==t)return p(V);var n;return Ye&&rt.state.fatArrowAt==rt.stream.start&&(n=rt.stream.match(/^\s*:\s*/,!1))&&(rt.state.fatArrowAt=rt.stream.pos+n[0].length),p($)}return"number"==e||"string"==e?(rt.marked=$e?"property":rt.style+" property",p($)):"jsonld-keyword"==e?p($):Ye&&v(t)?(rt.marked="keyword",p(K)):"["==e?p(N,Z,T("]"),$):"spread"==e?p(A,$):"*"==t?(rt.marked="keyword",p(K)):":"==e?h($):void 0}function V(e){return"variable"!=e?h($):(rt.marked="property",p(ke))}function $(e){return":"==e?p(A):"("==e?h(ke):void 0}function G(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var l=rt.state.lexical;return"call"==l.info&&(l.pos=(l.pos||0)+1),p(function(n,r){return n==t||r==t?h():h(e)},r)}return i==t||o==t?p():n&&n.indexOf(";")>-1?h(e):p(T(t))}return function(n,i){return n==t||i==t?p():h(e,r)}}function X(e,t,n){for(var r=3;r<arguments.length;r++)rt.cc.push(arguments[r]);return p(C(t,n),G(e,t),S)}function Y(e){return"}"==e?p():h(M,Y)}function Z(e,t){if(Ye){if(":"==e)return p(te);if("?"==t)return p(Z)}}function Q(e,t){if(Ye&&(":"==e||"in"==t))return p(te)}function J(e){if(Ye&&":"==e)return rt.stream.match(/^\s*\w+\s+is\b/,!1)?p(N,ee,te):p(te)}function ee(e,t){if("is"==t)return rt.marked="keyword",p()}function te(e,t){return"keyof"==t||"typeof"==t||"infer"==t||"readonly"==t?(rt.marked="keyword",p("typeof"==t?A:te)):"variable"==e||"void"==t?(rt.marked="type",p(se)):"|"==t||"&"==t?p(te):"string"==e||"number"==e||"atom"==e?p(se):"["==e?p(C("]"),G(te,"]",","),S,se):"{"==e?p(C("}"),re,S,se):"("==e?p(G(ae,")"),ne,se):"<"==e?p(G(te,">"),te):"quasi"==e?h(oe,se):void 0}function ne(e){if("=>"==e)return p(te)}function re(e){return e.match(/[\}\)\]]/)?p():","==e||";"==e?p(re):h(ie,re)}function ie(e,t){return"variable"==e||"keyword"==rt.style?(rt.marked="property",p(ie)):"?"==t||"number"==e||"string"==e?p(ie):":"==e?p(te):"["==e?p(T("variable"),Q,T("]"),ie):"("==e?h(_e,ie):e.match(/[;\}\)\],]/)?void 0:p()}function oe(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?p(oe):p(te,le)}function le(e){if("}"==e)return rt.marked="string-2",rt.state.tokenize=s,p(oe)}function ae(e,t){return"variable"==e&&rt.stream.match(/^\s*[?:]/,!1)||"?"==t?p(ae):":"==e?p(te):"spread"==e?p(ae):h(te)}function se(e,t){return"<"==t?p(C(">"),G(te,">"),S,se):"|"==t||"."==e||"&"==t?p(te):"["==e?p(te,T("]"),se):"extends"==t||"implements"==t?(rt.marked="keyword",p(te)):"?"==t?p(te,T(":"),te):void 0}function ce(e,t){if("<"==t)return p(C(">"),G(te,">"),S,se)}function ue(){return h(te,de)}function de(e,t){if("="==t)return p(te)}function fe(e,t){return"enum"==t?(rt.marked="keyword",p(We)):h(he,Z,ge,ye)}function he(e,t){return Ye&&v(t)?(rt.marked="keyword",p(he)):"variable"==e?(g(t),p()):"spread"==e?p(he):"["==e?X(me,"]"):"{"==e?X(pe,"}"):void 0}function pe(e,t){return"variable"!=e||rt.stream.match(/^\s*:/,!1)?("variable"==e&&(rt.marked="property"),"spread"==e?p(he):"}"==e?h():"["==e?p(N,T("]"),T(":"),pe):p(T(":"),he,ge)):(g(t),p(ge))}function me(){return h(he,ge)}function ge(e,t){if("="==t)return p(A)}function ye(e){if(","==e)return p(fe)}function ve(e,t){if("keyword b"==e&&"else"==t)return p(C("form","else"),M,S)}function be(e,t){return"await"==t?p(be):"("==e?p(C(")"),xe,S):void 0}function xe(e){return"var"==e?p(fe,we):"variable"==e?p(we):h(we)}function we(e,t){return")"==e?p():";"==e?p(we):"in"==t||"of"==t?(rt.marked="keyword",p(N,we)):h(N,we)}function ke(e,t){return"*"==t?(rt.marked="keyword",p(ke)):"variable"==e?(g(t),p(ke)):"("==e?p(w,C(")"),G(Se,")"),S,J,M,_):Ye&&"<"==t?p(C(">"),G(ue,">"),S,ke):void 0}function _e(e,t){return"*"==t?(rt.marked="keyword",p(_e)):"variable"==e?(g(t),p(_e)):"("==e?p(w,C(")"),G(Se,")"),S,J,_):Ye&&"<"==t?p(C(">"),G(ue,">"),S,_e):void 0}function Ce(e,t){return"keyword"==e||"variable"==e?(rt.marked="type",p(Ce)):"<"==t?p(C(">"),G(ue,">"),S):void 0}function Se(e,t){return"@"==t&&p(N,Se),"spread"==e?p(Se):Ye&&v(t)?(rt.marked="keyword",p(Se)):Ye&&"this"==e?p(Z,ge):h(he,Z,ge)}function Te(e,t){return"variable"==e?Me(e,t):Le(e,t)}function Me(e,t){
if("variable"==e)return g(t),p(Le)}function Le(e,t){return"<"==t?p(C(">"),G(ue,">"),S,Le):"extends"==t||"implements"==t||Ye&&","==e?("implements"==t&&(rt.marked="keyword"),p(Ye?te:N,Le)):"{"==e?p(C("}"),Ne,S):void 0}function Ne(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||Ye&&v(t))&&rt.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(rt.marked="keyword",p(Ne)):"variable"==e||"keyword"==rt.style?(rt.marked="property",p(Ae,Ne)):"number"==e||"string"==e?p(Ae,Ne):"["==e?p(N,Z,T("]"),Ae,Ne):"*"==t?(rt.marked="keyword",p(Ne)):Ye&&"("==e?h(_e,Ne):";"==e||","==e?p(Ne):"}"==e?p():"@"==t?p(N,Ne):void 0}function Ae(e,t){if("!"==t)return p(Ae);if("?"==t)return p(Ae);if(":"==e)return p(te,ge);if("="==t)return p(A);var n=rt.state.lexical.prev,r=n&&"interface"==n.info;return h(r?_e:ke)}function Oe(e,t){return"*"==t?(rt.marked="keyword",p(Fe,T(";"))):"default"==t?(rt.marked="keyword",p(N,T(";"))):"{"==e?p(G(ze,"}"),Fe,T(";")):h(M)}function ze(e,t){return"as"==t?(rt.marked="keyword",p(T("variable"))):"variable"==e?h(A,ze):void 0}function De(e){return"string"==e?p():"("==e?h(N):"."==e?h(P):h(Pe,Ie,Fe)}function Pe(e,t){return"{"==e?X(Pe,"}"):("variable"==e&&g(t),"*"==t&&(rt.marked="keyword"),p(Ee))}function Ie(e){if(","==e)return p(Pe,Ie)}function Ee(e,t){if("as"==t)return rt.marked="keyword",p(Pe)}function Fe(e,t){if("from"==t)return rt.marked="keyword",p(N)}function qe(e){return"]"==e?p():h(G(A,"]"))}function We(){return h(C("form"),he,T("{"),C("}"),G(He,"}"),S,S)}function He(){return h(he,ge)}function Re(e,t){return"operator"==e.lastType||","==e.lastType||Je.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function Be(e,t,n){return t.tokenize==o&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}var je,Ue,Ke=t.indentUnit,Ve=n.statementIndent,$e=n.jsonld,Ge=n.json||$e,Xe=n.trackScope!==!1,Ye=n.typescript,Ze=n.wordCharacters||/[\w$\xa1-\uffff]/,Qe=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),l={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:l,false:l,null:l,undefined:l,NaN:l,Infinity:l,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),Je=/[+\-*&%=<>!?|~^@]/,et=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,tt="([{}])",nt={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0},rt={state:null,column:null,marked:null,cc:null},it=new x("this",new x("arguments",null));return w.lex=k.lex=!0,_.lex=!0,S.lex=!0,{startState:function(e){var t={tokenize:o,lastType:"sof",cc:[],lexical:new u((e||0)-Ke,0,"block",!1),localVars:n.localVars,context:n.localVars&&new b(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=a&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==je?n:(t.lastType="operator"!=je||"++"!=Ue&&"--"!=Ue?je:"incdec",f(t,n,je,Ue,e))},indent:function(t,r){var i,l,c,u,d,f,h;if(t.tokenize==a||t.tokenize==s)return e.Pass;if(t.tokenize!=o)return 0;if(i=r&&r.charAt(0),l=t.lexical,!/^\s*else\b/.test(r))for(u=t.cc.length-1;u>=0;--u)if(d=t.cc[u],d==S)l=l.prev;else if(d!=ve&&d!=_)break;for(;("stat"==l.type||"form"==l.type)&&("}"==i||(c=t.cc[t.cc.length-1])&&(c==P||c==I)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;return Ve&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev),f=l.type,h=i==f,"vardef"==f?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==f&&"{"==i?l.indented:"form"==f?l.indented+Ke:"stat"==f?l.indented+(Re(t,r)?Ve||Ke:0):"switch"!=l.info||h||0==n.doubleIndentSwitch?l.align?l.column+(h?0:1):l.indented+(h?0:Ke):l.indented+(/^(?:case|default)\b/.test(r)?Ke:2*Ke)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ge?null:"/*",blockCommentEnd:Ge?null:"*/",blockCommentContinue:Ge?null:" * ",lineComment:Ge?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ge?"json":"javascript",jsonldMode:$e,jsonMode:Ge,expressionAllowed:Be,skipExpression:function(t){f(t,"atom","atom","true",new e.StringStream("",2,null))}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:h[t]}function n(e){var t,n,i;for(t=0;t<e.length;t++)n=e.charAt(t),i="'"+n+"'",f[i]||(f[i]=r(n))}function r(e){return function(t){return c(t,e)}}function i(e){var t,n=e.state.closeBrackets;return!n||n.override?n:(t=e.getModeAt(e.getCursor()),t.closeBrackets||n)}function o(n){var r,o,l,a,s,c=i(n);if(!c||n.getOption("disableInput"))return e.Pass;for(r=t(c,"pairs"),o=n.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return e.Pass;if(a=u(n,o[l].head),!a||r.indexOf(a)%2!=0)return e.Pass}for(l=o.length-1;l>=0;l--)s=o[l].head,n.replaceRange("",p(s.line,s.ch-1),p(s.line,s.ch+1),"+delete")}function l(n){var r,o,l,s=i(n),c=s&&t(s,"explode");if(!c||n.getOption("disableInput"))return e.Pass;for(r=n.listSelections(),o=0;o<r.length;o++){if(!r[o].empty())return e.Pass;if(l=u(n,r[o].head),!l||c.indexOf(l)%2!=0)return e.Pass}n.operation(function(){var e,t,i=n.lineSeparator()||"\n";for(n.replaceSelection(i+i,null),a(n,-1),r=n.listSelections(),e=0;e<r.length;e++)t=r[e].head.line,n.indentLine(t,null,!0),n.indentLine(t+1,null,!0)})}function a(e,t){var n,r,i,o=[],l=e.listSelections(),a=0;for(n=0;n<l.length;n++)r=l[n],r.head==e.getCursor()&&(a=n),i=r.head.ch||t>0?{line:r.head.line,ch:r.head.ch+t}:{line:r.head.line-1},o.push({anchor:i,head:i});e.setSelections(o,a)}function s(t){var n=e.cmpPos(t.anchor,t.head)>0;return{anchor:new p(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new p(t.head.line,t.head.ch+(n?1:-1))}}function c(n,r){var o,l,c,u,f,h,m,g,y,v,b,x,w,k,_,C,S=i(n);if(!S||n.getOption("disableInput"))return e.Pass;if(o=t(S,"pairs"),l=o.indexOf(r),l==-1)return e.Pass;for(c=t(S,"closeBefore"),u=t(S,"triples"),f=o.charAt(l+1)==r,h=n.listSelections(),m=l%2==0,y=0;y<h.length;y++){if(v=h[y],b=v.head,w=n.getRange(b,p(b.line,b.ch+1)),m&&!v.empty())x="surround";else if(!f&&m||w!=r)if(f&&b.ch>1&&u.indexOf(r)>=0&&n.getRange(p(b.line,b.ch-2),b)==r+r){if(b.ch>2&&/\bstring/.test(n.getTokenTypeAt(p(b.line,b.ch-2))))return e.Pass;x="addFour"}else if(f){if(k=0==b.ch?" ":n.getRange(p(b.line,b.ch-1),b),e.isWordChar(w)||k==r||e.isWordChar(k))return e.Pass;x="both"}else{if(!m||!(0===w.length||/\s/.test(w)||c.indexOf(w)>-1))return e.Pass;x="both"}else x=f&&d(n,b)?"both":u.indexOf(r)>=0&&n.getRange(b,p(b.line,b.ch+3))==r+r+r?"skipThree":"skip";if(g){if(g!=x)return e.Pass}else g=x}_=l%2?o.charAt(l-1):r,C=l%2?r:o.charAt(l+1),n.operation(function(){var e,t;if("skip"==g)a(n,1);else if("skipThree"==g)a(n,3);else if("surround"==g){for(e=n.getSelections(),t=0;t<e.length;t++)e[t]=_+e[t]+C;for(n.replaceSelections(e,"around"),e=n.listSelections().slice(),t=0;t<e.length;t++)e[t]=s(e[t]);n.setSelections(e)}else"both"==g?(n.replaceSelection(_+C,null),n.triggerElectric(_+C),a(n,-1)):"addFour"==g&&(n.replaceSelection(_+_+_+_,"before"),a(n,1))})}function u(e,t){var n=e.getRange(p(t.line,t.ch-1),p(t.line,t.ch+1));return 2==n.length?n:null}function d(e,t){var n=e.getTokenAt(p(t.line,t.ch+1));return/\bstring/.test(n.type)&&n.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}var f,h={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},p=e.Pos;e.defineOption("autoCloseBrackets",!1,function(r,i,o){o&&o!=e.Init&&(r.removeKeyMap(f),r.state.closeBrackets=null),i&&(n(t(i,"pairs")),r.state.closeBrackets=i,r.addKeyMap(f))}),f={Backspace:o,Enter:l},n(h.pairs+"`")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){function t(t){var n,r,s,c,u,d,f,h,p,m,g,y,v,b,x,w,k,_,C;if(t.getOption("disableInput"))return e.Pass;for(n=t.listSelections(),r=[],s=t.getOption("autoCloseTags"),c=0;c<n.length;c++){if(!n[c].empty())return e.Pass;if(u=n[c].head,d=t.getTokenAt(u),f=e.innerMode(t.getMode(),d.state),h=f.state,p=f.mode.xmlCurrentTag&&f.mode.xmlCurrentTag(h),m=p&&p.name,!m)return e.Pass;if(g="html"==f.mode.configuration,y="object"==typeof s&&s.dontCloseTags||g&&l,v="object"==typeof s&&s.indentTags||g&&a,d.end>u.ch&&(m=m.slice(0,m.length-d.end+u.ch)),b=m.toLowerCase(),!m||"string"==d.type&&(d.end!=u.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||1==d.string.length)||"tag"==d.type&&p.close||d.string.indexOf("/")==u.ch-d.start-1||y&&i(y,b)>-1||o(t,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(h)||[],m,u,!0))return e.Pass;x="object"==typeof s&&s.emptyTags,x&&i(x,m)>-1?r[c]={text:"/>",newPos:e.Pos(u.line,u.ch+2)}:(w=v&&i(v,b)>-1,r[c]={indent:w,text:">"+(w?"\n\n":"")+"</"+m+">",newPos:w?e.Pos(u.line+1,0):e.Pos(u.line,u.ch+1)})}for(k="object"==typeof s&&s.dontIndentOnAutoClose,c=n.length-1;c>=0;c--)_=r[c],t.replaceRange(_.text,n[c].head,n[c].anchor,"+insert"),C=t.listSelections().slice(0),C[c]={head:_.newPos,anchor:_.newPos},t.setSelections(C),!k&&_.indent&&(t.indentLine(_.newPos.line,null,!0),t.indentLine(_.newPos.line+1,null,!0))}function n(t,n){var r,i,l,a,s,c,u,d,f,h=t.listSelections(),p=[],m=n?"/":"</",g=t.getOption("autoCloseTags"),y="object"==typeof g&&g.dontIndentOnSlash;for(r=0;r<h.length;r++){if(!h[r].empty())return e.Pass;if(i=h[r].head,l=t.getTokenAt(i),a=e.innerMode(t.getMode(),l.state),s=a.state,n&&("string"==l.type||"<"!=l.string.charAt(0)||l.start!=i.ch-1))return e.Pass;if(u="xml"!=a.mode.name&&"htmlmixed"==t.getMode().name,u&&"javascript"==a.mode.name)c=m+"script";else if(u&&"css"==a.mode.name)c=m+"style";else{if(d=a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(s),f=d.length?d[d.length-1]:"",!d||d.length&&o(t,d,f,i))return e.Pass;c=m+f}">"!=t.getLine(i.line).charAt(l.end)&&(c+=">"),p[r]=c}if(t.replaceSelections(p),h=t.listSelections(),!y)for(r=0;r<h.length;r++)(r==h.length-1||h[r].head.line<h[r+1].head.line)&&t.indentLine(h[r].head.line)}function r(t){return t.getOption("disableInput")?e.Pass:n(t,!0)}function i(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function o(t,n,r,i,o){var l,a,s,c,u;if(!e.scanForClosingTag)return!1;if(l=Math.min(t.lastLine()+1,i.line+500),a=e.scanForClosingTag(t,i,null,l),!a||a.tag!=r)return!1;for(s=o?1:0,c=n.length-1;c>=0&&n[c]==r;c--)++s;for(i=a.to,c=1;c<s;c++){if(u=e.scanForClosingTag(t,i,null,l),!u||u.tag!=r)return!1;i=u.to}return!0}var l,a;e.defineOption("autoCloseTags",!1,function(n,i,o){if(o!=e.Init&&o&&n.removeKeyMap("autoCloseTags"),i){var l={name:"autoCloseTags"};"object"==typeof i&&i.whenClosing===!1||(l["'/'"]=function(e){return r(e)}),"object"==typeof i&&i.whenOpening===!1||(l["'>'"]=function(e){return t(e)}),n.addKeyMap(l)}}),l=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],a=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"],e.commands.closeTag=function(e){return n(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.markedSelection&&e.operation(function(){l(e)})}function n(e){e.state.markedSelection&&e.state.markedSelection.length&&e.operation(function(){i(e)})}function r(e,t,n,r){var i,o,l,u,d,f,h,p;if(0!=c(t,n))for(i=e.state.markedSelection,o=e.state.markedSelectionStyle,l=t.line;u=l==t.line?t:s(l,0),d=l+a,f=d>=n.line,h=f?n:s(d,0),p=e.markText(u,h,{className:o}),null==r?i.push(p):i.splice(r++,0,p),!f;)l=d}function i(e){var t,n=e.state.markedSelection;for(t=0;t<n.length;++t)n[t].clear();n.length=0}function o(e){var t,n;for(i(e),t=e.listSelections(),n=0;n<t.length;n++)r(e,t[n].from(),t[n].to())}function l(e){var t,n,l,s,u;if(!e.somethingSelected())return i(e);if(e.listSelections().length>1)return o(e);if(t=e.getCursor("start"),n=e.getCursor("end"),l=e.state.markedSelection,!l.length)return r(e,t,n);if(s=l[0].find(),u=l[l.length-1].find(),!s||!u||n.line-t.line<=a||c(t,u.to)>=0||c(n,s.from)<=0)return o(e);for(;c(t,s.from)>0;)l.shift().clear(),s=l[0].find();for(c(t,s.from)<0&&(s.to.line-t.line<a?(l.shift().clear(),r(e,t,s.to,0)):r(e,t,s.from,0));c(n,u.to)<0;)l.pop().clear(),u=l[l.length-1].find();c(n,u.to)>0&&(n.line-u.from.line<a?(l.pop().clear(),r(e,u.from,n)):r(e,u.to,n))}var a,s,c;e.defineOption("styleSelectedText",!1,function(r,l,a){var s=a&&a!=e.Init;l&&!s?(r.state.markedSelection=[],r.state.markedSelectionStyle="string"==typeof l?l:"CodeMirror-selectedtext",o(r),r.on("cursorActivity",t),r.on("change",n)):!l&&s&&(r.off("cursorActivity",t),r.off("change",n),i(r),r.state.markedSelection=r.state.markedSelectionStyle=null)}),a=8,s=e.Pos,c=e.cmpPos}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){return e&&e.bracketRegex||/[(){}[\]]/}function n(e,n,i){var o,l,a,u,d,f=e.getLineHandle(n.line),h=n.ch-1,p=i&&i.afterCursor;return null==p&&(p=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className)),o=t(i),(l=!p&&h>=0&&o.test(f.text.charAt(h))&&c[f.text.charAt(h)]||o.test(f.text.charAt(h+1))&&c[f.text.charAt(++h)])?(a=">"==l.charAt(1)?1:-1,i&&i.strict&&a>0!=(h==n.ch)?null:(u=e.getTokenTypeAt(s(n.line,h+1)),d=r(e,s(n.line,h+(a>0?1:0)),a,u,i),null==d?null:{from:s(n.line,h),to:d&&d.pos,match:d&&d.ch==l.charAt(0),forward:a>0})):null}function r(e,n,r,i,o){var l,a,u,d,f,h,p=o&&o.maxScanLineLength||1e4,m=o&&o.maxScanLines||1e3,g=[],y=t(o),v=r>0?Math.min(n.line+m,e.lastLine()+1):Math.max(e.firstLine()-1,n.line-m);for(l=n.line;l!=v;l+=r)if(a=e.getLine(l),a&&(u=r>0?0:a.length-1,d=r>0?a.length:-1,!(a.length>p)))for(l==n.line&&(u=n.ch-(r<0?1:0));u!=d;u+=r)if(f=a.charAt(u),y.test(f)&&(void 0===i||(e.getTokenTypeAt(s(l,u+1))||"")==(i||"")))if(h=c[f],h&&">"==h.charAt(1)==r>0)g.push(f);else{if(!g.length)return{pos:s(l,u),ch:f};g.pop()}return l-r!=(r>0?e.lastLine():e.firstLine())&&null}function i(e,t,r){var i,o,l,c,u=e.state.matchBrackets.maxHighlightLineLength||1e3,d=r&&r.highlightNonMatching,f=[],h=e.listSelections();for(i=0;i<h.length;i++)o=h[i].empty()&&n(e,h[i].head,r),o&&(o.match||d!==!1)&&e.getLine(o.from.line).length<=u&&(l=o.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",f.push(e.markText(o.from,s(o.from.line,o.from.ch+1),{className:l})),o.to&&e.getLine(o.to.line).length<=u&&f.push(e.markText(o.to,s(o.to.line,o.to.ch+1),{className:l})));if(f.length){if(a&&e.state.focused&&e.focus(),c=function(){e.operation(function(){for(var e=0;e<f.length;e++)f[e].clear()})},!t)return c;setTimeout(c,800)}}function o(e){e.operation(function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=i(e,!1,e.state.matchBrackets)})}function l(e){e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)}var a=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),s=e.Pos,c={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",o),t.off("focus",o),t.off("blur",l),l(t)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",o),t.on("focus",o),t.on("blur",l))}),e.defineExtension("matchBrackets",function(){i(this,!0)}),e.defineExtension("findMatchingBracket",function(e,t,r){return(r||"boolean"==typeof t)&&(r?(r.strict=t,t=r):t=t?{strict:!0}:null),n(this,e,t)}),e.defineExtension("scanForBracket",function(e,t,n,i){return r(this,e,t,n,i)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){var r,i,o,l,a;t(n),n.somethingSelected()||(r=n.getCursor(),i=n.getViewport(),i.from=Math.min(i.from,r.line),i.to=Math.max(r.line+1,i.to),o=e.findMatchingTag(n,r,i),o&&(n.state.matchBothTags&&(l="open"==o.at?o.open:o.close,l&&(n.state.tagHit=n.markText(l.from,l.to,{className:"CodeMirror-matchingtag"}))),a="close"==o.at?o.open:o.close,a?n.state.tagOther=n.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0))})}function r(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(i,o,l){l&&l!=e.Init&&(i.off("cursorActivity",n),i.off("viewportChange",r),t(i)),o&&(i.state.matchBothTags="object"==typeof o&&o.bothTags,i.on("cursorActivity",n),i.on("viewportChange",r),n(i))}),e.commands.toMatchingTag=function(t){var n,r=e.findMatchingTag(t,t.getCursor());r&&(n="close"==r.at?r.open:r.close,n&&t.extendSelection(n.to,n.from))}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function n(e,t,n,r){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=r?Math.max(r.from,e.firstLine()):e.firstLine(),this.max=r?Math.min(r.to-1,e.lastLine()):e.lastLine()}function r(e,t){var n=e.cm.getTokenTypeAt(f(e.line,t));return n&&/\btag\b/.test(n)}function i(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function o(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function l(e){for(var t,n,o;;){if(t=e.text.indexOf(">",e.ch),t==-1){if(i(e))continue;return}if(r(e,t+1))return n=e.text.lastIndexOf("/",t),o=n>-1&&!/\S/.test(e.text.slice(n+1,t)),e.ch=t+1,o?"selfClose":"regular";e.ch=t+1}}function a(e){for(var t,n;;){if(t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1,t==-1){if(o(e))continue;return}if(r(e,t+1)){if(m.lastIndex=t,e.ch=t,n=m.exec(e.text),n&&n.index==t)return n}else e.ch=t}}function s(e){for(;;){m.lastIndex=e.ch;var t=m.exec(e.text);if(!t){if(i(e))continue;return}{if(r(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(var t,n,i;;){if(t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1,t==-1){if(o(e))continue;return}if(r(e,t+1))return n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t)),e.ch=t+1,i?"selfClose":"regular";e.ch=t}}function u(e,t){for(var n,r,i,o,a,c=[];;){if(n=s(e),i=e.line,o=e.ch-(n?n[0].length:0),!n||!(r=l(e)))return;if("selfClose"!=r)if(n[1]){for(a=c.length-1;a>=0;--a)if(c[a]==n[2]){c.length=a;break}if(a<0&&(!t||t==n[2]))return{tag:n[2],from:f(i,o),to:f(e.line,e.ch)}}else c.push(n[2])}}function d(e,t){for(var n,r,i,o,l,s=[];;){if(n=c(e),!n)return;if("selfClose"!=n){if(r=e.line,i=e.ch,o=a(e),!o)return;if(o[1])s.push(o[2]);else{for(l=s.length-1;l>=0;--l)if(s[l]==o[2]){s.length=l;break}if(l<0&&(!t||t==o[2]))return{tag:o[2],from:f(e.line,e.ch),to:f(r,i)}}}else a(e)}}var f=e.Pos,h="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",p=h+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+h+"]["+p+"]*)","g");e.registerHelper("fold","xml",function(e,r){for(var i,o,a,c,d=new n(e,r.line,0);;){if(i=s(d),!i||d.line!=r.line)return;if(o=l(d),!o)return;if(!i[1]&&"selfClose"!=o)return a=f(d.line,d.ch),c=u(d,i[2]),c&&t(c.from,a)>0?{from:a,to:c.from}:null}}),e.findMatchingTag=function(e,r,i){var o,s,c,h,p=new n(e,r.line,r.ch,i);if((p.text.indexOf(">")!=-1||p.text.indexOf("<")!=-1)&&(o=l(p),s=o&&f(p.line,p.ch),c=o&&a(p),o&&c&&!(t(p,r)>0)))return h={from:f(p.line,p.ch),to:s,tag:c[2]},"selfClose"==o?{open:h,close:null,at:"open"}:c[1]?{open:d(p,c[2]),close:h,at:"close"}:(p=new n(e,s.line,s.ch,i),{open:h,close:u(p,c[2]),at:"open"})},e.findEnclosingTag=function(e,t,r,i){for(var o,l,a,s=new n(e,t.line,t.ch,r);o=d(s,i),o;)if(l=new n(e,t.line,t.ch,r),a=u(l,o.tag))return{open:o,close:a}},e.scanForClosingTag=function(e,t,r,i){var o=new n(e,t.line,t.ch,i?{from:0,to:i}:null);return u(o,r)}});
